1 2006-03-10 Raja R Harinath <rharinath@novell.com>
3 * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
4 (Expression.ResolveAsTypeTerminal): Likewise.
5 * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
6 * expression.cs, generic.cs, iterators.cs: Likewise.
7 * parameter.cs, statement.cs, typemanager.cs: Likewise.
9 2006-03-09 Martin Baulig <martin@ximian.com>
11 * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
12 TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
14 2006-03-09 Martin Baulig <martin@ximian.com>
16 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
17 `prepared' flag is set.
19 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
20 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
21 issues; see gtest-254.cs.
23 2006-03-07 Martin Baulig <martin@ximian.com>
25 * generic.cs (TypeManager.InferType): Allow infering
26 `IEnumerable<T>' with an array of T; see gtest-251.cs.
28 2006-03-06 Martin Baulig <martin@ximian.com>
31 (TypeManager.InferType): Fix gtest-250.cs.
34 (TypeManager.IsSubclassOf): Also check the base class.
37 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
40 2006-03-01 Raja R Harinath <rharinath@novell.com>
43 * expression.cs (ParameterReference.DoResolveBase): Change return
45 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
49 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
52 * typemanager.cs (GetFullNameSignature): Don't nullref on
55 2006-02-16 Martin Baulig <martin@ximian.com>
58 (TypeManager.GetGenericFieldDefinition): New public method; use it
59 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
61 2006-02-14 Martin Baulig <martin@ximian.com>
63 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
65 2006-02-14 Martin Baulig <martin@ximian.com>
68 (TypeManager.DropGenericMethodArguments): New public method; don't
69 use GetGenericMethodDefinition() on something which is not a
72 2006-02-14 Martin Baulig <martin@ximian.com>
75 (ConstraintChecker.CheckConstraints): If a type parameter has the
76 `struct' constraint, the type must be a non-nullable valuetype.
78 2006-02-10 Martin Baulig <martin@ximian.com>
81 (TypeManager.IsOverride): Make this work for instantiated methods
82 in a generic class; fixes #77509.
83 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
84 rather than calling it directly; fixes #77488.
86 2006-02-08 Martin Baulig <martin@ximian.com>
88 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
89 reporting into CheckConstraint() so we can use the correctly
92 2006-02-08 Martin Baulig <martin@ximian.com>
94 * expression.cs (BaseAccess): Add support for generic methods.
96 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
97 the new MethodGroupExpr.
99 2006-02-07 Martin Baulig <martin@ximian.com>
101 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
102 also reference types; fixes #77483.
104 2006-02-07 Martin Baulig <martin@ximian.com>
107 (TypeManager.IsGenericMethod): We now return whether something is
108 an instantiated generic method (and not a generic method def).
109 (TypeManager.IsGenericMethodDefinition): New public method.
112 (TypeManager.CSharpSignature): Only include type arguments for
113 "real" generic methods, not for any instantiated method.
114 (TypeManager.GetMethodName): Likewise, but also allow generic
115 method definitions here.
117 2006-02-06 Miguel de Icaza <miguel@novell.com>
119 * codegen.cs (EmitScopeInitFromBlock): check here the
120 capture_context, there is no need to make two calls to the
123 * anonymous.cs: Add some debugging messages that might help me
124 track other instances of this problem in the future (the
125 regression of test 467).
127 * cs-parser.jay: track the variable block, as we need to initalize
128 any captured variables declared in this block for the "catch"
129 portion of the "Try" statement.
131 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
132 scope initialization for captured variables.
134 Also, move the emit for the variables after the block location has
137 2006-02-06 Marek Safar <marek.safar@seznam.cz>
139 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
141 2006-02-06 Martin Baulig <martin@ximian.com>
143 * class.cs (TypeContainer.DefineType): If we're a struct, pass
144 `TypeManager.value_type' as parent type to
145 ModuleBuilder.DefineType(). Fixes #77358.
147 2006-02-02 Miguel de Icaza <miguel@novell.com>
149 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
150 commit yesterday, the initialization for the roots is necessary.
151 What is not necessary is the scope activation.
153 2006-02-02 Raja R Harinath <rharinath@novell.com>
155 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
156 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
158 (Argument.Resolve): Remove CS0206 checks.
160 2006-02-01 Miguel de Icaza <miguel@novell.com>
162 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
163 scopes for all the roots, the scopes will now be emitted when the
164 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
166 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
167 code. This reduces a lot of existing cruft.
169 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
170 that the ScopeInfo is generated as we enter the scope, not at the
171 time of use, which is what we used to do before.
173 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
174 every time a Block is about to be emitted if we have a
177 2006-02-01 Raja R Harinath <rharinath@novell.com>
179 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
180 attribute for mscorlib too.
182 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
184 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
186 * typemanager.cs (cons_param_array_attribute): Make private.
187 (Reset): Set it to null.
188 (InitCoreHelpers): Don't initialize it.
189 (ConsParamArrayAttribute): New. Initialize it as needed.
190 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
192 2006-01-31 Miguel de Icaza <miguel@novell.com>
194 * expression.cs: There might be errors reported during the
195 selection of applicable methods. If there are errors, do not
196 continue execution as it will lead the compiler to crash.
198 2006-01-30 Miguel de Icaza <miguel@novell.com>
200 * expression.cs: Member access is not allowed on anonymous
201 methods. Fixes #77402.
203 2006-01-30 Raja R Harinath <rharinath@novell.com>
206 * cs-parser.jay (VariableDeclaration): Don't set
207 current_array_type to null.
208 (field_declaration, event_declaration, declaration_statement):
211 2006-01-29 Raja R Harinath <harinath@gmail.com>
214 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
216 2006-01-28 Raja R Harinath <harinath@gmail.com>
218 * typemanager.cs (GenericParameterPosition): New.
221 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
223 * doc.cs : To process "include" elements, first we should create
224 another list than XmlNodeList, because it could result in node
225 removal, which could result in that the XmlNodeList gives up
228 2006-01-25 Miguel de Icaza <miguel@novell.com>
230 * expression.cs: Introduce an error report that we were not
231 catching before. Gonzalo ran into it.
233 2006-01-23 Miguel de Icaza <miguel@novell.com>
235 A fix for bug: #76957
237 * iterators.cs (MoveNextMethod.CreateMethodHost): call
238 ComputeMethodHost before creating the method, this is a new
241 * anonymous.cs (AnonymousContainer): Now we track all the scopes
242 that this method references (RegisterScope). The actual scope
243 where the method is hosted is computed with the ComputeMethodHost
244 before we create the method.
246 Moved the Deepest routine here.
248 (AnonymousContainer.ComputeMethodHost): New routine used to
249 compute the proper ScopeInfo that will host the anonymous method.
251 (ScopeInfo): Deal with multiple roots. The problem was that we
252 did not have a unique root where all ScopeInfos could be hanged
253 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
256 Remove AdjustMethodScope which is now computed at the end. Remove
257 LinkScope which did a partial link, instead link all ScopeInfos
258 before code generation from the new "LinkScopes" routine.
260 Simplify all the Add* routines as they no longer need to maintain
261 the tree, they just need to record that they are using variables
264 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
265 routines to produce the forest of ScopeInfo trees.
267 * class.cs (TypeContainer.AppendMethod): This is just like
268 AddMethod, but ensures that an interface implementation method
269 (IEnumerable.XXX) is not inserted at the beginning of the queue of
270 methods, but at the end.
272 We use this functionality to ensure that the generated MoveNext
273 method in the iterator class is resolved/emitted before the
274 enumerator methods created.
276 This is required because the MoveNext method computes the right
277 ScopeInfo for the method. And the other methods will eventually
278 need to resolve and fetch information computed from the anonymous
282 2006-01-23 Raja R Harinath <rharinath@novell.com>
284 Improve implementation of section 14.4.2.2 (Better function member).
285 * expression.cs (Invocation.MoreSpecific): Compare all type
286 arguments before deciding if one type is more specific than
287 another. Handle array types too. Return the more specific type.
288 (Invocation.BetterFunction): Add more tie-breaking rules from
289 section 14.4.2.2. Perform "more specific" check after
290 other tie-breaking rules. Compare all parameter types before
291 choosing the "more specific" method.
293 2006-01-21 Raja R Harinath <harinath@gmail.com>
294 Carlos Alberto Cortez <calberto.cortez@gmail.com>
297 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
299 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
300 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
302 2006-01-18 Martin Baulig <martin@ximian.com>
304 * class.cs (TypeContainer.AddToMemberContainer): Use
305 `symbol.MemberName.MethodName' instead of just `symbol.Name';
308 2006-01-18 Martin Baulig <martin@ximian.com>
310 Fix #76417: a generic class may now have methods which may unify
311 for some type parameter substitutions.
313 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
314 for methods which may unify anymore.
316 * expression.cs (Invocation.MoreSpecific): New private static
317 method; checks whether one method is more specific than another
318 according to 14.4.2.2 of the spec.
319 (Invocation.BetterFunction): Implement the tie-breaking rules from
320 14.4.2.2 of the spec: if two methods unify for some type parameter
321 substitution, we need to pick the more specific one.
323 2006-01-18 Raja R Harinath <rharinath@novell.com>
325 Fix #76656, cs0231-2.cs.
326 * cs-parser.jay (formal_parameter_list): Make error case catch
328 (parenthesized_expression_0): Add CS1026 check.
329 (invocation_expression): Remove unused { $$ = lexer.Location }.
331 2006-01-17 Raja R Harinath <rharinath@novell.com>
334 * cs-parser.jay (statement_expression): Don't list out the
335 individual statement-expressions. Convert syntax error into
338 2006-01-16 Raja R Harinath <rharinath@novell.com>
341 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
342 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
343 CheckIntermediateModification.
344 (FieldExpr.DoResolve): Add new two-argument version that
345 allows us to resolve the InstanceExpression as an lvalue.
346 The one-argument variant is now just a wrapper.
347 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
348 Resolve the lhs as an lvalue if the it has a value type.
349 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
350 from Assign.DoResolve.
351 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
352 resolved as an lvalue.
353 (PropertyExpr.DoResolve): Update.
354 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
355 has a value type. Move CS1612 check here from
356 CheckIntermediateModification.
357 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
358 * expression.cs (EmptyExpression.OutAccess): New. Used as the
359 'right_side' of a ResolveLValue on an 'out' argument.
360 (EmptyExpression.LValueMemberAccess): New. Used as the
361 'right_side' of a propagated ResolveLValue on a value type.
362 (LocalVariableReference.DoResolveBase): Recognize
363 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
365 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
366 EmptyExpression.Null.
368 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
370 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
371 Type.IsGenericParameter(). Fixed bug #77183.
372 * doc.cs : it is now identical to doc.cs in mcs.
374 2006-01-16 Martin Baulig <martin@ximian.com>
376 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
378 2006-01-16 Martin Baulig <martin@ximian.com>
380 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
383 2006-01-12 Miguel de Icaza <miguel@novell.com>
385 This fixes the problem where we used ldfld instead of ldflda to
386 load the "THIS" pointer on captured parameters, when THIS is a
387 value type. See bug #77205.
389 * iterators.cs (CapturedThisReference.Emit): Pass false to
390 EmitThis (we do not need the address).
392 * codegen.cs (EmitThis): it needs to know whether we need the
393 address of `this' or not. This is used by value types.
395 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
396 every other call passes false.
398 2006-01-12 Raja R Harinath <rharinath@novell.com>
401 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
403 * expression.cs (Invocation.OverloadResolve): Update.
404 (Invocation.DoResolve): Avoid double resolution of invocation.
406 2006-01-11 Raja R Harinath <rharinath@novell.com>
409 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
410 unary negation of floating point types as 0-expr; negation cannot
411 overflow in floating point types.
414 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
415 on operands of 'void' type.
418 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
419 and ExclusiveOr for boolean constants too.
421 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
423 * expression.cs: Fix Console.WriteLine ((this = x).foo);
425 2006-01-12 Miguel de Icaza <miguel@novell.com>
427 * cs-tokenizer.cs (Position): New class used to save and restore
428 the position state in the tokenizer. Before this patch the save
429 and restore was not complete enough so the line and columns would
430 start to drift and the debugger and stack traces will get the
433 2006-01-10 Martin Baulig <martin@ximian.com>
436 (TypeParameter.InflateConstraints): New public method.
438 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
439 constraints; fixes #77042.
441 2006-01-10 Martin Baulig <martin@ximian.com>
443 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
444 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
447 2006-01-09 Raja R Harinath <rharinath@novell.com>
450 * expression.cs (Invocation.OverloadResolve): Replace reflected
451 override methods with their base virtual methods, rather than
453 * typemanager.cs (TypeManager.GetOverride): New.
455 2005-12-21 Miguel de Icaza <miguel@novell.com>
457 * driver.cs: Report the case of no source files and no -out:
460 2005-12-20 Raja R Harinath <rharinath@novell.com>
463 * expression.cs (ComposedCast.GetSignatureForError): Define.
465 2006-01-05 Jb Evain <jbevain@gmail.com>
467 * class.cs (Property.Define, Indexer.Define): do not tag the
468 properties as SpecialName | RTSpecialName.
470 2006-01-04 Miguel de Icaza <miguel@novell.com>
472 * class.cs (MethodCore.IsDuplicateImplementation): This method was
473 doing a low-level comparission of parameter types. It was lacking
474 a check for __argslist.
476 2005-12-30 Miguel de Icaza <miguel@novell.com>
478 * expression.cs (ParameterReference.DoResolveBase): Allow
479 reference parameters if they are local to this block.
481 This allows the ref and out parameters of a delegate to be used in
482 an anonymous method, for example:
484 delegate void set (out int x);
486 set s = delegate (out int x){
490 This is used by functionality introduced late in the C# language.
492 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
493 method that take ref and out parameters.
495 Fixes #77119 which was a late change in the spec.
497 2005-12-23 Miguel de Icaza <miguel@novell.com>
499 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
500 parent if its the same scope. Fixes #77060.
502 2005-12-22 Marek Safar <marek.safar@seznam.cz>
504 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
506 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
508 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
509 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
510 that doesn't contain the full public key. This is a update of the
511 friend assemblies in .Net 2.0 release.
513 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
517 * namespace.cs (NamespaceEntry): Add extern_aliases as a
518 ListDictionary, to contain the ExternAliasEntry entries (in
519 addition to the NamespaceEntry.aliases hashtable). This field is
520 shared between the original entry and its doppelganger (bodyless
522 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
523 extern_aliases field.
524 (NamespaceEntry.Lookup): Move the IsImplicit check after the
525 lookup in extern_aliases.
527 2005-12-16 Raja R Harinath <rharinath@novell.com>
530 * class.cs (TypeContainer.Mark_HasEquals): New.
531 (TypeContainer.Mark_HasGetHashCode): New.
532 (ClassPart): Override them.
533 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
535 * generic.cs (GenericMethod.DefineMembers): Update to changes.
536 (TypeParameter.TypeParameter): Change type of 'parent' argument to
540 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
541 'parent' argument to the base constructor.
543 Remove all mention of TypeContainer from decl.cs.
544 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
545 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
546 (DeclSpace.DeclSpace): Likewise.
547 (DeclSpace.DefineMembers): Remove unused argument.
548 * cs-parser.jay (pop_current_class): Update to changes. Simplify
549 debugging check -- we don't care if the debug code throws an
550 InvalidCastException instead of an InternalErrorException.
551 * class.cs (TypeContainer.DefineMembers): Update to changes.
552 (TypeContainer.DoDefineMembers): Likewise.
553 (TypeContainer.GetMethods): Likewise.
554 (PropertyMember.Define): Likewise.
555 (MemberBase.Parent): New property that forwards to
556 MemberCore.Parent, but ensures that we get a TypeContainer.
557 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
558 (RootContext.PopulateTypes): Likewise. Remove special case code
559 for !RootContext.StdLib: DefineMembers is idempotent.
561 2005-12-13 Marek Safar <marek.safar@seznam.cz>
563 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
565 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
567 * doc.cs : The search for referenced namespace was insufficient to
568 get global one as it used to do. Fixed bug #76965.
570 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
572 * doc.cs : check name in cref in the last phase that whether it is
575 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
577 * cs-tokenizer.cs : reverted the latest change: it somehow broke
580 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
582 * doc.cs : so it turned out that we cannot skip override check for
583 interface members. Fixed bug #76954.
585 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
587 * cs-tokenizer.cs : fixed bug #75984:
588 - #warning and #error should not be handled when the source line
590 - #line is not checked strictly when the source line is disabled.
591 - #define and #undef is on the other hand checked strictly at any
594 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
596 * cs-tokenizer.cs : missing Location (actually, filename) in one of
599 2005-12-15 Raja R Harinath <rharinath@novell.com>
601 * generic.cs (TypeManager.IsGeneric): Remove unused method.
603 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
606 2005-12-14 Martin Baulig <martin@ximian.com>
608 * typemanager.cs (TypeManager.GetFullName): Make this public;
609 `Type.Fullname' now never returns null.
611 * class.cs (Method.Define): Use TypeManager.GetFullName() for
612 explicit interface implementations; we're now using the same
613 naming convention than csc does.
615 2005-12-14 Miguel de Icaza <miguel@novell.com>
617 * convert.cs (ExplicitConversionCore): Check the return value from
618 ExplicitConversionCore which can return null on failure. Fixes #76914
620 2005-12-09 Raja R Harinath <rharinath@novell.com>
622 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
623 instead of IsGenericInstance.
624 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
625 code that's now covered by the more general test.
626 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
628 * generic.cs (DropGenericTypeArguments): New. Captures the common
629 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
630 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
631 * generic.cs, report.cs, typemanager.cs: Likewise.
633 2005-12-08 Martin Baulig <martin@ximian.com>
635 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
637 * typemanager.cs (TypeManager.CSharpSignature): Include type
638 arguments in the signature of a generic method.
640 2005-12-07 Martin Baulig <martin@ximian.com>
642 Add support for custom attributes on type parameters.
644 * cs-parser.jay (type_arguments): Added `opt_attributes'.
646 * generic.cs (TypeParameterName): New public class; we use this
647 instead of a `string' to store the name of a type parameter, so we
648 can also have `Attributes'.
649 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
650 array instead of a `string[]' array.
651 (TypeParameter.ctor): We now also take an `Attributes' argument.
652 (TypeParameter.EmitAttributes): New public method; emit our
653 `OptAttributes' here.
654 (GenericMethod.EmitAttributes): New public method; emit the custom
655 attributes on all our type parameters.
657 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
659 (MethodData.Define): If we're a generic method, call
660 EmitAttributes() on it.
662 2005-12-07 Martin Baulig <martin@ximian.com>
665 (ConstraintChecker): New public abstract class; move the
666 constraint checking here from `ConstructedType' and also do
667 constraint checking for generic methods here.
669 * expression.cs (Invocation.OverloadResolve): Use
670 ConstraintChecker.CheckConstraints() if we resolved to a generic
673 2005-12-05 Marek Safar <marek.safar@seznam.cz>
675 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
677 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
679 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
680 (FieldBase.Initializer): Initializer is now optional.
681 (EventField.Define): Only event field can have initializer.
683 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
685 * const.cs (Const): Reuse initializer.
687 * cs-parser.jay: Updated after FieldBase changes.
688 Added current_array_type to simplify array initializers.
690 * ecore.cs (NullCast.IsDefaultValue): Implemented.
692 * expression.cs, iterators.cs: Updated.
694 * namespace.cs (NamespaceEntry): Made UsingFound private.
696 2005-12-05 Marek Safar <marek.safar@seznam.cz>
698 * parameterCollection.cs: Obsolete, removed.
699 * parser.cs: Obsolete, removed.
701 2005-12-05 Marek Safar <marek.safar@seznam.cz>
704 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
706 * enum.cs (Enum.Define): Set obsolete context here.
708 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
711 - FindDocumentedMember() now expects 1) paramList as null
712 when "we don't have to check the number of parameters" and
713 2) Type.EmptyTypes when "there is no arguments".
714 - Introduced FoundMember struct to hold the exact type which was
715 used to find the documented member (the above change broke
716 test-xml-044; it might be better just to use DeclaringType than
717 what MS does, like this change does, but it depends on usage.)
719 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
721 * doc.cs : documented member might be from DeclaringType for nested
722 types. Fixed bug #76782.
724 2005-12-03 Ben Maurer <bmaurer@ximian.com>
726 * anonymous.cs: Have the param code handle leaving copies on the
727 stack etc. Allows anonymous params to take part in the assignment
728 code (++, +=, etc). Fixes bug #76550
730 * expression.cs: Handle the prepare_for_load/leave_copy by passing
731 it down to the anon code.
733 * iterators.cs: Use dummy var here
735 * codegen.cs: Handle new vars
737 2005-12-01 Marek Safar <marek.safar@seznam.cz>
740 * class.cs (MethodData.Define): Set proper Obsolete context.
742 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
744 (FieldExpr.DoResolve): Ditto.
746 2005-12-01 Marek Safar <marek.safar@seznam.cz>
749 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
750 parent is not obsolete.
752 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
754 * doc.cs : (FindDocumentedMember) find parameterless members first
755 and get CS0419 in the early stage. Fixed first case of bug #76727.
757 2005-11-30 Marek Safar <marek.safar@seznam.cz>
760 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
761 no error was reported.
763 *expression.cs (Binary.DoResolve): left can be null.
765 2005-12-06 Raja R Harinath <rharinath@novell.com>
767 * class.cs (MethodCore.CheckGenericOverride): Delete unused
768 abstract method and all overrides.
769 * support.cs (ParameterData.GenericConstraints): Delete.
770 (ReflectionParameters.type_params): Delete.
771 (ReflectionParameters.ReflectionParameters): Make private.
772 (ReflectionParameters.GetConstaints): New factory method.
773 * generic.cs (TypeParameterDefineType): Use it.
774 (TypeManager.GetTypeParameterConstraints): Likewise.
776 2005-11-22 Marek Safar <marek.safar@seznam.cz>
779 * class.cs (MethodData.Emit): Parameters should be labeled first.
781 2005-11-21 Marek Safar <marek.safar@seznam.cz>
784 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
786 2005-11-18 Marek Safar <marek.safar@seznam.cz>
788 * attribute.cs (AreParametersCompliant): Moved to Parameter.
790 * class.cs (MethodCore): Parameter clean up.
791 (IMethodData): Added ParameterInfo.
792 (MethodData): Parameter clean up.
793 (Indexer.Define): Parameter clean up.
805 * typemanager.cs: Parameter clean up.
807 * delegate.cs (Define): Get rid of duplicated code.
809 * expression.cs (ParameterReference): Removed useless parameters
813 * parameter.cs (ParamsParameter): New class, params specialization.
814 (ArglistParameter): Attemp to separate arglist.
815 (Parameter): Refactored to be reusable and faster.
816 (Parameter.Modifier): Made understandable.
817 (Parameters): Changed to be used as a class for `this' assembly
818 parameters. Refactored to use new specialized classes.
820 * support.cs (ParameterData): Added Types property.
821 (InternalParameters): Deleted.
823 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
825 * doc.cs : the previous patch does not actually fix the bug.
826 PropertyInfo override check is now implemented and really fixed it.
827 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
829 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
831 * doc.cs : apply "override filter" also to properties.
834 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
836 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
837 no need to check overrides. For classes, omit those results from
838 interfaces since they must exist in the class. Fixed bug #76726.
840 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
842 * typemanager.cs : (GetFullNameSignature) differentiate indexers
843 with different parameters. Fixed the second problem in #76685.
845 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
847 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
848 get expected 'protected' access in CheckValidFamilyAccess()).
851 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
853 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
854 Fixed bug #76705. CS1569 was incorrectly commented out.
856 2005-11-23 Martin Baulig <martin@ximian.com>
858 * generic.cs (Constraints.Define): Removed.
859 (TypeParameter.DefineConstraints): Removed.
860 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
861 on the GenericTypeParameterBuilder here.
863 2005-11-23 Martin Baulig <martin@ximian.com>
865 * typemanager.cs (TypeManager.GetProperty): Make this public.
867 * generic.cs (Nullable.NullableInfo.ctor): Use
868 TypeManager.GetProperty() rather than using reflection directly.
870 2005-11-17 Martin Baulig <martin@ximian.com>
872 * expression.cs (Indexers.GetIndexersForType): Added support for
873 generic parameters; fixes #76587.
875 2005-11-17 Martin Baulig <martin@ximian.com>
878 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
879 inherit the scope from our parent. Fixes #76653.
881 2005-11-15 Martin Baulig <martin@ximian.com>
883 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
884 instead of `ScopeTypeBuilder' to refer to the "current" type.
885 (AnonymousMethod.CreateScopeType): Correctly create the helper
886 class if we're inside a generic type definition.
888 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
890 * doc.cs : use Invocation.IsOverride() to do real override check.
891 * expression.cs : made Invocation.IsOverride() internal.
893 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
895 * doc.cs : use TypeManager.FindMembers() instead of (possible)
896 TypeBuilder.FindMembers() and filter overriden base members out.
899 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
901 * doc.cs : ref/out parameters are represented as '@' (instead of
902 '&' in type FullName). Fixed bug #76630 (additionally crefs).
904 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
906 * doc.cs : when there was no '.' in cref to methods in doc comment,
907 then parameters were missing in the output. Fixed bug #76691.
909 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
911 * driver.cs : don't output docs when there is an error.
914 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
917 Now it should detect indexers. Fixed primary concern in bug #76685.
918 Fixed CS0419 message to not show the identical member signature in
921 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
923 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
924 instead of Type.FindMembers() since it does not handle events.
927 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
929 * codegen.cs: Fixed typo (speficied -> specified).
931 2005-11-11 Marek Safar <marek.safar@seznam.cz>
934 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
936 2005-11-11 Marek Safar <marek.safar@seznam.cz>
938 * attribute.cs: Changed error message.
940 * cs-tokenizer.cs: One more check.
942 2005-11-10 Marek Safar <marek.safar@seznam.cz>
944 * statement.cs (Block.Resolve): Ignore empty statement.
946 2005-11-10 Marek Safar <marek.safar@seznam.cz>
948 * report.cs: Made error/warning methods more strict to avoid
951 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
952 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
953 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
954 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
956 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
958 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
959 Use the more explicit AssemblyName.FullName instead of
960 AssemblyName.Name to report errors.
962 2005-11-11 Marek Safar <marek.safar@seznam.cz>
964 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
967 2005-11-10 Marek Safar <marek.safar@seznam.cz>
977 * report.cs: Fixed error reporting and typos.
979 * generic.cs (TypeParameter.GetSignatureForError): New method.
980 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
982 * typemanager.cs (GetFullName): Refactored.
984 2005-11-08 Marek Safar <marek.safar@seznam.cz>
986 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
987 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
989 * class.cs (TypeContainer.IsComImport): New property.
990 (Constructor.Define): Create proper ctor for ComImport types.
992 * expression.cs (New.CheckComImport): Fixed.
994 2005-11-07 Miguel de Icaza <miguel@novell.com>
996 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
997 that a parameter has been captured does not mean that we do not
998 have to do the rest of the processing. This fixes the second part
999 of #76592. If there was another anonymous method capturing
1000 values in the past, the Scope would never be set for the second
1001 method that captured the same parameter.
1003 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1004 properly manipulate the stack. Second part of fix for #76592.
1006 * expression.cs (New): Add support for invoking "new" on
1007 interfaces that have been flagged with the ComImport attribute and
1008 the CoClass. Fixes #76637
1010 * statement.cs (Try.DoEmit): When a variable is captured, do not
1011 try to emit the vi.LocalBuilder variable as it has been captured.
1012 Create a temporary variable and store the results on the
1013 FieldBuilder. Fixes #76642
1015 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1017 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1019 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1021 * expression.cs (Binary.DoResolve): Added && optimalization.
1023 * typemanager.cs (AddUserType): Removed useless argument.
1025 2005-11-04 Marek Safar <marek.safar@seznam.cz>
1027 * statement.cs (Block.variables): Uses ListDictionary.
1029 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1032 * class.cs (PartialContainer.EmitType): Customized to emit
1033 security attributes.
1034 (ClassPart.ApplyAttributeBuilder): Transform security attribute
1035 for partial classes.
1037 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1040 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1041 access has to be fixed.
1043 * typemanager.cs (IsUnmanagedType): Wrong common field type.
1045 2005-11-01 Marek Safar <marek.safar@seznam.cz>
1048 * ecore.cs (NullCast.Reduce): Implemented.
1050 * expression.cs (ArrayCreation.CheckIndices): Correcly check
1053 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1055 (Foreach.Resolve): Catch null properly.
1057 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1059 * cs-tokenizer.cs: Warning text fix.
1061 * driver.cs: AllWarningNumbers exposed on public interface.
1063 * report.cs (): Reviewed warning numbers.
1064 (IsValidWarning): Use binary search.
1066 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1068 * driver.cs: Implemeted resource visibility.
1069 (Resources): New class for code sharing between /res: and
1072 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1074 decl.cs (CurrentTypeParameters): Fixed to be public.
1076 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1078 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1080 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1082 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1084 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
1086 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1088 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1090 Add friend assembly access support.
1091 * typemanager.cs: assembly_internals_vis_attrs
1092 cache for friend assembly access.
1093 (TypeManager.IsFriendAssembly): New method for
1094 checking friend assembly access.
1095 (TypeManager.Error_FriendAccessNameNotMatching): New
1097 (TypeManager.CompareKeyTokens): Likewise.
1098 (TypeManager.Filter): Handle friend accessible
1101 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1102 friend accessible types.
1104 * ecore.cs (Expression.IsAccessorAccessible): Handle
1105 friend accessible properties.
1107 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1110 2005-10-28 Marek Safar <marek.safar@seznam.cz>
1113 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1116 * convert (Convert.ImplicitReferenceConversion): NullCast holds
1119 * ecore.cs (NullCast): Child is contant only.
1121 * literal.cs (NullLiteral.Reduce): null can be converted to any
1124 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
1126 * driver.cs: Use Encoding.Default as default code page instead
1129 2005-10-27 Raja R Harinath <rharinath@novell.com>
1132 * expression.cs (Invocation.Error_InvalidArguments): Handle
1133 __arglist parameters.
1134 (Invocation.VerifyArgumentsCompat): Likewise.
1135 * support.cs (ReflectionParameters.GetSignatureForError): Print
1136 __arglist parameters.
1137 (InternalParamters.GetSignatureForError): Likewise.
1138 * parameter.cs (Parameters.GetSignatureForError): Likewise.
1140 2005-10-26 Marek Safar <marek.safar@seznam.cz>
1142 * attribute.cs (GetPropertyValue): Made public.
1144 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1146 Add new property WrapNonExceptionThrows to handle 2.0 assembly
1148 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1151 * driver.cs: Reflect method name change.
1153 * statement.cs (Try.Resolve): Warn when try has both general
1156 * typemanager.cs: runtime_compatibility_attr_type new predefined
1159 2005-10-26 Raja R Harinath <harinath@gmail.com>
1162 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1163 treat it as an empty parameter list.
1165 2005-10-26 Raja R Harinath <rharinath@novell.com>
1168 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
1169 ResolveAsTypeStep silent.
1170 * statement.cs (Block.AddConstant): Mark block as used.
1171 (Block.ResolveMeta): Avoid piling on error messages
1172 if a constant initializer resolution fails.
1174 2005-10-25 Raja R Harinath <rharinath@novell.com>
1176 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1178 (NamespaceEntry.VerifyAllUsing): New.
1179 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
1180 behaviour. Delegates actual resolution of alias to ...
1181 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
1182 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1184 * driver.cs (Driver.MainDriver): Update.
1186 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1187 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1189 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1191 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1192 RootNamespace.DefineNamespacesForAll.
1194 2005-10-24 Raja R Harinath <harinath@gmail.com>
1196 * typemanager.cs (assemblies, external_aliases, modules)
1197 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1198 (ComputeNamespaces, GetRootNamespace): Remove extra staging
1199 overhead. Move resposibility ...
1200 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
1201 * driver.cs, attribute.cs, codegen.cs: Update to changes.
1203 2005-10-23 Raja R Harinath <harinath@gmail.com>
1205 * namespace.cs (RootNamespace.all_namespaces): Renamed from
1206 cached_namespaces. Improve usage.
1207 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1208 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1209 Move from GlobalRootNamespace and simplify.
1210 (RootNamespace.Global): Make instance variable.
1211 (RootNamespace.RootNamespace): Add "alias name" parameter.
1212 (GlobalRootNamespace): Simplify drastically.
1213 (Namespace.Lookup): Don't use GetNamespace.
1214 * typemanager.cs (GetRootNamespace): Rename from
1215 ComputeNamespaceForAlias.
1216 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1218 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1220 * anonymous.cs (AnonymousContainer): Don't crash when container
1223 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1225 * expression.cs (Binary.DoResolve): Warn when comparing same
1228 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1231 * expression.cs (Binary.DoResolve): It looks like there are no
1232 convetsion rules in enum context.
1234 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1236 Add support for extern alias qualifiers.
1237 * typemanager.cs: Move some LookupTypeReflection code
1238 to namespace.cs, to have cleaner code. Added some methods
1239 to help us keep track of the extern aliased references.
1240 * driver.cs: Add suport for extern alias assemblies on command
1241 line and check for their warnings/errors. Also keep track of the
1242 extern aliased assemblies.
1243 * namespace.cs: Move the global functionality of Namespace
1244 to GlobalRootNamespace/RootNamespace. Now the global namespace
1245 is GlobalRootNamespace.Globa. Also the code moved from
1246 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
1247 Finally added LocalAliasEntry (AliasEntry before) and
1248 ExternAliasEntry, to handle alias statements.
1249 * cs-parser.jay: Add support in the grammar for extern alias
1251 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
1252 Update callings to Namespace (now in GlobalRootNamespace).
1254 2005-10-25 Martin Baulig <martin@ximian.com>
1256 * convert.cs (ImplicitTypeParameterConversion): Make base
1257 interfaces actually work; fixes #76557.
1259 2005-10-25 Martin Baulig <martin@ximian.com>
1262 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
1263 all the type parameters; fixes #76551.
1265 2005-10-25 Martin Baulig <martin@ximian.com>
1270 (GenericMethod.ctor): Added `Expression return_type' and
1271 `Parameters parameters' arguments.
1272 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
1273 parameter and return types to check their constraints if they're
1276 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
1279 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1280 constraints of a generic type if `ec.ResolvingGenericMethod'.
1282 * class.cs (MethodCore.DoDefineParameters): Set
1283 `ec.ResolvingGenericMethod' if we're a generic method.
1284 (MemberBase.MemberType): Likewise.
1286 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1288 * typemanager.cs (TypeManager): Added
1289 TypeManager.internals_visible_attr_type to cache
1290 S.R.CompilerServices.InternalsVisibleToAttribute.
1292 * codegen.cs (AssemblyClass): Added checks for
1293 InternalsVisibleToAttribute in new method
1294 CheckInternalsVisibleAttribute () and also cache the
1295 AssemblyName in AssemblyClass.Name.
1297 2005-10-24 Martin Baulig <martin@ximian.com>
1300 (TypeManager.ExpandInterfaces): Added overloaded version which
1301 just takes a `Type[]' array.
1304 (Constraints.Resolve): Don't expand the interfaces here; ie. we
1305 just use the interfaces which were explicitly specified and not
1306 the interfaces they inherit. Fixes #76482.
1307 (TypeParameter.FindMembers): Expand the interfaces here.
1309 2005-10-21 Martin Baulig <martin@ximian.com>
1312 (Constraints.Resolve): Also resolve the actual types here.
1313 (Constraints.ResolveTypes): Just check the constraints here.
1314 Fixes #76363; see gtest-218.cs.
1316 2005-10-21 Martin Baulig <martin@ximian.com>
1319 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
1320 instead of a `BoxedCast'; fixes gtest-217.cs.
1322 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
1324 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1325 1) "new()" is specified as generic parameter constraint and 2) the
1326 type is TypeBuilder and 3) the type is abstract even if it has a
1327 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
1329 2005-10-20 Martin Baulig <martin@ximian.com>
1332 (GenericConstraints.TypeParameter): New public property.
1333 (TypeParameter.ctor): Also take a `DeclSpace' argument.
1334 (TypeParameter.DeclSpace): New public property.
1335 (TypeParameter.DefineType): Inflate the constraints if our
1336 `DeclSpace' is an `Iterator'.
1338 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
1340 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
1341 GenericMethod argument to compare methods' generic type arguments.
1344 2005-10-19 Martin Baulig <martin@ximian.com>
1346 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
1347 not ResolveType() when resolving the base type, so we're not
1348 checking the constraints here.
1349 (TypeContainer.ResolveType): Call ResolveType() on our base_type
1352 2005-10-19 Martin Baulig <martin@ximian.com>
1354 * generic.cs (ConstructedType.CheckConstraints): Committing
1355 untested fix for #76441.
1357 2005-10-18 Raja R Harinath <rharinath@novell.com>
1360 * class.cs (TypeContainer.DefineType): Move updating of
1361 topological sort earlier in the code.
1362 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1364 2005-10-18 Marek Safar <marek.safar@seznam.cz>
1367 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1369 * constant.cs (Constant.TryReduce): Moved from Cast class.
1370 (Reduce): Made little bit more OO and fixed missing conversions.
1372 * ecore.cs (Reduce): Implemented.
1373 (Binary.EnumLiftUp): New method to upgrade values to enum values.
1375 * literal.cs (Reduce): Implemented.
1377 * class.cs: Reverted Miguel's wrong commit.
1379 2005-10-14 Miguel de Icaza <miguel@novell.com>
1381 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1383 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
1385 * cs-parser.jay, expression.cs : CS0214 was missing error location
1386 for constants. Fixed bug #76404.
1388 2005-10-10 Raja R Harinath <rharinath@novell.com>
1390 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1392 (PropertyExpr.EmitCall): Likewise.
1393 * expression.cs (Invocation.EmitArguments): Handle case where
1395 (Invocation.EmitCall): Avoid allocating temporary variable if
1396 there are no arguments.
1398 2005-10-11 Marek Safar <marek.safar@seznam.cz>
1401 * convert.cs (ExplicitConversionCore): Fixed object->enum
1404 2005-10-07 Raja R Harinath <rharinath@novell.com>
1407 * convert.cs (ImplicitConversionStandard): Move conversion of
1408 void* to arbitrary pointer types ...
1409 (ExplicitConversionStandard): .. here.
1410 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1411 error to always print typenames.
1413 2005-10-07 Raja R Harinath <rharinath@novell.com>
1415 * convert.cs (GetConversionOperator): Rename from
1416 GetConversionOperators. Move operator selection code from ...
1417 (UserDefinedConversion): ... here.
1419 2005-10-06 Marek Safar <marek.safar@seznam.cz>
1421 * convert.cs (ExplicitConversionCore): Removed duplicate enum
1424 2005-10-05 Marek Safar <marek.safar@seznam.cz>
1426 * assign.cs (Assign.DoResolve): Error method changed.
1428 * cfold.cs (DoConstantNumericPromotions): Error method changed.
1430 * const.cs (ResolveValue): Reset in_transit immediately.
1432 * constant.cs: Error method changed.
1434 * convert.cs: Removed useless location parameter.
1435 (ExplicitNumericConversion): Don't do double enum check.
1436 (ExplicitConversionCore): Renamed from ExplicitConversion.
1437 (ExplicitUnsafe): Extracted from ExplicitConversion.
1438 (ExplicitConversion): Uses for error reporting.
1440 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
1442 (ResolveBoolean): Uses common error method.
1443 (CastToDecimal): Get rid of ec.
1444 (CastFromDecimal): Optimized.
1445 (ConvCast): Get rid of ec.
1447 * enum.cs (ResolveValue): Reset in_transit immediately.
1448 (Emit): Return after first error.
1450 * expression.cs: Convert changes.
1452 * literal.cs: Error method changed.
1454 * statement.cs: Error method changed.
1456 2005-10-06 Raja R Harinath <rharinath@novell.com>
1458 Fix gtest-131.cs and gtest-211.cs.
1459 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
1460 Only emit code for a label if it is used. Unreachable code can
1461 violate ECMA evaluation stack invariants.
1463 2005-09-27 Marek Safar <marek.safar@seznam.cz>
1465 * anonymous.cs: Implemented ExprClassName.
1467 * assign.cs (Assign.DoResolve): Don't chrash when type is not
1470 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
1473 * class.cs (StaticClass.DefineContainerMembers): Report protected
1476 * codegen.cs: if(ed) PRODUCTION.
1478 * convert.cs (Error_CannotImplicitConversion): Better error
1481 * cs-parser.jay: More error checks.
1483 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
1485 * driver.cs (CSCParseOption): Enabled wrong option check.
1487 * ecore.cs (Expression.ExprClassName): Turned to property.
1488 (MemberExpr.CheckIntermediateModification): For checking boxed
1489 value types modification.
1491 * statement.cs (Fixed.Resolve): Expression type must be
1492 convertible to fixed type.
1493 (CollectionForeach.GetEnumeratorFilter,TryType):
1494 Small refactoring for easier error checking.
1496 2005-09-26 Marek Safar <marek.safar@seznam.cz>
1498 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
1501 * class.cs (GeneratedBaseInitializer): New class for customization
1502 compiler generated initializers.
1503 (MemberBase.DoDefine): Check Obsolete attribute here.
1504 (FieldMember.DoDefine): Ditto.
1506 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
1509 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
1510 (MemberCore.GetObsoleteAttribute): Removed argument.
1511 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
1512 (MemberCore.CheckObsoleteType): New helper.
1516 * statement.cs: Updates after MemberCore changes.
1518 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
1519 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
1521 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
1522 obsolete attribute for compiler construct.
1523 (As.DoResolve): Cache result.
1525 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
1527 2005-10-01 Miguel de Icaza <miguel@novell.com>
1529 * expression.cs (Probe): instead of having a "Type probe_type"
1530 keep the extra information as a TypeExpr probe_type_expr since the
1531 "As" operator needs to perform some type checks.
1533 * (As.DoResolve): If the type is a type parameter, ensure that it
1534 is constrained by a class.
1536 2005-09-22 Miguel de Icaza <miguel@novell.com>
1538 * statement.cs (Lock): Use the TemporaryVariable class instead of
1539 manually using local variables as those do not work when variables
1542 * ecore.cs: Moved the TemporaryVariable class from being a nested
1543 class inside Foreach to be a public class that can be employed in
1546 2005-09-19 Marek Safar <marek.safar@seznam.cz>
1548 * cs-parser.jay: interface_accessors replaced by
1549 accessor_declarations.
1551 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
1554 * statement.cs (GotoCase.Resolve): Convert null constant to
1556 (SwitchLabel.ResolveAndReduce): Ditto.
1557 (SwitchLabel.NullStringCase): Custom null stamp.
1558 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
1560 typemanager.cs (CSharpSignature): Don't skip first argument
1563 2005-09-16 Marek Safar <marek.safar@seznam.cz>
1565 * cfold.cs, constant.cs, convert.cs, ecore.cs,
1566 expression.cs, iterators.cs, literal.cs: Store constants and
1569 * class.cs (MemberBase.ShortName): Pass location.
1571 * cs-parser.jay: Some location fixes.
1573 * ecore.cs (Expression.Location): Made virtual.
1575 2005-09-27 Marek Safar <marek.safar@seznam.cz>
1578 * const.cs (Const.ResolveValue): Check for assigning non-null
1579 value to reference type.
1581 2005-09-26 Raja R Harinath <rharinath@novell.com>
1584 * expression.cs (This.VerifyFixed): In a value type T, the type of
1585 'this' is T&, iow, 'this' is either an out or ref parameter. In a
1586 value type R, 'this' is treated as a value parameter.
1588 2005-09-05 Miguel de Icaza <miguel@novell.com>
1590 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1591 if the underlying types are the same, otherwise we need to produce
1592 code that will do the proper cast.
1594 This was exposed by Marek's constant rewrite which produced
1595 invalid code for the call site:
1598 void Method (X v) {}
1602 This fixes test-49.cs
1604 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1606 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
1607 Type/Object should be allowed as well. Fixed bug #75968.
1609 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1611 * expression.cs : (Binary.DoResolve): when one is enum constant and
1612 another is constant 0, then return enum one *as enum type*.
1615 2005-10-04 Martin Baulig <martin@ximian.com>
1617 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
1618 `SetMemberIsUsed()' work for generics, too.
1620 2005-10-04 Martin Baulig <martin@ximian.com>
1622 * expression.cs (DelegateInvocation.EmitStatement): Make this work
1623 for corlib. Fixes #75691.
1625 2005-09-28 Marek Safar <marek.safar@seznam.cz>
1628 * driver.cs: Fix compilation files with full root path.
1630 2005-09-25 Miguel de Icaza <miguel@novell.com>
1632 * report.cs (SymbolRelatedToPreviousError): Format the output so
1633 it does not use an open parenthesis that is never closed.
1635 * driver.cs: Follow coding guidelines
1637 2005-09-18 Miguel de Icaza <miguel@novell.com>
1639 * driver.cs: Set InEmacs based on the environment variable EMACS.
1641 * location.cs (InEmacs): in this mode, do not report column
1642 location as it confuses Emacs.
1644 2005-10-03 Raja R Harinath <rharinath@novell.com>
1646 * support.cs (SeekableStreamReader.Position): Don't error out when
1647 the requested position is just beyond the end of the current
1650 2005-09-28 Raja R Harinath <rharinath@novell.com>
1652 * support.cs (SeekableStreamReader): Simplify drastically. Don't
1653 try to keep in sync with the byte count of the underlying Stream.
1654 However, this limits us to a window size of 2048 characters: i.e.,
1655 the maximum lookahead of our lexer/parser can be 2048 characters.
1657 2005-09-22 Martin Baulig <martin@ximian.com>
1659 * driver.cs: Removed a debugging FIXME.
1661 2005-09-21 Raja R Harinath <rharinath@novell.com>
1663 * cs-parser.jay (type_arguments): Add CS1644 check.
1664 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
1666 2005-09-15 Raja R Harinath <rharinath@novell.com>
1668 * Makefile (PROGRAM): Make profile specific.
1669 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
1670 the current directory.
1673 * expression.cs (Invocation.EmitCall): Remove optimization on
1674 this_call since it doesn't handle 'this' being a value type.
1676 2005-09-05 Geoff Norton <gnorton@customerdna.com>
1678 * driver.cs: Ensure file handles are closed after parsing
1680 2005-09-05 Miguel de Icaza <miguel@novell.com>
1682 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1683 if the underlying types are the same, otherwise we need to produce
1684 code that will do the proper cast.
1686 This was exposed by Marek's constant rewrite which produced
1687 invalid code for the call site:
1690 void Method (X v) {}
1694 This fixes test-49.cs
1696 2005-09-05 Martin Baulig <martin@ximian.com>
1698 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
1699 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
1701 * cs-parser.jay (delegate_declaration): Small fix for #75852.
1703 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1705 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
1706 to be a pointer type due to the spec 25.2, so check if declaring
1707 type is generic type definition. Fixed bug #75772.
1709 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1712 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
1713 both types are not defined by methods.
1714 * expression.cs : (Invocation.IsApplicable): it should work when
1715 the argument type is equal to the parameter type, not only when
1716 ImplicitConversionExists() returns true.
1718 2005-09-02 Raja R Harinath <rharinath@novell.com>
1720 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
1724 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
1725 flow-branching for LocalVariableReferences in case we were invoked
1726 from a MemberAccess.
1727 * expression.cs (LocalVariableReference.VerifyAssigned): New.
1729 (LocalVariableReference.DoResolveBase): ... this.
1730 (MemberAccess.Resolve): Do the check that was disabled during
1733 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
1736 (PartialContainer.Create): check abstract/sealed/static strictly
1737 but abstract/sealed can exist only at one side. Fixed bug #75883.
1739 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
1742 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
1743 specified, don't default to UnmanagedType.I4.
1745 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
1747 * expression.cs : conditional operator should check possibly
1748 incorrect assign expression. Fixed bug #75946.
1750 2005-08-30 Raja R Harinath <rharinath@novell.com>
1753 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
1754 (ScopeInfo.EmitScopeType): Use it to construct field names from
1755 names of captured locals.
1758 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
1759 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
1760 Pass 'target_type' to BoxedCast. Don't default to 'object'.
1761 (ExplicitConversion): Remove enum cases already handled by
1762 implicit conversion. Move implicit conversion check to the beginning.
1763 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
1764 * expression.cs (ArrayCreation.EmitDynamicInitializers):
1765 Don't treat System.Enum as a struct.
1767 2005-08-30 Jb Evain <jbevain@gmail.com>
1769 * attribute.cs: handles as expression in parameters.
1771 2005-08-30 Raja R Harinath <rharinath@novell.com>
1774 * class.cs (TypeContainer.VerifyClsName): Don't use a
1775 PartialContainer when verifying CLS compliance.
1776 (AbstractPropertyEventMethod): Set Parent here, ...
1777 (PropertyMethod): ... not here.
1779 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
1781 * attribute.cs : escaped attribute name should not be allowed to be
1782 resolved (e.g. @class as classAttribute). Fixed bug #75930.
1784 2005-08-29 Raja R Harinath <rharinath@novell.com>
1787 * convert.cs (ImplicitStandardConversionExists): Allow zero also
1788 when converting a long constant to unsigned long.
1789 * expression.cs (Invocation.OverloadResolve): Add sanity check to
1790 detect where IsApplicable and VerifyArgumentsCompat disagree.
1792 2005-08-29 Raja R Harinath <rharinath@novell.com>
1793 and Carlos Alberto Cortez <carlos@unixmexico.org>
1796 * class.cs (TypeContainer.CanElideInitializer): New helper.
1797 (TypeContainer.EmitFieldInitializers): Use it to determine if we
1798 can safely emitting the initializer of a field.
1800 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1802 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
1803 allowed inside a switch (without loop). Fixed bug #75433.
1805 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
1807 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
1808 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
1810 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1812 * driver.cs : kinda reverting the default encoding changes (not exact
1813 revert since I noticed that "codepage:reset" might not work fine).
1815 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1817 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
1818 Location. Now getter and setter store location correctly.
1819 (errors/cs0111-12.cs now reports the expected location.)
1821 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1823 * driver.cs : Use default encoding on the environment.
1824 Removed (now that) extra parameter for SeekableStreamReader.
1825 * support.cs : (SeekableStreamReader) third .ctor() argument for
1826 StreamReader is not required (always true). preamble size could
1827 be acquired in simpler and safe way.
1829 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
1831 * cs-parser.jay: report CS0642 at warning level 3
1832 and report CS0642 for an if else statement also
1833 fixes bug #74745. Patch by John Luke (and a bit
1835 Removed extra CS0642 warning check for "while",
1837 * statement.cs: In Block.Resolve(), CS0642 check
1838 is reimplemented to check a sequence of an empty
1839 statement and a block.
1841 Both fix bug #66777.
1843 2005-08-24 Marek Safar <marek.safar@seznam.cz>
1845 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
1846 detection until I fix it.
1848 * cs-tokenizer.cs: Changed error message.
1850 * cs-parser.jay: Fixed 2 error locations.
1852 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
1853 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
1856 * enum.cs (GetSignatureForError): Fixed.
1858 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
1862 * typemanager.cs (RegisterProperty): Removed.
1864 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
1866 2005-08-24 Raja R Harinath <rharinath@novell.com>
1869 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
1870 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
1872 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1874 * expression.cs : tiny fix is required for not warning positive ulong.
1877 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1879 * expression.cs : add CS0652 check for constant and integral
1880 expression. Fixed bug #53974.
1882 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1884 * expression.cs : in DoNumericPromotions(), check if there is implicit
1885 conversion overload for string (to check CS0034). Fixed bug #52492.
1887 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1889 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
1891 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1893 * ecore.cs : report location when it is *not* Null.
1895 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1901 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
1902 correctly. Fixed bug #75721.
1904 2005-08-23 Raja R Harinath <rharinath@novell.com>
1906 * support.cs (SeekableStreamReader.Position): Avoid an expensive
1907 loop that performs 'min (pos, char_count)'.
1910 * expression.cs (Unary.ResolveOperator): Don't discard implicit
1911 converted value in Operator.OnesComplement.
1913 2005-08-22 Ben Maurer <bmaurer@ximian.com>
1915 * anonymous.cs: If the anon method is pulled into a helper class,
1916 it needs to be `internal' not `private'. Fixes runtime behavior on
1919 2005-08-17 Marek Safar <marek.safar@seznam.cz>
1922 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
1925 2005-08-16 Marek Safar <marek.safar@seznam.cz>
1927 The big constants rewrite
1928 Fix #75746, #75685 and more
1929 As a side effect saved 1MB for MWF ;-)
1931 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
1932 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
1933 enum based for corlib compilation.
1935 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
1938 * class.cs (FixedField.Define): Use ResolveAsConstant.
1940 * const.cs (IConstant): Interface constants and enums.
1941 (Const.ResolveValue): New method for constant resolvning.
1942 (ExternalConstant): Constants from imported assemblies.
1944 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
1945 conversion; like enums.
1946 (Constant.ToType): Converts this constant to different type.
1947 (Constant.Increment): Adds 1.
1949 * convert.cs (ImplicitConversionRequired): Simplified.
1951 * cs-parser.jay: Create EnumMember directly.
1953 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
1955 * doc.cs (GenerateEnumDocComment): Removed.
1957 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
1958 (ConvertIntLiteral): Removed.
1959 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
1961 * enum.cs (EnumMember): Implement IConstant.
1962 (Enum.IsValidEnumConstant): Removed.
1963 (Enum.GetNextDefaultValue): Removed.
1964 (Enum.FindMembers): Updated.
1965 (Enum.GenerateDocComment): Iterate enum members.
1967 * expression.cs (Cast.TryReduce): Handle enums correctly.
1968 (New.Constantify): Made public.
1969 (MemberAccess.DoResolve): Removed contant specific if(s).
1971 * literal.cs (NullLiteral): Implement new abstract methods.
1973 * statement.cs (GotoCase.Resolve): Use new constant methods.
1974 (SwitchLabel.ResolveAndReduce): Use new constant methods.
1976 * typemanager.cs (LookupEnum): Removed.
1977 (IsEnumType): Fixed to work with corlib.
1978 (RegisterConstant): Removed.
1979 (LookupConstant): Removed.
1980 (GetConstant): Changed to work with IConstant.
1982 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
1984 * location.cs : Fixed overflown (>255) column number.
1986 2005-08-03 Raja R Harinath <rharinath@novell.com>
1988 First cut of the qualified-alias-member feature.
1989 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
1991 * cs-parser.jay (DOUBLE_COLON): New token.
1992 (namespace_or_type_name): Add rule for recognizing
1993 qualified-alias-members.
1994 (primary_expression): Likewise.
1995 (element_access): Allow QualifiedAliasMember as a possible
1996 type-bearing expression.
1997 (local_variable_type, local_variable_pointer_type): Likewise.
1998 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
1999 aliases in the current and enclosing namespace declarations.
2000 (NamespaceEntry.UsingAlias): Add CS0440 warning.
2001 * decl.cs (MemberName.is_double_colon): New.
2002 (MemberName.MemberName): Add new constructor for alias-member.
2003 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2004 * expression.cs (QualifiedAliasMember): New expression type.
2006 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2008 * location.cs : it borked when no argument was specified.
2010 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2012 * location.cs : tiny ToString() format fix.
2014 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2016 * statement.cs : oops, it was missing.
2018 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2020 A set of fixes for precise line/column location.
2023 "token" field now holds a file/line "delta", a line number offset
2024 from the segment, and a column number. See also:
2025 http://lists.ximian.com/pipermail/mono-devel-list/2004-
2026 December/009508.html
2027 Removed static IsNull. Use instance IsNull property instead.
2029 For some tokens it stores Location. For Identifier it stores
2030 LocatedToken which is a pair of string name and location.
2031 Column numbers are adjusted only at getChar().
2033 Use Location.ToString() for reporting (it now contains column).
2035 Largely modified to use LocatedToken instead of
2036 string (IDENTIFIER), and to acquire Location from some tokens.
2037 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2038 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2040 Now MemberName holds Location. DeclSpace.ctor() receives Location
2041 as a parameter. Removed extra parameters to all derived classes.
2042 Replaced Location.IsNull() with instance property.
2043 * assign.cs, expression.cs :
2044 Added .ctor() overload that omits Location.
2046 Added "nameEscaped" flag that indicates the identifier was escaped
2047 in the source file. This fixes bug #57047.
2049 2005-09-02 Martin Baulig <martin@ximian.com>
2051 * class.cs: Make CS3005 a warning, not an error.
2053 2005-08-02 Marek Safar <marek.safar@seznam.cz>
2055 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2056 New method, looking for lo-case imported cls type.
2058 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2061 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2063 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2065 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2067 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2069 Optimized to save 3.5 MB for SWF compilation.
2071 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2073 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2074 (PartialContainer.Create): Moved logic AddToContainer.
2075 (PartialContainer.MarkForDuplicationCheck): Shares name.
2077 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2080 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2082 (Namespace.GetSignatureForError): New method.
2084 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2085 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2087 2005-08-01 Raja R Harinath <rharinath@novell.com>
2090 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2091 member lookup rather than qualifier_type, since qualifier_type can
2094 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2096 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2099 2005-07-31 Miguel de Icaza <miguel@novell.com>
2101 * statement.cs: Copy the local exception into the exception
2102 captured local. Fixes 75674
2104 2005-07-31 Raja R Harinath <harinath@gmail.com>
2107 * expression.cs (Invocation.OverloadResolve): Don't report error
2108 CS1501 if error CS1502 has been reported.
2109 (New.DoResolve): Delegate CS1501 reporting to
2110 Invocation.OverloadResolve.
2113 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2114 invariant-meaning-in-block property in an enclosing block if
2117 2005-07-29 Marek Safar <marek.safar@seznam.cz>
2119 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2120 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2121 (Switch.CheckSwitch): Just save 50kb for SWF.
2123 2005-07-27 Martin Baulig <martin@ximian.com>
2125 * anonymous.cs (CaptureContext.AddField): Added
2126 `AnonymousContainer am' argument; compute its toplevel scope if
2127 it's not already computed. Fixes #75649.
2129 2005-07-26 Raja R Harinath <rharinath@novell.com>
2132 * class.cs (Constructor.Emit): Reset block to null if the block
2135 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2137 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2139 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2141 * class.cs (MethodData.Define): Check whether accessor implementing
2142 interface is public.
2144 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2146 2005-07-22 Marek Safar <marek.safar@seznam.cz>
2149 * namespace.cs (LookupType): Moved same type check to...
2151 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2154 2005-07-21 Raja R Harinath <rharinath@novell.com>
2156 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2157 already found a typebuilder.
2158 * class.cs (MethodCore.IsDuplicateImplementation): Compare
2159 MemberNames, not strings.
2161 * const.cs (Error_ExpressionMustBeConst):
2162 Rename from Error_EpressionMustBeConst.
2163 * const.cs, class.cs, statement.cd: Update.
2165 2005-07-21 Marek Safar <marek.safar@seznam.cz>
2169 * const.cs (Const.LookupConstantValue): Report missing contant expression
2171 (Error_EpressionMustBeConstant): Only one error method.
2173 * class.cs, statement.c: Updated.
2175 2005-07-20 Raja R Harinath <rharinath@novell.com>
2177 * statement.cs (Block.Flags): Add back HasVarargs.
2178 (Block.flags): Make protected.
2179 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2181 * typemanager.cs (types, typecontainers, user_types): Remove.
2182 (UserTypes, TypeContainers): Likewise.
2183 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2184 (CleanUp, Reset): Update.
2185 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
2186 (GetNestedType): Use Type.GetNestedType.
2187 (CoreLookupType): Take two arguments, the namespace and the
2188 basename of the type. Update to use the Namespace.Lookup
2190 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2191 (RealMemberLookup): Use IsNestedChildOf instead of playing with
2192 string concatenation and substring matches.
2193 * class.cs, enum.cs, delegate.cs: Update to changes.
2195 2005-07-20 Marek Safar <marek.safar@seznam.cz>
2197 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2198 Expression and made virtual.
2200 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2201 (ImplicitStandardConversionExists): Fixed `byte' typo ?
2203 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2205 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2208 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2211 2005-07-18 Marek Safar <marek.safar@seznam.cz>
2214 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2215 AssemblyCultureAttribute is not used on executable.
2218 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2220 2005-07-16 Raja R Harinath <rharinath@novell.com>
2223 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2224 New. Reports CS0252/CS0253.
2225 Mostly taken from preliminary patch by Duncak Mak.
2226 (Binary.DoResolveOperator): Store results of operator lookup.
2227 Use them to detect if we need to warn about unintended reference
2230 2005-07-15 Raja R Harinath <rharinath@novell.com>
2233 * namespace.cs (Namespace.Lookup): Add back location parameter.
2234 (Namespace.LookupType): Add CS0436 report. Add location parameter.
2235 * delegate.cs, ecore.cs, expression.cs: Update to changes.
2237 * codegen.cs (EmitContext.DeclSpace): Make readonly.
2238 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2239 (Namespace.LookupType): ... this.
2240 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2242 * typemanager.cs (LookupTypeReflection): Remove buggy code that
2243 purported to handle pointers.
2244 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2247 2005-07-15 Marek Safar <marek.safar@seznam.cz>
2249 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2252 2005-07-15 Raja R Harinath <rharinath@novell.com>
2254 * namespace.cs (Namespace.Lookup): Drop location parameter.
2255 (NamespaceEntry.LookupAlias): Remove. Merge into ...
2256 (NamespaceEntry.Lookup): ... this.
2257 (NamespaceEntry.Error_AmbiguousTypeReference):
2258 Move here from DeclSpace.
2259 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2261 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2262 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2263 Move to NamespaceEntry.
2264 * delegate.cs, expression.cs: Update to changes.
2266 2005-08-31 Martin Baulig <martin@ximian.com>
2268 Committing a patch from Atsushi Enomoto for #75850.
2270 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
2271 Prefer a generic enumerator over a non-generic one.
2273 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2275 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2276 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2278 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2280 * driver.cs : reverting default encoding change as well as mcs.
2282 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2284 * driver.cs, support.cs : merged r48826.
2286 > could you integrate your mcs changes to gmcs otherwise
2287 > gmcs cannot compile some files.
2289 2005-08-20 Martin Baulig <martin@ximian.com>
2291 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2292 scope if we don't already have it.
2294 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2295 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2298 2005-07-31 Miguel de Icaza <miguel@novell.com>
2300 * statement.cs: Copy the local exception into the exception
2301 captured local. Fixes 75674
2303 2005-07-15 Marek Safar <marek.safar@seznam.cz>
2305 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2308 2005-08-12 Martin Baulig <martin@ximian.com>
2310 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
2311 for nested types here to avoid hitting the cache too early.
2313 2005-08-09 Miguel de Icaza <miguel@novell.com>
2315 * enum.cs: On the new compiler CLS error 3005 is now a warning not
2318 2005-08-03 Martin Baulig <martin@ximian.com>
2320 Make iterators in generic methods work; see gtest-191.cs.
2323 (Constraints.Resolve): Protect against being called twice.
2326 (TypeContainer.GetClassBases): Make this `protected virtual'.
2328 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
2329 (Iterator.GetClassBases): Override this and compute the base
2331 (Iterator.DefineNestedTypes): If we're a generic method, all our
2332 method type parameters become class type parameters on the proxy
2336 (ToplevelBlock.Parameters): Make this a property, not a field.
2337 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2339 2005-08-03 Martin Baulig <martin@ximian.com>
2341 * typemanager.cs (TypeManager.IsSubclassOf): Use
2342 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
2343 (TypeManager.GetFullName_recursed): Improved.
2345 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2348 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
2349 Private accessor case, using TypeManager.IsPrivateAccessible instead of
2350 invocation_type == mi.DeclaringType, since the first one also checks
2351 other condition used by generic instances.
2353 2005-07-27 Martin Baulig <martin@ximian.com>
2355 * anonymous.cs (CaptureContext.AddField): Added
2356 `AnonymousContainer am' argument; compute its toplevel scope if
2357 it's not already computed. Fixes #75649.
2359 2005-07-14 Marek Safar <marek.safar@seznam.cz>
2361 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2362 CheckAttributeType and refactored.
2363 (Attribute.ResolvePossibleAttributeType): Changed to reuse
2364 ResolveAsTypeTerminal error handling.
2365 (ResolveAsTypeTerminal): Introduced because of global attributes extra
2367 (GetSignatureForError): Print errors in same way.
2370 * codegen.cs: Reflect attribute GetSignatureForError change.
2373 * expression.cs: Add silent parameter to ResolveAsTypeStep.
2375 * namespace.cs (UsingEntry): Refactored to make fields private.
2378 statement.cs: Error_UnexpectedKind has extra parameter.
2380 2005-07-14 Raja R Harinath <rharinath@novell.com>
2382 * ecore.cs (IAlias): Remove.
2383 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
2384 that implement the interface.
2385 * namespace.cs (Namespace): Likewise.
2386 (Namespace.declspaces): Renamed from 'defined_names'.
2387 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
2388 DeclSpace instead of an IAlias.
2389 * tree.cs (Tree.AddDecl): Update.
2391 2005-07-12 Raja R Harinath <rharinath@novell.com>
2393 * statement.cs (Block.Flags); Remove HasVarargs.
2394 (Block.HasVarargs): Move to ToplevelBlock.
2395 (Block.ThisVariable, Block.AddThisVariable): Likewise.
2396 (Block.Variables): Make protected. Initialize variable hashtable
2398 (Block.AddVariable): Update.
2399 (Block.Resolve): Update to changes.
2400 (ToplevelBlock.HasVarargs): New boolean.
2401 (ToplevelBlock.ThisVariable): Move here from Block.
2402 (ToplevelBlock.AddThisVariable): Likewise.
2403 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
2404 * expression.cs (This.ResolveBase): Update to changes.
2405 (ArglistAccess.DoResolve): Likewise.
2407 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2410 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2412 * class.cs (TypeContainer.VerifyMembers): Distinguish between
2413 not used and not used & assigned.
2414 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2416 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2419 * expression.cs (Is.DoResolve): null is never provided type.
2421 2005-07-08 Marek Safar <marek.safar@seznam.cz>
2424 * cs-parser.jay: Less strict event error rule to catch more errors.
2426 2005-07-11 Martin Baulig <martin@ximian.com>
2428 * generic.cs (ConstructedType.CheckConstraints): Improve the check
2429 for the constructor constraint: we do not only have to check
2430 whether the class has a public constructor, but also ensure that
2431 it's parameterless. Fixes #75492.
2433 2005-07-11 Martin Baulig <martin@ximian.com>
2435 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
2436 between type parameters if they either have the reference type
2437 constraint or the class constraint.
2439 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
2441 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
2443 2005-07-07 Marek Safar <marek.safar@seznam.cz>
2446 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
2447 (ExtractSecurityPermissionSet): Cope with self referencing security
2448 attributes properly.
2450 * driver.cs (SetOutputFile): Made public property OutputFile.
2452 2005-07-07 Raja R Harinath <rharinath@novell.com>
2455 * class.cs (TypeContainer.first_nonstatic_field): Rename from
2456 has_nonstatic_fields. Make into a FieldBase pointer.
2457 (TypeContainer.AddField): Add CS0282 check.
2458 (TypeContainer.EmitType): Update.
2460 2005-07-06 Miguel de Icaza <miguel@novell.com>
2462 * cs-tokenizer.cs (consume_identifier): Do not create strings to
2463 compare if they start with __.
2465 2005-07-06 Raja R Harinath <rharinath@novell.com>
2467 * statement.cs (Switch.SwitchGoverningType): Only look at
2468 UserCasts that don't need implicit standard conversions to one of
2469 the allowed switch types (Fixes test-322.cs).
2470 (LocalInfo.Resolve): Re-enable sanity-test.
2472 2005-07-06 Marek Safar <marek.safar@seznam.cz>
2474 * cs-tokenizer.cs (consume_identifier): Detect double undescores
2476 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
2478 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
2480 2005-07-06 Raja R Harinath <rharinath@novell.com>
2483 * ecore.cs (SimpleName.GetSignatureForError): Add.
2484 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
2485 (MemberAccess.GetSignatureForError): Add.
2487 2005-07-05 Marek Safar <marek.safar@seznam.cz>
2489 The big error and warning messages review.
2519 * typemanager.cs: Updated.
2521 * class.cs: (MethodCore.SetYields): Moved here to share.
2522 (PropertyMethod.Define): Moved iterator setup here.
2524 * iterators.cs: Add orig_method to have full access to parent
2527 2005-07-05 Raja R Harinath <rharinath@novell.com>
2529 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
2530 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
2531 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
2532 variable of struct type.
2533 * expression.cs (Unary.ResolveOperator): Update to change.
2534 (Indirection.VerifyFixed): Likewise.
2535 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
2536 (ParameterReference.VerifyFixed): Value parameters are fixed.
2537 (This.VerifyFixed): Treat 'this' as a value parameter.
2538 * statement.cs (LocalInfo.IsFixed): Remove.
2540 2005-07-01 Martin Baulig <martin@ximian.com>
2542 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2543 `ec.EmitThis ()' to get the correct scope.
2545 2005-07-01 Martin Baulig <martin@ximian.com>
2547 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
2548 instance is a ParameterReference; fixes #75299.
2550 2005-06-30 Raja R Harinath <rharinath@novell.com>
2553 * expression.cs (Indexers.map): Remove.
2554 (Indexers.Append): Filter out inaccessible setters and getters.
2555 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
2558 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
2560 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
2561 (FieldExpr.Emit, PropertyExpr.Emit): Update.
2562 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
2563 * expression.cs (Invocation.EmitCall): Add CS0120 check.
2565 2005-06-30 Marek Safar <marek.safar@seznam.cz>
2568 * class.cs (FieldBase.GetInitializerExpression): One more field
2571 2005-06-28 Miguel de Icaza <miguel@novell.com>
2573 * pending.cs: Do not define a proxy if the base method is virtual,
2574 it will be picked up by the runtime (bug 75270).
2576 2005-07-08 Martin Baulig <martin@ximian.com>
2578 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
2579 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
2581 2005-07-07 Martin Baulig <martin@ximian.com>
2583 * generic.cs (ConstructedType.CheckConstraint): Use
2584 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
2585 called recursively; fixes #75329.
2587 2005-07-06 Martin Baulig <martin@ximian.com>
2589 * generic.cs (TypeManager.InferTypeArguments): Added support for
2590 anonymous methods; fixes #75461.
2592 2005-07-01 Martin Baulig <martin@ximian.com>
2594 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2595 `ec.EmitThis ()' to get the correct scope.
2597 2005-07-01 Martin Baulig <martin@ximian.com>
2599 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
2600 instance is `This'; fixes #75299.
2602 2005-06-30 Martin Baulig <martin@ximian.com>
2604 * class.cs (Indexer): Implement IIteratorContainer; added support
2605 for iterators in indexers.
2608 (EmitContext.CurrentIterator): Make this a property, not a field.
2610 * anonymous.cs (AnonymousContainer.Iterator): New public property.
2612 2005-06-28 Miguel de Icaza <miguel@novell.com>
2614 * pending.cs: Do not define a proxy if the base method is virtual,
2615 it will be picked up by the runtime (bug 75270).
2617 2005-06-28 Martin Baulig <martin@ximian.com>
2619 * cs-parser.jay (interface_method_declaration): Avoid a
2620 reduce/reduce conflict by moving some of the code into a separate
2621 `interface_method_declaration_body' rule; fixes #75368.
2623 2005-06-28 Martin Baulig <martin@ximian.com>
2625 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
2626 array check after the check for TypeBuilder's.
2628 2005-06-21 Raja R Harinath <rharinath@novell.com>
2630 * convert.cs (FindMostEncompassedType): Add two trivial special
2631 cases (number_of_types == 0 || number_of_types == 1).
2632 (FindMostEncompasingType): Likewise.
2634 2005-06-17 Raja R Harinath <rharinath@novell.com>
2636 Some cleanups preparing for the fix of #75283.
2637 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
2639 (EventExpr.InstanceResolve): Likewise.
2640 (EventExpr.DoResolve): Remove redundant checks.
2642 2005-06-08 Miguel de Icaza <miguel@novell.com>
2644 * class.cs: Small fix.
2646 2005-06-08 Raja R Harinath <rharinath@novell.com>
2649 * class.cs (GetPartialBases): Fix return value check of
2652 2005-06-07 Raja R Harinath <rharinath@novell.com>
2654 Ensure that partial classes are registered in their enclosing
2655 namespace. Initial part of fix of #75160.
2656 * tree.cs (Tree.RecordDecl): Add new namespace argument.
2657 Register declspace with namespace here, not in
2658 DeclSpace.RecordDecl.
2659 * cs-parser.jay: Pass namespace to RecordDecl.
2660 * class.cs (PartialContainer.Create): Likewise.
2661 (ClassPart.DefineType): New sanity-check. Throws an exception if
2663 * decl.cs (Declspace.RecordDecl): Remove.
2664 * namespace.cs (NamespaceEntry.DefineName): Remove.
2666 2005-06-06 Marek Safar <marek.safar@seznam.cz>
2668 * rootcontext.cs: Reset TargetExt as well.
2670 2005-06-03 Raja R Harinath <rharinath@novell.com>
2672 * ecore.cs (Expression.Resolve): Emit CS0654 error when
2675 2005-06-02 Raja R Harinath <rharinath@novell.com>
2677 Fix #75080, cs0119.cs.
2678 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
2680 (Expression.Resolve): ... this. Use it. Remove bogus code
2681 allowing ExprClass.Type and ExprClass.Namespace for
2682 ResolveFlags.VariableOrValue.
2683 (Expression.Resolve) [1-argument variant]: Change default resolve
2684 flags based on language version.
2685 (Expression.Error_UnexpectedKind): Use a simple string array
2686 rather than an ArrayList.
2687 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
2689 (TypeOfVoid.DoResolve): Likewise.
2690 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
2691 flags argument -- it always has the same value.
2693 2005-05-31 Raja R Harinath <rharinath@novell.com>
2696 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
2697 Use it in the error message.
2698 * assign.cs, expression.cs, statement.cs: Update.
2700 2005-05-30 Raja R Harinath <rharinath@novell.com>
2703 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
2704 the "almostMatchedMember" case too.
2705 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
2706 that failed the accessibility checks to 'almost_match'.
2708 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
2710 * attribute.cs: Use internal MethodBuilder methods to set
2711 ExactSpelling and SetLastError on PInvoke methods, instead
2712 of passing them via charset. Fixes #75060.
2714 2005-05-27 Raja R Harinath <rharinath@novell.com>
2716 * parameter.cs (Parameter): Remove TODO comment.
2717 (Parameter.DefineParameter): Remove Location parameter.
2718 (Parameters.LabelParameters): Likewise.
2719 * class.cs (Constructor.Emit): Update to change.
2720 (MethodData.Emit): Likewise.
2721 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
2722 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
2724 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
2727 Removed Parameters.Location and added Parameter.Location instead.
2728 Removed Location parameter from Emit() and GetSignature().
2735 Modified all related calls.
2737 2005-06-21 Martin Baulig <martin@ximian.com>
2739 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
2740 left-hand side is not a nullable type; fixes #75328.
2742 2005-06-21 Martin Baulig <martin@ximian.com>
2745 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
2746 (TypeManager.GetFullNameSignature): Likewise.
2748 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
2749 `source.FullName' and `target.FullName' to check whether there are
2750 two conflicting definitions.
2752 2005-06-21 Martin Baulig <martin@ximian.com>
2754 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
2755 a BoxedCast - also for reference types - to be compatible with csc.
2757 2005-06-21 Martin Baulig <martin@ximian.com>
2759 * expression.cs (MemberAccess.DoResolve): Add support for nested
2760 types in a generic instance; fixes #75320.
2762 2005-06-20 Martin Baulig <martin@ximian.com>
2764 * generic.cs (TypeManager.InferType): Also walk the class
2765 hierarchy for generic instances; fixes #75261.
2767 2005-06-17 Martin Baulig <martin@ximian.com>
2769 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
2770 to make things work for corlib.
2772 2005-06-15 Martin Baulig <martin@ximian.com>
2774 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
2775 obsolete `SecurityAction' values.
2777 2005-06-06 Marek Safar <marek.safar@seznam.cz>
2779 * rootcontext.cs: Reset TargetExt as well.
2781 2005-06-09 Martin Baulig <martin@ximian.com>
2783 * delegate.cs (Delegate.VerifyMethod): Added
2784 `MethodGroupExpr old_mg' argument; inherit its
2785 `HasTypeParameters'; fix #75085.
2787 2005-06-09 Martin Baulig <martin@ximian.com>
2789 * expression.cs (Invocation.OverloadResolve): Correctly handle
2790 generic methods for the SetMemberIsUsed(); fix #75064.
2792 2005-06-09 Martin Baulig <martin@ximian.com>
2794 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
2797 2005-06-08 Martin Baulig <martin@ximian.com>
2799 * cs-parser.jay (nullable_type_or_conditional): If we put the
2800 nullable back and our `type' is a `ComposedCast', remove the
2801 nullable from it. Fixes #75156.
2803 * expression.cs (ComposedCast.RemoveNullable): New public method.
2805 2005-06-08 Martin Baulig <martin@ximian.com>
2807 The big Iterators rewrite :-)
2809 * iterators.cs: Rewrite this to use the anonymous methods framework.
2811 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
2812 before the TypeContainers; see 2test-21.cs.
2815 (TypeContainer.DefineType): Don't create a new EmitContext if we
2816 already have one (this only happens if we're an Iterator).
2817 (TypeContainer.Define): Also call Define() on all our iterators.
2818 (Method.CreateEmitContext): Added support for iterators.
2821 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
2822 (AnonymousContainer.CreateMethodHost): Moved here from
2823 AnonymousMethod and made abstract.
2824 (AnonymousContainer.CreateScopeType): New abstract method.
2825 (AnonymousContainer.IsIterator): New public property.
2826 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
2827 get the ScopeTypeBuilder rather than manually defining it here.
2828 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
2831 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
2832 before RootContext.DefineTypes().
2834 * codegen.cs (EmitContext.RemapToProxy): Removed.
2835 (EmitContext.CurrentAnonymousMethod): Changed type from
2836 AnonymousMethod -> AnonymousContainer.
2837 (EmitContext.ResolveTopBlock): Protect from being called twice.
2838 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
2839 (EmitContext.EmitThis): Removed the iterators hacks; use the
2840 anonymous methods framework for that.
2843 (ToplevelBlock.Container): Make this a property, not a field.
2844 (ToplevelBlock.ReParent): New public method; move the
2845 ToplevelBlock into a new container.
2846 (Foreach.TemporaryVariable): Simplify.
2848 2005-06-05 Martin Baulig <martin@ximian.com>
2850 * statement.cs (LocalInfo.CompilerGenerated): New flag.
2851 (Block.AddTemporaryVariable): New public method; creates a new
2852 `LocalInfo' for a temporary variable.
2853 (Block.EmitMeta): Create the LocalBuilders for all the temporary
2855 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
2856 non-iterator variables.
2858 2005-06-05 Martin Baulig <martin@ximian.com>
2860 * statement.cs (Foreach.TemporaryVariable): Create the
2861 LocalBuilder in the Emit phase and not in Resolve since in some
2862 situations, we don't have an ILGenerator during Resolve; see
2863 2test-19.cs for an example.
2865 2005-06-04 Martin Baulig <martin@ximian.com>
2867 The big Foreach rewrite - Part II.
2869 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
2870 with `PropertyInfo ienumerator_getcurrent'.
2872 * codegen.cs (VariableStorage): Removed.
2875 (Foreach): Derive from Statement, not ExceptionStatement.
2876 (Foreach.CollectionForeach): New nested class. Moved all the code
2877 dealing with collection foreach here.
2878 (Foreach.ForeachHelperMethods): Removed.
2879 (Foreach.TemporaryVariable): Implement IMemoryLocation.
2881 2005-05-23 Martin Baulig <martin@ximian.com>
2883 * statement.cs (Try.DoResolve): Don't create a `finally' if we
2884 don't need to. Fix #75014.
2886 2005-05-26 Raja R Harinath <rharinath@novell.com>
2888 Improve user-defined conversion handling.
2889 * convert.cs (GetConversionOperators): Rewrite. Return only the
2890 applicable operators.
2891 (AddConversionOperators): New. Helper for GetConversionOperators.
2892 (FindMostEncompassedType, FindMostEncompassingType): Verify that
2893 there is only one most encompassed/encompassing type.
2894 (FindMostSpecificSource, FindMostSpecificTarget): Remove
2895 "applicable operator" handling.
2896 (UserConversion): Move cache here from GetConversionOperators.
2897 Directly cache the chosen operator, rather than the whole
2899 (ExplicitNumericConversion): Fix buggy implementation of Decimal
2900 case. Allow conversion of decimal to sbyte and byte too.
2901 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2902 New static methods. Used to avoid allocating EmptyExpressions in
2905 2005-05-24 Duncan Mak <duncan@novell.com>
2907 * ecore.cs (CastFromDecimal): New class for casting a decimal to
2908 another class, used in Convert.ExplicitNumericConversion.
2909 (CastToDecimal): New class, similar to above, but casts to
2910 System.Decimal, used in Convert.ImplicitNumericConversion and also
2911 in explicit convesion from double/float to decimal.
2913 * convert.cs (ImplicitNumericConversion): Handle implicit
2914 conversions to System.Decimal.
2915 (ExplicitNumericConversion): handle explicit conversions to
2920 2005-05-20 Miguel de Icaza <miguel@novell.com>
2922 * typemanager.cs: Do not throw an exception in the TypeBuilder
2923 case, we take care of it on the TypeCode.
2925 2005-05-17 Marek Safar <marek.safar@seznam.cz>
2927 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
2930 * cs-parser.jay: Catch more lexical errors.
2932 * report.cs: Add one more Error method.
2935 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
2937 2005-05-20 Martin Baulig <martin@ximian.com>
2939 * class.cs (TypeContainer.CircularDepException): Removed.
2940 (TypeContainer.DefineType): Removed the `InTransit' stuff.
2941 (TypeContainer.CheckRecursiveDefinition): Check for circular class
2942 (CS0146) and interface (CS0529) dependencies here.
2944 2005-05-20 Martin Baulig <martin@ximian.com>
2946 * expression.cs (New.DoResolve): Move the CS0712 check above the
2947 CS0144 check; otherwise it can never be reached.
2949 2005-05-20 Martin Baulig <martin@ximian.com>
2951 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
2953 2005-05-20 Martin Baulig <martin@ximian.com>
2955 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
2957 * typemanager.cs (TypeManager.IsAttributeType): New public method.
2959 2005-05-19 Martin Baulig <martin@ximian.com>
2962 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
2963 to disable error reporting.
2965 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
2966 here since we don't want to report an error; see the new test-336.cs.
2968 2005-05-19 Raja R Harinath <rharinath@novell.com>
2970 * statement.cs (ToplevelBlock.GetParameterReference)
2971 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
2972 Move here from class Block.
2973 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
2974 * expression.cs (ParameterReference.DoResolveBase): Likewise.
2976 2005-05-18 Martin Baulig <martin@ximian.com>
2981 (FlowBranching.Reachability): Add non-static public And() and Or()
2983 (FlowBranchingSwitch): New class; do the `break_origins' thing
2984 like in FlowBranchingLoop.
2985 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
2986 reachability, not just locals and parameters.
2987 (FlowBranching.MergeChild): Remove some of the hacks for loop and
2988 switch; MergeBreakOrigins() now takes care of that.
2990 2005-05-18 Martin Baulig <martin@ximian.com>
2992 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2993 a loop and may leave it, reset the barrier; fixes #74974.
2995 2005-05-16 Raja R Harinath <rharinath@novell.com>
2997 Fix test-382.cs. Emit values of decimal constants.
2998 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3000 (TypeContainer.AddField): ... this.
3001 (TypeContainer.EmitFieldInitializers): Allow the list of fields
3002 with initializers to include 'Const's.
3003 (ClassPart.RegisterFieldForInitialization): Forward to
3005 * const.cs (Const.Const): Pass initializer to base class.
3006 (Const.Define): In case of decimal constants, register them for
3007 initialization in a static constructor.
3009 2005-05-14 Martin Baulig <martin@ximian.com>
3011 * statement.cs (Block.Resolve): Correctly handle unreachable code;
3012 do not call ResolveUnreachable() on unreachable statements in
3013 here, see the comment in the source code.
3015 2005-05-13 Raja R Harinath <rharinath@novell.com>
3018 * expression.cs (BinaryResolveOperator): If one of the operands of
3019 an equality comparison is 'null' and the other is a pointer type,
3020 convert the null to a NullPointer.
3021 * convert.cs (ImplicitReferenceConversion): If the expression is a
3022 NullLiteral and the target type is a pointer type, return a
3023 NullPointer instead.
3024 (ImplicitConversionStandard): Likewise.
3026 2005-05-13 Marek Safar <marek.safar@seznam.cz>
3028 * cs-parser.jay: Set readonly context based on special constructs.
3030 * expression.cs (LocalVariableReference.DoResolveBase): Improved
3031 readonly variable error handling.
3033 * rootcontext.cs (EmitCode): Don't verify members when error
3036 * statement.cs (LocalInfo): Add reaodnly context information.
3037 (SetReadOnlyContext, GetReadOnlyContext): New methods.
3039 2005-05-17 Martin Baulig <martin@ximian.com>
3041 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3044 2005-05-13 Martin Baulig <martin@ximian.com>
3046 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3047 handle unreachable blocks.
3049 2005-05-13 Martin Baulig <martin@ximian.com>
3052 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3053 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3056 2005-05-13 Martin Baulig <martin@ximian.com>
3058 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3059 instance variable, not a local. Fix #74873.
3060 (Block.ResolveUnreachable): Set it to true here.
3062 2005-05-12 Martin Baulig <martin@ximian.com>
3064 * cs-parser.jay (property_declaration): Pass the `current_class',
3065 not the `current_container' to Property's .ctor. Fixes #74912.
3067 2005-05-11 Martin Baulig <martin@ximian.com>
3069 * typemanager.cs (Closure): Copy this from MCS and merge all the
3070 GMCS-specific changes into it.
3072 2005-05-12 Raja R Harinath <harinath@gmail.com>
3075 * typemanager.cs (unmanaged_enclosing_types): New.
3076 (IsUnmanagedType): Avoid infloops by using
3077 'unmanaged_enclosing_types' to talk with recursive invocations.
3079 2005-05-11 Duncan Mak <duncan@novell.com>
3081 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3082 continuing to process for 'arg'.
3083 (handle_preprocessing_directive): Check the argument of the #endif
3084 directive and report error CS1025 if there are any trailing
3087 According to the C# spec, having even whitespace after the #endif
3088 directive is illegal; however, because we call arg.TrimEnd ()
3089 beforehand, we have the same behavior as csc, allowing whitespace
3090 after the directive.
3094 2005-05-11 Marek Safar <marek.safar@seznam.cz>
3098 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3099 (Constructor.GetObsoleteAttribute): Implemented correctly.
3101 2005-05-10 Martin Baulig <martin@ximian.com>
3103 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3104 resolve the type; fixes #74864.
3105 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3106 in DoResolve(); fixes #74862.
3108 2005-05-10 Martin Baulig <martin@ximian.com>
3110 * support.cs (ReflectionParameters.ParameterModifier): Use
3111 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3112 and `ParameterAttributes.In'. Fixes #74884.
3114 2005-05-10 Martin Baulig <martin@ximian.com>
3116 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3117 the cache if we're just looking for `MemberTypes.NestedType' in a
3120 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3121 constraints if we're still resolving the type tree.
3122 (Expression.MemberLookup): If we're resolving the type tree, only
3123 look for `MemberTypes.NestedType' since we're only interested in
3126 * class.cs (TypeContainer.DefineType): Don't resolve the type
3127 parameters here; do this later in ResolveType() after the type
3128 tree has been resolved.
3129 (TypeContainer.ResolveType): New public method; this is called
3130 after the type tree is resolved and before the types are being
3131 populated. We resolve the generic constraints here.
3132 (TypeContainer.DoDefineMember): Check the constraints on our base
3133 class and interfaces.
3135 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3136 set the `ResolvingTypeTree' flag on the EmitContext.
3138 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3140 2005-05-10 Marek Safar <marek.safar@seznam.cz>
3142 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3144 * expression.cs (Argument.GetParameterModifier): Turned to property.
3145 (Invocation.Error_InvalidArguments): Add more descriptive errors.
3147 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3150 2005-05-09 Raja R Harinath <rharinath@novell.com>
3153 * decl.cs (MemberCache.AddMethods): Register override methods,
3154 rather than non-override methods.
3155 * typemanager.cs (RegisterOverride): New.
3156 (IsOverride): Update.
3158 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3160 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3162 2005-05-06 Martin Baulig <martin@ximian.com>
3165 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3166 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3168 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3172 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3173 recursive declaration.
3175 * statement.cs (Block.ResolveMeta): Report any error in resolving.
3177 2005-05-06 Marek Safar <marek.safar@seznam.cz>
3179 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3181 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3183 2005-05-05 Raja R Harinath <rharinath@novell.com>
3186 * decl.cs (DeclSpace.FamilyAccessible):
3187 Use TypeManager.IsNestedFamilyAccessible.
3189 Fix reopened #64812.
3190 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3193 2005-05-04 Raja R Harinath <rharinath@novell.com>
3194 Abin Thomas <projectmonokochi@rediffmail.com>
3195 Anoob V E <projectmonokochi@rediffmail.com>
3196 Harilal P R <projectmonokochi@rediffmail.com>
3199 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3200 allow access to all static members.
3202 2005-05-04 Martin Baulig <martin@ximian.com>
3204 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3206 2005-05-04 Martin Baulig <martin@ximian.com>
3210 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3211 section at the end; make things work if `default' is not the last
3214 2005-05-04 Martin Baulig <martin@ximian.com>
3218 * statement.cs (Switch): Replaced the `got_default' field with a
3219 `default_section' one.
3220 (Switch.CheckSwitch): Set `default_section' here.
3221 (Switch.Resolve): If we're a constant switch and the constant is
3222 not found, use the default section.
3224 2005-05-03 Martin Baulig <martin@ximian.com>
3226 * expression.cs (ArrayAccess.EmitGetLength): New public method.
3228 * statement.cs (Foreach.ArrayForeach): New nested class.
3229 (Foreach.TemporaryVariable): New nested class.
3230 (Foreach.EmitArrayForeach): Removed; this is now in the new
3233 2005-05-03 Raja R Harinath <rharinath@novell.com>
3235 * pending.cs (BaseImplements): Move the #74773 fix here. This is
3237 (VerifyPendingMethods): Revert change below.
3239 * typemanager.cs (IsOverride, RegisterNonOverride): New.
3240 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3241 that used to trigger warning -28. Remove warning -28.
3242 * expression.cs (Invocation.OverloadResolve): Use
3243 TypeManager.IsOverride to distinguish override methods.
3246 * pending.cs (VerifyPendingMethods): If a base type implements the
3247 requested interface, don't bother checking individual methods of
3248 the base type. As a side-effect, this prevents the creation of
3249 unnecessary proxies.
3251 2005-05-02 Martin Baulig <martin@ximian.com>
3255 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3256 Also `And' the locals if the old vector is null.
3257 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3258 null; in this case we basically reset all the variables.
3260 2005-05-02 Martin Baulig <martin@ximian.com>
3264 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3265 Added `FlowBranching branching' argument; always `and' the
3266 variables instead of `or'ing them unless we're an infinite loop.
3268 * statement.cs (While.Resolve): Create a new sibling unless we're
3271 2005-05-02 Martin Baulig <martin@ximian.com>
3275 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3276 arguments; use it instead of creating a new TopLevelBlock.
3277 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3278 our ConstructorInitializer.
3281 (TopLevelBlock.TopLevelBranching): New public property.
3282 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3283 and create our `TopLevelBranching'.
3285 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3286 anonymous method host, use `block.TopLevelBranching' rather than
3287 creating a new branching.
3289 2005-04-20 Miguel de Icaza <miguel@novell.com>
3291 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3292 a ScopeInfo, if any of the current children is a child of the new
3293 entry, move those children there.
3295 2005-04-30 Martin Baulig <martin@ximian.com>
3297 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3298 at the beginning of a SwitchSection. Fix #73335.
3300 2005-04-27 Marek Safar <marek.safar@seznam.cz>
3303 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3305 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3306 (FieldExpr.DoResolve): Obsolete members are ignored for field
3309 2005-04-26 Marek Safar <marek.safar@seznam.cz>
3311 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3312 of arrays detection.
3314 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3316 (Field.VerifyClsCompliance): Volatile fields are not compliant.
3318 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3321 2005-04-25 Ben Maurer <bmaurer@ximian.com>
3323 * cs-parser.jay: Use the prefered version of -unsafe in error
3326 2005-04-22 Marek Safar <marek.safar@seznam.cz>
3328 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3331 2005-04-20 John Luke <john.luke@gmail.com>
3333 * driver.cs: fix typo in error message, --outout to --output
3335 2005-04-30 Martin Baulig <martin@ximian.com>
3337 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
3338 handle the .NET 2.x security attributes.
3340 2005-04-30 Martin Baulig <martin@ximian.com>
3343 (TypeManager.ExpandInterfaces): Don't add things twice.
3346 (TypeContainer.VerifyClsCompliance): Allow generic instances.
3348 2005-04-29 Martin Baulig <martin@ximian.com>
3350 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
3352 * anonymous.cs: Added support for anonymous generic methods.
3354 2005-04-29 Martin Baulig <martin@ximian.com>
3356 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
3359 2005-04-29 Martin Baulig <martin@ximian.com>
3361 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
3363 * expression.cs (New.DoResolve): Fix the CS0304 check.
3365 2005-04-29 Martin Baulig <martin@ximian.com>
3367 * typemanager.cs (TypeManager.GetFullName): Updated to the new
3370 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
3371 explicit interface implementation, compare the interface types.
3372 (MethodData.Define): Use the new naming scheme from the latest
3374 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
3376 * decl.cs (MemberName.GetMemberName): Removed.
3377 (MemberName.MethodName, FullName): New properties.
3379 2005-04-25 Raja R Harinath <rharinath@novell.com>
3381 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3383 2005-04-22 Martin Baulig <martin@ximian.com>
3385 * generic.cs (GenericMethod): Create the EmitContext in the
3386 `Define()'; in `Define(MethodBuilder)', create the type parameters
3387 before calling `Define()'. Fixes #73933.
3389 2005-04-22 Martin Baulig <martin@ximian.com>
3392 (Constraints.Resolve): Make things work wrt. the new type lookup system.
3393 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3395 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3396 ConstructedType, check its constraints.
3398 2005-04-20 Marek Safar <marek.safar@seznam.cz>
3400 * codegen.cs (InRefOutArgumentResolving): New field.
3402 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3403 fields outside contructor.
3405 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3407 2005-04-19 Miguel de Icaza <miguel@novell.com>
3409 * anonymous.cs (CaptureContext.EmitParameterInstance): The
3410 parameter code was not completed ever, so it was not as up-to-date
3411 as local variables. Must finish it.
3413 The bug fix was to compare the Toplevel of the block, not the
3414 current block. Thanks for Ben for pointing this out.
3416 2005-04-19 Raja R Harinath <rharinath@novell.com>
3418 * decl.cs (AddMethods): Use the declaring type of the problem
3419 method to determine if we want to squash a warning.
3421 2005-04-19 Marek Safar <marek.safar@seznam.cz>
3423 * attribute.cs: Removed debug output.
3425 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3427 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3430 2005-04-18 Raja R Harinath <rharinath@novell.com>
3433 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
3434 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
3435 all null comparisons against reference types.
3437 2005-04-18 Marek Safar <marek.safar@seznam.cz>
3440 * class.cs (TypeContainer.CircularDepException) New nested
3442 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
3443 (TypeContainer.DefineType): Removed error, reset InTransit before
3445 (Class.DefineType): Throw exception when is in Transit.
3446 Catch exception and report error.
3447 (Struct.DefineType): Throw exception when is in Transit.
3448 Catch exception and report error.
3449 (Interface.DefineType): Throw exception when is in Transit.
3450 Catch exception and report error.
3452 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
3453 handle nested exception handlers.
3455 * flowanalysis.cs (InTryWithCatch): New method, search for try with
3458 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
3459 InFinally and InCatch storage.
3461 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
3462 (Catch.Resolve): Set and Restore ec.InCatch.
3463 (Try.Resolve): Set and Restore ec.InFinally.
3464 (Try.HasCatch): True when try has catch.
3466 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
3468 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
3469 for the same event member, so exclude such cases from warning 419.
3472 2005-04-16 Miguel de Icaza <miguel@novell.com>
3474 * expression.cs (Binary.ResolveOperator): Apply patch from John
3475 Luke to fix bug 59864: operators &, | and ^ on enumerations
3476 require that the same enum type on both sides.
3478 * driver.cs: Add warnings to old flag usage, this is to assist
3479 people who produce Makefiles and hope that the Makefiles will be
3482 * class.cs (TypeContainer.EmitType): Moved the definition of the
3483 special $PRIVATE$ field from the resolve phase to the Emit phase.
3484 During resolve we do not know if we are a struct with
3485 HasExplicitLayout, we know this only after the attributes for the
3488 Set the FieldOffset to zero on the dummy field that we create for
3489 the class. Fixes 74590.
3491 2005-04-16 Raja R Harinath <rharinath@novell.com>
3494 * ecore.cs (PropertyExpr.resolved): New.
3495 (DoResolve): Use it to handle a case of double resolution here.
3496 Handle a case of identical-name-and-type-name.
3497 * expression.cs (ArrayCreation.CheckIndices): Avoid double
3498 resolution by storing the results of expression resolution back
3499 into the "probes" array.
3501 2005-04-15 Raja R Harinath <rharinath@novell.com>
3503 Fix cs0208-7.cs and cs0208-8.cs.
3504 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
3505 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
3506 error reporting to point out the reason a struct is not unmanaged.
3508 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3510 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
3511 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
3513 2005-04-13 Raja R Harinath <rharinath@novell.com>
3516 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
3517 IdenticalNameAndTypeName here.
3518 (EventExpr.InstanceResolve): Likewise.
3520 2005-04-13 Marek Safar <marek.safar@seznam.cz>
3522 C# 2.0 DefaultCharSetAttribute implementation
3524 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
3525 which allows us to set GlobalNamespace for every resolve.
3526 (Attribute.ResolveArguments): Cut from Resolve.
3527 (Attribute.GetCharSetValue): Returns CharSet named argument.
3528 (Attribute.DefinePInvokeMethod): Gets default charset from
3530 (GlobalAttribute.ResolveAsTypeStep): Override.
3531 (GlobalAttribute.ResolveArguments): Override.
3533 * class.cs (TypeAttr): Is protected.
3535 * codegen.cs (ModuleClass.DefaultCharSet): New member.
3536 (ModuleClass.DefaultCharSetType): New memeber.
3537 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
3539 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
3540 charset from module.
3542 * delegate.cs (TypeAttr): Override.
3543 (Delegate.DefineType): Use this TypeAttr.
3545 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
3546 at very early stage (before types are defined) to resolve model
3547 module attributes. It will probably not work with corlib but it
3550 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
3551 charset from module.
3553 * typemanager.cs (default_charset_type): New type.
3555 2005-04-13 Raja R Harinath <rharinath@novell.com>
3557 * decl.cs (MemberCache.AddMethods): Don't warn if
3558 System.Object.Finalize has buggy MethodAttributes.
3560 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
3563 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3565 * doc.cs : detect ambiguous reference to overloaded members.
3566 Fixed bug #71603. MS 1.1 csc does not detect it.
3568 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3570 * doc.cs : delegates must not be referenced with parameters.
3573 2005-04-12 Miguel de Icaza <miguel@novell.com>
3575 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
3577 2005-04-10 Miguel de Icaza <miguel@novell.com>
3579 * driver.cs (MainDriver): Stop processing if the CLS stage found
3582 (CompilerCallableEntryPoint.InvokeCompiler): Always
3583 reset after execution; Take a TextWriter argument for the
3586 * report.cs: Use the error stream instead of hardcoding stderr.
3588 2005-04-09 Miguel de Icaza <miguel@novell.com>
3590 * class.cs: Reduce code paths to test, too small of an
3591 optimization to make it worth the extra testing. Always perform
3594 2005-04-08 Raja R Harinath <rharinath@novell.com>
3597 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
3598 operators that had errors reported on them.
3600 2005-04-08 Marek Safar <marek.safar@seznam.cz>
3602 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
3604 (Attribute.Resolve): Add named argument type checking.
3606 * class.cs (FixedField.Define): Use IsPrimitiveType
3608 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
3610 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
3611 unsafe parameter types.
3613 * statement.cs (Using.ResolveExpression): Add better error description.
3615 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
3617 2005-04-08 Raja R Harinath <rharinath@novell.com>
3620 * attribute.cs (Attribute.GetAttributeUsage): Resolve
3621 AttributeUsageAttribute in the emitcontext of the attribute class,
3622 not in the emitcontext of the attributable entity it was attached to.
3623 * cs-parser.jay: Use 'current_class', not 'current_container',
3624 when creating a GlobalAttribute.
3626 2005-04-08 Alp Toker <alp@atoker.com>
3628 * pending.cs: The fix to #58413 failed to compile methods implementing
3629 interfaces with/without params modifiers and vice versa, even though
3630 params modifiers aren't part of the signature. Make the modifier check
3631 less strict as in csc.
3633 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
3634 Anoob V E <projectmonokochi@rediffmail.com>
3635 Harilal P R <projectmonokochi@rediffmail.com>
3638 * pending.cs (TypeAndMethods.mods): New. Store the parameter
3639 modifiers of pending methods.
3640 (PendingImplementation.PendingImplementation): Initialize it.
3641 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
3642 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
3643 with ParameterData. Add check for modifiers.
3644 * class.cs (MethodData.Define): Update to changes.
3646 2005-04-07 Raja R Harinath <rharinath@novell.com>
3648 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
3650 2005-04-07 Marek Safar <marek.safar@seznam.cz>
3652 * class.cs (PropertyMethod.Define): Check private accessor in abstract
3655 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
3658 * typemanager.cs: Registered RequiredAttributeAttribute.
3660 2005-04-06 Marek Safar <marek.safar@seznam.cz>
3662 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
3663 Warning CS0169 is back at level 3.
3664 (IMethodData.SetMemberIsUsed): New method.
3666 * decl.cs (IsUsed): New value; moved from FieldBase.Status
3667 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
3669 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
3671 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
3673 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
3676 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
3679 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
3680 to avoid the problems with nested types.
3682 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
3683 Anoob V.E <projectmonokochi@rediffmail.com>
3684 Harilal P.R <projectmonokochi@rediffmail.com>
3685 Raja R Harinath <rharinath@novell.com>
3688 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
3690 * typemanager (GetConstructor): Make public.
3692 2005-04-05 John Luke <john.luke@gmail.com>
3693 Raja R Harinath <rharinath@novell.com>
3696 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
3697 struct too. Return false quicker in a few cases.
3698 (VerifyUnManaged): Use it.
3700 2005-04-05 Raja R Harinath <rharinath@novell.com>
3703 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
3704 not 'unreachable_seen'.
3706 2005-04-04 Marek Safar <marek.safar@seznam.cz>
3708 * attribute.cs (Attribute.GetValue): Removed unused.
3710 * codegen.cs (CodeGen.TrimExt): Removed unused.
3712 * cs-parser.jay (output): Removed unused.
3714 * cs-tokenizer.cs (hex_digits): Removed unused.
3716 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
3718 * expression.cs (Indirection.LoadExprValue): Removed unused.
3719 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
3721 * iterators.cs (Iterator.param_types): Removed unused.
3723 * statement.cs (Goto.block): Removed unused.
3724 (ToplevelBlock.did): Removed unused.
3725 (Switch.ResolveConstantSwitch): Removed unused.
3727 2005-04-01 Ben Maurer <bmaurer@ximian.com>
3729 * rootcontext.cs: Allow mcs to bootstrap with the compilation
3732 2005-04-19 Martin Baulig <martin@ximian.com>
3734 Merged r42462 from MCS and made it work for GMCS.
3736 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
3738 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
3740 2005-04-01 Raja R Harinath <rharinath@novell.com>
3742 Fix #74232 and cs0208-3.cs.
3743 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
3744 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
3745 unmanaged type. Don't use FieldBuilders when 't' is a
3746 TypeBuilder. Use ModFlags and MemberType fields.
3747 * class.cs (MemberBase.member_type): Rename from MemberType.
3748 (MemberBase.MemberType): New property. Determines member_type on
3750 (MemberBase.DoDefine): Don't initialize MemberType here.
3751 (FieldMember.Define): Likewise.
3753 2005-04-01 Marek Safar <marek.safar@seznam.cz>
3756 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
3757 Attributes are emitted there.
3759 2005-04-01 Raja R Harinath <rharinath@novell.com>
3761 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
3762 keyword in 'partial enum' too.
3763 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
3765 Report from Kamil Skalski <nazgul@omega.pl>.
3768 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
3769 have partial containers too.
3771 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
3772 in block' checks to Block.CheckInvariantMeaningInBlock.
3773 * statement.cs (Block.GetKnownVariableInfo): Make private.
3774 (Block.IsVariableUsedInChildBlock): Remove.
3775 (Block.IsVariableUsedInBlock): Likewise.
3776 (Block.CheckInvariantMeaningInBlock): New. Show location of
3777 conflicting declaration.
3778 (Block.AddVariable): Make error messages less long-winded and more
3779 specific. Show location of conflicting declaration.
3780 * parameter.cs (Parameters.Location): New readonly property.
3782 2005-03-31 Raja R Harinath <rharinath@novell.com>
3784 Clean up semantics of invoking ResolveMemberAccess.
3785 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
3786 can have an instance, ensure that we pass in a non-TypeExpression
3787 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
3788 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
3789 argument. Update to changes and simplify.
3790 (FieldExpr.Emitinstance): Remove CS0120 check.
3791 (PropertyExpr.EmitInstance): Likewise.
3792 * expression.cs (Argument.Resolve): Likewise.
3793 (Invocation.DoResolve): Update to changes in semantics of
3796 2005-03-31 Marek Safar <marek.safar@seznam.cz>
3799 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
3802 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
3804 2005-03-31 Raja R Harinath <rharinath@novell.com>
3806 Fix difference in behaviour with commandline invocation.
3807 * driver.cs (Driver.Reset): New.
3808 (CompilerCallableEntryPoint): Call it.
3810 * statement.cs (If.Resolve): Avoid spurious "uninitialized
3811 variable" warnings if the boolean expression failed to resolve.
3813 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
3815 * attribute.cs: Fix the union of several permissions when some of them
3816 are unrestricted (so the result isn't an unrestricted permission set).
3819 2005-03-30 Raja R Harinath <rharinath@novell.com>
3821 * ecore.cs (MemberExpr): New class. Convert from interface
3823 (MemberExpr.ResolveMemberAccess): Refactor and move here from
3824 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
3826 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
3827 (MethodGroupExpr.IsExplicitImpl): Remove.
3828 (Expression.GetFieldFromEvent): Remove.
3829 (SimpleName.MemberStaticCheck): Remove.
3830 (SimpleName.DoSimpleNameResolve): Update to changes.
3831 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
3832 (MemberAccess.IdenticalNameAndTypeName): Remove.
3833 (MemberAccess.error176): Move to MemberExpr.
3834 (MemberAccess.DoResolve): Update to changes.
3835 (BaseAccess.DoResolve): Likewise.
3837 2005-03-30 Marek Safar <marek.safar@seznam.cz>
3839 C# 2.0 Conditional attribute class implementation
3841 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
3842 Analyzes class whether it has attribute which has ConditionalAttribute
3843 and its condition is not defined.
3845 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
3846 (Class.IsExcluded): New method. Search for at least one defined
3847 condition in ConditionalAttribute of attribute class.
3849 2005-03-30 Raja R Harinath <rharinath@novell.com>
3851 * ecore.cs (PropertyExpr): Derive from Expression, not
3852 ExpressionStatement.
3853 (PropertyExpr.EmitStatement): Remove.
3855 2005-03-29 Raja R Harinath <rharinath@novell.com>
3858 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
3859 internal field "value__" of an enum be private. The examples for
3860 "value__" that I found on MSDN all used FieldAttributes.Private.
3862 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
3863 Don't mention IL method attribute names.
3865 Fix #47991. Remove a TODO.
3866 * statement.cs (Block.Toplevel): Make into a field.
3867 (Block.Parameters): Move into ToplevelBlock.
3868 (Block.known_variables): Rename from child_variable_names.
3869 (Block.Block): Remove variants that take Parameters. Initialize
3870 'Toplevel' with the immediately surrounding toplevel block.
3871 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
3872 LocalInfo parameter.
3873 (Block.GetKnownVariableInfo): New.
3874 (Block.IsVariableNameUsedInChildBlock): Update.
3875 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
3876 the block, even though it may not be in scope.
3877 (Block.AddVariable): Remove Parameters parameter. Use
3878 Toplevel.Parameters instead.
3879 (Block.AddConstant): Remove Parameters parameter.
3880 (Block.GetParameterReference): Update to use Toplevel.Parameters.
3881 (Block.IsParamaterReference): Likewise.
3882 (Block.IsLocalParameter): Likewise. Simplify a lot.
3883 (ToplevelBlock.Parameters): New. Moved from Block.
3884 (ToplevelBlock.ToplevelBlock): Update to changes. Always
3885 initialize Parameters to a non-null value.
3886 * cs-parser.jay: Update to changes.
3887 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
3888 simple names that mean different things in the same block. Use
3889 Block.IsVariableNameUsedInBlock.
3891 2005-03-28 Raja R Harinath <rharinath@novell.com>
3893 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
3895 2005-03-26 Raja R Harinath <harinath@acm.org>
3898 * assign.cs (Assign.DoResolve): When the RHS of an assignment
3899 fails to resolve, ensure that the LHS is still resolved as an
3902 2005-03-25 Raja R Harinath <harinath@acm.org>
3904 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
3906 (Enum.current_ec): Remove.
3907 (Enum.LookupEnumValue): Remove EmitContext argument.
3908 Just uses the one created during DefineType.
3909 (Enum.FindMembers): Update.
3910 * expression.cs (MemberAccess.DoResolve): Update.
3912 2005-03-22 Marek Safar <marek.safar@seznam.cz>
3914 * assign.cs (Assign.DoResolve): Check for CS1717 when
3915 source and target are same (uses Equals).
3917 * expression.cs (LocalVariableReference, ParameterReference,
3918 This): Implemented Equals, GetHashCode.
3920 * statement.cs (Block.GetParameterReference): Removed useless
3923 2005-03-22 Raja R Harinath <rharinath@novell.com>
3926 * statement.cs (Block.AddVariable): Ensure that we skip implicit
3927 blocks before deciding whether the error is cs0136 or cs0128.
3929 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
3930 (using_alias_directive, using_namespace_directive): Pass
3931 MemberName, not an expression to Namespace.UsingAlias and
3933 (MakeName): Use the MemberName of the namespace.
3934 * namespace.cs (Namespace.MemberName): New.
3935 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
3936 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
3938 * decl.cs (MemberName.Name): Make readonly.
3939 (MemberName.FromDotted): New "constructor".
3940 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
3941 (MemberCore.Name): Compute from MemberName on demand.
3942 (MemberCore.SetMemberName): Provide a way to change the
3944 (MemberCore.AddToContainer): Don't take a fullname parameter.
3945 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
3946 fully qualified name of the container to the member name.
3947 (TypeContainer.AddToTypeContainer): Use a fully qualified name
3948 only if the type is a member of the root container.
3949 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
3950 MemberName.Left rather than searching for an embedded ".".
3951 (PartialContainer.CreatePart): Update to changes in RootContext.
3952 (MemberBase.ShortName): Turn into a property. Use
3953 MemberCore.SetMemberName.
3954 (MemberBase.ExplicitInterfaceName): Remove.
3955 (MemberBase.UpdateMemberName): Remove.
3956 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
3957 (PropertyBase.SetMemberName): New override.
3958 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
3959 (Tree.GetDecl): New.
3960 (Tree.AllDecls): Rename from Decls.
3961 * attribute.cs, enum.cs, report.cs: Update to changes.
3962 * driver.cs (MainDriver): Use MemberName.FromDotted on
3963 RootContext.MainClass.
3965 2005-03-21 Marek Safar <marek.safar@seznam.cz>
3967 * class.cs (FixedField.Define): Check for CS1664 and more sanity
3970 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
3972 2005-03-18 Marek Safar <marek.safar@seznam.cz>
3974 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
3975 property accessor modifiers.
3977 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
3978 fixed buffer attribute (CS1716).
3979 (PropertyMethod.HasCustomAccessModifier): When property accessor
3980 has custom modifier.
3982 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
3984 (PropertyExpr.DoResolveLValue): Add CS0272.
3986 2005-03-17 Miguel de Icaza <miguel@novell.com>
3988 * convert.cs: When converting to a pointer, use the proper Conv.U
3989 or Conv.I depending on the source data type.
3991 * cs-tokenizer.cs: Make the size for large decimal constants,
3994 2005-03-17 Martin Baulig <martin@ximian.com>
3996 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3997 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
3999 2005-03-17 Martin Baulig <martin@ximian.com>
4001 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4002 to bool so we can return an error condition.
4003 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4006 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
4008 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4011 2005-03-16 Raja R Harinath <rharinath@novell.com>
4013 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4014 Refactor to avoid traversing the list of assemblies, and to avoid
4015 string concatenation.
4016 * typemanager.cs (guid_attr_type): Remove.
4017 (negative_hits, pointers, references): Remove hashes.
4019 (GetConstructedType): New. Uses type_hash to handle constructed
4020 types (arrays, references, pointers).
4021 (GetReferenceType, GetPointerType): Use it.
4022 (GetNestedType): New. Uses type_hash to handle nested types of
4024 (LookupType, LookupTypeDirect): Remove.
4025 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
4026 'types' hash and LookupTypeReflection directly.
4027 (params_string, params_object): Use GetConstructedType.
4028 * namespace.cs (Namespace.cached_types): New. Cache of reflected
4030 (Namespace.Lookup): Use cached_types.
4031 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4032 provided by old TypeManager.LookupType.
4033 * rootcontext.cs (MakeFQN): Remove.
4034 * decl.cs (DeclSpace.MakeFQN): Likewise.
4035 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4036 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4037 TypeManager.GetConstructedType.
4038 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4040 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
4042 * cs-parser.jay: Fix build.
4044 2005-03-15 Marek Safar <marek.safar@seznam.cz>
4046 * class.cs (TypeContainer.CircularDepException) New nested
4047 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4049 * cs-parser.jay: Reports CS1527 for any namespace element.
4051 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4054 * expression.cs (ParameterReference.IsAssigned): Changed error to
4056 (Error_WrongNumArguments): Moved CS0245 detection here.
4058 * statement.cs (Return.Resolve): Add CS1622 report.
4060 2005-03-11 Marek Safar <marek.safar@seznam.cz>
4062 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4064 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
4066 * attribute.cs expression.cs: Get rid of some allocations.
4068 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
4070 * doc.cs : just eliminate the latest change.
4072 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4074 * doc.cs : commented out the latest change. It breaks xml-030.cs
4076 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4078 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4079 fail. So invoke CreateType() in FindDocumentedType().
4081 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4083 * cs-tokenizer.cs : added IsKeyword().
4084 * doc.cs : Detect keyword incorrectly used as identifier.
4085 Allow identifiers prefixed by @.
4087 2005-03-10 Marek Safar <marek.safar@seznam.cz>
4089 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4090 It caused exception in namespace resolving (again!).
4092 * class.cs (Class.ctor): Removed exit.
4093 (PropertyMethod.ctor): ditto.
4095 * codegen.cs (Codegen.Reset): Reset static data.
4096 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4098 * cs-tokenizer.cs (Cleanup): Removed.
4100 * driver.cs (GetSystemDir): Rewrote to one line command.
4101 It caused problem with unloaded dynamic modules.
4102 (UnixParseOption): Removed Exit.
4103 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4104 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4105 Now can be mcs used as library.
4107 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4110 * location.cs (Reset): Reset static data.
4112 * namespace.cs (Reset): Reset static data.
4114 * report.cs (Report.Reset): Reset static data.
4116 * rootcontext.cs (RootContext.Reset): Reset static data.
4118 * tree.cs (RootTypes.ctor): Use Location.Null
4120 * typemanager.cs (TypeManager.Reset): Reset static data.
4121 (CoreLookupType): Removed Exit.
4122 (TypeHandle.Reset): Reset static data.
4124 2005-03-10 Raja R Harinath <rharinath@novell.com>
4127 * typemanager.cs (ComputeNamespaces): Import namespaces from
4128 referenced modules too.
4130 2005-03-09 Raja R Harinath <rharinath@novell.com>
4132 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4135 2005-03-09 Raja R Harinath <rharinath@novell.com>
4137 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4138 enclosing DeclSpace. This ensures that a name-lookup populates
4139 more caches and there are fewer 'TypeExpression's. Carve out
4140 nested type lookup into ...
4141 (LookupNestedTypeInHierarchy): ... this.
4143 2005-04-15 Martin Baulig <martin@ximian.com>
4145 Merged r41590 from MCS and make it work in the generics land.
4147 * generic.cs (TypeParameter.UpdateConstraints): Removed the
4150 * class.cs (PartialContainer.UpdateConstraints): Removed.
4151 (PartialContainer.CheckConstraints): Removed.
4152 (PartialContainer.SetParameterInfo): Store the constraints here.
4153 (PartialContainer.DefineTypeParameters): New public method;
4154 resolve the type parameter's constraints here. Note that the
4155 PartialContainer doesn't have an EmitContext anymore, so we must
4156 do this in the ClassPart.
4158 2005-03-09 Raja R Harinath <rharinath@novell.com>
4160 Clean up a few partial-class semantics.
4161 Fixes test-357.cs and cs1618-2.cs.
4162 * cs-parser.jay (struct_declaration): Use 'current_class' as
4163 parent of newly-created struct. Remove call to Register ().
4164 Use 'pop_current_class' to complete handing the current struct.
4165 (interface_declaration): Likewise.
4166 (class_declaration): Likewise.
4167 (enum_declaration): Use 'current_class' as parent of newly created
4169 (delegate_declaration): Likewise.
4170 (pop_current_class): New function. This is used to handle closing
4171 up the 'current_class' and 'current_container', and pointing them
4172 to the enclosing class/container.
4173 (CSharpParser): Initialize 'current_class' too.
4174 * decl.cs (MemberCore): Add check for invariant: a partial
4175 container is not a parsed entity, and thus does not enclose any
4177 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4178 (DeclSpace.BaseTypeExpr): Use it.
4179 (DeclSpace.LookupType): Add check for invariant.
4180 * class.cs (TypeContainer): Add check for invariant: a nested
4181 class should have the same NamespaceEntry as its enclosing class.
4182 (TypeContainer.EmitFieldInitializers): Make virtual.
4183 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4185 (TypeContainer.Register): Remove.
4186 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4187 null. Use TypeResolveEmitContext for resolving base types and
4188 interfaces. Move initialization of Parts.TypeBuilder here from
4190 (TypeContainer.DefineNestedTypes): ... here.
4191 (PartialContainer): Take a Namespace not a NamespaceEntry.
4192 (PartialContainer.Create): Don't use Register. Call the
4193 appropriate Add... function directly.
4194 (ClassPart): Take both the PartialContainer and the enclosing
4195 class as constructor arguments.
4196 (ClassPart.EmitFieldInitializers): Override.
4197 (ClassPart.PartFindNestedTypes): Remove.
4198 (FieldBase.GetInitializerExpression): Resolve the initializer
4199 expression in the emit context of the enclosing class.
4200 * tree.cs (RootTypes): Remove Register ().
4202 2005-03-08 Marek Safar <marek.safar@seznam.cz>
4204 * cs-parser.jay: Removed CS0134.
4206 * driver.cs: Removed CS1901.
4208 * expression.cs (SizeOf.DoResolve): Don't report CS0233
4209 for predefined types.
4211 2005-03-07 Duncan Mak <duncan@novell.com>
4213 * codegen.cs (Save): Catch UnauthorizedAccessException as
4214 well. Fixes bug #73454.
4216 2005-03-07 Marek Safar <marek.safar@seznam.cz>
4218 * cs-tokenizer.cs (xtoken): Add CS1035.
4220 * class.cs (MethodData.Define): Add CS0683.
4221 (FieldMember.ctor): Add CS0681.
4223 2005-03-07 Raja R Harinath <rharinath@novell.com>
4225 * ecore.cs (SimpleName.DoResolve): Rename from
4226 SimpleName.DoResolveAllowStatic.
4227 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4228 Pass 'intermediate' flag to MemberStaticCheck.
4229 (SimpleName.MemberStaticCheck): Skip "static check" only in case
4230 of "intermediate" lookups via MemberAccess.
4231 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
4232 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4234 2005-03-07 Raja R Harinath <rharinath@novell.com>
4237 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4238 slipped in because of variable names that are identical to a
4239 builtin type's BCL equivalent ('string String;', 'int Int32;').
4240 (PropertyExpr.EmitInstance): Likewise.
4242 2005-03-04 Marek Safar <marek.safar@seznam.cz>
4244 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4246 * report.cs (warning_ignore_table): Made public.
4248 2005-03-04 Raja R Harinath <rharinath@novell.com>
4251 * class.cs (MethodData.Emit): Pass 'container' to
4252 container.GetObsoleteAttribute instead of 'container.Parent'.
4254 2005-03-03 Marek Safar <marek.safar@seznam.cz>
4256 * cs-parser.jay: Add 1534 error test.
4258 * iterators.cs (Yield.CheckContext): Add error 1629.
4259 (Iterator.ctor): Save unsafe modifier.
4260 (MoveNextMethod.DoEmit): Restore unsafe context.
4262 * namespace.cs (UsingAlias): Better error message.
4264 2005-03-03 Dan Winship <danw@novell.com>
4266 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4267 the warning message [#73219]
4269 2005-03-03 Raja R Harinath <rharinath@novell.com>
4271 Fix compile with MCS 1.0.0.0.
4272 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4273 w_restore to not depend on string constant folding.
4275 2005-03-03 Raja R Harinath <rharinath@novell.com>
4277 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
4278 CS0246 check to users who passed 'silent = false'.
4279 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4281 (SimpleName.SimpleNameResolve): Update.
4282 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4283 (MemberAccess.IdenticalNameAndTypeName): Update.
4284 * doc.cs (FindDocumentedTypeNonArray): Update.
4286 2005-03-03 Raja R Harinath <rharinath@novell.com>
4288 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4289 * parameters.cs (ComputeAndDefineParameters): Remove.
4290 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4291 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4292 Use GetParameterInfo.
4294 2005-03-02 Marek Safar <marek.safar@seznam.cz>
4296 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4298 2005-03-02 Raja R Harinath <rharinath@novell.com>
4300 Unify DeclSpace.LookupType and DeclSpace.FindType.
4301 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
4302 is in charge of defining nested types on demand.
4303 (DeclSpace.LookupType): Use it when the current_type is a
4304 TypeBuilder. Use LookupTypeDirect for reflected types.
4305 (DeclSpace.FindType): Remove.
4306 (DeclSpace.LookupInterfaceOrClass): Likewise.
4307 (DeclSpace.DefineTypeAndParents): Likewise.
4308 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4309 DeclSpace.LookupType.
4310 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4311 * typemanager.cs (LookupType): Simplify.
4312 (AddUserType): Remove type from negative_hits.
4313 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4314 * class.cs (TypeContainer.FindMembers): Move handling of nested
4316 (TypeContainer.FindMembers_NestedTypes): ... here.
4317 (TypeContainer.FindNestedType): Implement override.
4318 (ClassPart.FindNestedType): Delegate to PartialContainer.
4319 (ClassPart.PartFindNestedType): Looks up the nested types of the
4322 2005-04-14 Martin Baulig <martin@ximian.com>
4324 * generic.cs (ConstructedType): Moved all the type lookup and
4325 nested class logic into SimpleName.
4326 (ConstructedType.ResolveConstructedType): Our underlying type is
4327 already fully resolved; all the type lookup stuff is in
4330 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
4331 constructed types here instead of in ConstructedType.
4333 * decl.cs (MemberName.GetTypeExpression): Always create a
4334 SimpleName, not a ConstructedType.
4335 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
4337 2005-03-02 Martin Baulig <martin@ximian.com>
4339 * class.cs (TypeContainer.DoDefineMembers): We also need a default
4340 static constructor in static classes.
4342 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
4344 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4345 sizeParamIndex is not specified.
4347 2005-03-01 Marek Safar <marek.safar@seznam.cz>
4350 * report.cs (WarningMessage.IsEnabled): Missing null check.
4352 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4354 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4355 in the fields and not in the properties.
4357 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
4359 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
4362 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4364 * attribute.cs: Small refactoring (improved robustness).
4365 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4366 (ValidateGuid): Removed.
4367 (Resolve): Removed referenced to above mentioned.
4368 (GetAttributeUsage): Made private and changed to work without
4370 (GetIndexerAttributeValue): Don't crash.
4371 (GetConditionalAttributeValue): Ditto.
4372 (GetClsCompliantAttributeValue): Ditto.
4373 (ExtractSecurityPermissionSet): All attributes exceptions are
4375 (GetPropertyValue): New helper.
4376 (GetMethodImplOptions): New method.
4377 (DefinePInvokeMethod): Reuse common code. Implemented handling of
4378 some missing properties.
4380 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4381 (Method.ApplyAttributeBuilder): Updated.
4383 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4386 2005-02-28 Raja R Harinath <rharinath@novell.com>
4389 * report.cs (Report.SymbolRelatedToPreviousError): Handle
4390 non-simple types (array, pointer, reference).
4392 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4394 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4396 * class.cs (MethodCore.IsDuplicateImplementation): Special error
4398 (Method.CheckBase): Catch wrong destructor here.
4399 (MethodData.Define): Add errors 550, 668.
4401 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4403 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4405 * pending.cs (VerifyPendingMethods): Add error 551.
4407 * typemanager.cs (CSharpName): Next error report helper.
4409 2005-02-25 Marek Safar <marek.safar@seznam.cz>
4411 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4412 attributes. Removed useless attribute double check.
4413 It saves almost 2MBs for corlib.
4415 2005-02-25 Raja R Harinath <rharinath@novell.com>
4418 * statement.cs (ExpressionStatement.Resolve): Make robust to being
4419 called twice in case of error.
4421 2005-02-23 Chris Toshok <toshok@ximian.com>
4423 Fix compiler portions of #72827.
4424 * statement.cs (Block.Emit): call Begin/EndScope on the
4425 EmitContext instead of the ILGenerator.
4427 * codegen.cs (EmitContext.BeginScope): new method, call
4428 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4430 (EmitContext.BeginScope): same, but EndScope and CloseScope
4432 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
4433 offset and call the superclass's OpenScope(int) with it.
4434 (SymbolWriter.CloseScope): get the current il
4435 offset and call superclass's CloseScope(int) with it.
4437 2005-02-23 Marek Safar <marek.safar@seznam.cz>
4439 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
4440 CS1677 for out and ref as well.
4442 * class.cs (Method.Define): Add error CS1599 detection.
4444 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
4446 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
4448 * delegate.cs (Delegate.Define): Add error CS1599 detection.
4450 * support.cs.cs (ModifierDesc): New helper method.
4452 2005-02-23 Raja R Harinath <rharinath@novell.com>
4453 Abin Thomas <projectmonokochi@rediffmail.com>
4454 Anoob V E <projectmonokochi@rediffmail.com>
4455 Harilal P R <projectmonokochi@rediffmail.com>
4458 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
4459 MemberLookup (used for error reporting) actually returns a result.
4460 Fix error report number (122, not 112).
4462 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
4463 Anoob V E <projectmonokochi@rediffmail.com>
4464 Harilal P R <projectmonokochi@rediffmail.com>
4467 * pending.cs (PendingImplementation.GetAbstractMethods):
4468 Find NonPublic members too.
4470 2005-02-22 Marek Safar <marek.safar@seznam.cz>
4472 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
4475 * class.cs (MethodCore.CheckMethodAgainstBase):
4476 Add error 239 report.
4478 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4480 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4482 * class.cs (Operator.Define): Add error 217 report.
4484 2005-02-21 Raja R Harinath <rharinath@novell.com>
4487 * expression.cs (Invocation.IsApplicable): Make public.
4488 (Invocation.IsParamsMethodApplicable): Likewise.
4489 * delegate.cs (Delegate.VerifyApplicability): Don't use
4490 Invocation.VerifyArgumentCompat for parameter applicability
4491 testing. Use Invocation.IsApplicable and
4492 Invocation.IsParamsMethodApplicable.
4494 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4496 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4498 * class.cs (Operator.Define): Add error 217 report.
4500 2005-02-21 Raja R Harinath <rharinath@novell.com>
4502 * namespace.cs (UsingEntry.Resolve): Undo change below.
4504 2005-02-21 Raja R Harinath <rharinath@novell.com>
4507 * ecore.cs (Expression.MemberLookupFailed): Add argument to
4508 disable the error message when the extended MemberLookup also
4510 (Expression.MemberLookupFinal): Update.
4511 (SimpleName.DoSimpleNameResolve): Update.
4512 * expression.cs (MemberAccess.ResolveNamespaceOrType):
4513 Don't use MemberLookupFinal.
4514 (New.DoResolve): Update.
4515 (BaseAccess.CommonResolve): Update.
4517 2005-02-21 Raja R Harinath <rharinath@novell.com>
4520 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
4521 occured previously, don't resolve again.
4523 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4526 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
4527 argument. Call ResolveAttributeUsage for unresolved.
4528 when types doesn't match ctor arguments.
4530 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
4531 for nested attribute classes.
4532 (Class.attribute_usage): Removed.
4533 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
4534 for attribute class.
4536 * ecore.cs (IsAttribute): Removed.
4538 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
4540 * rootcontext.cs (RegisterAttribute): Removed, attributes are
4542 (attribute_types): Removed.
4543 (EmitCode): Global attributes are emited as the latest.
4545 2005-02-18 Marek Safar <marek.safar@seznam.cz>
4547 * class.cs (EmitFieldInitializers): Don't emit field initializer
4548 for default values when optimilization is on.
4550 * constant.cs (Constant.IsDefaultValue): New property.
4552 * driver.cs: Add /optimize handling.
4556 * literal.cs: Implement new IsDefaultValue property.
4558 * rootcontext.cs (Optimize): New field, holds /optimize option.
4560 2005-02-18 Raja R Harinath <rharinath@novell.com>
4562 Fix crasher in re-opened #72347.
4563 * namespace.cs (Namespace.Lookup): Return null if
4564 DeclSpace.DefineType returns null.
4567 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
4569 2005-02-18 Raja R Harinath <rharinath@novell.com>
4571 Fix remainder of #63202. Change semantics of DoResolveLValue: it
4572 now returns null if it cannot resolve to an lvalue.
4573 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
4574 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
4575 returned null. Remove check for SimpleName.
4576 (EventExpr.DoResolveLValue): New.
4577 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
4578 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
4580 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
4582 (Unary.ResolveOperator): Move CS0211 check ...
4583 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
4585 (Unary.DoResolveLValue): Simplify.
4586 (AddressOf.DoResolveLValue): New.
4587 (ArrayAccess.DoResolveLValue): New.
4589 2005-02-16 Marek Safar <marek.safar@seznam.cz>
4591 * attribute.cs (Attribute.Resolve): Add arguments casting for
4592 when types doesn't match ctor arguments.
4594 2005-02-16 Raja R Harinath <rharinath@novell.com>
4596 Fix parts of #63202.
4597 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
4598 lookup of operator in base type. Ensure that all checks happen
4599 when the operator resolves to an "op_..." method.
4601 2005-02-15 Raja R Harinath <rharinath@novell.com>
4604 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
4605 'ignore_cs0104' parameter. Pass it to ...
4606 (NamespaceEntry.Lookup): ... this.
4607 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
4608 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
4609 (TypeLookupExpression.DoResolveAsTypeStep): Update.
4610 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
4611 Update. Request that cs0104 errors be ignored.
4612 (ComposedCast.ResolveAsTypeStep): Update.
4614 2005-02-14 Raja R Harinath <rharinath@novell.com>
4617 * expression.cs (Invocation.BetterFunction): Remove support for
4618 comparing virtual functions and their overrides.
4619 (Invocation.IsOverride): New.
4620 (Invocation.OverloadResolve): Don't consider 'override' functions
4621 during candidate selection. Store them in a lookaside list.
4622 If the selected method is a 'virtual' function, use the list to
4623 find any overrides that are closer to the LHS type.
4625 2005-02-14 Marek Safar <marek.safar@seznam.cz>
4627 * expression.cs (New.DoResolve): Add complex core type reduction.
4628 (New.Constantify): Converts complex core type syntax like 'new int ()'
4631 2005-02-14 Raja R Harinath <rharinath@novell.com>
4633 * decl.cs (EntryType.EntryType): New constructor to create an
4634 updated copy of a cache entry.
4635 (MemberCache.AddMethods): Use it.
4636 (MemberCache.ClearDeclaredOnly): Remove.
4637 (MemberCache.MemberCache): Update.
4639 2005-02-11 Miguel de Icaza <miguel@novell.com>
4641 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
4642 variable. This one is represents the actual low-level declaration
4643 of the method, as opposed to the semantic level `IsStatic'.
4645 An anonymous method which is hosted into a static method might be
4646 actually an instance method. IsStatic would reflect the
4647 container, while MethodIsStatic represents the actual code
4650 * expression.cs (ParameterReference): Use the new MethodIsStatic
4651 instead of IsStatic.
4653 * anonymous.cs (AnonymousMethod.Compatible): Pass the
4654 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
4655 set on the current EmitContext.
4657 * expression.cs (Cast): Overload DoResolveLValue so we can pass
4658 resolve our casted expression as an LValue. This triggers the
4659 proper LValue processing that is later required by Assign.
4663 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
4665 2005-02-11 Marek Safar <marek.safar@seznam.cz>
4667 C# 2.0 Fixed buffer implementation
4669 * anonymous.cs: Update after RegisterHelperClass renaming.
4671 * attribute.cs (AttributeTester.fixed_buffer_cache):
4672 Cache of external fixed buffers.
4673 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
4674 implementation if field is fixed buffer else null.
4677 (TypeContainer.AddField): Accept FieldMember instead of Field.
4678 (FieldBase.IsFieldClsCompliant): Extracted code from
4679 VerifyClsCompliance descendant customization.
4680 (FixedField): New class handles fixed buffer fields.
4681 (FixedFieldExternal): Keeps information about imported fixed
4683 (IFixedField): Make access to internal or external fixed buffer
4686 * cs-parser.jay: Add fixed buffer parsing.
4688 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
4691 * expression.cs (Indirection): Extended implementation to accept
4693 (PointerArithmetic.Emit): Get element from fixed buffer as well.
4694 (ElementAccess.MakePointerAccess): Get type as parameter.
4695 (DoResolve): Add fixed buffer field expression conversion.
4696 (DoResolveLValue): Ditto.
4697 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
4698 (ArrayPtr): Derives from FixedBufferPtr.
4699 (ArrayPtr.Emit): Add extra emit for array elements.
4701 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
4703 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
4704 for compiler generated types.
4705 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
4707 * statement.cs (Fixed): Refactored to be easier add fixed buffer
4708 and consume less memory.
4709 (Fixed.Resolve): Add fixed buffer case.
4711 * typemanager.cs (compiler_generated_attr_ctor,
4712 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
4713 (HasElementType): Add our own implementation to work on every
4716 2005-02-11 Miguel de Icaza <miguel@novell.com>
4718 * anonymous.cs (CaptureContext): Track whether `this' has been
4721 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
4722 only captured `this' if it was implicitly done (instance
4723 methods/variables were used).
4725 * codegen.cs (EmitContext.CaptureThis): New method to flag that
4726 `this' must be captured.
4728 2005-01-30 Miguel de Icaza <miguel@novell.com>
4730 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
4731 is null it means that there has been no need to capture anything,
4732 so we just create a sibling.
4734 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
4736 Just a partial fix. The other half is fairly elusive.
4738 2005-02-10 Raja R Harinath <rharinath@novell.com>
4740 Fix #52586, cs0121-4.cs.
4741 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
4742 and return a hashtable.
4743 (MemberCache.ClearDeclaredOnly): New.
4744 (MemberCache.MemberCache): Update to change. Make a deep copy of
4745 the method_hash of a base type too.
4746 (MemberCache.AddMethods): Adapt to having a deep copy of the base
4747 type methods. Overwrite entries with the same MethodHandle so
4748 that the ReflectedType is correct. The process leaves in base
4749 virtual functions and their overrides as distinct entries.
4750 (CacheEntry): Now a class instead of a struct. It shouldn't alter
4751 matters since it was boxed in a ArrayList before.
4752 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
4754 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
4755 case of a virtual function and its override (choose the overload
4757 (Invocation.OverloadResolve): Avoid 'override' members during
4758 'applicable_type' calculation.
4760 2005-03-28 Raja R Harinath <rharinath@novell.com>
4762 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4763 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4764 GetTypeHandle. It is possible for a reflected type to derive from
4765 a TypeBuilder (e.g., int[] derives from the TypeBuilder
4766 System.Array during mscorlib compilation).
4767 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4768 contain a method_hash, don't create one either. Don't create a
4769 deep copy of the base cache's method_hash.
4770 (MemberCache.SetupCache): Rename back from DeepCopy.
4771 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4772 already initialized. If we see an override function, add its
4773 underlying base virtual function to the member_hash too.
4775 2005-02-09 Raja R Harinath <rharinath@novell.com>
4777 Combine two near-redundant caches.
4778 * typemanager.cs (method_params): Rename from method_internal_params.
4779 (TypeManager.GetParameterData): New. Replace
4780 Invocation.GetParameterData.
4781 (TypeManager.LookupParametersByBuilder): Remove.
4782 * expression.cs (Invocation.method_parameter_cache): Remove.
4783 (Invocation.GetParameterData): Remove.
4785 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
4788 2005-02-08 Raja R Harinath <rharinath@novell.com>
4791 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
4792 TypeManager.multicast_delegate_type is null, resolve it by looking
4793 up "System.MulticastDelegate".
4794 * rootcontext.cs (RootContext.ResolveCore): Simplify.
4796 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
4797 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
4798 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
4801 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
4802 (LabeledStatement.AddReference): New. Set 'referenced'.
4803 (Goto.Resolve): Use it.
4805 2005-02-05 John Luke <john.luke@gmail.com>
4807 * driver.cs: remove duplicate -doc line in Usage ()
4809 2005-02-04 Raja R Harinath <rharinath@novell.com>
4811 * location.cs (Location.AddFile): Fix CS2002 error report.
4813 2005-02-02 Martin Baulig <martin@ximian.com>
4815 * delegate.cs (Delegate.DefineType): Report an internal error if
4816 TypeManager.multicast_delegate_type is null. See bug #72015 for
4819 2005-02-02 Raja R Harinath <rharinath@novell.com>
4821 Fix a crasher in a variant of #31984.
4822 * const.cs (Constant.CheckBase): New override that defers the
4823 new-or-override check in case the base type hasn't been populated
4825 (Constant.Define): Ensure the new-or-override check is performed.
4827 2005-02-01 Duncan Mak <duncan@ximian.com>
4829 * const.cs (LookupConstantValue): Check that `ce' is not null
4830 before calling GetValue ().
4832 2005-02-01 Raja R Harinath <rharinath@novell.com>
4834 Fix test-334.cs (#69519).
4835 * cs-parser.jay (using_alias_directive): Pass in an expression to
4836 NamespaceEntry.UsingAlias.
4837 (using_namespace_directive): Pass in an expression to
4838 NamespaceEntry.Using.
4839 (namespace_name): Don't flatten to a string.
4840 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
4841 (NamespaceEntry.AliasEntry.Resolve): Lookup using
4843 (NamespaceEntry.UsingEntry): Likewise.
4844 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
4846 (NamespaceEntry.LookupForUsing): Remove.
4847 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
4849 (NamespaceEntry.Lookup): Remove support for dotted names.
4851 2005-02-01 Raja R Harinath <rharinath@novell.com>
4853 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
4855 (NamespaceEntry.ImplicitParent): Compute on demand.
4856 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
4857 parallels the current.
4858 (NamespaceEntry.LookupForUsing): Use it.
4859 (NamespaceEntry.Lookup): If the current namespace-entry is
4860 implicit, don't search aliases and using tables.
4862 2005-02-01 Raja R Harinath <rharinath@novell.com>
4865 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
4867 (TypeContainer.BaseCache): Compute on demand.
4868 (TypeContainer.FindMembers): Define constants and types if they're
4869 not already created.
4870 (FieldMember.Define): Move resetting of ec.InUnsafe before error
4872 * const.cs (Constant.Define): Make idempotent.
4874 2005-01-29 Miguel de Icaza <miguel@novell.com>
4876 * pending.cs: Produce better code (no nops produced by using Ldarg
4879 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
4880 i - 1' it should be arg + 1.
4884 2005-01-28 Raja R Harinath <rharinath@novell.com>
4886 * attribute.cs (Attribute.CheckAttributeType): Make private
4888 (Attribute.ResolveType): Make virtual.
4889 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
4890 handling of RootContext.Tree.Types.
4892 2005-01-27 Raja R Harinath <rharinath@novell.com>
4894 Update attribute-handling to use the SimpleName/MemberAccess
4896 * cs-parser.jay (attribute): Pass in an expression to the
4897 constructors of Attribute and GlobalAttribute.
4898 * attribute.cs (Attribute): Take an expression for the name.
4899 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
4900 passed in attribute name expression.
4901 (Attribute.CheckAttributeType): Use it.
4902 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
4903 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
4904 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
4905 argument to prevent error messages if the lookup fails.
4907 2005-01-27 Marek Safar <marek.safar@seznam.cz>
4909 * expression.cs (Indirection): Implemented IVariable interface
4910 to support indirection in AddressOf operator.
4911 (PointerArithmetic.Emit): Add optimalization for case where
4912 result can be precomputed.
4914 2005-01-26 Martin Baulig <martin@ximian.com>
4916 * class.cs (TypeContainer.AttributeTargets): Return the correct
4917 AttributeTargets depending on our `Kind' instead of throwing an
4918 exception; fixes #71632.
4920 2005-01-26 Marek Safar <marek.safar@seznam.cz>
4923 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
4926 2005-03-17 Martin Baulig <martin@ximian.com>
4928 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4929 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
4931 2005-03-17 Martin Baulig <martin@ximian.com>
4933 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4934 to bool so we can return an error condition.
4935 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4938 2005-03-17 Martin Baulig <martin@ximian.com>
4940 * generic.cs (TypeMananager.IsIEnumerable): New public method.
4942 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
4943 converting from an array-type of T to `IEnumerable<T>'.
4945 2005-03-16 Martin Baulig <martin@ximian.com>
4947 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
4948 (Nullable.LiftedUnaryMutator): New public class.
4950 * expression.cs (UnaryMutator.DoResolve): Added support for
4953 2005-03-14 Martin Baulig <martin@ximian.com>
4955 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
4957 2005-03-14 Martin Baulig <martin@ximian.com>
4959 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
4960 the comparision operators `<', `>', `<=' and `>='.
4962 2005-03-13 Martin Baulig <martin@ximian.com>
4965 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
4966 avoid confusion with the `NullLiteral'.
4967 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
4969 2005-03-13 Martin Baulig <martin@ximian.com>
4971 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
4972 comparing arbitrary types with the null literal.
4974 2005-03-13 Martin Baulig <martin@ximian.com>
4976 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
4977 boolean operators '&&', '||', '&' and '|'.
4978 (Nullable.OperatorTrueOrFalse): New public class.
4980 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
4981 instead of a `StaticCallExpr'; added support for nullables.
4983 2005-03-10 Martin Baulig <martin@ximian.com>
4986 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
4987 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
4989 2005-03-07 Martin Baulig <martin@ximian.com>
4991 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
4992 it work if `expr' is not an IMemoryLocation.
4993 (Nullable.Lifted): Implement IMemoryLocation.
4994 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
4997 2005-03-05 Martin Baulig <martin@ximian.com>
4999 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5000 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5001 (Nullable): Added support for lifted unary and binary operators.
5003 * expression.cs (Unary.DoResolve): Added support for nullable types.
5004 (Binary.DoResolve): Likewise.
5005 (Conditional.DoResolve): Likewise.
5007 2005-03-02 Martin Baulig <martin@ximian.com>
5009 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5011 * class.cs (ClassPart.SetParameterInfo): Override this.
5012 (PartialContainer.SetParameterInfo): Override this.
5013 (TypeContainer.CheckConstraints): New protected method.
5014 (PartialContainer.CheckConstraints): Override this and check
5015 whether the same contraints were specified in all parts of a
5016 partial generic type definition.
5017 (PartialContainer.UpdateConstraints): New public method.
5019 * generic.cs (TypeParameter.UpdateConstraints): New public method.
5021 2005-03-02 Martin Baulig <martin@ximian.com>
5023 Committing a patch from Carlos Alberto Cortez to fix #72887.
5025 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5026 casts from `T []' to `int []'.
5028 2005-03-02 Martin Baulig <martin@ximian.com>
5030 * generic.cs (TypeManager.IsEqual): Make this symmetric.
5032 * expression.cs (Binary.ResolveOperator): When resolving a
5033 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5034 `=='. Fixes #71866. See gen-127.cs.
5036 2005-03-02 Martin Baulig <martin@ximian.com>
5038 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5039 static constructor in static classes.
5041 2005-03-02 Martin Baulig <martin@ximian.com>
5044 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5045 (Nullable.LiftedConversion): Added support for user-defined
5048 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5050 * cs-parser.jay: Use ComposedCast everywhere instead of
5051 NullableType, so we don't need to check for NullableType
5053 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5054 case where we'll be resolved into a `parenthesized_expression_0'
5058 (Convert.UserDefinedConversion): Added nullable conversions.
5060 2005-02-28 Martin Baulig <martin@ximian.com>
5062 * generic.cs (TypeManager.IsNullableType): New static method.
5063 (Nullable): New abstract class.
5064 (Nullable.NullLiteral): New public class.
5065 (Nullable.LiftedConversion): New public class.
5067 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5068 `builtin_types opt_nullable'.
5071 (Convert.ImplicitConversionStandard): Added nullable conversions.
5072 (Convert.ExplicitConversionStandard): Likewise.
5073 (Convert.ExplicitConversion): Likewise.
5075 2005-02-26 Martin Baulig <martin@ximian.com>
5077 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5078 begin with a "?", for instance "?[]". Don't do a type lookup if
5081 2005-02-25 Martin Baulig <martin@ximian.com>
5083 The first part of Nullable Types :-)
5085 * generic.cs (NullableType): New public class.
5086 (NullCoalescingOperator): New public class.
5087 (TypeArguments.Resolve): Add a CS0306 check.
5089 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5090 (opt_nullable): New rule.
5091 (type): Added `opt_nullable' to `namespace_or_type_name',
5092 `builtin_types' and `pointer_type'.
5093 (array_type): Added `opt_nullable'.
5094 (opt_rank_specifier_or_nullable): New rule; this is the
5095 combination of `opt_rank_specifier' and `opt_nullable'.
5096 (opt_error): New rule; catch errors here.
5097 (nullable_type_or_conditional): New rule; we use this to check for
5098 nullable and still detect the conditional operator.
5099 (local_variable_type): Use `opt_rank_specifier_or_nullable'
5100 instead `opt_rank_specifier'.
5102 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5105 2005-02-24 Martin Baulig <martin@ximian.com>
5107 * README, README.Changes: Removed; they're old and obsolete.
5109 2005-02-22 Martin Baulig <martin@ximian.com>
5111 * generic.cs (TypeParameter.Resolve): If resolving the constraints
5112 returned an error, set `constraints' to null to avoid a crash
5114 (TypeParameter.ResolveType): Likewise.
5116 2005-02-22 Martin Baulig <martin@ximian.com>
5119 (Constraints.ResolveTypes): Protect against being called twice.
5120 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5121 (TypeParameter.ResolveType): New public method; calls
5122 constraints.ResolveTypes().
5123 (TypeParameter.DefineType): Moved constraints.ResolveType() out
5124 into the new ResolveType().
5125 (GenericMethod.Define): Call ResolveType() on all our
5128 2005-02-21 Martin Baulig <martin@ximian.com>
5131 (TypeManager.generic_nullable_type): New static public field.
5132 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5135 (RootContext.ResolveCore): Resolve "System.Nullable`1".
5137 2005-02-15 Martin Baulig <martin@ximian.com>
5139 * generic.cs (ConstructedType.Constraints): Correctly check
5140 constraints if the argument type is a type parameter; fixes
5143 2005-02-02 Martin Baulig <martin@ximian.com>
5145 * delegate.cs (Delegate.DefineType): Report an internal error if
5146 TypeManager.multicast_delegate_type is null. See bug #72015 for
5149 2005-01-29 Miguel de Icaza <miguel@novell.com>
5151 * pending.cs: Produce better code (no nops produced by using Ldarg
5154 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5155 i - 1' it should be arg + 1.
5159 2005-01-26 Martin Baulig <martin@ximian.com>
5161 * cs-parser.jay (indexer_declarator): Don't report an error if we
5162 have type parameters since we can be an explicit interface
5163 implementation; fixes #71449.
5165 2005-01-26 Martin Baulig <martin@ximian.com>
5167 * class.cs (TypeContainer.AttributeTargets): Return the correct
5168 AttributeTargets depending on our `Kind' instead of throwing an
5169 exception; fixes #71632.
5171 2005-01-26 Martin Baulig <martin@ximian.com>
5173 * delegate.cs (Delegate.DefineType): Correctly define our type
5174 parameters. Fixes #71483.
5176 2005-01-25 Raja R Harinath <rharinath@novell.com>
5179 * expression.cs (MemberAccess.DoResolve): Don't complain with
5180 cs0572 when the LHS of a member access has identical name and type
5183 2005-01-25 Marek Safar <marek.safar@seznam.cz>
5186 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5188 Create custom PermissionSet only for PermissionSetAttribute.
5190 2005-01-24 Marek Safar <marek.safar@seznam.cz>
5193 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5194 delegates in static class.
5196 2005-01-24 Martin Baulig <martin@ximian.com>
5198 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5199 merging an implicit block, just use its reachability.
5201 * statement.cs (Block.Resolve): Make the unreachable code check
5202 work wrt. implicit blocks; see test-337 from #63842.
5204 2005-01-21 Alp Toker <alp@atoker.com>
5206 * cs-parser.jay: destructor_declaration's container is PartialContainer
5207 not Class when partial types are used, so use Kind prop instead of
5210 2005-01-22 Miguel de Icaza <miguel@ximian.com>
5212 * cs-parser.jay: Improve error reporting when an interface
5215 2005-01-20 Dick Porter <dick@ximian.com>
5217 * support.cs: SeekableStreamReader fix from Sandor Dobos
5218 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5219 chars are read. Fixes bug 70369.
5221 2005-01-20 Raja R Harinath <rharinath@novell.com>
5223 * cs-parser.jay (catch_clause): Simplify current_block handling
5226 2005-01-17 Miguel de Icaza <miguel@ximian.com>
5228 * convert.cs (ImplicitStandardConversionExists): Synchronize the
5229 code with ImplicitStandardConversion to handle the implicit
5230 conversion of method groups into valid delegate invocations.
5232 The problem is that in parameter handling we were using this code
5233 path. Fixes bug #64698
5235 2005-01-19 Raja R Harinath <rharinath@novell.com>
5237 * cs-parser.jay: Fix several infelicities.
5238 - Avoid assigning to the parser value stack. Code like
5239 '$3 = null' is unclean. Synthesize a value for the code block
5241 - Avoid using oob_stack for storing location information. Use ...
5242 (_mark_): ... this. New (empty) rule. Saves the current location
5244 (foreach_statement): Avoid using oob_stack for current_block
5245 handling. Use technique used in for_statement and
5246 using_statement. Synthesize a value for the code block to store
5247 additional intermediate information.
5249 2005-01-13 Miguel de Icaza <miguel@ximian.com>
5251 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5252 of a different type is only allowed to private fields of a
5253 containing type, not on fields of a base class.
5255 See test-174.cs and error cs0122-9.cs
5257 2005-01-13 Raja R Harinath <rharinath@novell.com>
5259 Fix test-335.cs (bug #58126).
5260 * cs-parser.jay (argument): Split out non-expression parts of the
5261 rule into 'non_simple_argument'.
5262 (invocation_expression): Support parenthesized invocations with
5263 multiple arguments, and with single non-simple arguments.
5265 2005-01-13 Raja R Harinath <rharinath@novell.com>
5267 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5270 2005-01-12 Raja R Harinath <rharinath@novell.com>
5272 Fix cs0038-1.cs, cs1640-6.cs.
5273 * ecore.cs (Expression.Resolve): Remove special-case for
5274 SimpleName in error-handling.
5275 (Expression.almostMatchedMembers): Relax access permission to
5277 (Expression.MemberLookupFailed): Handle duplicates in
5278 almostMatchedMembers list.
5279 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5280 * expression.cs (New.DoResolve): Report CS1540 for more cases.
5281 * typemanager.cs (GetFullNameSignature): Use the MethodBase
5282 overload if the passed in MemberInfo is a MethodBase.
5284 2005-01-25 Martin Baulig <martin@ximian.com>
5287 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
5289 2005-01-12 Marek Safar <marek.safar@seznam.cz>
5292 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5293 for non-CAS & merge permission sets properly.
5295 2005-01-11 Raja R Harinath <rharinath@novell.com>
5297 Improve standard-compliance of simple name and member access
5298 resolution. Fixes bugs #52697, #57200, #67520, #69519.
5299 * ecore.cs (FullNamedExpression): New abstract base class
5300 for Namespaces and TypeExpressions.
5301 (ResolveFlags.SimpleName): Remove.
5302 (SimpleName): Remove support for dotted names.
5303 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
5304 DeclSpace.FindType and DeclSpace.LookupType.
5305 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5306 (Expression.ExprClassName): Make member function.
5307 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5308 a namespace. Remove creation of dotted "SimpleName"s.
5309 (MemberAccess.DoResolve): Likewise.
5310 * decl.cs (DeclSpace.Cache): Make private.
5311 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5312 (DeclSpace.FindType): Update.
5313 (DeclSpace.LookupType): Move here from RootContext. Return a
5314 FullNamedExpression.
5315 * namespace.cs (Namespace): Derive from FullNamedExpression
5316 so that it can be part of expression resolution.
5317 (Namespace.Lookup): Return an FullNamedExpression.
5318 (NamespaceEntry.LookupAlias): Lookup aliases only in current
5320 * rootcontext.cs (NamespaceLookup): Remove.
5321 (LookupType): Move to DeclSpace.
5322 * attribute.cs (CheckAttributeType): Update.
5323 * doc.cs (FindDocumentedType): Remove allowAlias argument.
5324 (FindDocumentedTypeNonArray): Likewise.
5326 2005-01-11 Raja R Harinath <rharinath@novell.com>
5328 Fix cs0509.cs, cs1632.cs.
5329 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5330 is the same as IsInterface.
5331 (TypeContainer.GetClassBases): Likewise.
5332 * statement.cs (LabeledStatement.ig): New field.
5333 (LabeledStatement.LabelTarget): Save ILGenerator which created the
5335 (LabeledStatement.DoEmit): Check that the label was created with
5336 the same ILGenerator.
5338 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5341 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5342 accessors to its properties.
5344 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5345 from accessors to property.
5347 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5350 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5353 2005-01-08 Miguel de Icaza <miguel@ximian.com>
5355 * attribute.cs: Check for null and empty strings.
5357 I have lost another battle to Paolo.
5359 2005-01-07 Marek Safar <marek.safar@seznam.cz>
5362 * class.cs (PropertyMethod): Set Parent field in ctors.
5363 (SetMethod.InternalParameters): Add unsafe switch hack.
5364 Override MarkForDuplicationCheck where it is appropriate.
5366 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5367 It says whether container allows members with the same name.
5369 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5370 Removed is_method parameter.
5372 2005-01-06 Duncan Mak <duncan@ximian.com>
5374 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5375 because the previous change led to incorrect reporting of CS1032
5376 ("Cannot define/undefine preprocessor symbols after first token in
5377 file"). Instead of using `tokens_seen' as the only flag that
5378 triggers CS1040, introduce `comments_seen'. This new flag is used
5379 to signify having seen comments on the current line, so it is
5380 unset after a newline.
5382 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5384 * doc.cs : When searching for a type, find nested type too.
5385 This fixes bug #71040.
5387 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5390 - Warn missing member comment on those classes which also does not
5391 have doc comments. Fixed bug #71041.
5392 - Don't warn missing doc comment on default constructor.
5395 2005-01-06 Duncan Mak <duncan@ximian.com>
5397 * cs-tokenizer.cs (xtoken): After handling traditional C-style
5398 comments, set `tokens_seen' to true. This allows us to detect
5399 misplaced preprocessor directives (i.e. not at the beginning of
5400 the a line, nor after whitespaces). In that case, report error
5401 CS1040. This fixes bug #56460.
5403 * cs-parser.jay (interface_member_declaration): Add checks for
5404 IsExplicitImpl, and report CS0541 error if an interface member is
5405 defined as an explicit interface declaration.
5407 2005-01-06 Marek Safar <marek.safar@seznam.cz>
5410 * class.cs (PropertyMethod): Set Parent field in ctors.
5411 (SetMethod.InternalParameters): Add unsafe switch hack.
5413 * decl.cs (MemberCore.Parent): Cannot be readonly.
5415 2005-01-06 Raja R Harinath <rharinath@novell.com>
5417 * decl.cs (DeclSpace.ResolveType): Remove.
5418 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5419 Merge in code from ...
5420 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
5421 * class.cs, enum.cs: Update to changes.
5423 2005-01-06 Miguel de Icaza <miguel@ximian.com>
5425 * anonymous.cs: Ensure that we init the scope of our parent if it
5426 has not been initialized yet.
5428 2004-12-30 Duncan Mak <duncan@ximian.com>
5430 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5431 if field.FieldBuilder is null. Fixes #70758.
5433 * convert.cs: Fixed some typos and updated some of the comments.
5434 (ImplicitStandardConversionExists):
5435 (TryImplicitIntConversion): If `target_type' is an interface and
5436 the type of `ic' implements this interface, return true or a new
5437 BoxedCast instead of null. This fixes #70468.
5439 2004-12-29 Duncan Mak <duncan@ximian.com>
5441 * expression.cs (Argument.Emit): Check that Expr is
5442 IMemoryLocation before casting to it, and report CS1510 otherwise.
5446 2004-12-21 Ben Maurer <bmaurer@ximian.com>
5448 * statement.cs (Block.ThisVariable): remove the recursion here, to
5449 make the --profile more sane.
5451 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
5453 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5454 assembly, by JB Evain.
5456 2004-12-17 Raja R Harinath <rharinath@novell.com>
5458 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
5459 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5460 "parent" refers to enclosing type/class. "base" refers to superclass.
5462 2004-12-17 Raja R Harinath <rharinath@novell.com>
5464 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5465 Ensure that we only have GlobalAttributes.
5466 * attribute.cs (Attribute.Emit): Make non-virtual.
5467 (GlobalAttribute.Emit): Remove.
5468 (Attribute.Resolve): Make virtual.
5469 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
5470 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5471 the argument. Don't create one.
5472 (Attribute.GetObsoleteAttribute): Likewise.
5473 (Attribute.GetClsCompliantAttributeValue): Likewise.
5474 * class.cs, decl.cs: Update to changes.
5476 2004-12-17 Marek Safar <marek.safar@seznam.cz>
5478 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5480 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5482 * statement.cs (Foreach.Resolve): Add error 186 report.
5484 2004-12-16 Marek Safar <marek.safar@seznam.cz>
5486 * expression.cs (Conditional.DoResolve): Add warning 429.
5488 * statement.cs (If.Resolve): Add warning 665.
5490 2004-12-16 Raja R Harinath <rharinath@novell.com>
5492 New invariant: RootContext.Tree.Types.NamespaceEntry == null
5493 except when in the parser, and in GlobalAttribute.
5494 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5495 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5496 RootContext.Tree.Types.NamespaceEntry once work is done.
5497 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
5498 and resets RootContext.Tree.Types.NamespaceEntry.
5500 2004-12-15 Marek Safar <marek.safar@seznam.cz>
5502 * cs-parser.jay: Don't create a block for every variable.
5504 2004-12-14 Miguel de Icaza <miguel@ximian.com>
5506 * location.cs: Provide extra information.
5508 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5509 variables from the captured environment, it is the ldarg_0.
5511 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5513 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5516 * class.cs: Changed warning level for 169 to avoid developer
5517 displeasure from warning flooding. It will be changed back when they
5518 fix most of current BCL warnings.
5520 * RootContext.cs: Pushed default WarningLevel to 3.
5522 * statement.cs: Removed unused variable.
5524 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5526 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5527 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5528 Add error 502 report.
5529 (StaticClass.DefineType): Add error 441 report.
5530 (Class.AllowedModifiersProp): New virtual property as temporary
5531 extension to AllowedModifiers.
5532 (Class.DefineType): Add error 418 report. Moved ModFlags check here
5533 to share implementation with StaticClass and don't call virtual
5536 * driver.cs (MainDriver): Add error 1558 test.
5538 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5539 report. Moved error 36 test here.
5541 * statement.cs (Throw.Resolve): Add error 724 report.
5543 * typemanager.cs: Add out_attribute_type core type.
5545 2004-12-13 Marek Safar <marek.safar@seznam.cz>
5547 * class.cs (TypeContainer.VerifyClsCompliance): Add error
5549 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5551 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5554 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5556 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
5557 Add error 3023 report.
5558 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5560 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5563 2004-12-12 John Luke <john.luke@gmail.com>
5565 * driver.cs (AddArgs): take -- into account when
5566 adding arguments, fixes bug 65710
5568 2004-12-12 Martin Baulig <martin@ximian.com>
5570 * expression.cs (Unary.TryReduceNegative): Added support for
5571 SByteConstant and ByteConstant.
5572 (Unary.Reduce): Check error values from TryReduceNegative().
5574 2004-12-10 Marek Safar <marek.safar@seznam.cz>
5576 * attributes.cs (Attribute.Resolve): Avoid multiple error report
5577 and report exception as error 182.
5579 2004-12-10 Raja R Harinath <rharinath@novell.com>
5581 * driver.cs (Main): Fix message when there are warnings.
5583 2004-12-09 Miguel de Icaza <miguel@ximian.com>
5585 * delegate.cs: Fixed my fix from yesterday, sorry about that.
5587 2004-12-09 Marek Safar <marek.safar@seznam.cz>
5589 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
5590 Reduced number of warnings.
5592 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5594 2004-12-08 Miguel de Icaza <miguel@ximian.com>
5596 * driver.cs: Removed message.
5598 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5600 2004-12-08 <vargaz@freemail.hu>
5602 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5604 2004-12-08 Martin Baulig <martin@ximian.com>
5606 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5607 instead of a CS3002 for properties and indexer.
5609 2004-12-08 Martin Baulig <martin@ximian.com>
5611 * decl.cs (MemberName.ToString): Make this work again.
5613 2004-12-08 Marek Safar <marek.safar@seznam.cz>
5615 * attribute.cs (Resolve): Add error 591 detection.
5617 * class.cs (FieldMember.Define): Add error 1547 detection.
5618 (Indexer.Define): Add error 620 detection.
5619 (Operator.Define): Add error 590 detection.
5621 * ecore.cs: Missing argument for error 79.
5623 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5626 2004-12-07 Marek Safar <marek.safar@seznam.cz>
5629 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5632 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
5634 * cs-parser.jay : handle doc comments on implicit/explicit operators.
5635 Some operator comments were suppressed.
5636 * doc.cs : Implicit/explicit operator name in doc comments are like
5637 "op_Explicit(type)~returnType", so added suffix handling.
5639 2005-01-21 Alp Toker <alp@atoker.com>
5641 * cs-parser.jay: destructor_declaration's container is PartialContainer
5642 not Class when partial types are used, so use Kind prop instead of 'is'.
5644 2004-12-12 Martin Baulig <martin@ximian.com>
5646 * expression.cs (Unary.TryReduceNegative): Added support for
5647 SByteConstant and ByteConstant.
5648 (Unary.Reduce): Check error values from TryReduceNegative().
5650 2004-12-11 Martin Baulig <martin@ximian.com>
5652 * support.cs (ReflectionParameters.ParameterName): If we have a
5653 `gpd', call `ParameterName' on it.
5655 * parameter.cs (Parameter.GetParameterAttributes): New static method.
5657 * pending.cs (PendingImplementation.DefineProxy): Call
5658 DefineParameter() for all of the MethodBuilder's arguments.
5660 2004-12-09 Martin Baulig <martin@ximian.com>
5662 * doc.cs (DocUtil): Make this a static class.
5664 2004-12-09 Martin Baulig <martin@ximian.com>
5666 * expression.cs (Invocation.InferType): Moved the type inference
5667 implementation into TypeManager.
5669 * generics.cs (TypeManager): Moved the type inference
5670 implementation here.
5672 2004-12-09 Martin Baulig <martin@ximian.com>
5674 * typemanager.cs (TypeManager): Make this a partial class.
5677 (TypeManager): Move the generics part of `TypeManager' here.
5679 2004-12-08 Martin Baulig <martin@ximian.com>
5681 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5682 instead of a CS3002 for properties and indexer. Added CS3024
5683 check for generic interfaces.
5685 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
5686 instances are not CLS-compliant.
5688 2004-12-08 Martin Baulig <martin@ximian.com>
5691 (void_pointer_expression): New rule for `void*', `void**' etc.
5692 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
5694 2004-12-08 Martin Baulig <martin@ximian.com>
5696 * expression.cs (Invocation.InferType): Removed the hack for
5697 MethodCore.MayUnify().
5699 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
5702 * class.cs (MethodCore.MayUnify): Use
5703 TypeManager.MayBecomeEqualGenericTypes().
5705 2004-12-08 Martin Baulig <martin@ximian.com>
5707 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
5708 parameter, box it. Fixes #69233.
5710 2004-12-08 Martin Baulig <martin@ximian.com>
5712 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
5713 have the ctor constraint. Fixes #68326.
5715 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
5717 * cs-parser.jay : interface comment was not consumed because of
5718 extra opt_semicolon before doc handling.
5720 2004-12-03 Raja R Harinath <rharinath@novell.com>
5722 Fix test-327.cs, test-328.cs, and put in early infrastructure
5723 for eventually fixing #52697.
5724 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
5725 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
5727 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
5728 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
5729 (VerifyUsing, error246): Update.
5730 * rootcontext.cs (RootContext.NamespaceLookup): Just use
5731 'NamespaceEntry.LookupNamespaceOrType'.
5733 2004-12-07 Martin Baulig <martin@ximian.com>
5735 * driver.cs: Call it "BETA SOFTWARE" :-)
5737 2004-12-06 Raja R Harinath <rharinath@novell.com>
5739 Fix crash on cs0657-17.cs.
5740 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5741 Use RootContext.Tree.Types, not 'new RootTypes ()'.
5742 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5743 the case where the NamespaceEntry gets overwritten.
5745 2004-12-06 Marek Safar <marek.safar@seznam.cz>
5747 Fixed #69195, #56821
5748 * ecore.cs (ResolveBoolean): Tiny refactoring.
5750 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
5751 of right expression resolving when left is false constant and
5752 operator is LogicalAnd OR true constant and operator is LogicalOr.
5754 * statement.cs (ResolveUnreachable): Always reports warning.
5756 2004-12-05 Miguel de Icaza <miguel@ximian.com>
5758 * class.cs: Distinguish between 1721 and 1722 (just a little help
5759 for the programmer).
5761 2004-12-03 Miguel de Icaza <miguel@ximian.com>
5763 * delegate.cs: Only allow this on new versions of the language.
5765 2004-12-02 Duncan Mak <duncan@ximian.com>
5767 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
5769 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
5770 here as a static method. Take an additional bool out parameter
5771 `must_do_cs1540_check' for signaling to InstanceResolve.
5772 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
5773 member field from PropertyExpr class and made it an argument of
5775 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
5776 check for MarshalByRefObject, and report CS0122 instead of CS1540.
5777 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
5778 and `remove_accessor' as well as InstanceResolve: report CS0122
5783 2004-12-07 Martin Baulig <martin@ximian.com>
5785 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
5786 and CS0692 where appropriate.
5788 2004-12-06 Martin Baulig <martin@ximian.com>
5790 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
5791 IsDuplicateImplementation() and improved it.
5793 * expression.cs (Invocation.InferTypeArguments): Added
5794 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
5795 and removed the "ref" modifier from `infered_types'.
5797 * decl.cs (MemberName.ToString): Removed the exception.
5799 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
5801 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
5802 comments are allowed.
5804 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
5806 * delegate.cs: Add checks for subtypes in paramaters and return values
5807 in VerifyMethod () to add support for Covariance/Contravariance
5810 2004-12-02 Miguel de Icaza <miguel@ximian.com>
5812 * report.cs: Remove extra closing parenthesis.
5814 * convert.cs (Error_CannotImplicitConversion): If the name of the
5815 types are the same, provide some extra information.
5817 2004-12-02 Marek Safar <marek.safar@seznam.cz>
5820 * attribute.cs (Resolve): Improved implementation of params
5821 attribute arguments.
5823 * support.cs (ParameterData): Add HasParams to be faster.
5825 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
5827 all things are for /doc support:
5829 * doc.cs: new file that supports XML documentation generation.
5830 * mcs.exe.sources: added doc.cs.
5832 Handle /doc command line option.
5833 Report error 2006 instead of 5 for missing file name for /doc.
5834 Generate XML documentation when required, after type resolution.
5836 Added support for picking up documentation (/// and /** ... */),
5837 including a new XmlCommentState enumeration.
5839 Added lines to fill Documentation element for field, constant,
5840 property, indexer, method, constructor, destructor, operator, event
5841 and class, struct, interface, delegate, enum.
5842 Added lines to warn incorrect comment.
5844 Added Documentation field (passed only when /doc was specified).
5846 Added DocComment, DocCommentHeader, GenerateDocComment() and
5847 OnGenerateDocComment() and some supporting private members for
5848 /doc feature to MemberCore.
5850 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
5852 Added overriden DocCommentHeader.
5854 Added overriden DocCommentHeader and GenerateDocComment().
5856 2004-12-01 Miguel de Icaza <miguel@ximian.com>
5858 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
5859 unwrapping the enumeration values, chain to
5860 DoConstantNumericPromotions again, so we can promote things to the
5861 fundamental types (takes care of enums that are bytes, sbytes).
5865 2004-12-01 Raja R Harinath <rharinath@novell.com>
5867 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
5868 Fix long-standing bug in type-lookup. Use FindType instead of
5869 LookupType when ec.ResolvingTypeTree.
5870 (Attribute.ResolveType, Attribute.Resolve)
5871 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
5873 (Attributes.Search): Remove internal version. Update.
5874 (Attributes.SearchMulti): Update.
5875 (Attributes.GetClsCompliantAttribute): Remove.
5876 (Attributes.GetIndexerNameAttribute): Remove.
5877 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
5878 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
5879 * class.cs (Indexer.Define): Likewise.
5881 2004-12-01 Marek Safar <marek.safar@seznam.cz>
5884 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
5885 MarshallByReference members access.
5887 * expression.cs: Use CheckMarshallByRefAccess;
5888 Better error CS0197 message.
5890 * report.cs: Print whole related error message.
5892 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5894 * class (GetClassBases): Better error 60 report.
5895 (EventProperty): Disabled warning 67 detection.
5897 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5900 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
5902 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
5905 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5908 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
5910 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
5912 2004-11-26 Miguel de Icaza <miguel@ximian.com>
5914 * attribute.cs (Attribute.Resolve): Refine error reporting and
5915 report a cs0117 if the identifier does not exist, to distinguish
5916 from 0617 which is a miss-use of the actual identifier.
5918 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
5919 between cs0070 and cs0079.
5921 * class.cs (MemberBase.DoDefine): When reporting a wrong
5922 accessibility level, we use MethodCore to compare instead of
5923 Method (this was a regression in some refactoring effort).
5925 So now we correctly report cs0056 again.
5927 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
5928 testing the target_type (which was known to be object_type) and
5929 not the source type (which is anonymous_method).
5931 Fixed reporting of error cs1660.
5933 * expression.cs (UserCast.Source): Expose the underlying cast.
5935 * statement.cs (Switch.SwitchGoverningType): Sort the list of
5936 allowed types to find a match to int32 first (most common).
5938 In addition, it ignores any ImplicitUserConversions that did an
5939 internal implicit conversion (as the switch statement allows only
5940 one integral conversion to exist).
5942 * class.cs (PartialContainer.Create): rename `name' to
5943 `member_name' for clarity. Then replace the string calls with a
5944 call to MemberName.GetPartialName, as now using
5945 MemberName.ToString is an error (this is due to the side effects
5946 it had, that were fixed in the past).
5948 This will restore the error reporting on a number of partial class
5949 errors that were missusing this (and getting an exception as a
5950 results, which is now just a plain textual warning, because
5951 yyparse debug output would crash otherwise).
5953 2004-11-26 Raja R Harinath <rharinath@novell.com>
5955 * Makefile (PROGRAM_INSTALL_DIR): Remove.
5957 2004-11-25 Ben Maurer <bmaurer@ximian.com>
5959 * rootcontext.cs (LookupType): Make sure to cache lookups that
5960 don't give us a negative result. This saves about 5% of corlib
5963 2004-11-25 Miguel de Icaza <miguel@ximian.com>
5965 * report.cs (AbstractMessage.Print): messages are sent to stderr
5967 * class.cs (TypeContainer.GetClassBases): It is an error to have a
5968 non-interface in the list of interfaces (at this point, either
5969 parent was properly set, or a base class is being listed in the
5970 interfaces section).
5972 This flags error 1722, and resolves the crash from bug 69259.
5974 2004-11-25 Ben Maurer <bmaurer@ximian.com>
5976 * statement.cs (Using.EmitExpressionFinally): make this work right
5977 for valuetypes. Fixes 69926.
5979 2004-11-25 Miguel de Icaza <miguel@ximian.com>
5981 * const.cs (Const.ChangeType): Cope with the "0 literal can be
5982 converted to an enum" here, before we try to change the underlying
5983 type. This code exists, but it is a different code path than the
5984 one used while encoding constants.
5986 (ImplicitReferenceConversionExists): In addition, resynchronized
5987 the code here, so it matches the same code in
5988 ImplicitReferenceConversionExists for the `from any class-type S
5989 to any interface-type T'.
5991 2004-11-25 Marek Safar <marek.safar@seznam.cz>
5993 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
5995 2004-11-24 Miguel de Icaza <miguel@ximian.com>
5997 * cs-parser.jay: Use verbosity accordingly.
5999 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6001 * expression.cs (Unary.ResolveOperator): Do not report warning;
6002 AddressOf reads from variable.
6004 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6006 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6010 * attribute.cs (Attributable): Removed CheckTargets.
6011 (Attributes.Emit): Explicit attribute targets are tested here.
6013 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6014 not enabled for interfaces.
6016 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6017 (GetAssemblyName): Ouch next bug there.
6019 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6021 * expression.cs: Error 275 added.
6023 2004-11-23 Marek Safar <marek.safar@seznam.cz>
6025 Fix bug #69177 (Implemented decimal constant support)
6027 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6028 (BinaryFold): Add DecimalConstant.
6030 * const.cs (Define): Decimal constant
6032 (ChangeType): Add decimal type handling.
6033 (LookupConstantValue): Don't set value for decimal type but
6034 emit DecimalConstantAttribute. Needed for constant optimization.
6036 * constant.cs (ToDecimal): New method.
6037 (ConvertToDecimal): New method.
6038 (IntConstant): Implemented ConvertToDecimal.
6039 (DecimalConstant.Emit): Emit optimized version for decimals in
6042 * expression.cs (ResolveOperator): Changed order of constant
6043 reduction to work correctly with native types which have
6044 overloaded operators.
6045 (ResolveMemberAccess): Extract constant value from attribute
6048 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6050 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6051 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6052 (ChangeType): Decimal is special.
6053 (TypeToCoreType): Add decimal type.
6055 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6057 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6060 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6062 * class.cs (EventField.ApplyAttributeBuilder): Fix error
6065 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6067 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6069 * pending.cs (PendingImplementation): Grab only interfaces.
6071 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6073 * statement.cs (ForeachHelperMethods): Add location member and
6074 error 202 detection.
6076 2004-11-18 Marek Safar <marek.safar@seznam.cz>
6078 * expression.cs (DoResolveBase): Fixed wrong warning for out
6081 2004-12-04 Martin Baulig <martin@ximian.com>
6083 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6084 to check whether the conversion is ok.
6086 * typemanager.cs (TypeManager.GetTypeArguments): Just return
6087 `Type.EmptyTypes' if we're not a generic TypeContainer.
6089 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6091 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6092 old bug: when converting from the null literal to a pointer,
6093 return an EmptyCast, not the NullLiteral.
6095 This fixes #69921, the recent null_type changes probably made this
6098 2004-12-03 Martin Baulig <martin@ximian.com>
6100 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6101 method as our child, call AnonymousMethod.Compatible() on it.
6103 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6105 * class.cs (FieldBase): Use an unused bit field from the field to
6106 encode the `has_offset' property from the FieldMember. This saves
6107 a couple of Ks on bootstrap compilation.
6109 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6110 method as our child, return the AnonymousMethod resolved
6113 * expression.cs (New.DoResolve): Allow return values from
6114 NewDelegate to also include AnonymousMethods.
6118 2004-11-29 Raja R Harinath <rharinath@novell.com>
6120 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6122 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6123 System.Runtime.InteropServices._Exception, since it's a base
6124 interface of the core type System.Exception in the net_2_0 profile.
6126 2004-11-27 Martin Baulig <martin@ximian.com>
6128 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6130 2004-11-26 Raja R Harinath <rharinath@novell.com>
6132 * Makefile: Convert to use executable.make.
6133 * gmcs.exe.sources: New.
6135 2004-11-25 Martin Baulig <martin@ximian.com>
6137 * expression.cs (Invocation.InferType): Added support for byref types.
6139 2004-11-25 Martin Baulig <martin@ximian.com>
6141 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6142 in TypeManager.TypeToCoreType().
6144 2004-11-25 Martin Baulig <martin@ximian.com>
6146 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6147 "Dispose" method from the `current_type'.
6148 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6149 DoDefineMembers() instead of using the MethodBuilder; this is
6150 required for generic iterators.
6152 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6154 2004-11-24 Martin Baulig <martin@ximian.com>
6156 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6158 2004-11-20 Martin Baulig <martin@ximian.com>
6160 * expression.cs (Invocation.InferType): Correctly infer generic
6161 instances; see gen-103.cs.
6162 (Invocation.InferTypeArguments): If a generic method doesn't have
6163 any unbound type parameters, we don't need to infer anything.
6165 2004-11-19 Raja R Harinath <rharinath@novell.com>
6167 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6169 2004-11-17 Raja R Harinath <rharinath@novell.com>
6171 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6172 (TypeHandle.GetMemberCache): New.
6173 (TypeHandle.TypeHandle): Update.
6174 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6175 (TypeManager.LookupParentInterfacesCache):
6176 Rename from LookupInterfaceCache. Optimize slightly.
6177 (TypeManager.MemberLookup_FindMembers): Update.
6178 * decl.cs (MemberCache.MemberCache): Set Container to null in the
6180 (AddCacheContents): Rename from AddHashtable.
6181 * class.cs (TypeContainer.parent_container): Remove.
6182 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6183 (TypeContainer.DoDefineMembers): Don't initialize it.
6184 Update to name changes.
6186 2004-11-17 Miguel de Icaza <miguel@ximian.com>
6188 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6189 that factors the code to check access modifiers on override.
6191 (PropertyBase): Use the code here.
6193 Patch from Lluis S'anchez, fixes bug #69361.
6195 2004-11-15 Miguel de Icaza <miguel@ximian.com>
6197 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6198 routine that is used to report the use of a captured variable
6199 whose address has been taken.
6201 There are two checks: one when variables are being captured and
6202 the other check is when the address of a variable is taken.
6204 (because an anonymous methods might be resolved before *or* after
6205 the address has been taken) and
6207 * expression.cs (Conditional.DoResolve): Remove the special
6208 casing that Martin added to trueExpr and falseExpr being both
6209 NullLiteral. We get the right behavior now just by introducing
6210 the null_type into the compiler.
6212 * convert.cs (ExplicitConversion): Change the code to use
6213 null_type instead of testing `expr is NullLiteral'.
6214 (ImplicitConversionStandard): use null_type too.
6215 (ImplicitReferenceConversionExists): use null_type too.
6216 (ImplicitReferenceConversion): use null_type too.
6218 * literal.cs: The type of `NullLiteral' is now null_type instead
6220 (Resolve): Set the type here.
6222 * typemanager.cs: Introduce null_type.
6224 2004-11-18 Martin Baulig <martin@ximian.com>
6227 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6229 2004-11-18 Martin Baulig <martin@ximian.com>
6231 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
6233 2004-11-18 Martin Baulig <martin@ximian.com>
6235 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
6236 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
6237 call ResolveConstructedType() on it to resolve it without checking
6239 (Constraints.ResolveTypes): Check them here.
6240 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
6241 but don't check constraints.
6242 (ConstructedType.ResolveAsTypeTerminal): Override this and also
6243 check constraints here.
6244 (ConstructedType.ResolveConstructedType): New public method. This
6245 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
6246 resolve ourselves without checking constraints.
6248 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
6250 2004-11-18 Martin Baulig <martin@ximian.com>
6253 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
6255 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
6257 2004-11-18 Martin Baulig <martin@ximian.com>
6259 * ecore.cs (TypeExpr.ResolveType): Removed.
6260 (Expression.ResolveAsTypeTerminal): We always return a fully
6261 resolved `TypeExpr', so we can just access its `Type'.
6263 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
6265 2004-11-17 Martin Baulig <martin@ximian.com>
6267 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
6268 sure we don't return any unresolved TypeExpr's.
6269 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
6271 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
6273 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
6274 unresolved `ConstructedType's.
6276 2004-11-17 Martin Baulig <martin@ximian.com>
6278 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
6280 2004-11-17 Martin Baulig <martin@ximian.com>
6283 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
6285 * decl.cs (DeclSpace.ResolveType): Removed.
6286 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
6288 2004-11-17 Martin Baulig <martin@ximian.com>
6290 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6291 direction, like FindMembers() does. Fixes #69546, testcase is in
6294 2004-11-16 Martin Baulig <martin@ximian.com>
6296 This is based on a patch from Marek Safar, see bug #69082.
6297 Fixes bugs #63705 and #67130.
6299 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6300 method; create a MemberCache for an interface type and cache the
6303 * decl.cs (IMemberContainer.ParentContainer): Removed.
6304 (IMemberContainer.ParentCache): New property.
6305 (MemberCache.SetupCacheForInterface): Removed.
6306 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6307 to create a cache for an interface's "parent".
6309 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6312 2004-11-14 Ben Maurer <bmaurer@ximian.com>
6314 * statement.cs: Avoid adding bools to a hashtable.
6316 2004-11-15 Martin Baulig <martin@ximian.com>
6318 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
6320 2004-11-11 Martin Baulig <martin@ximian.com>
6322 * typemanager.cs (TypeManager.GetMethodName): New method.
6324 * class.cs (MethodData.Define): Include the generic arity in the
6325 name of an explicit interface; also add it to the method name.
6327 * pending.cs (PendingImplementation.InterfaceMethod): The method
6328 name now includes the generic arity.
6330 2004-11-07 Miguel de Icaza <miguel@ximian.com>
6332 * expression.cs (Invocation.OverloadResolve): Flag error if we are
6333 calling an unsafe method from a safe location.
6335 2004-11-06 Marek Safar <marek.safar@seznam.cz>
6338 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6340 2004-11-06 Miguel de Icaza <miguel@ximian.com>
6342 * namespace.cs (VerifyUsing): use GetPartialName instead of
6345 2004-11-05 Miguel de Icaza <miguel@ximian.com>
6347 * statement.cs (Return.Resolve): Fix regression in typo: if
6348 `in_exc', we have to request a NeedReturnLabel, this was a typo
6349 introduced in the anonymous method check-in. Fixes #69131.
6351 * Indexers were using the ShortName when defining themselves,
6352 causing a regression in the compiler bootstrap when applying the
6353 patch from 2004-11-02 (first part), now they use their full name
6354 and the bug is gone.
6356 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
6358 * driver.cs: Strip the path from the names of embedded resources. Fixes
6361 2004-11-04 Raja R Harinath <rharinath@novell.com>
6363 Fix error message regression: cs0104-2.cs.
6364 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6365 (AliasEntry.Resolve): Update.
6366 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
6368 (RootContext.LookupType): Update.
6370 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
6372 * cs-parser.jay: Add support for handling accessor modifiers
6373 * class: Add support port accessor modifiers and error checking,
6374 define PropertyMethod.Define as virtual (not abstract anymore)
6375 * ecore.cs: Add checking for proeprties access with access modifiers
6376 * iterators.cs: Modify Accessor constructor call based in the modified
6378 2004-11-02 Ben Maurer <bmaurer@ximian.com>
6380 * expression.cs (StringConcat): Handle being called twice,
6381 as when we have a concat in a field init with more than two
6384 2004-11-02 Miguel de Icaza <miguel@ximian.com>
6386 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6387 special case explicit implementations, we should always produce
6388 the .property or .event declaration.
6390 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6391 since it will not return correct data if people use this
6392 unresolved in the presence of using statements (see test-313).
6394 * class.cs (MethodData.Define): If we are an explicit interface
6395 implementation, set the method name to the full name of the
6396 interface plus the name of the method.
6398 Notice that using the method.MethodName.GetFullName() does not
6399 work, as it will only contain the name as declared on the source
6400 file (it can be a shorthand in the presence of using statements)
6401 and not the fully qualifed type name, for example:
6405 class D : ICloneable {
6406 object ICloneable.Clone () {
6410 Would produce a method called `ICloneable.Clone' instead of
6411 `System.ICloneable.Clone'.
6413 * namespace.cs (Alias.Resolve): Use GetPartialName.
6415 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6417 * cs-parser.jay: Add error 1055 report.
6419 2004-11-01 Miguel de Icaza <miguel@ximian.com>
6421 * assign.cs (Assign.DoResolve): Only do the transform of
6422 assignment into a New if the types are compatible, if not, fall
6423 through and let the implicit code deal with the errors and with
6424 the necessary conversions.
6426 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6428 * cs-parser.jay: Add error 1031 report.
6430 * cs-tokenizer.cs: Add location for error 1038.
6432 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6434 * cs-parser.jay: Add error 1016 report.
6436 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6438 * cs-parser.jay: Add errors 1575,1611 report.
6440 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6442 * cs-parser.jay: Add error 1001 report.
6444 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6447 * attribute.cs (GetMarshal): Add method argument for
6448 caller identification.
6450 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6451 agument for GetMarshal and RuntimeMissingSupport.
6453 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6455 * attribute.cs (ExtractSecurityPermissionSet): Removed
6456 TypeManager.code_access_permission_type.
6458 * typemanager.cs: Removed TypeManager.code_access_permission_type.
6460 2004-10-27 Miguel de Icaza <miguel@ximian.com>
6462 * expression.cs (LocalVariableReference.DoResolveLValue): Check
6463 for obsolete use of a variable here. Fixes regression on errors
6464 cs0619-25 and cs0619-26.
6466 2004-10-27 Marek Safar <marek.safar@seznam.cz>
6468 Fix #62358, implemented security attribute encoding.
6470 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6471 Tests permitted SecurityAction for assembly or other types.
6472 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6473 data from SecurityPermissionAttribute to PermisionSet class.
6475 * class.cs (ApplyAttributeBuilder): Added special handling
6476 for System.Security.Permissions.SecurityAttribute based types.
6478 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6479 special handling for System.Security.Permissions.SecurityAttribute
6482 * enum.cs (ApplyAttributeBuilder): Added special handling
6483 for System.Security.Permissions.SecurityAttribute based types.
6485 * parameter.cs (ApplyAttributeBuilder): Added special handling
6486 for System.Security.Permissions.SecurityAttribute based types.
6488 * rootcontext.cs: Next 2 core types.
6490 * typemanager.cs (TypeManager.security_permission_attr_type):
6491 Built in type for the SecurityPermission Attribute.
6492 (code_access_permission_type): Build in type.
6494 2004-10-17 Miguel de Icaza <miguel@ximian.com>
6496 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6497 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6498 all of this information into
6499 EmitContext.EmitCapturedVariableInstance.
6501 * codegen.cs (EmitCapturedVariableInstance): move here the
6502 funcionality of emitting an ldarg.0 in the presence of a
6503 remapping. This centralizes the instance emit code.
6505 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6506 then emit a load of this: it means that we have reached the
6507 topmost ScopeInfo: the one that contains the pointer to the
6508 instance of the class hosting the anonymous method.
6510 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6511 captures to the topmost CaptureContext.
6513 2004-10-12 Miguel de Icaza <miguel@ximian.com>
6515 * expression.cs (LocalVariableReference): Move the knowledge about
6516 the iterators into codegen's EmitCapturedVariableInstance.
6518 2004-10-11 Miguel de Icaza <miguel@ximian.com>
6520 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6521 all code paths return a value from an anonymous method (it is the
6522 same as the 161 error, but for anonymous methods).
6524 2004-10-08 Miguel de Icaza <miguel@ximian.com>
6526 The introduction of anonymous methods in the compiler changed
6527 various ways of doing things in the compiler. The most
6528 significant one is the hard split between the resolution phase
6529 and the emission phases of the compiler.
6531 For instance, routines that referenced local variables no
6532 longer can safely create temporary variables during the
6533 resolution phase: they must do so from the emission phase,
6534 since the variable might have been "captured", hence access to
6535 it can not be done with the local-variable operations from the runtime.
6539 (Block.Flags): New flag `IsTopLevel' to indicate that this block
6540 is a toplevel block.
6542 (ToplevelBlock): A new kind of Block, these are the blocks that
6543 are created by the parser for all toplevel method bodies. These
6544 include methods, accessors and anonymous methods.
6546 These contain some extra information not found in regular blocks:
6547 A pointer to an optional CaptureContext (for tracking captured
6548 local variables and parameters). A pointer to the parent
6551 (Return.Resolve): Catch missmatches when returning a value from an
6552 anonymous method (error 1662).
6553 Invoke NeedReturnLabel from the Resolve phase instead of the emit
6556 (Break.Resolve): ditto.
6558 (SwitchLabel): instead of defining the labels during the
6559 resolution phase, we now turned the public ILLabel and ILLabelCode
6560 labels into methods called GetILLabelCode() and GetILLabel() that
6561 only define the label during the Emit phase.
6563 (GotoCase): Track the SwitchLabel instead of the computed label
6564 (its contained therein). Emit the code by using
6565 SwitchLabel.GetILLabelCode ().
6567 (LocalInfo.Flags.Captured): A new flag has been introduce to track
6568 whether the Local has been captured or not.
6570 (LocalInfo.IsCaptured): New property, used to tell whether the
6571 local has been captured.
6573 * anonymous.cs: Vastly updated to contain the anonymous method
6576 The main classes here are: CaptureContext which tracks any
6577 captured information for a toplevel block and ScopeInfo used to
6578 track the activation frames for various local variables.
6580 Each toplevel block has an optional capture context associated
6581 with it. When a method contains an anonymous method both the
6582 toplevel method and the anonymous method will create a capture
6583 context. When variables or parameters are captured, they are
6584 recorded on the CaptureContext that owns them, for example:
6588 MyDelegate d = delegate {
6593 Here `a' will be recorded as captured on the toplevel
6594 CapturedContext, the inner captured context will not have anything
6595 (it will only have data if local variables or parameters from it
6596 are captured in a nested anonymous method.
6598 The ScopeInfo is used to track the activation frames for local
6599 variables, for example:
6601 for (int i = 0; i < 10; i++)
6602 for (int j = 0; j < 10; j++){
6603 MyDelegate d = delegate {
6608 At runtime this captures a single captured variable `i', but it
6609 captures 10 different versions of the variable `j'. The variable
6610 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6611 recorded on a child.
6613 The toplevel ScopeInfo will also track information like the `this'
6614 pointer if instance variables were referenced (this is necessary
6615 as the anonymous method lives inside a nested class in the host
6616 type of the method).
6618 (AnonymousMethod): Expanded to track the Toplevel, implement
6619 `AnonymousMethod.Compatible' to tell whether an anonymous method
6620 can be converted to a target delegate type.
6622 The routine now also produces the anonymous method content
6624 (AnonymousDelegate): A helper class that derives from
6625 DelegateCreation, this is used to generate the code necessary to
6626 produce the delegate for the anonymous method that was created.
6628 * assign.cs: API adjustments for new changes in
6629 Convert.ImplicitStandardConversionExists.
6631 * class.cs: Adjustments to cope with the fact that now toplevel
6632 blocks are of type `ToplevelBlock'.
6634 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6635 insteda of standard blocks.
6637 Flag errors if params arguments are passed to anonymous methods.
6639 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6640 `CurrentAnonymousMethod' which points to the current Anonymous
6641 Method. The variable points to the AnonymousMethod class that
6642 holds the code being compiled. It is set in the new EmitContext
6643 created for the anonymous method.
6645 (EmitContext.Phase): Introduce a variable and an enumeration to
6646 assist in enforcing some rules about when and where we are allowed
6647 to invoke certain methods (EmitContext.NeedsReturnLabel is the
6648 only one that enfonces this right now).
6650 (EmitContext.HaveCaptureInfo): new helper method that returns
6651 whether we have a CapturedContext initialized.
6653 (EmitContext.CaptureVariable): New method used to register that a
6654 LocalInfo must be flagged for capturing.
6656 (EmitContext.CapturedParameter): New method used to register that a
6657 parameters must be flagged for capturing.
6659 (EmitContext.CapturedField): New method used to register that a
6660 field must be flagged for capturing.
6662 (EmitContext.HaveCapturedVariables,
6663 EmitContext.HaveCapturedFields): Return whether there are captured
6664 variables or fields.
6666 (EmitContext.EmitMethodHostInstance): This is used to emit the
6667 instance for the anonymous method. The instance might be null
6668 (static methods), this (for anonymous methods that capture nothing
6669 and happen to live side-by-side with the current method body) or a
6670 more complicated expression if the method has a CaptureContext.
6672 (EmitContext.EmitTopBlock): Routine that drives the emission of
6673 code: it will first resolve the top block, then emit any metadata
6674 and then emit the code. The split is done so that we can extract
6675 any anonymous methods and flag any captured variables/parameters.
6677 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6678 during this phase, the ILGenerator should not be used as labels
6679 and local variables declared here might not be accessible to any
6680 code that is part of an anonymous method.
6682 Exceptions to this include the temporary variables that are
6683 created by some statements internally for holding temporary
6686 (EmitContext.EmitMeta): New routine, in charge of emitting all the
6689 (EmitContext.TemporaryReturn): This method is typically called
6690 from the Emit phase, and its the only place where we allow the
6691 ReturnLabel to be defined other than the EmitMeta. The reason is
6692 that otherwise we would have to duplicate a lot of logic in the
6693 Resolve phases of various methods that today is on the Emit
6696 (EmitContext.NeedReturnLabel): This no longer creates the label,
6697 as the ILGenerator is not valid during the resolve phase.
6699 (EmitContext.EmitThis): Extended the knowledge in this class to
6700 work in anonymous methods in addition to iterators.
6702 (EmitContext.EmitCapturedVariableInstance): This emits whatever
6703 code is necessary on the stack to access the instance to a local
6704 variable (the variable will be accessed as a field).
6706 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6707 EmitContext.EmitAddressOfParameter): Routines to support
6708 parameters (not completed at this point).
6710 Removals: Removed RemapLocal and RemapLocalLValue. We probably
6711 will also remove the parameters.
6713 * convert.cs (Convert): Define a `ConstantEC' which points to a
6714 null. This is just to prefity some code that uses
6715 ImplicitStandardConversion code and do not have an EmitContext
6718 The idea is to flag explicitly that at that point in time, it is
6719 known that the conversion will not trigger the delegate checking
6720 code in implicit conversions (which requires a valid
6723 Everywhere: pass new EmitContext parameter since
6724 ImplicitStandardConversionExists now requires it to check for
6725 anonymous method conversions.
6727 (Convert.ImplicitStandardConversionExists): If the type of an
6728 expression is the anonymous_method_type, and the type is a
6729 delegate, we invoke the AnonymousMethod.Compatible method to check
6730 whether an implicit conversion is possible.
6732 (Convert.ImplicitConversionStandard): Only do implicit method
6733 group conversions if the language level is not ISO_1.
6735 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6736 MethodInfo for the Invoke method. used by Delegate and
6739 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6740 method conversions if the target type is a delegate.
6742 Removed extra debugging nops.
6744 (LocalVariableReference): Turn the `local_info' into a public
6747 Add `prepared' field, the same hack used for FieldExprs to cope
6748 with composed assignments, as Local variables do not necessarily
6749 operate purely on the stack as they used to: they can be captured
6752 Add `temp' for a temporary result, like fields.
6754 Refactor DoResolve and DoResolveLValue into DoResolveBase.
6756 It now copes with Local variables that are captured and emits the
6757 proper instance variable to load it from a field in the captured
6760 (ParameterReference.DoResolveBase): During the resolve phase,
6761 capture parameters if we are in an anonymous method.
6763 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
6764 anonymous method, use the EmitContext helper routines to emit the
6765 parameter reference.
6767 * iterators.cs: Set RemapToProxy to true/false during the
6770 * parameters.cs (GetParameterByName): New helper method.
6772 * typemanager.cs (anonymous_method_type) a new type that
6773 represents an anonyous method. This is always an internal type,
6774 used as a fencepost to test against the anonymous-methodness of an
6777 2004-10-20 Marek Safar <marek.safar@seznam.cz>
6779 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
6781 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
6783 2004-11-10 Martin Baulig <martin@ximian.com>
6785 * expression.cs (Invocation.BetterFunction): If two methods have
6786 equal parameter types, but only one of them is generic, the
6787 non-generic one wins.
6788 (New.DoResolve): Don't set `is_struct' to false if we're a generic
6789 instance; just use `Type.IsValueType' to determine whether
6790 something is a struct or not.
6791 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
6792 so we can be called multiple times.
6794 2004-11-10 Martin Baulig <martin@ximian.com>
6796 * generic.cs (TypeParameter.DefineConstraints): New public method.
6797 (TypeParameter.CheckAccessLevel): Override this and return true.
6798 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
6799 override ResolveType() anymore.
6800 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
6802 2004-11-10 Martin Baulig <martin@ximian.com>
6804 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
6805 call DeclSpace.ResolveNestedType() on it.
6807 2004-11-10 Martin Baulig <martin@ximian.com>
6809 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
6810 non-null, call ParameterModifier() on it.
6812 2004-11-10 Martin Baulig <martin@ximian.com>
6815 (Iterators): Added `current_type' and `this_type' fields.
6816 (Iterators.DefineIterator): Create a new EmitContext and store it
6817 in `ec'; compute `this_type'.
6819 2004-11-10 Martin Baulig <martin@ximian.com>
6822 (TypeManager.IsPrivateAccessible): New public method.
6823 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
6825 2004-11-10 Martin Baulig <martin@ximian.com>
6827 * class.cs (TypeContainer.DefineType): Call
6828 TypeBuilder.DefineGenericParameters() before resolving the type
6830 (MethodData.parent_method): New protected field.
6831 (MethodData..ctor): Added `MethodInfo parent_method' argument.
6832 (MethodData.Define): Compute `parent_method'.
6835 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6836 (MemberCore.GetClsCompliantAttributeValue): Likewise.
6837 (DeclSpace.ec): New protected field; store the EmitContext here.
6838 (DeclSpace.EmitContext): New public property.
6839 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
6840 (DeclSpace.ResolveNestedType): New public method.
6841 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
6842 (DeclSpace.NestedAccessible): Added `Type tb' argument.
6843 (DeclSpace.FamilyAccessible): Likewise.
6844 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
6845 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6848 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
6851 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6852 (Enum.Emit): Don't create a new EmitContext.
6854 2004-10-18 Martin Baulig <martin@ximian.com>
6856 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
6857 `Type' directly, but call ResolveType() on it.
6858 (Catch.Resolve): Likewise.
6859 (Foreach.Resolve): Likewise.
6861 2004-10-18 Martin Baulig <martin@ximian.com>
6863 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
6864 `Type' directly, but call ResolveType() on it.
6865 (Probe.DoResolve): Likewise.
6866 (ArrayCreation.LookupType): Likewise.
6867 (TypeOf.DoResolve): Likewise.
6868 (SizeOf.DoResolve): Likewise.
6870 2004-10-18 Raja R Harinath <rharinath@novell.com>
6872 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6875 2004-10-17 John Luke <john.luke@gmail.com>
6877 * class.cs (Operator.GetSignatureForError): use CSharpName
6879 * parameter.cs (Parameter.GetSignatureForError): Returns
6880 correct name even if was not defined.
6882 2004-10-13 Raja R Harinath <rharinath@novell.com>
6885 * class.cs (TypeContainer.EmitContext): New property.
6886 (DefineNestedTypes): Create an emitcontext for each part.
6887 (MethodCore.DoDefineParameters): Use container's emitcontext.
6888 Pass type array to InternalParameters.
6889 (MemberBase.DoDefine): Use container's emitcontext.
6890 (FieldMember.Define): Likewise.
6891 (Event.Define): Likewise.
6892 (SetMethod.GetParameterInfo): Change argument to EmitContext.
6893 Pass type array to InternalParameters.
6894 (SetIndexerMethod.GetParameterInfo): Likewise.
6895 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6896 * delegate.cs (Define): Pass emitcontext to
6897 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
6898 array to InternalParameters.
6899 * expression.cs (ParameterReference.DoResolveBase): Pass
6900 emitcontext to GetParameterInfo.
6901 (ComposedCast.DoResolveAsTypeStep): Remove check on
6902 ec.ResolvingTypeTree.
6903 * parameter.cs (Parameter.Resolve): Change argument to
6904 EmitContext. Use ResolveAsTypeTerminal.
6905 (Parameter.GetSignature): Change argument to EmitContext.
6906 (Parameters.ComputeSignature): Likewise.
6907 (Parameters.ComputeParameterTypes): Likewise.
6908 (Parameters.GetParameterInfo): Likewise.
6909 (Parameters.ComputeAndDefineParameterTypes): Likewise.
6910 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
6911 * support.cs (InternalParameters..ctor): Remove variant that takes
6913 * typemanager.cs (system_intptr_expr): New.
6914 (InitExpressionTypes): Initialize it.
6916 2004-10-12 Chris Toshok <toshok@ximian.com>
6918 * cs-parser.jay: fix location for try_statement and catch_clause.
6920 2004-10-18 Martin Baulig <martin@ximian.com>
6922 * class.cs (FieldMember.Define): Don't access the TypeExpr's
6923 `Type' directly, but call ResolveType() on it.
6924 (MemberBase.DoDefine): Likewise.
6926 * expression.cs (New.DoResolve): Don't access the TypeExpr's
6927 `Type' directly, but call ResolveType() on it.
6928 (ComposedCast.DoResolveAsTypeStep): Likewise.
6930 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6931 `Type' directly, but call ResolveType() on it.
6933 2004-10-17 John Luke <john.luke@gmail.com>
6935 * class.cs (Operator.GetSignatureForError): use CSharpName
6937 * parameter.cs (Parameter.GetSignatureForError): Returns
6938 correct name even if was not defined.
6940 2004-10-13 Raja R Harinath <rharinath@novell.com>
6943 * class.cs (TypeContainer.EmitContext): New property.
6944 (DefineNestedTypes): Create an emitcontext for each part.
6945 (MethodCore.DoDefineParameters): Use container's emitcontext.
6946 Pass type array to InternalParameters.
6947 (MemberBase.DoDefine): Use container's emitcontext.
6948 (FieldMember.Define): Likewise.
6949 (Event.Define): Likewise.
6950 (SetMethod.GetParameterInfo): Change argument to EmitContext.
6951 Pass type array to InternalParameters.
6952 (SetIndexerMethod.GetParameterInfo): Likewise.
6953 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6954 * delegate.cs (Define): Pass emitcontext to
6955 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
6956 array to InternalParameters.
6957 * expression.cs (ParameterReference.DoResolveBase): Pass
6958 emitcontext to GetParameterInfo.
6959 (ComposedCast.DoResolveAsTypeStep): Remove check on
6960 ec.ResolvingTypeTree.
6961 * parameter.cs (Parameter.Resolve): Change argument to
6962 EmitContext. Use ResolveAsTypeTerminal.
6963 (Parameter.GetSignature): Change argument to EmitContext.
6964 (Parameters.ComputeSignature): Likewise.
6965 (Parameters.ComputeParameterTypes): Likewise.
6966 (Parameters.GetParameterInfo): Likewise.
6967 (Parameters.ComputeAndDefineParameterTypes): Likewise.
6968 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
6969 * support.cs (InternalParameters..ctor): Remove variant that takes
6971 * typemanager.cs (system_intptr_expr): New.
6972 (InitExpressionTypes): Initialize it.
6974 2004-10-12 Chris Toshok <toshok@ximian.com>
6976 * cs-parser.jay: fix location for try_statement and catch_clause.
6978 2004-10-07 Raja R Harinath <rharinath@novell.com>
6980 More DeclSpace.ResolveType avoidance.
6981 * decl.cs (MemberCore.InUnsafe): New property.
6982 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
6983 with newly created EmitContext.
6984 (FieldMember.Define): Likewise.
6985 * delegate.cs (Delegate.Define): Likewise.
6986 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
6987 only if normal name-lookup fails.
6988 (TypeExpr.DoResolve): Enable error-checking.
6989 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
6990 (SizeOf.DoResolve): Likewise.
6991 (ComposedCast.DoResolveAsTypeStep): Likewise.
6992 (StackAlloc.DoResolve): Likewise.
6993 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
6994 (Block.Unsafe): New property.
6995 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
6996 (Unsafe): Set 'unsafe' flag of contained block.
6997 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
6998 (Fixed.Resolve): Likewise.
6999 (Catch.Resolve): Likewise.
7000 (Using.ResolveLocalVariableDecls): Likewise.
7001 (Foreach.Resolve): Likewise.
7003 2004-10-05 John Luke <john.luke@gmail.com>
7005 * cs-parser.jay: add location to error CS0175
7007 2004-10-04 Miguel de Icaza <miguel@ximian.com>
7009 * ecore.cs (Expression.Constantity): Add support for turning null
7012 * const.cs (Const.Define): Allow constants to be reference types
7013 as long as the value is Null.
7015 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
7017 * namespace.cs (NamespaceEntry.Using): No matter which warning
7018 level is set, check if this namespace name has already been added.
7020 2004-10-03 Ben Maurer <bmaurer@ximian.com>
7022 * expression.cs: reftype [!=]= null should always use br[true,false].
7025 2004-10-03 Marek Safar <marek.safar@seznam.cz>
7028 * attribute.cs: Enum conversion moved to
7029 GetAttributeArgumentExpression to be applied to the all
7032 2004-10-01 Raja R Harinath <rharinath@novell.com>
7034 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7035 * class.c (TypeContainer.DefineType): Flag error if
7036 base types aren't accessible due to access permissions.
7037 * decl.cs (DeclSpace.ResolveType): Move logic to
7038 Expression.ResolveAsTypeTerminal.
7039 (DeclSpace.ResolveTypeExpr): Thin layer over
7040 Expression.ResolveAsTypeTerminal.
7041 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7042 Refactor code into NestedAccess. Use it.
7043 (DeclSpace.NestedAccess): New.
7044 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7045 argument to silence errors. Check access permissions.
7046 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7047 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7048 (Cast.DoResolve): Likewise.
7049 (New.DoResolve): Likewise.
7050 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7051 (TypeOf.DoResolve): Likewise.
7053 * expression.cs (Invocation.BetterConversion): Return the Type of
7054 the better conversion. Implement section 14.4.2.3 more faithfully.
7055 (Invocation.BetterFunction): Make boolean. Make correspondence to
7056 section 14.4.2.2 explicit.
7057 (Invocation.OverloadResolve): Update.
7058 (Invocation): Remove is_base field.
7059 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
7060 (Invocation.Emit): Likewise.
7062 2004-09-24 Marek Safar <marek.safar@seznam.cz>
7064 * cs-parser.jay: Reverted 642 warning fix.
7066 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7069 * decl.cs (FindMemberWithSameName): Indexer can have more than
7072 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7074 * expression.cs (LocalVariableReference.DoResolveLValue):
7075 Do not report warning 219 for out values.
7076 (EmptyExpression.Null): New member to avoid extra allocations.
7078 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7080 * cs-parser.jay: Fix wrong warning 642 report.
7082 * cs-tokenizer.cs (CheckNextToken): New helper;
7083 Inspect next character if is same as expected.
7085 2004-09-23 Martin Baulig <martin@ximian.com>
7087 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7088 (Convert.ImplicitReferenceConversionExists): Likewise.
7090 2004-11-09 Raja R Harinath <rharinath@novell.com>
7092 * Makefile (DISTFILES): Comment out a few missing files.
7094 2004-10-29 Raja R Harinath <rharinath@novell.com>
7096 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7097 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
7098 (gmcs.exe): Invoke bootstrap-libs.
7099 (clean-local): Clean the net_2_0_bootstrap profile too.
7100 (PROGRAM_INSTALL_DIR): New.
7101 (install-local): Use it.
7103 2004-10-13 Martin Baulig <martin@ximian.com>
7105 * generic.cs (TypeManager.InflatedConstraints): New nested class.
7106 (TypeParameter.DefineType): If we're a method type parameter and
7107 that method is overriding something, "inflate" its constraints.
7109 2004-10-12 Martin Baulig <martin@ximian.com>
7111 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7112 and have type arguments, create and resolve a ConstructedType.
7114 2004-10-12 Martin Baulig <martin@ximian.com>
7116 * decl.cs (MemberCache.FindMemberToOverride): Use
7117 TypeManager.IsEqual() to compare the parameters and Type.Equals()
7118 to compare the invocationType.
7120 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7121 When comparing two type parameters, only do the signature-only
7122 comparision for method type parameters.
7124 2004-10-11 Martin Baulig <martin@ximian.com>
7126 * report.cs: Don't make --fatal abort on warnings, we have
7127 -warnaserror for that.
7129 2004-10-11 Martin Baulig <martin@ximian.com>
7132 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7133 (TypeManager.IsEqual): Call ourself recursively instead of using
7136 2004-10-11 Martin Baulig <martin@ximian.com>
7138 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7139 on our own type parameters, not on the ones we inherit from a containing
7142 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7145 * generic.cs (TypeParameter.Define): We may only be called once.
7147 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7148 instead of TypeManager.IsEqual().
7150 2004-09-28 Martin Baulig <martin@ximian.com>
7153 (GenericConstraints.EffectiveBaseClass): New public property.
7154 (TypeParameter.GenericConstraints): New public property.
7155 (ConstructedType.CheckConstraints): Improved.
7157 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7158 (Convert.TypeParameterConversion): New private method; use this in
7159 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7160 for all conversions related to type parameters.
7162 2004-09-24 Martin Baulig <martin@ximian.com>
7164 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7165 type parameter conversions for type parameters which are known to
7168 2004-09-24 Martin Baulig <martin@ximian.com>
7170 * generic.cs (GenericConstraints): Added `IsReferenceType' and
7171 `IsValueType' properties.
7173 * support.cs (ReflectionConstraints): Use
7174 Type.GetGenericParameterConstraints() instead of the old hack.
7176 2004-09-24 Martin Baulig <martin@ximian.com>
7178 * generic.cs (GenericConstraints): Moved here and made it an
7181 * support.cs (GenericConstraints): Moved to generic.cs.
7183 2004-09-24 Martin Baulig <martin@ximian.com>
7186 (ReflectionConstraints): Un-nested this class and made it public.
7189 (TypeManager.GetTypeParameterConstraints): New public method.
7190 (TypeManager.HasConstructorConstraint): Use the attributes.
7192 2004-09-24 Martin Baulig <martin@ximian.com>
7194 * support.cs (GenericConstraints): Replaced `HasConstructor',
7195 `IsReferenceType' and `IsValueType' with `Attributes'.
7196 (ReflectionParameters.ReflectionConstraints): Removed the Create()
7197 method and made the .ctor public.
7199 * generic.cs (Constraints.Attributes): New public property.
7200 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7201 `IsReferenceType' -> `HasReferenceTypeConstraint' and
7202 `IsValueType' -> `HasValueTypeConstraint'.
7204 2004-09-23 Martin Baulig <martin@ximian.com>
7206 * generic.cs (Constraints): Reflect latest runtime changes.
7208 2004-09-23 Martin Baulig <martin@ximian.com>
7210 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7211 (Convert.ImplicitReferenceConversionExists): Likewise.
7213 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7215 * class.cs (Operator.Define): Add error 448 and 559 report.
7217 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7219 * class.cs (MemberBase.IsTypePermitted): New protected
7220 method for checking error CS0610.
7222 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7224 * class.cs (TypeContainer.HasExplicitLayout): New property
7225 Returns whether container has StructLayout attribute set Explicit.
7226 (FieldMember): New abstract class for consts and fields.
7227 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7228 (Field): Reuse FieldMember.
7230 * const.cs (Const): Reuse FieldMember.
7232 * rootcontext.cs: EmitConstants call moved to class.
7234 2004-09-22 Martin Baulig <martin@ximian.com>
7236 Marek and me just fixed one of our oldest bugs: #28562 :-)
7238 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7240 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7241 we're an EnumConstant, just return that.
7242 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7243 an EnumConstant. In this case, we need to use GetValueAsEnumType()
7244 to get the value which'll actually be written into the attribute.
7245 However, we have to use GetValue() to access the attribute's value
7248 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7250 * constant.cs (Constant.IsNegative): New abstract property
7253 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7254 (StackAlloc.DoResolve): Reused IsNegative.
7256 2004-09-22 Martin Baulig <martin@ximian.com>
7258 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
7259 public method; like LookupTypeContainer, but also works for
7262 * report.cs (Report.SymbolRelatedToPreviousError): Use
7263 TypeManager.LookupGenericTypeContainer().
7265 2004-09-22 Martin Baulig <martin@ximian.com>
7267 Thanks to Peter Sestoft for this bug report.
7269 * expression.cs (Conditional): If both the `trueExpr' and the
7270 `falseExpr' is a NullLiteral, return a NullLiteral.
7272 2004-09-22 Martin Baulig <martin@ximian.com>
7274 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7275 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7276 for the "get_Current" call.
7278 2004-09-21 Martin Baulig <martin@ximian.com>
7280 * convert.cs (Convert.ImplicitReferenceConversion): When
7281 converting to an interface type, first check whether we're
7282 converting from a reference type.
7284 2004-09-14 Martin Baulig <martin@ximian.com>
7286 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7288 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7291 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7292 called and is obsolete then this member suppress message
7293 when call is inside next [Obsolete] method or type.
7295 * expression.cs: Use TestObsoleteMethodUsage member.
7297 2004-09-14 Martin Baulig <martin@ximian.com>
7299 * genericparser.cs: Removed.
7301 2004-09-13 Marek Safar <marek.safar@seznam.cz>
7303 * class.cs (MethodCore.CheckBase): Fix bug #65757.
7305 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7307 * attribute.cs (Attribute.Resolve): Add error 653 report.
7309 * class.cs (Class.ApplyAttributeBuilder): Add error 641
7311 (Method.ApplyAttributeBuilder): Add error 685 report.
7312 (Operator.Define): Add error 564 report.
7314 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7316 * expression.cs (Invocation.DoResolve): Add error
7319 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7322 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7324 * class.cs (ConstructorInitializer.Resolve):
7325 Wrong error number (515->516).
7327 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7329 * class.cs (Indexer.Define): Add error 631 report.
7331 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7333 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7335 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7337 * expression.cs (Probe.DoResolve): Add error CS0241 report.
7339 2004-09-10 Marek Safar <marek.safar@seznam.cz>
7341 * cs-parser.jay: Added error CS0241 report.
7343 2004-09-10 Raja R Harinath <rharinath@novell.com>
7345 * cs-parser.jay (fixed_statement): Introduce a scope for the
7346 declaration in the 'fixed' statement.
7348 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7350 * cs-parser.jay: Added CS0230 error report.
7352 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7354 * cs-parser.jay: Added errors CS0231 and CS0257 report.
7356 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7358 * expression.cs (Argument.Resolve): Added error CS0192 and
7361 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7363 C# 2.0 #pragma warning feature
7365 * cs-tokenizer.cs (PreProcessPragma): New method;
7366 Handles #pragma directive.
7368 * report.cs (WarningRegions): New class; Support
7369 class for #pragma warning directive. It tests whether
7370 warning is enabled for a given line.
7372 2004-09-08 Miguel de Icaza <miguel@ximian.com>
7374 * const.cs: Add more descriptive error report, tahnks to
7377 2004-09-08 Marek Safar <marek.safar@seznam.cz>
7379 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7381 2004-09-07 Miguel de Icaza <miguel@ximian.com>
7383 * expression.cs: Apply patch from Ben: Remove dead code from
7384 ArrayCreation, and remove the TurnintoConstant call in const.cs,
7385 as that code just threw an exception anwyays.
7387 * const.cs: Remove the call to the turnintoconstant, for details
7390 * literal.cs: The type of the null-literal is the null type; So
7391 we use a placeholder type (literal.cs:System.Null, defined here)
7394 * expression.cs (Conditional.DoResolve): Remove some old code that
7395 is no longer needed, conversions have been fixed.
7397 (ArrayCreationExpression.DoResolve): Return false if we fail to
7398 resolve the inner expression.
7400 2004-09-07 Raja R Harinath <rharinath@novell.com>
7403 * cs-parser.jay (delegate_declaration): Record a delegate
7404 declaration as a type declaration.
7405 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7407 2004-09-06 Miguel de Icaza <miguel@ximian.com>
7409 * parameter.cs: Do not crash if the type can not be resolved.
7411 * expression.cs: Report errors with unsafe pointers, fixes #64896
7413 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
7415 * expression.cs: Pointer arith always needs to do a conv.i
7416 if the operand is a long. fix 65320
7418 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7420 Fixed cs0619-37.cs, cs0619-38.cs
7422 * enum.cs (GetObsoleteAttribute): Removed.
7424 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7425 on Enum member is double staged. The first is tested member
7428 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7430 Fixed #56986, #63631, #65231
7432 * class.cs: (TypeContainer.AddToMemberContainer): New method,
7433 adds member to name container.
7434 (TypeContainer.AddToTypeContainer): New method, adds type to
7436 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7437 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7438 AddOperator): Simplified by reusing AddToMemberContainer.
7439 (TypeContainer.UserDefinedStaticConstructor): Changed to property
7441 (Method.CheckForDuplications): Fixed implementation to test all
7443 (MemberBase): Detection whether member is explicit interface
7444 implementation is now in constructor.
7445 (MemberBase.UpdateMemberName): Handles IndexerName.
7446 (Accessor): Changed to keep also location information.
7447 (AbstractPropertyEventMethod): Is derived from MemberCore.
7448 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7449 will be emited or not.
7450 (PropertyBase.AreAccessorsDuplicateImplementation):
7451 Tests whether accessors are not in collision with some method.
7452 (Operator): Is derived from MethodCore to simplify common
7455 * decl.cs (Flags.TestMethodDuplication): Test for duplication
7457 (DeclSpace.AddToContainer): Adds the member to defined_names
7458 table. It tests for duplications and enclosing name conflicts.
7460 * enum.cs (EnumMember): Clean up to reuse the base structures
7462 2004-09-03 Martin Baulig <martin@ximian.com>
7464 Merged latest changes into gmcs. Please keep this comment in
7465 here, it makes it easier for me to see what changed in MCS since
7466 the last time I merged.
7468 2004-09-03 Martin Baulig <martin@ximian.com>
7470 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7471 into TypeContainer, to make partial classes work again.
7473 2004-09-03 Martin Baulig <martin@ximian.com>
7475 * rootcontext.cs (RootContext.V2): Removed.
7477 2004-03-23 Martin Baulig <martin@ximian.com>
7479 * expression.cs (Invocation.OverloadResolve): Added `bool
7480 may_fail' argument and use it instead of the Location.IsNull() hack.
7482 2004-09-09 Martin Baulig <martin@ximian.com>
7484 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
7486 2004-09-09 Martin Baulig <martin@ximian.com>
7488 * generic.cs (TypeParameter.DefineType): Added support for
7489 explicit interface methods.
7491 2004-09-09 Martin Baulig <martin@ximian.com>
7493 * README.Changes: New document. Started to list important changes
7494 between MCS and GMCS here.
7496 2004-09-08 Martin Baulig <martin@ximian.com>
7499 (TypeContainer.CheckRecursiveDefinition): New protected method.
7500 (TypeContainer.DefineType): Move the CS0146 check into
7501 CheckRecursiveDefinition().
7503 2004-09-06 Martin Baulig <martin@ximian.com>
7505 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
7506 types for the constructor constraint.
7508 2004-09-03 Martin Baulig <martin@ximian.com>
7510 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7511 into TypeContainer, to make partial classes work again.
7513 2004-09-03 Martin Baulig <martin@ximian.com>
7515 * rootcontext.cs (RootContext.V2): Removed.
7517 2004-03-23 Martin Baulig <martin@ximian.com>
7519 * expression.cs (Invocation.OverloadResolve): Added `bool
7520 may_fail' argument and use it instead of the Location.IsNull() hack.
7522 2004-09-03 Martin Baulig <martin@ximian.com>
7524 Merged latest changes into gmcs. Please keep this comment in
7525 here, it makes it easier for me to see what changed in MCS since
7526 the last time I merged.
7528 2004-09-03 Raja R Harinath <rharinath@novell.com>
7531 * expression.cs (BetterConversion): Don't allow either conversion
7532 to be null. Remove redundant implicit conversion test when 'q ==
7533 null' -- when this function is invoked, we already know that the
7534 implicit conversion exists.
7535 (BetterFunction): Assume that 'best' is non-null. Remove
7536 redundant reimplementation of IsApplicable when 'best' is null.
7537 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7538 number of arguments.
7539 (IsAncestralType): Extract from OverloadResolve.
7540 (OverloadResolve): Make robust to the MethodGroupExpr being
7541 unsorted. Implement all the logic of Section 14.5.5.1, and
7542 support overloading of methods from multiple applicable types.
7543 Clean up logic somewhat. Don't pass null methods to BetterFunction.
7545 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7546 (RealError, Warning): Append type of report to related symbol.
7548 2004-09-03 Marek Safar <marek.safar@seznam.cz>
7550 * enum.cs: Fixed CLS-Compliance checks for enum members.
7551 Error tests cs3008-8.cs, cs3014-8.cs
7553 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7555 Fixed bug #62342, #63102
7556 * class.cs: ImplementIndexer uses member.IsExplicitImpl
7557 like ImplementMethod.
7559 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7561 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7564 2004-09-02 Martin Baulig <martin@ximian.com>
7566 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7567 TypeManager.GetArgumentTypes() rather than calling GetParameters()
7570 2004-09-01 Marek Safar <marek.safar@seznam.cz>
7572 C# 2.0 Static classes implemented
7574 * class.cs (TypeContainer): instance_constructors,
7575 initialized_fields, initialized_static_fields,
7576 default_constructor, base_inteface_types are protected to be
7577 accessible from StaticClass.
7578 (TypeContainer.DefineDefaultConstructor): New virtual method
7579 for custom default constructor generating
7580 (StaticClass): New class to handle "Static classes" feature.
7582 * cs-parser.jay: Handle static keyword on class like instance
7585 * driver.cs: Added "/langversion" command line switch with two
7586 options (iso-1, default).
7588 2004-08-31 Marek Safar <marek.safar@seznam.cz>
7590 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7592 2004-08-31 Miguel de Icaza <miguel@ximian.com>
7594 * delegate.cs: Style.
7596 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
7598 * delegate.cs: Add seperate instance expr field for miguel.
7600 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7602 * PointerArithmetic (Resolve): make sure we are not doing
7603 pointer arith on void*. Also, make sure we are resolved
7604 by not setting eclass until resolve.
7606 All callers: Make sure that PointerArithmetic gets resolved.
7608 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7610 * ArrayCreation (LookupType): If the type does not resolve
7611 to an array, give an error.
7613 2004-08-27 Marek Safar <marek.safar@seznam.cz>
7615 * statement.cs (Try.Resolve): Fixed bug #64222
7617 2004-08-27 Martin Baulig <martin@ximian.com>
7620 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7623 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7625 * ecore.cs (Constantify): Get underlying type via
7626 System.Enum.GetUnderlyingType to avoid StackOverflow on the
7627 Windows in special cases.
7629 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7631 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7632 for obtaining also private methods.
7633 (GetRemoveMethod): Used GetRemoveMethod (true)
7634 for obtaining also private methods.
7636 2004-09-02 Martin Baulig <martin@ximian.com>
7638 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7639 TypeManager.GetArgumentTypes() rather than calling GetParameters()
7642 2004-08-27 Martin Baulig <martin@ximian.com>
7645 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7648 2004-08-25 Martin Baulig <martin@ximian.com>
7650 * support.cs (ReflectionParameters..ctor): If this is a generic
7651 method, retrieve and store its type parameters.
7652 (InternalParameters..ctor): Added `TypeParameter[]' argument.
7653 (ReflectionParameters.GenericConstraints): The argument specifies
7654 the type parameter, not the method parameter.
7655 (InternalParameters.GenericConstraints): Likewise.
7657 * generic.cs (TypeParameter.DefineType): Correctly handle
7658 constraints wrt. generic methods in interfaces and their
7661 2004-08-24 Martin Baulig <martin@ximian.com>
7663 * generic.cs (TypeParameter.IsSubclassOf): New public method.
7664 (Constraints.IsSubclassOf): New internal method.
7666 * typemanager.cs (TypeManager.FindMembers): Added special support
7667 for GenericTypeParameterBuilder's.
7668 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
7671 2004-08-24 Martin Baulig <martin@ximian.com>
7674 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7675 this for accessibility checks.
7676 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7677 IsNestedFamilyAccessible.
7678 (TypeManager.IsSubclassOf): New method, do what the name actually
7681 2004-08-24 Martin Baulig <martin@ximian.com>
7683 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
7684 as a SimpleName, include the generic arity.
7686 2004-08-24 Martin Baulig <martin@ximian.com>
7688 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7689 MethodAttributes.HideBySig for operators.
7691 2004-08-23 Martin Baulig <martin@ximian.com>
7693 Back to the old error reporting system :-)
7695 * report.cs (Message): Removed.
7696 (Report.MessageData, ErrorData, WarningData): Removed.
7697 (Report.Error, Warning): Back to the old system.
7699 2004-08-23 Martin Baulig <martin@ximian.com>
7701 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7703 * class.cs (TypeContainer.ParentContainer): New public virtual
7704 method; replaces the explicit interface implementation.
7705 (ClassPart.ParentContainer): Override.
7707 2004-08-23 Martin Baulig <martin@ximian.com>
7709 * statement.cs (Switch): Added support for constant switches; see
7710 #59428 or test-285.cs.
7712 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7715 * statement.cs (GetEnumeratorFilter): Removed useless
7716 logic because C# specs is strict. GetEnumerator must be
7719 2004-08-22 Martin Baulig <martin@ximian.com>
7721 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7722 a switch and may break, reset the barrier. Fixes #59867.
7724 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7726 CLS-Compliance speed up (~5% for corlib)
7728 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7729 New method. Tests container for CLS-Compliant names
7731 * class.cs (TypeContainer.VerifyClsName): New method.
7732 Checks whether container name is CLS Compliant.
7733 (Constructor): Implements IMethodData.
7735 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7736 low-case table for CLS Compliance test.
7737 (MemberCache.VerifyClsParameterConflict): New method.
7738 Checks method parameters for CS3006 error.
7740 * enum.cs (EnumMember): Is derived from MemberCore.
7741 (Enum.VerifyClsName): Optimized for better performance.
7743 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7745 * report.cs: Renamed Error_T to Error and changed all
7748 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7750 * class.cs (TypeContainer.IndexerArrayList): New inner class
7751 container for indexers.
7752 (TypeContainer.DefaultIndexerName): New constant for default
7753 indexer name. Replaced all "Item" with this constant.
7754 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7756 * typemanager.cs (TypeManager.default_member_ctor): Cache here
7757 DefaultMemberAttribute constructor.
7759 2004-08-05 Martin Baulig <martin@ximian.com>
7761 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7764 2004-08-05 Marek Safar <marek.safar@seznam.cz>
7766 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7767 multi platforms problem.
7769 * compiler.csproj: Included shared files.
7771 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7773 Fix bug 60333, 55971 in the more general way
7774 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7775 Added arg_type argument for constant conversion.
7776 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7778 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7781 * class.cs (TypeContainer ): New inner classes MethodArrayList,
7782 OperatorArrayList, MethodCoreArrayList for typecontainer
7783 containers. Changed class member types to these new types.
7784 (MethodArrayList.DefineMembers): Added test for CS0659.
7786 2004-08-04 Miguel de Icaza <miguel@ximian.com>
7788 * cfold.cs: Synchronize the folding with the code in expression.cs
7789 Binary.DoNumericPromotions for uint operands.
7791 * attribute.cs: Revert patch from Raja, it introduced a regression
7792 while building Blam-1.2.1 (hard to isolate a test case).
7794 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7798 (TypeContainer.Define): Renamed to DefineContainerMembers because of
7800 (MethodCore.parent_method): New member. The method we're overriding
7801 if this is an override method.
7802 (MethodCore.CheckBase): Moved from Method class and made common.
7803 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7805 (MethodCore.CheckForDuplications): New abstract method. For custom
7806 member duplication search in a container
7807 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7808 method and its return type.
7809 (Event.conflict_symbol): New member. Symbol with same name in the
7813 (MemberCache.FindMemberWithSameName): New method. The method
7814 is looking for conflict with inherited symbols.
7816 2004-08-04 Martin Baulig <martin@ximian.com>
7818 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7820 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7822 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7824 * report.cs (Message): New enum for better error, warning reference in
7826 (MessageData): New inner abstract class. It generally handles printing of
7827 error and warning messages.
7828 Removed unused Error, Warning, Message methods.
7830 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7832 Fix for cs0592-8.cs test
7834 (Attributable.ValidAttributeTargets): Made public.
7835 (Attribute.ExplicitTarget): New member for explicit target value.
7836 (Attribute.CheckTargets): Now we translate explicit attribute
7837 target to Target here.
7839 2004-08-03 Ben Maurer <bmaurer@ximian.com>
7841 * ecore.cs (MethodGroupExpr): new IsBase property.
7843 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7845 * delegate.cs (DelegateCreation): store a MethodGroupExpr
7846 rather than an instance expr.
7848 (DelegateCreation.Emit): Use the method group rather than
7849 the instance expression. Also, if you have base.Foo as the
7850 method for a delegate, make sure to emit ldftn, not ldftnvirt.
7852 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
7854 (NewDelegate.DoResolve): Only check for the existance of Invoke
7855 if the method is going to be needed. Use MethodGroupExpr.
7857 (NewDelegate.Emit): Remove, DelegateCreation implements this.
7859 * expression.cs: For pointer arith., make sure to use
7860 the size of the type, not the size of the pointer to
7863 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7866 * class.cs (Class): Added error CS0502 test.
7868 2004-08-03 John Luke <jluke@cfl.rr.com>
7869 Raja R Harinath <rharinath@novell.com>
7872 * attribute.cs (Attribute.complained_before): New flag.
7873 (Attribute.ResolveType, Attribute.Resolve),
7874 (Attribute.DefinePInvokeMethod): Set it.
7875 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7877 2004-08-03 Martin Baulig <martin@ximian.com>
7879 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7880 use a user-defined operator; we still need to do numeric
7881 promotions in case one argument is a builtin type and the other
7882 one has an implicit conversion to that type. Fixes #62322.
7884 2004-08-18 Martin Baulig <martin@ximian.com>
7886 * class.cs (Method.Define): Use the correct method name when
7887 creating the MethodBuilder for a generic method.
7889 2004-08-17 Martin Baulig <martin@ximian.com>
7891 * generic.cs (Constraints): Support type parameter constraints.
7893 2004-08-16 Martin Baulig <martin@ximian.com>
7895 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
7896 (Token.GENERIC_DIMENSION): New token; this is returned if we
7897 encounter an unbound generic type in a typeof() expression.
7899 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
7900 this token is only generated while parsing a typeof() expression.
7901 (typeof_expression): Removed the old unbound_type hack.
7903 * generic.cs (TypeArguments.IsUnbound): New public property.
7905 * decl.cs (MemberName): Added support for unbound types.
7907 2004-08-14 Martin Baulig <martin@ximian.com>
7910 (TypeManager.IsEqualGenericInstance): New static method.
7911 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
7912 just used to check accessibility, so follow the rules of 26.1.6.
7914 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
7915 ConstructedType instead of a TypeExpression if we have type arguments.
7917 * cs-parser.jay (typeof_expression): Support unbound generic types.
7919 * ecore.cs (UnboundTypeExpression): New public class.
7921 2004-08-12 Martin Baulig <martin@ximian.com>
7923 * typemanager.cs (TypeManager.IsNestedChildOf): Use
7924 TypeManager.IsEqual() rather than `=='.
7926 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
7927 generic instances as well.
7929 2004-08-12 Martin Baulig <martin@ximian.com>
7931 * expression.cs (Invocation.InferType): We can only infer method
7932 type parameters. Fixes #62647.
7934 2004-08-11 Martin Baulig <martin@ximian.com>
7936 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
7937 before resolving the base classes.
7939 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7941 * Makefile: install .mdb file too.
7943 2004-08-05 Martin Baulig <martin@ximian.com>
7945 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
7946 initializer, the current type is just the TypeBuilder, not the
7947 instantiated generic type.
7948 (FieldExpr.IsFieldInitializer): New public property.
7950 2004-08-04 Martin Baulig <martin@ximian.com>
7952 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7954 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7956 2004-08-03 Martin Baulig <martin@ximian.com>
7958 * class.cs (MethodData.Define): If we're an explicit
7959 implementation, remove the generic arity from the type name.
7961 2004-08-03 Martin Baulig <martin@ximian.com>
7963 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7964 use a user-defined operator; we still need to do numeric
7965 promotions in case one argument is a builtin type and the other
7966 one has an implicit conversion to that type. Fixes #62322.
7968 2004-08-02 Martin Baulig <martin@ximian.com>
7970 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
7972 (TypeContainer.GetClassBases): Return the unexpanded list of
7973 interfaces; we expand them later.
7974 (TypeContainer.DefineType): After creating the TypeBuilder, call
7975 TypeManager.ExpandInterfaces() to get an expanded and resolved
7978 * ecore.cs (TypeExpr.GetInterfaces): Removed
7980 * generics.cs (Constraints.InterfaceConstraints): Remove.
7981 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
7982 register the interface constraints.
7985 (TypeManager.AddUserType): Removed the `ifaces' argument.
7986 (TypeManager.AddTypeParameter): Likewise.
7987 (TypeManager.AddUserInterface): Removed, was unused.
7988 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
7989 `TypeExpr[]' array for the interfaces.
7990 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
7991 has been defined, returns a list of the resolved interfaces types.
7992 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
7993 (TypeManager.GetExplicitInterfaces): Likewise.
7995 2004-08-02 Martin Baulig <martin@ximian.com>
7997 * expression.cs (Invocation.EmitCall): If we're invoking a method
7998 on a type parameter, use the new `Constrained' prefix opcode.
8000 2004-08-02 Martin Baulig <martin@ximian.com>
8002 * statement.cs (LocalInfo.Flags): Added `IsThis'.
8003 (LocalInfo.IsThis): New public property.
8004 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8006 2004-08-01 Martin Baulig <martin@ximian.com>
8008 * class.cs (TypeContainer.GetClassBases): Don't set the default
8009 here since we may get called from GetPartialBases().
8010 (TypeContainer.DefineType): If GetClassBases() didn't return a
8011 parent, use the default one.
8013 2004-07-30 Martin Baulig <martin@ximian.com>
8015 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8017 * class.cs (SourceMethod): New public class, derive from the
8018 symbol writer's ISourceMethod.
8019 (Method): Use the new symbol writer API.
8021 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8022 as argument and use the new symbol writer.
8025 (SourceFile): Implement the symbol writer's ISourceFile.
8026 (Location.SymbolDocument): Removed.
8027 (Location.SourceFile): New public property.
8029 * symbolwriter.cs: Use the new symbol writer API.
8031 2004-07-30 Raja R Harinath <rharinath@novell.com>
8033 * Makefile (install-local): Remove. Functionality moved to
8036 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
8038 * Makefile: Install mcs.exe.config file together with mcs.exe.
8039 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8040 correct runtime version.
8042 2004-07-25 Martin Baulig <martin@ximian.com>
8045 (TypeContainer.RegisterOrder): Removed, this was unused.
8046 (TypeContainer, interface_order): Removed.
8047 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8048 TypeContainer as argument since we can also be called with a
8049 `PartialContainer' for a partial class/struct/interface.
8050 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8051 of checking whether we're an `Interface' - we could be a
8053 (PartialContainer.Register): Override; call
8054 AddClass()/AddStruct()/AddInterface() on our parent.
8056 * cs-parser.jay (interface_member_declaration): Add things to the
8057 `current_container', not the `current_class'.
8059 * rootcontext.cs (RegisterOrder): The overloaded version which
8060 takes an `Interface' was unused, removed.
8062 * typemanager.cs (TypeManager.LookupInterface): Return a
8063 `TypeContainer', not an `Interface'.
8064 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8065 contain a `PartialContainer' for an interface, so check it's
8066 `Kind' to figure out what it is.
8068 2004-07-25 Martin Baulig <martin@ximian.com>
8070 * class.cs (Class.DefaultTypeAttributes): New public constant.
8071 (Struct.DefaultTypeAttributes): Likewise.
8072 (Interface.DefaultTypeAttributes): Likewise.
8073 (PartialContainer.TypeAttr): Override this and add the
8074 DefaultTypeAttributes.
8076 2004-07-25 Martin Baulig <martin@ximian.com>
8078 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8079 we can just use the `Parent' field instead.
8081 2004-07-25 Martin Baulig <martin@ximian.com>
8083 * class.cs (TypeContainer.Emit): Renamed to EmitType().
8085 2004-07-25 Martin Baulig <martin@ximian.com>
8087 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8088 our parts before defining any methods.
8089 (TypeContainer.VerifyImplements): Make this virtual.
8090 (ClassPart.VerifyImplements): Override and call VerifyImplements()
8091 on our PartialContainer.
8093 2004-07-25 Martin Baulig <martin@ximian.com>
8095 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8097 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8098 argument, we can just use the `Parent' field instead.
8101 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
8102 (MemberBase.DoDefine): Likewise.
8104 2004-07-24 Martin Baulig <martin@ximian.com>
8106 * decl.cs (MemberCore.Parent): New public field.
8107 (DeclSpace.Parent): Moved to MemberCore.
8109 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8110 (MemberBase.ctor): Added TypeContainer argument, pass it to our
8112 (FieldBase, Field, Operator): Likewise.
8113 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8114 (EventField, Event): Likewise.
8116 2004-07-23 Martin Baulig <martin@ximian.com>
8118 * class.cs (PartialContainer): New public class.
8119 (ClassPart): New public class.
8120 (TypeContainer): Added support for partial classes.
8121 (TypeContainer.GetClassBases): Splitted some of the functionality
8122 out into GetNormalBases() and GetPartialBases().
8124 * cs-tokenizer.cs (Token.PARTIAL): New token.
8125 (Tokenizer.consume_identifier): Added some hacks to recognize
8126 `partial', but only if it's immediately followed by `class',
8127 `struct' or `interface'.
8129 * cs-parser.jay: Added support for partial clases.
8131 2004-07-23 Martin Baulig <martin@ximian.com>
8133 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8134 a `DeclSpace' and also made it readonly.
8135 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8136 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8137 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8139 * cs-parser.jay: Pass the `current_class', not the
8140 `current_container' (at the moment, this is still the same thing)
8141 to a new Method, Property, Event, Indexer or Constructor.
8143 2004-07-23 Martin Baulig <martin@ximian.com>
8145 * cs-parser.jay (CSharpParser): Added a new `current_class' field
8146 and removed the `current_interface' one.
8147 (struct_declaration, class_declaration, interface_declaration):
8148 Set `current_class' to the newly created class/struct/interface;
8149 set their `Bases' and call Register() before parsing their body.
8151 2004-07-23 Martin Baulig <martin@ximian.com>
8153 * class.cs (Kind): New public enum.
8154 (TypeContainer): Made this class abstract.
8155 (TypeContainer.Kind): New public readonly field.
8156 (TypeContainer.CheckDef): New public method; moved here from
8158 (TypeContainer.Register): New public abstract method.
8159 (TypeContainer.GetPendingImplementations): New public abstract
8161 (TypeContainer.GetClassBases): Removed the `is_class' and
8162 `is_iface' parameters.
8163 (TypeContainer.DefineNestedTypes): Formerly known as
8165 (ClassOrStruct): Made this class abstract.
8167 * tree.cs (RootTypes): New public type.
8169 2004-07-20 Martin Baulig <martin@ximian.com>
8171 * tree.cs (Tree.RecordNamespace): Removed.
8172 (Tree.Namespaces): Removed.
8174 * rootcontext.cs (RootContext.IsNamespace): Removed.
8176 * cs-parser.jay (namespace_declaration): Just create a new
8177 NamespaceEntry here.
8179 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
8181 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8182 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8183 entry to make sure it runs in the correct runtime version.
8185 2004-07-18 Martin Baulig <martin@ximian.com>
8187 * generic.cs (ConstructedType.CheckConstraints): Improved
8188 constraints checking.
8190 2004-07-18 Martin Baulig <martin@ximian.com>
8192 * expression.cs (Invocation.BetterMethod): Call
8193 TypeManager.TypeToCoreType() on all types and removed my previous
8194 hack; we're already doig the right thing here.
8196 2004-07-17 Martin Baulig <martin@ximian.com>
8198 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8200 2004-07-16 Martin Baulig <martin@ximian.com>
8202 * iterators.cs: Added generics support.
8204 2004-07-16 Martin Baulig <martin@ximian.com>
8206 * iterators.cs: Rewrote this. We're now using one single Proxy
8207 class for both the IEnumerable and the IEnumerator interface and
8208 `Iterator' derives from Class so we can use the high-level API.
8210 * class.cs (TypeContainer.AddIterator): New method.
8211 (TypeContainer.DoDefineType): New protected virtual method, which
8212 is called from DefineType().
8213 (TypeContainer.DoDefineMembers): Call DefineType() and
8214 DefineMembers() on all our iterators.
8215 (TypeContainer.Emit): Call Emit() on all our iterators.
8216 (TypeContainer.CloseType): Call CloseType() on all our iterators.
8218 * codegen.cs (EmitContext.CurrentIterator): New public field.
8220 2004-07-15 Martin Baulig <martin@ximian.com>
8223 (TypeManager.not_supported_exception_type): New type.
8225 2004-07-14 Martin Baulig <martin@ximian.com>
8228 (TypeManager.generic_ienumerable_type): New type.
8229 (TypeManager.generic_ienumerator_type): New type.
8232 (RootContext.interfaces_first_stage): Added
8233 "System.Collections.Generic.IEnumerator`1" and
8234 "System.Collections.Generic.IEnumerable`1".
8236 2004-07-14 Martin Baulig <martin@ximian.com>
8238 * iterators.cs: Use real error numbers.
8240 2004-07-14 Martin Baulig <martin@ximian.com>
8242 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8243 requires this to be a System.Collection.IEnumerable and not a
8244 class implementing that interface.
8245 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
8247 2004-07-13 Marek Safar <marek.safar@seznam.cz>
8249 * class.cs: Fixed previous fix, it broke some error tests.
8251 2004-07-12 Martin Baulig <martin@ximian.com>
8253 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8256 2004-07-14 Martin Baulig <martin@ximian.com>
8258 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
8259 an exclamation mark (!) for the generic arity to reflect the
8260 latest spec changes; ie. use "System.Collections.Generic.IList`1".
8262 2004-07-13 Martin Baulig <martin@ximian.com>
8264 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
8265 specifiers being part of a type argument.
8267 2004-07-13 Martin Baulig <martin@ximian.com>
8269 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
8270 name for generic types.
8272 2004-07-13 Martin Baulig <martin@ximian.com>
8274 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
8277 2004-07-09 Miguel de Icaza <miguel@ximian.com>
8279 * assign.cs (LocalTemporary): Add new argument: is_address,If
8280 `is_address' is true, then the value that we store is the address
8281 to the real value, and not the value itself.
8283 * ecore.cs (PropertyExpr): use the new local temporary
8284 stuff to allow us to handle X.Y += z (where X is a struct)
8286 2004-07-08 Martin Baulig <martin@ximian.com>
8288 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8289 not always return, just like we're doing in Using.Resolve().
8291 2004-07-07 Miguel de Icaza <miguel@ximian.com>
8293 * cs-parser.jay (fixed_statement): flag this as Pinned.
8295 2004-07-06 Miguel de Icaza <miguel@ximian.com>
8297 * typemanager.cs (TypeManager): Removed MakePinned method, this
8298 mechanism is replaced with the .NET 2.x compatible mechanism of
8299 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8301 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
8302 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8303 `IsFixed' property which has a different meaning.
8305 2004-07-02 Raja R Harinath <rharinath@novell.com>
8307 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8308 visible from inside a nested class, not just the names of the
8309 immediately enclosing class.
8312 2004-06-24 Raja R Harinath <rharinath@novell.com>
8314 * expression.cs (BetterConversion): Remove buggy special-case
8315 handling of "implicit constant expression conversions". At this
8316 point, we already know that the conversion is possible -- we're
8317 only checking to see which is better.
8319 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8321 * cs-parser.jay: Added error CS0210 test.
8323 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8325 * cs-parser.jay: Added error CS0134 test.
8327 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8330 * cs-parser.jay: Added error CS0145 test.
8332 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8334 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8336 2004-06-23 Ben Maurer <bmaurer@ximian.com>
8338 * expression.cs (StackAlloc.Resolve): The argument may not
8339 be a constant; deal with this case.
8341 2004-06-23 Marek Safar <marek.safar@seznam.cz>
8343 * attribute.cs (IndexerName_GetIndexerName): Renamed to
8344 GetIndexerAttributeValue.
8345 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8347 * class.cs (Indexer.Define): Added error tests for CS0415,
8350 2004-06-23 Miguel de Icaza <miguel@ximian.com>
8352 * attribute.cs (Attribute.Resolve): Keep field code in sync with
8355 2004-06-23 Martin Baulig <martin@ximian.com>
8357 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8358 neither return nor throw, reset the barrier as well. Fixes #60457.
8360 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
8362 * class.cs : EventAttributes is now set to None by default.
8363 This fixes bug #60459.
8365 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8368 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8369 Don't throw exception but return null (it's sufficient now).
8371 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8373 * typemanager.cs (GetArgumentTypes): Faster implementation.
8375 2004-06-18 Martin Baulig <martin@ximian.com>
8377 * attribute.cs (Attribute.Resolve): Check whether we're an
8378 EmptyCast which a Constant child. Fixes #60333.
8380 2004-06-17 Ben Maurer <bmaurer@ximian.com>
8382 * statement.cs (EmitCollectionForeach): Account for the fact that
8383 not all valuetypes are in areas which we can take the address of.
8384 For these variables, we store to a temporary variable. Also, make
8385 sure that we dont emit a `callvirt' on a valuetype method.
8387 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8389 * expression.cs (StackAlloc.DoReSolve): Added test for
8390 negative parameter (CS0247).
8392 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8395 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8397 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8400 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8403 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8405 Fix bug #58254 & cs1555.cs, cs1556.cs
8406 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8408 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8410 * cs-parser.jay: Added error CS1669 test for indexers.
8412 2004-06-18 Martin Baulig <martin@ximian.com>
8414 * generics.cs (GenericMethod.ctor): Don't take an Attributes
8415 argument. Fixes #60441.
8417 2004-06-16 Ben Maurer <bmaurer@ximian.com>
8418 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
8419 The name needs to have the actual name of the method in order
8420 for other tests (such as the one in OverloadResolve for Invoke
8421 on a delegate) to work. As well, it does not really help
8422 error reporting because the method group had multiple methods.
8423 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
8424 Make profiling work.
8426 2004-06-13 Martin Baulig <martin@ximian.com>
8428 * cs-parser.jay: Don't allow generic attributes.
8430 2004-06-13 Martin Baulig <martin@ximian.com>
8432 * class.cs (MemberBase.DoDefineBase): New protected method.
8433 (MemberBase.DoDefine): Compute the `flags' in the new
8434 DoDefineBase() which must be called first.
8435 (Method.Define): Call DoDefineBase() first so we have the flags
8436 when defining the generic method.
8438 * cs-parser.jay (interface_method_declaration): Support generic methods.
8440 2004-06-13 Martin Baulig <martin@ximian.com>
8442 * decl.cs (TypeName): Removed.
8443 (MemberName): Removed TypeName and MemberNow; now we just have
8446 * cs-parser.jay: Don't distinguish between type arguments and type
8447 parameters in the grammar and simplified the rules a bit. The
8448 reduce/reduce conflicts are now gone (except the one we inherited
8451 2004-06-11 Martin Baulig <martin@ximian.com>
8453 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8454 call this twice: for params and varargs methods.
8456 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8459 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8461 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8463 * attribute.cs (Attribute.GetValidTargets): Made public.
8466 (AbstractPropertyEventMethod): New class for better code sharing.
8467 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8469 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8471 2004-06-09 Martin Baulig <martin@ximian.com>
8473 * cs-parser.jay: Removed a reduce/reduce conflict.
8475 2004-06-03 Martin Baulig <martin@ximian.com>
8477 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
8478 GetSimpleName() and return a SimpleName.
8480 * ecore.cs (SimpleName.Arguments): New public field.
8481 (SimpleName): Added overloaded ctor which takes an additional
8482 TypeArguments argument.
8483 (SimpleName.SimpleNameResolve): Added support for generic methods.
8484 (MethodGroupExpr.ResolveGeneric): New public method. The code was
8485 formerly in MemberAccess.DoResolve(), but we also need it in
8486 SimpleNameResolve().
8488 * expression.cs (MemberAccess.DoResolve): Use the new
8489 MethodGroupExpr.ResolveGeneric().
8491 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8493 * decl.cs: If possible, use lookuptypedirect here. We can only do
8494 this if there is no `.' after the namespace. Avoids using
8495 LookupType, which does lots of slow processing.
8496 (FindNestedType) New method, does what it says :-).
8497 * namespace.cs: use LookupTypeDirect.
8498 * rootcontext.cs: use membercache, if possible.
8499 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8501 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8504 According to the spec,
8506 In a member access of the form E.I, if E is a single identifier,
8507 and if the meaning of E as a simple-name (§7.5.2) is a constant,
8508 field, property, localvariable, or parameter with the same type as
8509 the meaning of E as a type-name (§3.8), then both possible
8510 meanings of E are permitted.
8512 We did not check that E as a simple-name had the same type as E as
8515 This trivial check gives us 5-7% on bootstrap time.
8517 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8519 * expression.cs (Invocation.OverloadResolve): Avoid the
8520 use of hashtables and boxing here by allocating on demand.
8522 2004-05-30 Martin Baulig <martin@ximian.com>
8524 * rootcontext.cs (RootContext.LookupType): Don't cache things if
8525 we're doing a silent lookup. Don't try to lookup nested types in
8526 TypeManager.object_type (thanks to Ben Maurer).
8528 2004-05-30 Martin Baulig <martin@ximian.com>
8530 Committing a patch from Ben Maurer.
8532 * rootcontext.cs (RootContext.LookupType): Cache negative results.
8534 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8536 * convert.cs: add a trivial cache for overload operator resolution.
8538 2004-05-31 Marek Safar <marek.safar@seznam.cz>
8541 (AttributeTester.GetObsoleteAttribute): Returns instance of
8542 ObsoleteAttribute when type is obsolete.
8545 (TypeContainer.VerifyObsoleteAttribute): Override.
8546 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8547 (MethodCode.VerifyObsoleteAttribute): Override.
8548 (MemberBase.VerifyObsoleteAttribute): Override.
8551 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8552 and report proper error.
8555 (Delegate.VerifyObsoleteAttribute): Override.
8558 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8559 and report proper error.
8560 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8563 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8567 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8568 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8569 Added test for ObsoleteAttribute.
8572 (Catch): Derived from Statement.
8574 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8576 * decl.cs: If possible, use lookuptypedirect here. We can only do
8577 this if there is no `.' after the namespace. Avoids using
8578 LookupType, which does lots of slow processing.
8579 (FindNestedType) New method, does what it says :-).
8580 * namespace.cs: use LookupTypeDirect.
8581 * rootcontext.cs: use membercache, if possible.
8582 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8584 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8587 According to the spec,
8589 In a member access of the form E.I, if E is a single identifier,
8590 and if the meaning of E as a simple-name (§7.5.2) is a constant,
8591 field, property, localvariable, or parameter with the same type as
8592 the meaning of E as a type-name (§3.8), then both possible
8593 meanings of E are permitted.
8595 We did not check that E as a simple-name had the same type as E as
8598 This trivial check gives us 5-7% on bootstrap time.
8600 2004-05-30 Marek Safar <marek.safar@seznam.cz>
8602 Fixed bug #59071 & cs0160.cs
8603 * statement.cs (Try.Resolve): Check here whether order of catch
8604 clauses matches their dependencies.
8606 2004-05-30 Marek Safar <marek.safar@seznam.cz>
8609 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
8612 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8614 * expression.cs (Invocation.OverloadResolve): Avoid the
8615 use of hashtables and boxing here by allocating on demand.
8617 2004-05-30 Martin Baulig <martin@ximian.com>
8619 * rootcontext.cs (RootContext.LookupType): Don't cache things if
8620 we're doing a silent lookup. Don't try to lookup nested types in
8621 TypeManager.object_type (thanks to Ben Maurer).
8623 2004-05-30 Martin Baulig <martin@ximian.com>
8625 Committing a patch from Ben Maurer.
8627 * rootcontext.cs (RootContext.LookupType): Cache negative results.
8629 2004-05-29 Martin Baulig <martin@ximian.com>
8631 * class.cs (IMethodData.ShouldIgnore): New method.
8633 * typemanager.cs (TypeManager.MethodFlags): Don't take a
8634 `Location' argument, we don't need it anywhere. Use
8635 `IMethodData.ShouldIgnore ()' instead of
8636 `MethodData.GetMethodFlags ()'.
8637 (TypeManager.AddMethod): Removed.
8638 (TypeManager.AddMethod2): Renamed to AddMethod.
8640 2004-05-29 Martin Baulig <martin@ximian.com>
8642 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8644 * convert.cs (Convert.ImplicitReferenceConversion): If we're
8645 converting from a class type S to an interface type and we already
8646 have an object on the stack, don't box it again. Fixes #52578.
8648 2004-05-29 Martin Baulig <martin@ximian.com>
8650 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8651 Added support for `params' parameters. Fixes #59267.
8653 2004-05-29 Martin Baulig <martin@ximian.com>
8655 * literal.cs (NullPointer): Provide a private .ctor which sets
8656 `type' to TypeManager.object_type. Fixes #59048.
8658 2004-05-29 Martin Baulig <martin@ximian.com>
8660 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8661 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
8663 * ecore.cs (EventExpr.instance_expr): Make the field private.
8665 2004-05-26 Marek Safar <marek.safar@seznam.cz>
8667 Fixed bug #50080 & cs0214-2.cs
8668 * expression.cs (Cast.DoResolve): Check unsafe context here.
8670 * statement.cs (Resolve.DoResolve): Likewise.
8672 2004-05-26 Martin Baulig <martin@ximian.com>
8674 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8676 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8677 (RootContext.LookupType): Pass down the `silent' flag.
8679 2004-05-25 Martin Baulig <martin@ximian.com>
8682 (MethodGroupExpr.IdenticalTypeName): New public property.
8683 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8684 expression actually refers to a type.
8686 2004-05-25 Martin Baulig <martin@ximian.com>
8688 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8689 for #56176 and made it actually work.
8691 2004-05-25 Martin Baulig <martin@ximian.com>
8693 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8694 (FieldExpr, PropertyExpr): Override and implement
8695 CacheTemporaries. Fixes #52279.
8697 2004-05-25 Miguel de Icaza <miguel@ximian.com>
8699 * location.cs: In the new compiler listing a file twice is a
8700 warning, not an error.
8702 2004-05-24 Martin Baulig <martin@ximian.com>
8704 * enum.cs (Enum.DefineType): For the `BaseType' to be a
8705 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
8707 2004-05-24 Martin Baulig <martin@ximian.com>
8709 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8710 walking the `using' list. Fixes #53921.
8712 2004-05-24 Martin Baulig <martin@ximian.com>
8714 * const.cs (Const.LookupConstantValue): Added support for
8715 EmptyCast's; fixes #55251.
8717 2004-05-24 Martin Baulig <martin@ximian.com>
8719 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8720 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8721 which does the CS0135 check. The reason is that we first need to
8722 check whether the variable actually exists.
8724 2004-05-24 Martin Baulig <martin@ximian.com>
8726 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8727 than RootContext.LookupType() to find the explicit interface
8730 2004-05-24 Raja R Harinath <rharinath@novell.com>
8732 * Makefile: Simplify. Use executable.make.
8733 * mcs.exe.sources: New file. List of sources of mcs.exe.
8735 2004-05-24 Anders Carlsson <andersca@gnome.org>
8739 Use the invariant culture when doing String.Compare for CLS case
8742 2004-05-23 Martin Baulig <martin@ximian.com>
8744 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8745 don't have any dots. Fixes #52622, added cs0246-8.cs.
8747 * namespace.cs (NamespaceEntry.Lookup): Likewise.
8749 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8751 * class.cs (MemberBase.Define): Reuse MemberType member for
8752 resolved type. Other methods can use it too.
8754 2004-05-23 Martin Baulig <martin@ximian.com>
8756 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8757 the variable also exists in the current block (otherwise, we need
8758 to report a CS0103). Fixes #58670.
8760 2004-05-23 Martin Baulig <martin@ximian.com>
8762 * flowanalysis.cs (Reachability.Reachable): Compute this
8763 on-the-fly rather than storing it as a field.
8765 2004-05-23 Martin Baulig <martin@ximian.com>
8767 * flowanalysis.cs (Reachability.And): Manually compute the
8768 resulting `barrier' from the reachability.
8770 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8773 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8774 instance of ObsoleteAttribute when symbol is obsolete.
8777 (IMethodData): Extended interface for ObsoleteAttribute support.
8779 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8781 * attribute.cs: Fix bug #55970
8783 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8787 (GetObsoleteAttribute): New method. Creates the instance of
8789 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8790 ObsoleteAttribute when member is obsolete.
8791 (AttributeTester.Report_ObsoleteMessage): Common method for
8792 Obsolete error/warning reporting.
8795 (TypeContainer.base_classs_type): New member for storing parent type.
8798 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8799 for this MemberCore.
8801 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8803 * attribute.cs, const.cs: Fix bug #58590
8805 2004-05-21 Martin Baulig <martin@ximian.com>
8807 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8808 out parameters if the end of the method is unreachable. Fixes
8811 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8813 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8814 Hari was right, why extra method.
8816 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8818 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8820 2004-05-20 Martin Baulig <martin@ximian.com>
8822 * delegate.cs: Convert this file to Unix mode - like the original
8825 2004-05-20 Martin Baulig <martin@ximian.com>
8827 * attribute.cs: Convert this file to Unix mode - like the original
8830 2004-05-19 Marek Safar <marek.safar@seznam.cz>
8832 Fix bug #58688 (MCS does not report error when the same attribute
8835 * attribute.cs (Attribute.Emit): Distinction between null and default.
8837 2004-05-19 Raja R Harinath <rharinath@novell.com>
8839 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8840 of a top-level attribute without an attribute target.
8841 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
8843 (Attribute.Conditional_GetConditionName),
8844 (Attribute.Obsolete_GetObsoleteMessage): Update.
8845 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
8846 part of ScanForIndexerName.
8847 (Attribute.CanIgnoreInvalidAttribute): New function.
8848 (Attribute.ScanForIndexerName): Move to ...
8849 (Attributes.ScanForIndexerName): ... here.
8850 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8851 (Attributes.Search): New internal variant that can choose not to
8852 complain if types aren't resolved. The original signature now
8854 (Attributes.GetClsCompliantAttribute): Use internal variant, with
8855 complaints suppressed.
8856 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8857 only if it not useful.
8858 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8859 top-level for attributes that are shared between the assembly
8860 and a top-level class.
8861 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8862 * class.cs: Update to reflect changes.
8863 (DefineIndexers): Fuse loops.
8864 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
8865 a couple more variants of attribute names.
8867 2004-05-18 Marek Safar <marek.safar@seznam.cz>
8869 Fix bug #52585 (Implemented explicit attribute declaration)
8872 (Attributable.ValidAttributeTargets): New abstract method. It gets
8873 list of valid attribute targets for explicit target declaration.
8874 (Attribute.Target): It holds target itself.
8875 (AttributeSection): Removed.
8876 (Attribute.CheckTargets): New method. It checks whether attribute
8877 target is valid for the current element.
8880 (EventProperty): New class. For events that are declared like
8881 property (with add and remove accessors).
8882 (EventField): New class. For events that are declared like field.
8885 * cs-parser.jay: Implemented explicit attribute target declaration.
8887 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
8888 Override ValidAttributeTargets.
8891 (ReturnParameter): Class for applying custom attributes on
8893 (ParameterAtribute): New class. Class for applying custom
8894 attributes on the parameter type.
8896 2004-05-17 Miguel de Icaza <miguel@ximian.com>
8898 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8901 (Method): Allow UNSAFE here.
8903 * modifiers.cs: Support unsafe reporting.
8905 2004-05-17 Marek Safar <marek.safar@seznam.cz>
8907 * decl.cs: Fix bug #58478.
8909 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8911 * statement.cs: When checking for unreachable code on an EmptyStatement,
8912 set the location. Fixes bug #58488.
8914 2004-05-13 Miguel de Icaza <miguel@ximian.com>
8916 * driver.cs: Add -pkg handling.
8918 From Gonzalo: UseShelLExecute=false
8920 2004-05-12 Marek Safar <marek.safar@seznam.cz>
8923 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8925 (Attribute.IsClsCompliaceRequired): Moved to base for better
8927 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8928 when attribute is AttributeUsageAttribute.
8929 (Attribute.GetValidTargets): Simplified.
8930 (Attribute.GetAttributeUsage): New method returns AttributeUsage
8931 attribute for this type.
8932 (Attribute.ApplyAttributes): Method renamed to Emit and make
8934 (GlobalAttributeSection): New class for special handling of global
8935 attributes (assembly, module).
8936 (AttributeSection.Emit): New method.
8938 * class.cs: Implemented Attributable abstract methods.
8939 (MethodCore.LabelParameters): Moved to Parameter class.
8940 (Accessor): Is back simple class.
8941 (PropertyMethod): Implemented Attributable abstract class.
8942 (DelegateMethod): Implemented Attributable abstract class.
8943 (Event): New constructor for disctintion between normal Event
8944 and Event with accessors.
8946 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8948 * codegen.cs, const.cs, decl.cs, delegate.cs:
8949 (CommonAssemblyModulClass): Implemented Attributable abstract class
8952 * enum.cs: Implement IAttributeSupport interface.
8953 (EnumMember): New class for emum members. Implemented Attributable
8957 (ParameterBase): Is abstract.
8958 (ReturnParameter): New class for easier [return:] attribute handling.
8960 * typemanager.cs: Removed builder_to_attr.
8962 2004-05-11 Raja R Harinath <rharinath@novell.com>
8965 * attribute.cs (Attribute.GetPositionalValue): New function.
8966 * class.cs (TypeContainer.VerifyMembers): New function.
8967 (TypeContainer.Emit): Use it.
8968 (ClassOrStruct): New base class for Class and Struct.
8969 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
8970 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8972 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8973 then each non-static field should have a FieldOffset attribute.
8974 Otherwise, none of the fields should have a FieldOffset attribute.
8975 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
8976 and FieldOffset attributes.
8977 * typemanager.cs (TypeManager.struct_layout_attribute_type)
8978 (TypeManager.field_offset_attribute_type): New core types.
8979 (TypeManager.InitCoreTypes): Initialize them.
8981 2004-05-11 Michal Moskal <malekith@pld-linux.org>
8983 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8984 Return correct type.
8987 2004-05-09 Miguel de Icaza <miguel@ximian.com>
8989 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8990 be implicitly converted to ulong.
8992 * expression.cs: The logic for allowing operator &, | and ^ worked
8993 was wrong, it worked before because we did not report an error in
8994 an else branch. Fixes 57895.
8996 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8997 allow volatile fields to be reference types.
8999 2004-05-07 Miguel de Icaza <miguel@ximian.com>
9001 * driver.cs: Add support for /debug-
9003 2004-05-07 Raja R Harinath <rharinath@novell.com>
9005 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
9006 Add a 'complain' parameter to silence errors.
9007 (Attribute.Resolve): Update to changes. Put in sanity check to catch
9008 silently overlooked type-resolutions.
9009 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9011 (Attributes.Search): New function.
9012 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9013 (Attributes.GetAttributeFullName): Remove hack.
9014 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
9015 Update to reflect changes.
9016 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9017 Use Attributes.Search instead of nested loops.
9019 2004-05-07 Marek Safar <marek.safar@seznam.cz>
9022 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9023 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9024 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9026 * report.cs: (Report.Warning): Renamed to Warning_T because of
9027 parameter collision.
9029 2004-05-05 Raja R Harinath <rharinath@novell.com>
9031 * expression.cs (MemberAccess.ResolveMemberAccess):
9032 Exit with non-zero status after Report.Error.
9033 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9035 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9037 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9039 * support.cs: Don't hang when the file is empty.
9041 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9043 * support.cs: In SeekableStreamReader, compute the preamble size of the
9044 underlying stream. Position changes should take into account that initial
9047 2004-05-03 Todd Berman <tberman@sevenl.net>
9049 * driver.cs: remove unused GetSysVersion function.
9051 2004-05-03 Todd Berman <tberman@sevenl.net>
9053 * driver.cs: Remove the hack from saturday, as well as the hack
9054 from jackson (LoadAssemblyFromGac), also adds the CWD to the
9055 link_paths to get that bit proper.
9057 2004-05-01 Todd Berman <tberman@sevenl.net>
9059 * driver.cs: Try a LoadFrom before a Load, this checks the current
9060 path. This is currently a bug in mono that is be fixed, however, this
9061 provides a workaround for now. This will be removed when the bug
9064 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
9066 * CryptoConvert.cs: Updated to latest version. Fix issue with
9067 incomplete key pairs (#57941).
9069 2004-05-01 Todd Berman <tberman@sevenl.net>
9071 * driver.cs: Remove '.' from path_chars, now System.* loads properly
9074 2004-04-30 Jackson Harper <jackson@ximian.com>
9076 * codegen.cs: Open keys readonly.
9078 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9080 * typemanager.cs: don't report cyclic struct layout when a struct
9081 contains 2 or more fields of the same type. Failed for Pango.AttrShape
9082 which has 2 Pango.Rectangle fields.
9084 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
9086 * expression.cs: Handle IntPtr comparisons with IL code
9087 rather than a method call.
9089 2004-04-29 Martin Baulig <martin@ximian.com>
9091 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
9092 the list of PropertyInfo's in class hierarchy and find the
9093 accessor. Fixes #56013.
9095 2004-04-29 Martin Baulig <martin@ximian.com>
9097 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9099 2004-04-29 Martin Baulig <martin@ximian.com>
9101 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9103 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9105 2004-04-29 Martin Baulig <martin@ximian.com>
9107 * class.cs (ConstructorInitializer.Resolve): Check whether the
9108 parent .ctor is accessible. Fixes #52146.
9110 2004-04-29 Martin Baulig <martin@ximian.com>
9112 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9114 * statement.cs (Using.EmitLocalVariableDecls): Use
9115 TypeManager.idisposable_type, not typeof (IDisposable).
9116 (Foreach.EmitCollectionForeach): Added support for valuetypes.
9118 2004-04-29 Martin Baulig <martin@ximian.com>
9120 * class.cs (Event.Define): Don't emit the field and don't set
9121 RTSpecialName and SpecialName for events on interfaces. Fixes
9124 2004-04-29 Raja R Harinath <rharinath@novell.com>
9126 Refactor Attribute.ApplyAttributes.
9127 * attribute.cs (Attributable): New base class for objects that can
9128 have Attributes applied on them.
9129 (Attribute): Make AttributeUsage fields public.
9130 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9131 (Attribute.IsInternalCall): New property.
9132 (Attribute.UsageAttr): Convert to a public read-only property.
9133 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9134 (Attribute.ResolveType, Attribute.Resolve)
9135 (Attribute.ScanForIndexerName): Update to reflect changes.
9136 (Attribute.CheckAttributeTarget): Re-format.
9137 (Attribute.ApplyAttributes): Refactor, to various
9138 Attributable.ApplyAttributeBuilder methods.
9139 * decl.cs (MemberCore): Make Attributable.
9140 * class.cs (Accessor): Make Attributable.
9141 (MethodData.ApplyAttributes): Use proper attribute types, not
9143 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9144 (TypeContainer.ApplyAttributeBuilder)
9145 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9146 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
9147 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9148 (Operator.ApplyAttributeBuilder): New factored-out methods.
9149 * const.cs (Const.ApplyAttributeBuilder): Likewise.
9150 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9151 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9152 * parameter.cs (ParameterBase): New Attributable base class
9153 that can also represent Return types.
9154 (Parameter): Update to the changes.
9156 2004-04-29 Jackson Harper <jackson@ximian.com>
9158 * driver.cs: Prefer the corlib system version when looking for
9159 assemblies in the GAC. This is still a hack, but its a better hack
9162 2004-04-29 Marek Safar <marek.safar@seznam.cz>
9164 * decl.cs, enum.cs: Improved error 3005 reporting.
9166 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9167 (related_symbols): New private member for list of symbols
9168 related to reported error/warning.
9170 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9172 2004-04-29 Martin Baulig <martin@ximian.com>
9174 * ecore.cs (Expression.Constantify): If we're an enum and
9175 TypeManager.TypeToCoreType() doesn't give us another type, use
9176 t.UnderlyingSystemType. Fixes #56178.
9178 2004-04-29 Martin Baulig <martin@ximian.com>
9180 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9181 interfaces and for each interface, only add members directly
9182 declared in that interface. Fixes #53255.
9184 2004-04-28 Martin Baulig <martin@ximian.com>
9186 * expression.cs (ConditionalLogicalOperator): Use a temporary
9187 variable for `left' to avoid that we evaluate it more than once;
9190 2004-04-28 Martin Baulig <martin@ximian.com>
9192 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9195 2004-04-28 Martin Baulig <martin@ximian.com>
9197 * statement.cs (LocalInfo.Resolve): Check whether the type is not
9200 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9201 whether the type is not void (CS1547).
9203 2004-04-28 Martin Baulig <martin@ximian.com>
9205 * expression.cs (Unary.DoResolveLValue): Override this and report
9206 CS0131 for anything but Operator.Indirection.
9208 2004-04-28 Martin Baulig <martin@ximian.com>
9210 Committing a patch from Ben Maurer; see bug #50820.
9212 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9215 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9218 2004-04-28 Martin Baulig <martin@ximian.com>
9220 Committing a patch from Ben Maurer; see bug #50820.
9222 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9225 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9228 2004-04-28 Martin Baulig <martin@ximian.com>
9230 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9231 (Block.AddLabel): Call DoLookupLabel() to only search in the
9234 2004-04-28 Martin Baulig <martin@ximian.com>
9236 * cfold.cs (ConstantFold.BinaryFold): Added special support for
9237 comparing StringConstants and NullLiterals in Equality and Inequality.
9239 2004-04-28 Jackson Harper <jackson@ximian.com>
9241 * driver.cs: Attempt to load referenced assemblies from the
9242 GAC. This is the quick and dirty version of this method that
9243 doesnt take into account versions and just takes the first
9244 canidate found. Will be good enough for now as we will not have more
9245 then one version installed into the GAC until I update this method.
9247 2004-04-28 Martin Baulig <martin@ximian.com>
9249 * typemanager.cs (TypeManager.CheckStructCycles): New public
9250 static method to check for cycles in the struct layout.
9252 * rootcontext.cs (RootContext.PopulateTypes): Call
9253 TypeManager.CheckStructCycles() for each TypeContainer.
9254 [Note: We only need to visit each type once.]
9256 2004-04-28 Martin Baulig <martin@ximian.com>
9258 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9260 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9261 success and added `out object value'. Use a `bool resolved' field
9262 to check whether we've already been called rather than
9263 `ConstantValue != null' since this breaks for NullLiterals.
9265 2004-04-28 Raja R Harinath <rharinath@novell.com>
9267 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9268 setting of this flag, since the 'set' method may be non-public.
9270 2004-04-28 Raja R Harinath <rharinath@novell.com>
9272 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9273 check on current_vector.Block.
9275 2004-04-27 Martin Baulig <martin@ximian.com>
9277 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9278 a field initializer. Fixes #56459.
9280 2004-04-27 Martin Baulig <martin@ximian.com>
9282 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9283 we're not attempting to use an indexer. Fixes #52154.
9285 2004-04-27 Martin Baulig <martin@ximian.com>
9287 * statement.cs (Return): Don't create a return label if we don't
9288 need it; reverts my change from January 20th. Thanks to Ben
9291 2004-04-27 Martin Baulig <martin@ximian.com>
9293 According to the spec, `goto' can only leave a nested scope, but
9296 * statement.cs (Block.LookupLabel): Only lookup in the current
9297 block, don't recurse into parent or child blocks.
9298 (Block.AddLabel): Check in parent and child blocks, report
9299 CS0140/CS0158 if we find a duplicate.
9300 (Block): Removed this indexer for label lookups.
9301 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9302 this already does the error reporting for us.
9305 (FlowBranching.UsageVector.Block): New public variable; may be null.
9306 (FlowBranching.CreateSibling): Added `Block' argument.
9307 (FlowBranching.LookupLabel): New public virtual method. Lookup a
9308 label for the target of a `goto' and check whether we're not
9309 leaving a `finally'.
9311 2004-04-27 Martin Baulig <martin@ximian.com>
9313 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9314 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9317 2004-04-27 Martin Baulig <martin@ximian.com>
9319 * statement.cs (Block.AddLabel): Also check for implicit blocks
9320 and added a CS0158 check.
9322 2004-04-27 Martin Baulig <martin@ximian.com>
9324 * flowanalysis.cs (FlowBranchingLoop): New class.
9325 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9326 UsageVector's instead of an ArrayList.
9327 (FlowBranching.Label): Likewise.
9328 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9329 (FlowBranching.AddBreakVector): New method.
9331 2004-04-27 Miguel de Icaza <miguel@ximian.com>
9333 * attribute.cs: Small regression fix: only convert the type if we
9334 the type is different, fixes System.Drawing build.
9336 2004-04-27 Martin Baulig <martin@ximian.com>
9338 * attribute.cs (Attribute.Resolve): If we have a constant value
9339 for a named field or property, implicity convert it to the correct
9342 2004-04-27 Raja R Harinath <rharinath@novell.com>
9344 * statement.cs (Block.Block): Implicit blocks share
9345 'child_variable_names' fields with parent blocks.
9346 (Block.AddChildVariableNames): Remove.
9347 (Block.AddVariable): Mark variable as "used by a child block" in
9348 every surrounding block.
9349 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9350 been used in a child block, complain about violation of "Invariant
9351 meaning in blocks" rule.
9352 * cs-parser.jay (declare_local_variables): Don't use
9353 AddChildVariableNames.
9354 (foreach_statement): Don't create an implicit block: 'foreach'
9357 2004-04-23 Miguel de Icaza <miguel@ximian.com>
9359 * convert.cs (ImplicitNumericConversion): 0 is also positive when
9360 converting from 0L to ulong. Fixes 57522.
9362 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9364 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9365 derived class hides via 'new' keyword field from base class (test-242.cs).
9366 TODO: Handle this in the more general way.
9368 * class.cs (CheckBase): Ditto.
9370 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9372 * decl.cs (caching_flags): New member for storing cached values
9374 (MemberCore.Flags): New enum where bit flags for caching_flags
9376 (MemberCore.cls_compliance): Moved to caching_flags.
9377 (DeclSpace.Created): Moved to caching_flags.
9379 * class.cs: Use caching_flags instead of DeclSpace.Created
9381 2004-04-21 Miguel de Icaza <miguel@ximian.com>
9383 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9384 if we are only a derived class, not a nested class.
9386 * typemanager.cs: Same as above, but do this at the MemberLookup
9387 level (used by field and methods, properties are handled in
9388 PropertyExpr). Allow for the qualified access if we are a nested
9391 2004-04-21 Marek Safar <marek.safar@seznam.cz>
9393 * class.cs: Refactoring.
9394 (IMethodData): New inteface; Holds links to parent members
9395 to avoid member duplication (reduced memory allocation).
9396 (Method): Implemented IMethodData interface.
9397 (PropertyBase): New inner classes for get/set methods.
9398 (PropertyBase.PropertyMethod): Implemented IMethodData interface
9399 (Event): New inner classes for add/remove methods.
9400 (Event.DelegateMethod): Implemented IMethodData interface.
9402 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9403 EmitContext (related to class.cs refactoring).
9405 2004-04-21 Raja R Harinath <rharinath@novell.com>
9407 * delegate.cs (Delegate.VerifyApplicability): If the number of
9408 arguments are the same as the number of parameters, first try to
9409 verify applicability ignoring any 'params' modifier on the last
9413 2004-04-08 Martin Baulig <martin@ximian.com>
9415 Merged latest changes into gmcs. Please keep this comment in
9416 here, it makes it easier for me to see what changed in MCS since
9417 the last time I merged.
9419 2004-04-16 Raja R Harinath <rharinath@novell.com>
9421 * class.cs (TypeContainer.AddIndexer): Use
9422 'ExplicitInterfaceName' to determine if interface name was
9423 explicitly specified. 'InterfaceType' is not initialized at this time.
9424 (TypeContainer.DefineIndexers): Remove use of temporary list. The
9425 Indexers array is already in the required order. Initialize
9426 'IndexerName' only if there are normal indexers.
9427 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9428 (TypeContainer.Emit): Emit DefaultMember attribute only if
9429 IndexerName is initialized.
9432 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
9434 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9437 2004-04-15 Raja R Harinath <rharinath@novell.com>
9439 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9443 * attribute.cs (Attribute.Resolve): Check for duplicate named
9447 2004-04-15 Miguel de Icaza <miguel@ximian.com>
9449 * iterators.cs (MarkYield): track whether we are in an exception,
9450 and generate code accordingly. Use a temporary value to store the
9451 result for our state.
9453 I had ignored a bit the interaction of try/catch with iterators
9454 since their behavior was not entirely obvious, but now it is
9455 possible to verify that our behavior is the same as MS .NET 2.0
9459 2004-04-14 Miguel de Icaza <miguel@ximian.com>
9461 * iterators.cs: Avoid creating temporaries if there is no work to
9464 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9465 Enumerations, use TypeManager.EnumToUnderlying and call
9468 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9471 (This.Emit): Use EmitContext.EmitThis to emit our
9474 (This.EmitAssign): Ditto.
9476 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9477 codepaths, we will move all the functionality into
9480 (FieldExpr.EmitAssign): Ditto.
9482 This fixes several hidden bugs that I uncovered while doing a code
9483 review of this today.
9485 * codegen.cs (EmitThis): reworked so the semantics are more clear
9486 and also support value types "this" instances.
9488 * iterators.cs: Changed so that for iterators in value types, we
9489 do not pass the value type as a parameter.
9491 Initialization of the enumerator helpers is now done in the caller
9492 instead of passing the parameters to the constructors and having
9493 the constructor set the fields.
9495 The fields have now `assembly' visibility instead of private.
9497 2004-04-11 Miguel de Icaza <miguel@ximian.com>
9499 * expression.cs (Argument.Resolve): Check if fields passed as ref
9500 or out are contained in a MarshalByRefObject.
9502 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9503 another compiler type.
9505 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
9507 * class.cs (Indexer.Define): use the new name checking method.
9508 Also, return false on an error.
9509 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9510 (is_identifier_[start/part]_character): make static.
9512 2004-04-10 Miguel de Icaza <miguel@ximian.com>
9514 * expression.cs (Binary.ResolveOperator): Do no append strings
9515 twice: since we can be invoked more than once (array evaluation)
9516 on the same concatenation, take care of this here. Based on a fix
9517 from Ben (bug #56454)
9519 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
9521 * codegen.cs: Fix another case where CS1548 must be reported (when
9522 delay-sign isn't specified and no private is available #56564). Fix
9523 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
9524 error when MCS is used on the MS runtime and we need to delay-sign
9525 (which seems unsupported by AssemblyBuilder - see #56621).
9527 2004-04-08 Marek Safar <marek.safar@seznam.cz>
9529 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9530 (TypeManager.ComputeNamespaces): Faster implementation for
9533 * compiler.csproj: Updated AssemblyName to mcs.
9535 2004-05-11 Jackson Harper <jackson@ximian.com>
9537 * Makefile: Preserve MONO_PATH
9539 2004-05-11 Jackson Harper <jackson@ximian.com>
9541 * Makefile: Use mono and mcs to build gmcs
9543 2004-05-03 Miguel de Icaza <miguel@ximian.com>
9545 * codegen.cs: Add patch from Robert Shade
9546 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
9549 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
9551 * CryptoConvert.cs: Updated to latest version. Fix issue with
9552 incomplete key pairs (#57941).
9554 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
9556 * codegen.cs: Fix another case where CS1548 must be reported (when
9557 delay-sign isn't specified and no private is available #56564). Fix
9558 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
9559 error when MCS is used on the MS runtime and we need to delay-sign
9560 (which seems unsupported by AssemblyBuilder - see #56621).
9562 2004-04-29 Jackson Harper <jackson@ximian.com>
9564 * Makefile: Set MONO_PATH to use the bootstrap corlib
9565 * driver.cs: Check the GAC for referenced assemblies.
9567 2004-04-29 Martin Baulig <martin@ximian.com>
9569 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
9571 2004-04-07 Martin Baulig <martin@ximian.com>
9573 * expression.cs (Binary.ResolveOperator): Added special case for
9574 Equality/Inequality between a type parameter and a null literal.
9576 2004-04-07 Martin Baulig <martin@ximian.com>
9578 * convert.cs: Check null literal -> type parameter conversions.
9580 2004-04-07 Martin Baulig <martin@ximian.com>
9582 * generic.cs (ConstructedType.CheckConstraints): Enforce the
9583 `class' and `struct' constraints.
9585 2004-04-07 Martin Baulig <martin@ximian.com>
9587 * generic.cs (SpecialConstraint): New public enum.
9588 (Constraints.Resolve): Added support for the `class' and `struct'
9591 * cs-parser.jay (type_parameter_constraint): Added support for the
9592 `class' and `struct' constraints.
9594 2004-04-07 Martin Baulig <martin@ximian.com>
9596 * support.cs (GenericConstraints): Replaced `Types' by
9597 `ClassConstraint' and `InterfaceConstraints'; added
9598 `HasClassConstraint'.
9600 2004-04-07 Martin Baulig <martin@ximian.com>
9603 (Constraints.InterfaceConstraints): New public property.
9604 (Constraints.Types): Make this property public
9605 (TypeParameter): Implement IMemberContainer.
9606 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
9607 instead of a TypeBuilder/MethodBuilder; pass the interface
9608 constraints to TypeManager.AddTypeParameter().
9609 (TypeParameter.DefineType): Just take an EmitContext and no
9610 TypeBuilder/MethodBuilder. Use the new public API.
9612 * typemanager.cs (TypeManager.AddTypeParameter): Added
9613 `TypeExpr[]' argument; add the interfaces to the
9614 `builder_to_ifaces' hash.
9615 (TypeManager.LookupMemberContainer): For
9616 GenericTypeParameterBuilders, get the TypeParameter from the
9617 `builder_to_type_param'.
9618 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
9619 the TypeParameter and call FindMembers on it.
9621 2004-04-07 Martin Baulig <martin@ximian.com>
9624 (MethodCore.GenericMethod): Moved this field here from Method.
9625 (MethodCore.IsDuplicateImplementation): Take the number of type
9626 parameters into account if we're a generic method.
9628 * expression.cs (Invocation.InferTypeArguments): Don't return true
9629 if `arguments' is null; we still need to check whether we actually
9630 don't need to infer anything in this case.
9631 (MemberAccess): Merged the functionality from GenericMemberAccess
9634 * generic.cs (GenericMemberAccess): Removed.
9636 2004-04-05 Martin Baulig <martin@ximian.com>
9638 * decl.cs (MemberCore): For generic classes, interfaces and
9639 structs, `Name' now includes the number of type parameters
9641 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
9642 encode the number of type arguments in the type name.
9644 * expression.cs (Expression.MemberLookup): Removed the
9645 `num_type_args' argument; we now encode the number of type
9646 arguments in the type name.
9648 * ecore.cs (SimpleName): Encode the number of type arguments in
9649 the type name itself.
9651 * generic.cs (ConstructedType): Likewise.
9653 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
9654 `MemberName'; we now include the number of type parameters in the
9657 * typemanager.cs (TypeManager.CheckGeneric): Removed.
9658 (TypeManager.MemberLookup): Removed the
9659 `num_type_args' argument; we now encode the number of type
9660 arguments in the type name.
9662 2004-04-03 Martin Baulig <martin@ximian.com>
9664 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
9665 (MemberCore.MemberName): Moved here from MemberBase.
9666 (DeclSpace.SetParameterInfo): Just take the constraints as an
9667 ArrayList; we already have the type parameters in our
9668 `MemberName'; also do the CS0080 reporting here.
9670 * cs-parser.jay (struct_declaration): Use `member_name' instead of
9671 `IDENTIFIER opt_type_parameter_list'; when constructing our
9672 `MemberName', it'll already include our type parameters.
9673 (class_declaration, interface_declaration): Likewise.
9674 (delegate_declaration): Likewise.
9675 (MakeName): Take a MemberName and return a MemberName.
9676 The following two changes are required to avoid shift/reduce conflicts:
9677 (member_name): Don't include a TypeName anymore; ie. this is now
9678 just 'IDENTIFIER opt_type_parameter_list'.
9679 (property_declaration, event_declaration): Use a
9680 `namespace_or_type_name' instead of a `member_name'.
9682 2004-04-03 Martin Baulig <martin@ximian.com>
9684 * decl.cs (MemberName): Renamed to `TypeName' and created a new
9686 (TypeName): Formerly known as MemberName.
9688 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
9689 instead of a `MemberName'.
9691 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
9692 (member_name): New rule; create a MemberName.
9694 2004-04-02 Martin Baulig <martin@ximian.com>
9696 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
9697 (CS0305 and CS0308).
9699 2004-04-02 Martin Baulig <martin@ximian.com>
9701 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
9702 support for nested types.
9704 2004-04-02 Martin Baulig <martin@ximian.com>
9706 * ecore.cs (IAlias): New public interface.
9707 (TypeExpr, TypeExpression): Implement IAlias.
9708 (TypeAliasExpression): New public class.
9710 * namespace.cs (Namespace): Implement IAlias.
9711 (Namespace.Lookup): Return an IAlias instead on an object.
9712 (Namespace.DefineName): Take an IAlias instead of an object.
9713 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
9715 (NamespaceEntry.UsingAlias): Take a Membername instead of an
9717 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
9719 (NamespaceEntry.Lookup): Likewise.
9721 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
9724 * decl.cs (DeclSpace): Implement IAlias.
9725 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
9727 * generic.cs (ConstructedType): Improved error checking.
9729 2004-04-02 Martin Baulig <martin@ximian.com>
9731 * convert.cs: Added type parameter conversions.
9734 (UnboxCast.Emit): Emit an `unbox.any' for type params.
9735 (ClassCast.Emit): If the source type is a type parameter, box it.
9736 If the target type is a type parameter, emit an `unbox.any'
9737 instead of a `classcast'.1
9739 2004-04-01 Martin Baulig <martin@ximian.com>
9741 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
9743 2004-04-01 Martin Baulig <martin@ximian.com>
9745 * generic.cs (ConstructedType.CheckConstraints): Use
9746 Convert.ImplicitStandardConversionExists(); user-defined implicit
9747 conversions are not allowed according to the spec.
9749 2004-03-30 Martin Baulig <martin@ximian.com>
9751 * expression.cs (New): Added support for type parameters.
9754 (TypeManager.activator_type): New public static field.
9755 (TypeManager.activator_create_instance): Likewise.
9757 2004-03-30 Martin Baulig <martin@ximian.com>
9759 * typemanager.cs (TypeManager.HasConstructorConstraint): New
9762 2004-03-30 Martin Baulig <martin@ximian.com>
9764 * generic.cs (ConstructedType.CheckConstraints): Actually follow
9765 the spec here: the argument type must be convertible to the
9768 2004-03-30 Martin Baulig <martin@ximian.com>
9771 (TypeParameter.Define, TypeParameter.DefineMethod): Call
9772 TypeManager.AddTypeParameter().
9773 (ConstructedType.CheckConstraints): Re-enable this and actually
9774 check whether we have a constructor constraint.
9777 (TypeManager.builder_to_type_param): New static field.
9778 (TypeManager.AddTypeParameter): New static method.
9779 (TypeManager.LookupTypeParameter): New public method.
9781 2004-03-30 Martin Baulig <martin@ximian.com>
9783 * generic.cs (TypeParameter.DefineType): Return a boolean and use
9784 the new API to actually define the constructor constraint.
9787 (TypeManager.new_constraint_attr_type): New static field.
9788 (TypeManager.InitCoreTypes): Initialize it.
9790 2004-03-30 Martin Baulig <martin@ximian.com>
9792 * generic.cs (Constraints): Completed error checking, use correct
9795 2004-03-29 Martin Baulig <martin@ximian.com>
9797 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
9799 * expression.cs (Invocation.InferTypeArguments): Added overloaded
9800 public version which takes a `ParameterData pd' instead of an
9803 2004-03-29 Martin Baulig <martin@ximian.com>
9805 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
9808 2004-03-29 Martin Baulig <martin@ximian.com>
9810 * expression.cs (Argument.ResolveMethodGroup): If we're a
9811 ConstructedType, call GetMemberAccess() on it.
9813 2004-03-29 Martin Baulig <martin@ximian.com>
9815 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
9816 (MethodCore.CheckGenericOverride): When overriding a generic
9817 method, check whether the constraints match.
9819 * support.cs (GenericConstraints): New public interface.
9820 (ParameterData.GenericConstraints): New public method.
9822 * parameter.cs (Parameter.Resolve): Check whether we're a generic
9823 method parameter and compute our constraints if appropriate.
9824 (Parameter.GenericConstraints): New public property.
9826 * generic.cs (Constraints): Implement GenericConstraints.
9828 2004-03-29 Martin Baulig <martin@ximian.com>
9830 * decl.cs (MemberCache.FindMemberToOverride): Use
9831 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
9833 2004-03-29 Martin Baulig <martin@ximian.com>
9835 * generic.cs (GenericMethod.Define): Resolve our type parameters.
9837 2004-03-29 Martin Baulig <martin@ximian.com>
9839 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
9840 not allowed on non-generic declarations").
9842 2004-03-29 Martin Baulig <martin@ximian.com>
9844 * expression.cs (Invocation.InferTypeArguments): Added overloaded
9845 public version of this method.
9847 * class.cs (MethodCore.IsDuplicateImplementation): Use
9848 Invocation.InferTypeArguments() to check this.
9850 2004-03-29 Martin Baulig <martin@ximian.com>
9852 * convert.cs: Use TypeManager.IsDelegateType() instead of
9853 comparing types correctly.
9855 2004-03-29 Martin Baulig <martin@ximian.com>
9857 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
9858 types directly to make it work for generic instances.
9860 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
9862 2004-03-29 Martin Baulig <martin@ximian.com>
9864 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
9867 2004-03-24 Martin Baulig <martin@ximian.com>
9869 * decl.cs (DeclSpace.FindType): Also use
9870 TypeManager.CheckGeneric() for types from the using clauses.
9872 2004-03-23 Martin Baulig <martin@ximian.com>
9874 * expression.cs (Invocation.OverloadResolve): Added `bool
9875 may_fail' argument and use it instead of the Location.IsNull() hack.
9877 2004-03-23 Martin Baulig <martin@ximian.com>
9879 * expression.cs (Invocation.InferType): Use correct type inference
9882 2004-03-23 Martin Baulig <martin@ximian.com>
9884 * ecore.cs (MethodGroupExpr.Name): Use
9885 TypeManager.CSharpSignature() instead of just the name.
9887 * expression.cs (Invocation.OverloadResolve): Provide better error
9889 (Invocation.DoResolve): OverloadResolve() never returns null
9890 without reporting an error, so removed the error -6 reporting here.
9892 2004-03-23 Martin Baulig <martin@ximian.com>
9894 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
9897 * cs-parser.jay (delegate_declaration): Support generic delegates.
9899 * delegate.cs: Support generic delegates.
9901 2004-03-22 Martin Baulig <martin@ximian.com>
9903 * expression.cs (Invocation.InferParamsTypeArguments): New static
9904 method; does type inference for params arguments.
9906 2004-03-21 Martin Baulig <martin@ximian.com>
9908 * typemanager.cs (TypeManager.IsGenericMethod): New public static
9909 method; checks whether a method is a generic method.
9911 * expression.cs (Invocation.InferTypeArguments): New static method;
9912 infer type arguments for generic method invocation.
9914 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
9915 property; we set this to true if we're resolving a generic method
9916 invocation and the user specified type arguments, ie. we're not
9917 doing type inference.
9919 2004-03-20 Martin Baulig <martin@ximian.com>
9921 * class.cs (MethodData.DeclaringType): New public property.
9922 (MethodData.Define): Set DeclaringType here.
9923 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
9924 instead of OperatorMethodBuilder.DeclaringType.
9926 2004-03-20 Martin Baulig <martin@ximian.com>
9928 * cs-tokenizer.cs (xtoken): Return a special
9929 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
9931 * cs-parser.jay (default_value_expression): Switch to the new
9934 2004-03-19 Martin Baulig <martin@ximian.com>
9936 * decl.cs (MemberName): New class. We use this to "construct"
9937 namespace_or_type_name's.
9939 * generics.cs (TypeArguments.GetDeclarations): New public method;
9940 returns the type arguments as a string[] and reports a CS0081 if
9941 one of them is not an identifier.
9943 * class.cs (MemberBase): The .ctor now takes the name as a
9944 MemberName instead of a string.
9945 (MemberBase.ExplicitInterfaceName): Changed type from string to
9947 (MemberBase.DoDefine): If we're an explicit implementation, the
9948 InterfaceType may be a generic instance.
9950 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
9951 (namespace_name): Call MemberName.GetName () to transform the
9952 MemberName into a string and ensure we don't have any type
9954 (type_name): Call MemberName.GetTypeExpression() to transfrom the
9955 MemberName into an expression.
9956 (method_header): Use namespace_or_type_name instead of member_name.
9958 2004-04-07 Miguel de Icaza <miguel@ximian.com>
9960 * rootcontext.cs: Add new types to the boot resolution.
9962 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9963 MulticastDelegate is not allowed.
9965 * typemanager.cs: Add new types to lookup: System.TypedReference
9968 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9969 check for TypedReference or ArgIterator, they are not allowed.
9971 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9972 makes us properly catch 1510 in some conditions (see bug 56016 for
9975 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
9977 * CryptoConvert.cs: update from corlib version
9980 2004-04-05 Miguel de Icaza <miguel@ximian.com>
9982 * class.cs (Indexer.Define): Check indexername declaration
9984 2004-04-05 Marek Safar <marek.safar@seznam.cz>
9986 * attribute.cs (IsClsCompliant): Fixed problem with handling
9987 all three states (compliant, not-compliant, undetected).
9989 2004-03-30 Marek Safar <marek.safar@seznam.cz>
9991 * attribute.cs (Attribute): Location is now public.
9992 (Resolve): Store resolved arguments (pos_values) in attribute class.
9993 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9994 (GetClsCompliantAttributeValue): New method that gets
9995 CLSCompliantAttribute value.
9996 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9997 if exists else null.
9998 (AttributeTester): New class for CLS-Compliant verification routines.
10000 * class.cs (Emit): Add CLS-Compliant verification.
10001 (Method.GetSignatureForError): Implemented.
10002 (Constructor.GetSignatureForError): Implemented
10003 (Constructor.HasCompliantArgs): Returns if constructor has
10004 CLS-Compliant arguments.
10005 (Constructor.Emit): Override.
10006 (Construcor.IsIdentifierClsCompliant): New method; For constructors
10007 is needed to test only parameters.
10008 (FieldBase.GetSignatureForError): Implemented.
10009 (TypeContainer): New member for storing base interfaces.
10010 (TypeContainer.FindMembers): Search in base interfaces too.
10012 * codegen.cs (GetClsComplianceAttribute): New method that gets
10013 assembly or module CLSCompliantAttribute value.
10014 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10016 (ModuleClass.Emit): Add error 3012 test.
10018 * const.cs (Emit): Override and call base for CLS-Compliant tests.
10020 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10021 state for all decl types.
10022 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10023 if CLS-Compliant tests are required.
10024 (IsClsCompliaceRequired): New method. Analyze whether code
10025 must be CLS-Compliant.
10026 (IsExposedFromAssembly): New method. Returns true when MemberCore
10027 is exposed from assembly.
10028 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10029 value or gets cached value.
10030 (HasClsCompliantAttribute): New method. Returns true if MemberCore
10031 is explicitly marked with CLSCompliantAttribute.
10032 (IsIdentifierClsCompliant): New abstract method. This method is
10033 used to testing error 3005.
10034 (IsIdentifierAndParamClsCompliant): New method. Common helper method
10035 for identifier and parameters CLS-Compliant testing.
10036 (VerifyClsCompliance): New method. The main virtual method for
10037 CLS-Compliant verifications.
10038 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10039 null. I don't know why is null (too many public members !).
10040 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10041 and get value of first CLSCompliantAttribute that found.
10043 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10044 (VerifyClsCompliance): Override and add extra tests.
10046 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10047 clscheck- disable CLS-Compliant verification event if assembly is has
10048 CLSCompliantAttribute(true).
10050 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10051 ApllyAttribute is now called in emit section as in the other cases.
10052 Possible future Emit integration.
10053 (IsIdentifierClsCompliant): New override.
10054 (VerifyClsCompliance): New override.
10055 (GetEnumeratorName): Returns full enum name.
10057 * parameter.cs (GetSignatureForError): Implemented.
10059 * report.cs (WarningData): New struct for Warning message information.
10060 (LocationOfPreviousError): New method.
10061 (Warning): New method. Reports warning based on the warning table.
10062 (Error_T): New method. Reports error based on the error table.
10064 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10065 verifications are done here.
10067 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10069 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10070 CLSCompliantAttribute.
10071 (all_imported_types): New member holds all imported types from other
10073 (LoadAllImportedTypes): New method fills static table with exported types
10074 from all referenced assemblies.
10075 (Modules): New property returns all assembly modules.
10077 2004-03-30 Miguel de Icaza <miguel@ximian.com>
10079 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10080 throwing a parser error.
10082 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10083 which removes the hardcoded get_/set_ prefixes for properties, as
10084 IL allows for the properties to be named something else.
10088 * expression.cs: Do not override operand before we know if it is
10089 non-null. Fix 56207
10091 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10093 * typemanager.cs: support for pinned variables.
10095 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10097 * decl.cs, typemanager.cs: Avoid using an arraylist
10098 as a buffer if there is only one result set.
10100 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10102 * expression.cs: Make sure you cant call a static method
10103 with an instance expression, bug #56174.
10105 2004-03-29 Miguel de Icaza <miguel@ximian.com>
10107 * class.cs (IsDuplicateImplementation): Improve error reporting to
10108 flag 663 (method only differs in parameter modifier).
10110 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10111 in preprocessor directives.
10113 * location.cs (LookupFile): Allow for the empty path.
10115 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
10116 better approach for some of that patch, but its failing with the
10117 CharSet enumeration. For now try/catch will do.
10119 * typemanager.cs: Do not crash if a struct does not have fields.
10122 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10124 * expression.cs: cs0213, cant fix a fixed expression.
10127 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10129 * cs-parser.jay: detect invalid embeded statements gracefully.
10132 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10134 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10137 the invocation type may not be a subclass of the tye of the item/
10138 The type of the item must be a subclass of the invocation item.
10143 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
10145 * attribute.cs: Added methods to get a string and a bool from an
10146 attribute. Required to information from AssemblyKeyFileAttribute,
10147 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10148 * codegen.cs: Modified AssemblyName creation to include support for
10149 strongnames. Catch additional exceptions to report them as CS1548.
10150 * compiler.csproj: Updated include CryptoConvert.cs.
10151 * compiler.csproj.user: Removed file - user specific configuration.
10152 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
10153 Mono.Security assembly. The original class is maintained and tested in
10154 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10155 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10156 like CSC 8.0 (C# v2) supports.
10157 * Makefile: Added CryptoConvert.cs to mcs sources.
10158 * rootcontext.cs: Added new options for strongnames.
10160 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
10162 * driver.cs: For --expect-error, report error code `2'
10163 if the program compiled with no errors, error code `1' if
10164 it compiled with an error other than the one expected.
10166 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
10168 * compiler.csproj: Updated for Visual Studio .NET 2003.
10169 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10170 * compiler.sln: Updated for Visual Studio .NET 2003.
10172 2004-03-24 Ravi Pratap M <ravi@ximian.com>
10174 * expression.cs: Fix bug #47234. We basically need to apply the
10175 rule that we prefer the conversion of null to a reference type
10176 when faced with a conversion to 'object' (csc behaviour).
10178 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10180 * statement.cs: Shorter form for foreach, eliminates
10181 a local variable. r=Martin.
10183 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10185 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10186 checks if we can use brtrue/brfalse to test for 0.
10187 * expression.cs: use the above in the test for using brtrue/brfalse.
10188 cleanup code a bit.
10190 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10192 * expression.cs: Rewrite string concat stuff. Benefits:
10194 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10195 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10196 rather than a concat chain.
10198 * typemanager.cs: Add lookups for more concat overloads.
10200 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10202 * expression.cs: Emit shorter il code for array init.
10219 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
10221 * statement.cs: Before, two switch blocks would be merged if the
10222 total size of the blocks (end_item - begin_item + 1) was less than
10223 two times the combined sizes of the blocks.
10225 Now, it will only merge if after the merge at least half of the
10230 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
10232 * class.cs : csc build fix for GetMethods(). See bug #52503.
10234 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
10236 * expression.cs: Make sure fp comparisons work with NaN.
10237 This fixes bug #54303. Mig approved this patch a long
10238 time ago, but we were not able to test b/c the runtime
10241 2004-03-19 Miguel de Icaza <miguel@ximian.com>
10243 * ecore.cs (TypExpr.GetHashCode): implement this overload.
10245 2004-03-19 Martin Baulig <martin@ximian.com>
10247 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
10248 two overloads may unify for some type parameter substitutions and
10249 report a CS0408 if appropriate.
10251 2004-03-19 Martin Baulig <martin@ximian.com>
10253 * class.cs (MemberCore.IsDuplicateImplementation): Report the
10254 error here and not in our caller.
10256 2004-03-19 Martin Baulig <martin@ximian.com>
10258 * interface.cs: Completely killed this file.
10259 (Interface): We're now a TypeContainer and live in class.cs.
10261 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10262 argument; we're now also called for interfaces.
10263 (TypeContainer.DefineMembers): Allow this method being called
10265 (TypeContainer.GetMethods): New public method; formerly known as
10266 Interface.GetMethod(). This is used by PendingImplementation.
10267 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10268 it's now private and non-static.
10269 (Interface): Moved this here; it's now implemented similar to
10271 (Method, Property, Event, Indexer): Added `bool is_interface'
10272 argument to their .ctor's.
10273 (MemberBase.IsInterface): New public field.
10275 * cs-parser.jay: Create normal Method, Property, Event, Indexer
10276 instances instead of InterfaceMethod, InterfaceProperty, etc.
10277 (opt_interface_base): Removed; we now use `opt_class_base' instead.
10278 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10280 2004-03-19 Martin Baulig <martin@ximian.com>
10282 * class.cs (MethodCore.IsDuplicateImplementation): New private
10283 method which does the CS0111 checking.
10284 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10285 Use IsDuplicateImplementation().
10287 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
10289 * decl.cs (FindMemberToOverride): New method to find the correct
10290 method or property to override in the base class.
10292 - Make Method/Property use the above method to find the
10293 version in the base class.
10294 - Remove the InheritableMemberSignatureCompare as it is now
10297 This patch makes large code bases much faster to compile, as it is
10298 O(n) rather than O(n^2) to do this validation.
10300 Also, it fixes bug 52458 which is that nested classes are not
10301 taken into account when finding the base class member.
10303 Reviewed/Approved by Martin.
10305 2004-03-17 Martin Baulig <martin@ximian.com>
10307 * expression.cs (MemberAccess.DoResolve): Take the parent's number
10308 of type arguments into account; use the `real_num_type_args'
10309 approach like in DoResolveAsTypeStep().
10311 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
10314 2004-03-17 Marek Safar <marek.safar@seznam.cz>
10316 * interface.cs: In all interface classes removed redundant
10317 member initialization.
10319 2004-03-16 Martin Baulig <martin@ximian.com>
10321 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10323 2004-03-15 Miguel de Icaza <miguel@ximian.com>
10325 * decl.cs (DefineTypeAndParents): New helper method to define a
10326 type's containers before the type itself is defined; This is a
10327 bug exposed by the recent changes to Windows.Forms when an
10328 implemented interface was defined inside a class that had not been
10331 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10333 (Check): Loop correctly to report errors modifiers
10334 (UNSAFE was not in the loop, since it was the same as TOP).
10336 * interface.cs: Every interface member now takes a ModFlags,
10337 instead of a "is_new" bool, which we set on the base MemberCore.
10339 Every place where we called "UnsafeOk" in the interface, now we
10340 call the proper member (InterfaceMethod.UnsafeOK) instead to get
10341 the unsafe settings from the member declaration instead of the
10342 container interface.
10344 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
10346 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10347 `set_indexer_name' to the pending bits (one per type).
10349 We fixed a bug today that was picking the wrong method to
10350 override, since for properties the existing InterfaceMethod code
10351 basically ignored the method name. Now we make sure that the
10352 method name is one of the valid indexer names.
10354 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
10356 * support.cs (SeekableStreamReader): Keep track of stream byte
10357 positions and don't mix them with character offsets to the buffer.
10359 Patch from Gustavo Giráldez
10361 2004-03-15 Marek Safar <marek.safar@seznam.cz>
10363 * interface.cs (InterfaceSetGetBase): Removed double member
10364 initialization, base class does it as well.
10366 2004-03-13 Martin Baulig <martin@ximian.com>
10368 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10369 when compiling corlib.
10371 2004-03-13 Miguel de Icaza <miguel@ximian.com>
10373 * convert.cs (ExplicitConversion): We were reporting an error on
10374 certain conversions (object_type source to a value type, when the
10375 expression was `null') before we had a chance to pass it through
10376 the user defined conversions.
10378 * driver.cs: Replace / and \ in resource specifications to dots.
10381 * class.cs: Add check for duplicate operators. Fixes 52477
10383 2004-03-11 Miguel de Icaza <miguel@ximian.com>
10385 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10386 that are in the middle of the statements, not only at the end.
10389 * class.cs (TypeContainer.AddField): No longer set the
10390 `HaveStaticConstructor' flag, now we call it
10391 `UserDefineStaticConstructor' to diferentiate the slightly
10392 semantic difference.
10394 The situation is that we were not adding BeforeFieldInit (from
10395 Modifiers.TypeAttr) to classes that could have it.
10396 BeforeFieldInit should be set to classes that have no static
10401 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10403 And most importantly Zoltan's comment:
10405 http://bugzilla.ximian.com/show_bug.cgi?id=44229
10407 "I think beforefieldinit means 'it's ok to initialize the type sometime
10408 before its static fields are used', i.e. initialization does not need
10409 to be triggered by the first access to the type. Setting this flag
10410 helps the JIT to compile better code, since it can run the static
10411 constructor at JIT time, and does not need to generate code to call it
10412 (possibly lots of times) at runtime. Unfortunately, mcs does not set
10413 this flag for lots of classes like String.
10415 csc sets this flag if the type does not have an explicit static
10416 constructor. The reasoning seems to be that if there are only static
10417 initalizers for a type, and no static constructor, then the programmer
10418 does not care when this initialization happens, so beforefieldinit
10421 This bug prevents the AOT compiler from being usable, since it
10422 generates so many calls to mono_runtime_class_init that the AOT code
10423 is much slower than the JITted code. The JITted code is faster,
10424 because it does not generate these calls if the vtable is type is
10425 already initialized, which is true in the majority of cases. But the
10426 AOT compiler can't do this."
10428 2004-03-10 Miguel de Icaza <miguel@ximian.com>
10430 * class.cs (MethodData.Emit): Refactor the code so symbolic
10431 information is generated for destructors; For some reasons we
10432 were taking a code path that did not generate symbolic information
10435 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
10437 * class.cs: Create a Constructor.CheckBase method that
10438 takes care of all validation type code. The method
10439 contains some code that was moved from Define.
10441 It also includes new code that checks for duplicate ctors.
10442 This fixes bug #55148.
10444 2004-03-09 Joshua Tauberer <tauberer@for.net>
10446 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10447 a { ... }-style array creation invokes EmitStaticInitializers
10448 which is not good for reference-type arrays. String, decimal
10449 and now null constants (NullCast) are not counted toward
10450 static initializers.
10452 2004-03-05 Martin Baulig <martin@ximian.com>
10454 * location.cs (SourceFile.HasLineDirective): New public field;
10455 specifies whether the file contains or is referenced by a "#line"
10457 (Location.DefineSymbolDocuments): Ignore source files which
10458 either contain or are referenced by a "#line" directive.
10460 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
10462 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10463 direct access to our parent, so check the method inline there.
10465 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
10467 * expression.cs (Invocation.EmitCall): Miguel's last commit
10468 caused a regression. If you had:
10473 In Foo the implict this would be null.
10475 2004-02-27 Miguel de Icaza <miguel@ximian.com>
10477 * expression.cs (Invocation.EmitCall): If the method is not
10478 virtual, do not emit a CallVirt to it, use Call.
10480 * typemanager.cs (GetFullNameSignature): Improve the method to
10481 cope with ".ctor" and replace it with the type name.
10483 * class.cs (ConstructorInitializer.Resolve): Now the method takes
10484 as an argument the ConstructorBuilder where it is being defined,
10485 to catch the recursive constructor invocations.
10487 2004-03-16 Martin Baulig <martin@ximian.com>
10489 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
10490 ConstructedType, call ResolveType() on it to get the type rather
10491 than just using `expr.Type'.
10493 2004-03-16 Martin Baulig <martin@ximian.com>
10495 * generics.cs (ConstructedType.GetMemberAccess): Take the
10496 EmitContext instead on the TypeExpr and use
10497 ec.TypeContainer.CurrentType/ec.ContainerType.
10499 2004-03-16 Martin Baulig <martin@ximian.com>
10501 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
10502 parameters before aliases.
10504 2004-03-16 Martin Baulig <martin@ximian.com>
10506 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
10507 New oublic function; checks whether two generic instances may become
10508 equal under some instantiations (26.3.1).
10510 * class.cs (TypeContainer.Define): Call
10511 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
10514 2004-03-16 Martin Baulig <martin@ximian.com>
10516 * class.cs (TypeContainer.GetClassBases): Moved
10517 Error_TypeParameterAsBase() here and also check whether the base
10518 class is not an attribute.
10520 2004-03-16 Martin Baulig <martin@ximian.com>
10522 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10524 2004-03-16 Martin Baulig <martin@ximian.com>
10526 * class.cs (Error_TypeParameterAsBase): Use correct error number
10529 2004-03-16 Martin Baulig <martin@ximian.com>
10531 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
10534 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
10537 2004-03-15 Martin Baulig <martin@ximian.com>
10539 * typemanager.cs (TypeManager.GetFullName): New public method.
10540 (TypeManager.MemberLookup): Added `int_num_type_arguments'
10541 argument; only return members with the correct number of type
10543 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
10544 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
10545 whether the number of type arguments matches.
10547 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
10548 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
10550 * expression.cs (MemberAccess): Added public `NumTypeArguments'
10551 field; it's set by the protected .ctor when we're actually a
10552 GenericMemberAccess.
10553 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
10554 arguments and pass it to MemberLookupFinal ().
10556 * ecore.cs (Expression.MemberLookup): Added `int
10557 num_type_arguments' argument; only return members with the correct
10558 number of type arguments.
10559 (Expression.MemberLookupFailed): Check whether the MemberLookup
10560 failed because we did not have the correct number of type
10561 arguments; report CS0305 in this case.
10563 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
10564 `e.ResolveAsTypeTerminal()' already did so.
10566 2004-03-15 Martin Baulig <martin@ximian.com>
10568 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
10569 we're a ConstructedType; in this case, the caller must report an
10570 error (for instance CS0131).
10572 * generic.cs (TypeArguments): Added Location argument to the .ctor.
10573 (TypeArguments.Resolve): Actually report errors here.
10575 2004-03-15 Miguel de Icaza <miguel@ximian.com>
10577 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10578 `set_indexer_name' to the pending bits (one per type).
10580 We fixed a bug today that was picking the wrong method to
10581 override, since for properties the existing InterfaceMethod code
10582 basically ignored the method name. Now we make sure that the
10583 method name is one of the valid indexer names.
10585 2004-03-15 Martin Baulig <martin@ximian.com>
10587 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
10588 for generic instances.
10590 2004-03-13 Martin Baulig <martin@ximian.com>
10592 * class.cs (TypeContainer.DefineType): Call
10593 TypeManager.AddUserType() immediately after creating the
10594 TypeBuilder; pass all type parameters when creating the
10597 * decl.cs (DeclSpace.FindNestedType): New public method.
10598 (DeclSpace.FindType): Added `int num_type_args' argument; only
10599 return types with the correct number of type parameters.
10600 (DeclSpace.CountTypeParams): New public property.
10602 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
10603 the number of type parameters; defaults to zero.
10605 * generic.cs (TypeArguments.Count): New public property.
10606 (ConstructedType.DoResolveAsTypeStep): First call
10607 ds.FindNestedType() to find out whether we're nested in the
10608 current generic type; in this case, we inherit all type parameters
10609 from the current class.
10611 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
10612 num_type_args' argument.
10613 (RootContext.LookupType): Added overloaded version which takes the
10614 number of type arguments; only return types with the correct
10615 number of type arguments.
10617 * typemanager.cs (TypeManager.CheckGeneric): New public function;
10618 checks whether `Type t' has `int num_type_args'.
10620 2004-03-13 Martin Baulig <martin@ximian.com>
10622 * generic.cs (GenericMethod.DefineType): New method; calls
10623 DefineType() on all the type parameters.
10625 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
10626 (MethodData.Define): If we're a generic method, call
10627 GenericMethod.DefineType() to define the type parameters.
10629 2004-03-10 Martin Baulig <martin@ximian.com>
10631 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
10632 instead of IsAssignableFrom.
10634 2004-03-10 Martin Baulig <martin@ximian.com>
10636 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
10638 * support.cs (ParameterData.HasArrayParameter): New property.
10639 (ReflectionParameters.ctor): Take a MethodBase instead of a
10640 ParameterInfo[]. If we have any type parameters, get the generic
10641 method definition and ask it whether we have variable arguments.
10643 2004-02-26 Miguel de Icaza <miguel@ximian.com>
10645 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10646 routines to check if a type is an enumerable/enumerator allow
10647 classes that implement the IEnumerable or IEnumerator interfaces.
10649 * class.cs (Property, Operator): Implement IIteratorContainer, and
10650 implement SetYields.
10652 (Property.Define): Do the block swapping for get_methods in the
10653 context of iterators. We need to check if Properties also
10654 include indexers or not.
10656 (Operator): Assign the Block before invoking the
10657 OperatorMethod.Define, so we can trigger the Iterator code
10660 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
10661 Property and Operator classes are not created when we parse the
10662 declarator but until we have the block completed, so we use a
10663 singleton SimpleIteratorContainer.Simple to flag whether the
10664 SetYields has been invoked.
10666 We propagate this setting then to the Property or the Operator to
10667 allow the `yield' to function.
10669 2004-02-25 Marek Safar <marek.safar@seznam.cz>
10671 * codegen.cs: Implemented attribute support for modules.
10672 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10673 Assembly/Module functionality.
10675 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10676 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10677 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10679 2004-02-16 Marek Safar <marek.safar@seznam.cz>
10681 * interface.cs (FindMembers): The operation is performed on all base
10682 interfaces and not only on the first. It is required for future CLS Compliance patch.
10684 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
10686 * statement.cs, codegen.cs:
10687 This patch deals with patterns such as:
10689 public class List : IEnumerable {
10691 public MyEnumerator GetEnumerator () {
10692 return new MyEnumerator(this);
10695 IEnumerator IEnumerable.GetEnumerator () {
10699 public struct MyEnumerator : IEnumerator {
10704 Before, there were a few things we did wrong:
10705 1) we would emit callvirt on a struct, which is illegal
10706 2) we emited ldarg when we needed to emit ldarga
10707 3) we would mistakenly call the interface methods on an enumerator
10708 type that derived from IEnumerator and was in another assembly. For example:
10710 public class MyEnumerator : IEnumerator
10712 Would have the interface methods called, even if there were public impls of the
10713 method. In a struct, this lead to invalid IL code.
10715 2004-02-11 Marek Safar <marek.safar@seznam.cz>
10717 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10720 * delegate.cs (Define): Fixed crash when delegate type is undefined.
10722 2004-02-11 Miguel de Icaza <miguel@ximian.com>
10724 * cs-parser.jay: Fix small regression: we were not testing V2
10725 compiler features correctly.
10727 * interface.cs: If the emit context is null, then create one
10729 2004-02-09 Marek Safar <marek.safar@seznam.cz>
10731 * decl.cs (GetSignatureForError): New virtual method to get full name
10732 for error messages.
10734 * attribute.cs (IAttributeSupport): New interface for attribute setting.
10735 Now it is possible to rewrite ApplyAttributes method to be less if/else.
10737 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10738 Duplicated members and code in these classes has been removed.
10739 Better encapsulation in these classes.
10741 2004-02-07 Miguel de Icaza <miguel@ximian.com>
10743 * assign.cs (Assign.DoResolve): When dealing with compound
10744 assignments, there is a new rule in ECMA C# 2.4 (might have been
10745 there before, but it is documented here) that states that in:
10749 If b is of type int, and the `op' is a shift-operator, then the
10750 above is evaluated as:
10754 * expression.cs (Binary.ResolveOperator): Instead of testing for
10755 int/uint/long/ulong, try to implicitly convert to any of those
10756 types and use that in pointer arithmetic.
10758 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10759 method to print information for from the type, not from the
10760 null-method we were given.
10762 2004-02-01 Duncan Mak <duncan@ximian.com>
10764 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10765 parsing for cmd, fixes bug #53694.
10767 2004-02-04 Marek Safar <marek.safar@seznam.cz>
10769 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10770 in the member name duplication tests. Property and operator name duplication
10771 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10773 2004-02-03 Marek Safar <marek.safar@seznam.cz>
10775 * interface.cs (PopulateMethod): Fixed crash when interface method
10776 returns not existing type (error test cs0246-3.cs).
10778 2004-02-02 Ravi Pratap M <ravi@ximian.com>
10780 * cs-parser.jay (interface_accessors): Re-write actions to also
10781 store attributes attached to get and set methods. Fix spelling
10784 (inteface_property_declaration): Modify accordingly.
10786 (InterfaceAccessorInfo): New helper class to store information to pass
10787 around between rules that use interface_accessors.
10789 * interface.cs (Emit): Apply attributes on the get and set
10790 accessors of properties and indexers too.
10792 * attribute.cs (ApplyAttributes): Modify accordingly to use the
10793 right MethodBuilder when applying attributes to the get and set accessors.
10795 2004-01-31 Miguel de Icaza <miguel@ximian.com>
10797 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10799 2004-01-26 Miguel de Icaza <miguel@ximian.com>
10801 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10803 2004-01-25 Miguel de Icaza <miguel@ximian.com>
10805 * cs-parser.jay: Remove YIELD token, instead use the new grammar
10806 changes that treat `yield' specially when present before `break'
10807 or `return' tokens.
10809 * cs-tokenizer.cs: yield is no longer a keyword.
10811 2004-01-23 Marek Safar <marek.safar@seznam.cz>
10813 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10814 setting for default constructors.
10815 For default constructors are almost every time set wrong Modifier. The
10816 generated IL code has been alright. But inside mcs this values was
10817 wrong and this was reason why several of my CLS Compliance tests
10820 2004-02-27 Martin Baulig <martin@ximian.com>
10822 * generics.cs (ConstructedType.ResolveType): Make the nested type
10823 stuff actually work.
10825 2004-02-25 Martin Baulig <martin@ximian.com>
10827 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
10828 property; returns the type parameters just from the current type,
10829 ie. with the ones from outer classes.
10830 (DeclSpace.LookupGeneric): First search in the current class, then
10832 (DeclSpace.initialize_type_params): When hiding a type parameter
10833 from an outer class, put it into the `type_param_list' anyways.
10835 * expression.cs (MemberAccess.expr): Made this field protected.
10837 * class.cs (TypeContainer.Define): The `CurrentType' just contains
10838 the type parameters from the current class.
10840 * generic.cs (ConstructedType.ResolveType): Support nested generic
10841 types by taking the type parameters which we inherit from outer
10842 classes into account.
10843 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
10844 support for nested generic types.
10846 2004-02-23 Martin Baulig <martin@ximian.com>
10848 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
10849 field and check whether we're nested inside a generic type.
10850 (DeclSpace.ResolveType): If we're resolving to a generic type
10851 definition, create a ConstructedType and return its resolved type.
10852 (DeclSpace.initialize_type_params): New private method;
10853 initializes the `type_param_list' field from the type parameters
10854 from this and all enclosing classes.
10855 (DeclSpace.TypeParameters): Call initialize_type_params() unless
10856 we're already initialized.
10858 2004-02-23 Martin Baulig <martin@ximian.com>
10860 * class.cs (Method.Define): Create the generic method before
10861 calling DoDefine().
10862 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
10863 the TypeContainer one); we use this for generic methods.
10865 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
10866 parent's TypeBuilder.
10868 2004-02-18 Martin Baulig <martin@ximian.com>
10870 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
10871 to check for equality.
10873 2004-02-05 Martin Baulig <martin@ximian.com>
10875 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
10876 `ec.TypeContainer.CurrentType', use it instead of
10877 `ec.ContainerType' to check whether we're in the type's ctor.
10879 2004-01-29 Martin Baulig <martin@ximian.com>
10881 * expression.cs (Invocation.DoResolve): If we're a
10882 `ConstructedType', then we're actually a generic method, so
10883 rewrite the expr as a GenericMemberAccess.
10885 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
10886 here; manually parse it into a string.
10888 2004-01-28 Martin Baulig <martin@ximian.com>
10890 * typemanager.cs (TypeManager.IsEqual): New static method.
10891 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
10892 check for equality instead of using `=='.
10894 2004-01-26 Martin Baulig <martin@ximian.com>
10896 * decl.cs (DeclSpace.CurrentType): New public field.
10898 * expression.cs (This.ResolveBase): If we have an
10899 `ec.TypeContainer.CurrentType', use it instead of
10900 `ec.ContainerType'.
10902 * class.cs (TypeContainer.DefineType): If we're a generic type,
10903 create the `CurrentType' (unresolved).
10904 (TypeContainer.GenericType): New private field.
10905 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
10906 it and store it in `GenericType' before creating the MemberCache.
10907 (TypeContainer.GetMembers): If we have a `GenericType', call
10908 TypeManager.FindMembers() on it.
10910 * interface.cs (Interface.GenericType): New private field.
10911 (Interface.DefineType): If we're a generic type, create the
10912 `CurrentType' (unresolved).
10913 (Interface.DefineMembers): If we have a `CurrentType', resolve it
10914 and store it in `GenericType' before creating the MemberCache.
10915 (Interface.GetMembers): If we have a `GenericType', call
10916 TypeManager.FindMembers() on it.
10918 2004-01-22 Martin Baulig <martin@ximian.com>
10920 * cs-parser.jay (namespace_or_type_name): Return an Expression,
10921 not a QualifiedIdentifier. This is what `type_name_expression'
10922 was previously doing.
10923 (type_name_expression): Removed; the code is now in
10924 `namespace_or_type_name'.
10925 (qualified_identifier): Removed, use `namespace_or_type_name'
10927 (QualifiedIdentifier): Removed this class.
10929 2004-01-22 Martin Baulig <martin@ximian.com>
10931 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10932 not a string as alias name.
10934 2004-01-21 Miguel de Icaza <miguel@ximian.com>
10936 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10937 #52730 bug, and instead compute correctly the need to use a
10938 temporary variable when requesting an address based on the
10939 static/instace modified of the field and the constructor.
10941 2004-01-21 Martin Baulig <martin@ximian.com>
10943 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10944 class and namespace before looking up aliases. Fixes #52517.
10946 2004-01-21 Martin Baulig <martin@ximian.com>
10948 * flowanalysis.cs (UsageVector.Merge): Allow variables being
10949 assinged in a 'try'; fixes exception4.cs.
10951 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10952 * class.cs : Implemented parameter-less constructor for TypeContainer
10954 * decl.cs: Attributes are now stored here. New property OptAttributes
10956 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10958 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10960 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10962 * typemanager.cs (CSharpSignature): Now reports also inner class name.
10963 (CSharpSignature): New method for indexer and property signature.
10965 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10967 * pending.cs (IsVirtualFilter): Faster implementation.
10969 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10971 * typemanager.cs: Avoid inclusion of same assembly more than once.
10973 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10975 * cs-parser.jay: Fixed problem where the last assembly attribute
10976 has been applied also to following declaration (class, struct, etc.)
10978 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10980 * class.cs: Added error CS0538, CS0539 reporting.
10981 Fixed crash on Microsoft runtime when field type is void.
10983 * cs-parser.jay: Added error CS0537 reporting.
10985 * pending.cs: Added error CS0535 reporting.
10986 Improved error report for errors CS0536, CS0534.
10988 2004-01-20 Miguel de Icaza <miguel@ximian.com>
10990 Merge a few bits from the Anonymous Method MCS tree.
10992 * statement.cs (ToplevelBlock): New class for toplevel methods,
10993 will hold anonymous methods, lifted variables.
10995 * cs-parser.jay: Create toplevel blocks for delegates and for
10996 regular blocks of code.
10998 2004-01-20 Martin Baulig <martin@ximian.com>
11000 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11001 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11002 and `NeedExplicitReturn'; added `IsLastStatement'.
11003 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11004 have a `ReturnLabel' or we're not unreachable.
11006 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11007 child's reachability; don't just override ours with it. Fixes
11008 #58058 (lluis's example).
11009 (FlowBranching): Added public InTryOrCatch(), InCatch(),
11010 InFinally(), InLoop(), InSwitch() and
11011 BreakCrossesTryCatchBoundary() methods.
11013 * statement.cs (Return): Do all error checking in Resolve().
11014 Unless we are the last statement in a top-level block, always
11015 create a return label and jump to it.
11016 (Break, Continue): Do all error checking in Resolve(); also make
11017 sure we aren't leaving a `finally'.
11018 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11019 statement in a top-level block.
11020 (Block.Flags): Added `IsDestructor'.
11021 (Block.IsDestructor): New public property.
11023 2004-01-20 Martin Baulig <martin@ximian.com>
11025 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11027 2004-01-20 Martin Baulig <martin@ximian.com>
11029 * statement.cs (Statement.ResolveUnreachable): New public method.
11030 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11031 (Block.Resolve): Resolve unreachable statements.
11033 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11035 * expression.cs: We need to fix the case where we do
11036 not have a temp variable here.
11038 * assign.cs: Only expression compound assignments need
11039 temporary variables.
11041 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11043 * flowanalysis.cs: Reduce memory allocation in a few ways:
11044 - A block with no variables should not allocate a bit
11046 - A method with no out parameters does not need any tracking
11047 for assignment of the parameters, so we need not allocate
11050 public readonly Type[] VariableTypes;
11051 public readonly string[] VariableNames;
11052 Are redundant. The data is already stored in the variable
11053 map, so we need not allocate another array for it.
11054 - We need to add alot of checks for if (params | locals) == null
11055 due to the first two changes.
11057 2004-01-18 Miguel de Icaza <miguel@ximian.com>
11059 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11060 implement IMemoryLocation, we store a copy on a local variable and
11061 take the address of it. Patch from Benjamin Jemlich
11063 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11064 to use a special "type_name_expression" rule which reduces the
11065 number of "QualifiedIdentifier" classes created, and instead
11066 directly creates MemberAccess expressions.
11068 2004-01-17 Miguel de Icaza <miguel@ximian.com>
11070 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11071 that fixes #52853. Null literal assignment to ValueType
11073 * class.cs (MethodData.Emit): Instead of checking the name of the
11074 method to determine if its a destructor, create a new derived
11075 class from Method called Destructor, and test for that.
11077 * cs-parser.jay: Create a Destructor object instead of a Method.
11079 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11083 2004-01-16 Miguel de Icaza <miguel@ximian.com>
11085 * expression.cs (Binary.ResolveOperator): Perform an implicit
11086 conversion from MethodGroups to their delegate types on the
11087 Addition operation.
11089 * delegate.cs: Introduce a new class DelegateCreation that is the
11090 base class for `NewDelegate' and `ImplicitDelegateCreation',
11091 factor some code in here.
11093 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11094 conversion from MethodGroups to compatible delegate types.
11096 * ecore.cs (Expression.Resolve): Do not flag error 654
11097 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11098 we allow conversions from MethodGroups to delegate types now.
11100 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11101 assignments in v2 either.
11103 2004-01-10 Miguel de Icaza <miguel@ximian.com>
11105 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11106 static read-only fields in ctors.
11108 Applied patch from Benjamin Jemlich
11110 * expression.cs (UnaryMutator): Avoid leaking local variables.
11112 2004-01-09 Miguel de Icaza <miguel@ximian.com>
11114 * cs-tokenizer.cs (IsCastToken): Allow the various native types
11115 here to return true, as they can be used like this:
11117 (XXX) int.MEMBER ()
11119 Fixed 49836 and all the other dups
11121 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
11123 * driver.cs: Implement /win32res and /win32icon.
11125 2004-01-08 Miguel de Icaza <miguel@ximian.com>
11127 * cs-parser.jay: Add a rule to improve error handling for the
11128 common mistake of placing modifiers after the type.
11130 2004-01-07 Miguel de Icaza <miguel@ximian.com>
11132 * cs-parser.jay (interface_event_declaration): Catch
11133 initialization of events on interfaces, and report cs0068
11135 * cs-parser.jay (interface_event_declaration): Catch
11136 initialization of events.
11138 * ecore.cs: Better report missing constructors.
11140 * expression.cs (Binary.ResolveOperator): My previous bug fix had
11141 the error reporting done in the wrong place. Fix.
11143 * expression.cs (Binary.ResolveOperator): Catch the
11144 operator + (E x, E y) error earlier, and later allow for implicit
11145 conversions in operator +/- (E e, U x) from U to the underlying
11148 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11149 52596, if the container class is abstract, the default constructor
11150 is protected otherwise its public (before, we were always public).
11152 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11155 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11156 Jemlich that fixes bug #52597, MCS was generating invalid code for
11157 idisposable structs. Thanks to Ben for following up with this
11160 2004-01-06 Miguel de Icaza <miguel@ximian.com>
11162 * driver.cs: Allow assemblies without code to be generated, fixes
11165 2004-01-07 Nick Drochak <ndrochak@gol.com>
11167 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11169 2004-01-05 Miguel de Icaza <miguel@ximian.com>
11171 * cs-parser.jay: Add rules to improve error reporting if fields or
11172 methods are declared at the namespace level (error 116)
11174 * Add rules to catch event add/remove
11176 2004-01-04 David Sheldon <dave-mono@earth.li>
11178 * expression.cs: Added matching ")" to error message for
11181 2004-01-03 Todd Berman <tberman@gentoo.org>
11183 * ecore.cs, attribute.cs:
11184 Applying fix from #52429.
11186 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11188 * ecore.cs, expression.cs, statement.cs:
11189 Total rewrite of how we handle branching. We
11190 now handle complex boolean expressions with fewer
11191 jumps. As well if (x == 0) no longer emits a ceq.
11193 if (x is Foo) is much faster now, because we generate
11196 Overall, we get a pretty big improvement on our benchmark
11197 tests. The code we generate is smaller and more readable.
11199 I did a full two-stage bootstrap. The patch was reviewed
11200 by Martin and Miguel.
11202 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11204 * cs-parser.jay: Make primary_expression not take a QI.
11205 we dont need this because the member_access rule covers
11206 us here. So we replace the rule with just IDENTIFIER.
11208 This has two good effects. First, we remove a s/r conflict.
11209 Second, we allocate many fewer QualifiedIdentifier objects.
11211 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11213 * attribute.cs: Handle MarshalAs attributes as pseudo, and
11214 set the correct information via SRE. This prevents
11215 hanging on the MS runtime. Fixes #29374.
11217 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11219 * convert.cs: correctly handle conversions to value types
11220 from Enum and ValueType as unboxing conversions.
11222 Fixes bug #52569. Patch by Benjamin Jemlich.
11224 2004-01-02 Ravi Pratap <ravi@ximian.com>
11226 * expression.cs (BetterConversion): Prefer int -> uint
11227 over int -> ulong (csc's behaviour). This fixed bug #52046.
11229 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
11231 * decl.cs (MemberCache.FindMembers): now returns a
11234 * typemanager.cs: In general, go with with ^^.
11235 (CopyNewMethods): take an IList.
11236 (RealMemberLookup): Only allocate an arraylist
11237 if we copy from two sets of methods.
11239 This change basically does two things:
11240 1) Fewer array lists allocated due to CopyNewMethods.
11241 2) the explicit cast in MemberList costed ALOT.
11243 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
11245 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11246 a hashtable to avoid needless string allocations when an identifier is
11247 used more than once (the common case).
11249 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11251 * pending.cs: MS's TypeBuilder.GetInterfaces ()
11252 is broken, it will not return anything. So, we
11253 have to use the information we have in mcs to
11256 * typemanager.cs: Add a cache for GetInterfaces,
11257 since this will now be used more often (due to ^^)
11259 (GetExplicitInterfaces) New method that gets the
11260 declared, not effective, interfaces on a type
11261 builder (eg, if you have interface IFoo, interface
11262 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11265 This patch makes MCS able to bootstrap itself on
11268 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11270 * expression.cs: Remove the Nop's that Miguel put
11273 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11275 * report.cs, codegen.cs: Give the real stack trace to
11276 the error when an exception is thrown.
11278 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11280 * decl.cs: only allocate hashtables for ifaces if
11283 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11285 * expression.cs: fix the error from cs0121-2.cs
11286 (a parent interface has two child interfaces that
11287 have a function with the same name and 0 params
11288 and the function is called through the parent).
11290 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
11292 * class.cs, rootcontext.cs, typmanager.cs: do not
11295 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
11297 * codegen.cs: remove stack for the ec flow branching.
11298 It is already a linked list, so no need.
11300 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
11302 * Makefile: Allow custom profiler here.
11304 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11306 * typemanager.cs (LookupType):
11307 - Use a static char [], because split takes
11308 a param array for args, so it was allocating
11310 - Do not store true in a hashtable, it boxes.
11312 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11314 * flowanalysis.cs: bytify common enums.
11316 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11318 * modifiers.cs: Add a new set of flags for the
11319 flags allowed on explicit interface impls.
11320 * cs-parser.jay: catch the use of modifiers in
11321 interfaces correctly.
11322 * class.cs: catch private void IFoo.Blah ().
11324 All related to bug #50572.
11326 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11328 * decl.cs: Rewrite the consistant accessability checking.
11329 Accessability is not linear, it must be implemented in
11330 a tableish way. Fixes #49704.
11332 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11334 * expression.cs: Handle negation in a checked context.
11335 We must use subtraction from zero. Fixes #38674.
11337 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11339 * class.cs: Ignore static void main in DLLs.
11340 * rootcontext.cs: Handle the target type here,
11341 since we are have to access it from class.cs
11342 * driver.cs: account for the above.
11344 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11346 * report.cs: Give line numbers and files if available.
11348 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
11350 * driver.cs: Implement /addmodule.
11352 * typemanager.cs: Change 'modules' field so it now contains Modules not
11355 2003-12-20 Martin Baulig <martin@ximian.com>
11357 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11358 (FieldBase.IsAssigned): Removed this field.
11359 (FieldBase.SetAssigned): New public method.
11360 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11362 2003-12-20 Martin Baulig <martin@ximian.com>
11364 * expression.cs (LocalVariableReference.DoResolve): Don't set
11365 `vi.Used' if we're called from DoResolveLValue().
11367 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11368 returns the usage vector it just merged into the current one -
11369 pass this one to UsageWarning().
11370 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11371 of the `EmitContext', don't call this recursively on our children.
11373 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
11375 * driver.cs: Implement /target:module.
11377 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
11379 * support.cs (CharArrayHashtable): New helper class.
11381 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
11382 char arrays, not strings, so we can avoid creating a string in
11383 consume_identifier if the identifier is a keyword.
11385 2003-12-16 Martin Baulig <martin@ximian.com>
11387 * statement.cs (LocalInfo.Assigned): Removed this property.
11388 (LocalInfo.Flags): Removed `Assigned'.
11389 (LocalInfo.IsAssigned): New public method; takes the EmitContext
11390 and uses flow analysis.
11391 (Block.UsageWarning): Made this method private.
11392 (Block.Resolve): Call UsageWarning() if appropriate.
11394 * expression.cs (LocalVariableReference.DoResolve): Always set
11395 LocalInfo.Used here.
11397 2003-12-13 Martin Baulig <martin@ximian.com>
11399 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11400 any value here; we're now using flow analysis to figure out
11401 whether a statement/block returns a value.
11403 2003-12-13 Martin Baulig <martin@ximian.com>
11405 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11407 (FlowBranching.MergeFinally): Don't call
11408 `branching.CheckOutParameters()' here, this is called in
11410 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11411 when adding the `finally' vector.
11413 2003-12-13 Martin Baulig <martin@ximian.com>
11416 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11417 actually work and also fix #48962.
11419 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
11421 * decl.cs: Do not check System.Object for nested types,
11422 since we know it does not have any. Big bang for buck:
11425 Run 1: 8.35 seconds
11426 Run 2: 8.32 seconds
11427 corlib: 17.99 seconds
11429 Run 1: 8.17 seconds
11430 Run 2: 8.17 seconds
11431 corlib: 17.39 seconds
11433 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
11435 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11436 time we are returning 0 members, so we save alot here.
11438 2003-12-11 Martin Baulig <martin@ximian.com>
11440 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11441 `MergeChild()', also just take the `FlowBranching' as argument;
11442 call Merge() on it and return the result.
11443 (FlowBranching.Merge): We don't need to do anything if we just
11446 2003-12-11 Martin Baulig <martin@ximian.com>
11448 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11449 them in an `ArrayList' to reduce memory usage. Thanks to Ben
11450 Maurer for this idea.
11452 2003-12-11 Martin Baulig <martin@ximian.com>
11454 * flowanalysis.cs (MergeResult): This class is now gone; we now
11455 use the `UsageVector' for this. The reason for this is that if a
11456 branching just has one sibling, we don't need to "merge" them at
11457 all - that's the next step to do.
11458 (FlowBranching.Merge): We now return a `UsageVector' instead of a
11461 2003-12-11 Martin Baulig <martin@ximian.com>
11463 Reworked flow analyis and made it more precise and bug-free. The
11464 most important change is that we're now using a special `Reachability'
11465 class instead of having "magic" meanings of `FlowReturns'. I'll
11466 do some more cleanups and optimizations and also add some more
11467 documentation this week.
11469 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11470 largely reworked this class.
11471 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11472 the new `Reachability' class instead of having "magic" values here.
11473 (FlowBranching): We're now using an instance of `Reachability'
11474 instead of having separate `Returns', `Breaks' etc. fields.
11476 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11477 based on flow analysis; ignore the return value of block.Emit ().
11479 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
11481 * driver.cs typemanager.cs: Find the mono extensions to corlib even
11482 if they are private.
11484 2003-12-09 Martin Baulig <martin@ximian.com>
11486 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11487 call them directly on the UsageVector.
11489 2003-12-09 Martin Baulig <martin@ximian.com>
11491 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11492 Changed return type from `FlowReturns' to `Reachability'.
11494 2003-12-09 Martin Baulig <martin@ximian.com>
11496 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11497 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11498 `Reachable' fields with a single `Reachability' one.
11500 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11502 * class.cs (FindMembers): Remove foreach's.
11507 Run 1: 8.74 seconds
11508 Run 2: 8.71 seconds
11511 Run 1: 8.64 seconds
11512 Run 2: 8.58 seconds
11515 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11520 This patch does a few things:
11521 1. EmptyStatement is now a singleton, so it is never reallocated.
11522 2. All blah is EmptyStatement constructs have been changed to
11523 blah == EmptyStatement.Value, which is much faster and valid
11524 now that EmptyStatement is a singleton.
11525 3. When resolving a block, rather than allocating a new array for
11526 the non-empty statements, empty statements are replaced with
11527 EmptyStatement.Value
11528 4. Some recursive functions have been made non-recursive.
11529 Mainly the performance impact is from (3), however (1) and (2) are needed for
11530 this to work. (4) does not make a big difference in normal situations, however
11531 it makes the profile look saner.
11536 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11537 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11538 Total memory allocated: 56397 KB
11541 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11542 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11543 Total memory allocated: 55666 KB
11545 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11547 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11548 than the hashtable in a hashtable version
11550 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11551 we always end up concating a string. This results in a huge perf
11552 loss, because many strings have to be tracked by the GC. In this
11553 patch, we first use a hashtable that works with two keys, so that
11554 the strings do not need to be concat'ed.
11558 Run 1: 8.74 seconds
11559 Run 2: 8.71 seconds
11562 Run 1: 8.65 seconds
11563 Run 2: 8.56 seconds
11565 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11567 * Makefile: Add a new target `do-time' that does a quick and simple
11568 profile, leaving easy to parse output.
11570 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
11572 * codegen.cs (Init): Create the dynamic assembly with
11573 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11575 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
11577 * support.cs: Make the PtrHashtable use only one
11578 instance of its comparer.
11580 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
11582 * typemanager.cs: Fix lookup of GetNamespaces.
11584 2003-11-29 Miguel de Icaza <miguel@ximian.com>
11586 * expression.cs: Removed redundant line.
11588 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11589 ArrayLists, use for loops with bounds.
11591 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11594 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11595 arraylists, use for loop with bounds.
11597 The above three changes give us a 0.071 second performance
11598 improvement out of 3.294 seconds down to 3.223. On my machine
11599 the above changes reduced the memory usage by 1,387 KB during
11600 compiler bootstrap.
11602 * cs-parser.jay (QualifiedIdentifier): New class used to represent
11603 QualifiedIdentifiers. Before we created a new string through
11604 concatenation, and mostly later on, the result would be
11605 manipulated by DecomposeQI through string manipulation.
11607 This reduced the compiler memory usage for bootstrapping from
11608 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11609 compile times in 0.05 seconds.
11611 2003-11-28 Dick Porter <dick@ximian.com>
11613 * support.cs: Do string compares with the Invariant culture.
11621 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11622 the comparison is done with the Invariant culture.
11624 2003-11-27 Miguel de Icaza <miguel@ximian.com>
11626 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11627 GetEnumerator method.
11629 (ProbeCollectionType): Iterate starting at the most specific type
11630 upwards looking for a GetEnumerator
11632 * expression.cs: Shift count can be up to 31 for int/uint and 63
11635 2003-11-26 Miguel de Icaza <miguel@ximian.com>
11637 * statement.cs (Block.LookupLabel): Also look for the label on the
11638 children blocks. Use a hash table to keep track of visited
11641 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11642 we actually did transform the other operand, otherwise fall back
11643 to the common codepath that casts to long.
11645 * cs-tokenizer.cs: Use the same code pattern as the int case.
11646 Maybe I should do the parsing myself, and avoid depending on the
11647 Parse routines to get this done.
11649 2003-11-25 Miguel de Icaza <miguel@ximian.com>
11651 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11652 which fixes bug 51347. This time test it.
11654 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11655 attributes for example can not tell the difference between these.
11656 The difference was only a syntax feature of the language.
11658 * attribute.cs: Apply attributes to delegates.
11660 * delegate.cs: Call the apply attributes method.
11662 2003-11-24 Miguel de Icaza <miguel@ximian.com>
11664 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11665 comparing 0 vs Byte.MinValue, not the value
11667 (ImplicitConversionRequired): When reporting a conversion error,
11668 use error 31 to print out the constant error instead of the
11671 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11672 which fixes bug 51347.
11674 2003-11-22 Miguel de Icaza <miguel@ximian.com>
11676 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
11677 which fixes the -warnaserror command line option.
11679 2003-11-21 Miguel de Icaza <miguel@ximian.com>
11681 * cfold.cs (DoNumericPromotions): During constant folding of
11682 additions on UIntConstant, special case intconstants with
11683 IntConstants like we do on the expression binary operator.
11685 2003-11-12 Miguel de Icaza <miguel@ximian.com>
11687 * convert.cs (ImplicitReferenceConversion): We were missing a case
11688 (System.Enum are not value types or class types, so we need to
11689 classify them separatedly).
11691 * driver.cs: We do not support error 2007.
11693 2003-11-12 Jackson Harper <jackson@ximian.com>
11695 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11696 system directory. Also use the full file name so users can
11697 libraries names mscorlib-o-tron.dll in a non system dir.
11699 2004-01-04 David Sheldon <dave-mono@earth.li>
11701 * expression.cs: Added matching ")" to error message for CS0077.
11703 2003-12-19 Martin Baulig <martin@ximian.com>
11705 * typemanager.cs (TypeManager.IsEqualGenericType): New public
11706 static method; see documentation in the method.
11707 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
11709 * convert.cs (Convert.ImplicitReferenceConversion,
11710 Convert.ImplicitReferenceConversionExists): Add support for
11711 generic type declarations; see gen-36.cs.
11713 2003-12-19 Martin Baulig <martin@ximian.com>
11715 * pending.cs (Pending.InterfaceMethod): Use
11716 `Type.IsAssignableFrom()' instead of `=='.
11718 2003-12-18 Martin Baulig <martin@ximian.com>
11720 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
11723 * convert.cs (Convert.ImplicitStandardConversionExists): Use
11724 `expr_type.Equals (target_type)' instead of `=='.
11726 2003-12-08 Martin Baulig <martin@ximian.com>
11728 * generics.cs (Constraints.Types): Removed.
11729 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
11731 (Constraints.ResolveTypes): New public method; resolves the
11732 TypeExpr's to Type's.
11733 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
11734 longer takes the constraints.
11735 (TypeParameter.DefineMethod): Likewise.
11736 (TypeParameter.DefineType): New public method. Calls
11737 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
11740 2003-12-08 Martin Baulig <martin@ximian.com>
11742 * convert.cs (Convert.ImplicitConversionStandard): Use
11743 `expr_type.Equals (target_type)' instead of `=='.
11745 2003-12-08 Martin Baulig <martin@ximian.com>
11747 * typemanager.cs (TypeManager.GetReferenceType): Call
11748 `Type.MakeByRefType ()'.
11750 2003-12-08 Martin Baulig <martin@ximian.com>
11752 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
11753 just has some special meaning in some situations. For instance,
11754 it is allowed to use `where' as the name of a variable etc.
11756 2003-12-04 Martin Baulig <martin@ximian.com>
11758 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
11759 `Type.MakeArrayType()' for array types.
11761 2003-11-18 Miguel de Icaza <miguel@ximian.com>
11763 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
11766 (SizeOf.DoResolve): assign the `type_queried' field. This gets
11769 2003-11-16 Martin Baulig <martin@ximian.com>
11771 * codegen.cs (EmitContext.IsGeneric): Removed.
11773 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
11774 ResolveGeneric() on the DeclSpace.
11776 2003-11-16 Martin Baulig <martin@ximian.com>
11778 * generic.cs (TypeArguments.Resolve):
11779 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
11780 `ResolveType()' on it to get the Type.
11782 2003-11-15 Martin Baulig <martin@ximian.com>
11784 * generic.cs (ConstructedType.GetInterfaces): Override this.
11786 2003-11-14 Martin Baulig <martin@ximian.com>
11788 * interface.cs (Interface.DefineType): Define all type parameters
11789 before adding the interfaces we inherit.
11791 2003-11-11 Martin Baulig <martin@ximian.com>
11793 * generic.cs (ConstructedType.ResolveType): Always call
11794 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
11796 2003-11-10 Martin Baulig <martin@ximian.com>
11798 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11799 (TypeManager.InitCoreTypes): Initialize them here, but instead of
11800 calling `ResolveType()' on them, directly assign their `Type'.
11802 2003-11-08 Martin Baulig <martin@ximian.com>
11804 * generic.cs (ConstructedType): Override `IsClass' etc.
11806 2003-11-08 Martin Baulig <martin@ximian.com>
11808 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11809 return value and the `out parent' parameter.
11810 (TypeContainer.DefineType): Moved the CS0644 check into
11811 GetClassBases(). Don't pass the interface types to the
11812 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11813 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11815 * ecore.cs (TypeExpr.IsAttribute): New property.
11816 (TypeExpr.GetInterfaces): New method.
11818 * interface.cs (Interface.GetInterfaceTypeByName): Return a
11819 TypeExpr instead of a Type.
11820 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11821 (Interface.DefineType): Don't pass the interface types to the
11822 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11823 them later and then call `TypeBulider.AddInterfaceImplementation()'.
11825 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11826 instead of a `Type[]'.
11827 (TypeManager.RegisterBuilder): Likewise.
11828 (TypeManager.AddUserInterface): Likewise.
11829 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11830 `Type[]' and also return a `TypeExpr[]'.
11831 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11833 2003-11-08 Martin Baulig <martin@ximian.com>
11835 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11838 2003-11-08 Martin Baulig <martin@ximian.com>
11840 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11841 TypeManager.ResolveExpressionTypes().
11843 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11844 instead of an Expression.
11845 (TypeExpr): This is now an abstract base class for `TypeExpression'.
11846 (TypeExpression): New public class; formerly known as `TypeExpr'.
11848 * expression.cs (ComposedCast): Derive from TypeExpr.
11850 * typemanager.cs (TypeManager.system_*_expr): These are now
11851 TypExpr's instead of Expression's.
11852 (TypeManager.ResolveExpressionTypes): New public static function;
11853 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11856 2003-11-06 Miguel de Icaza <miguel@ximian.com>
11858 * expression.cs (New.DoResolve): Do not dereference value that
11859 might be a null return.
11861 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11862 sure that the constant value has the right type. Fixes an
11863 unreported bug, similar to 50425.
11865 * const.cs (Const.LookupConstantValue): Call
11866 ImplicitStandardConversionExists before doing a conversion to
11867 avoid havng the TypeManager.ChangeType do conversions.
11869 Reduced the number of casts used
11871 (Const.ChangeType): New routine to enable reuse of the constant
11872 type changing code from statement.
11874 * typemanager.cs (ChangeType): Move common initialization to
11875 static global variables.
11879 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11880 every value type to go through, even if it was void. Fix that.
11882 * cs-tokenizer.cs: Use is_identifier_start_character on the start
11883 character of the define, and the is_identifier_part_character for
11884 the rest of the string.
11886 2003-11-05 Miguel de Icaza <miguel@ximian.com>
11888 * expression.cs (UnaryMutator.EmitCode): When I updated
11889 LocalVariableReference.DoResolve, I overdid it, and dropped an
11890 optimization done on local variable references.
11892 2003-11-04 Miguel de Icaza <miguel@ximian.com>
11894 * ecore.cs: Convert the return from Ldlen into an int.
11896 2003-10-20 Miguel de Icaza <miguel@ximian.com>
11898 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11899 the accessibility, this is a special case for toplevel non-public
11900 classes (internal for instance).
11902 2003-10-20 Nick Drochak <ndrochak@gol.com>
11904 * ecore.cs: Fix typo and build. Needed another right paren.
11906 2003-10-19 Miguel de Icaza <miguel@ximian.com>
11908 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
11909 `internal' case regular and protected, but not allowing protected
11910 to be evaluated later. Bug 49840
11912 2003-10-15 Miguel de Icaza <miguel@ximian.com>
11914 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11915 to kb.Nlast, and not the kb.nFirst to isolate the switch
11918 Extract the underlying type, so enumerations of long/ulong are
11919 treated like long/ulong.
11921 2003-10-14 Miguel de Icaza <miguel@ximian.com>
11923 * expression.cs (New): Overload the meaning of RequestedType to
11924 track the possible creation of the NewDelegate type, since
11925 DoResolve is invoked more than once for new constructors on field
11928 See bugs: #48800 and #37014
11930 * cs-parser.jay (declare_local_constants): Take an arraylist
11931 instead of a single constant.
11933 (local_constant_declaration): It should take a
11934 constant_declarators, not a constant_declarator. Fixes 49487
11936 * convert.cs: Fix error report.
11938 2003-10-13 Jackson Harper <jackson@ximian.com>
11940 * typemanager.cs (TypeToCoreType): Add float and double this fixes
11943 2003-11-03 Martin Baulig <martin@ximian.com>
11945 * expression.cs (ArrayAccess.GetStoreOpcode): Added
11946 `out bool has_type_arg'; if set, we need to pass the type to
11948 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
11949 Stelem_Any/Ldelem_Any for generic parameters.
11951 2003-11-02 Martin Baulig <martin@ximian.com>
11953 * expression.cs (Invocation.EmitCall): Use
11954 `TypeManager.IsValueType()' to check whether it's a value type.
11955 Don't set `struct_call' when calling a method on a type parameter.
11957 2003-11-02 Martin Baulig <martin@ximian.com>
11959 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
11960 and removed the TypeBuilder argument.
11962 * typemanager.cs (TypeManager.IsValueType): Return
11963 `t.IsGenericParameter || t.IsValueType'.
11965 2003-10-25 Martin Baulig <martin@ximian.com>
11967 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
11968 call ConstructedType.Resolve() on it.
11970 * generic.cs (ConstructedType.Resolve): Set `type' on success.
11972 2003-10-25 Martin Baulig <martin@ximian.com>
11974 * class.cs (TypeContainer.GetClassBases): Changed
11975 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
11976 CS8214 reporting here.
11977 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
11978 instead of a `Type' for our parent. In case of a recursive
11979 declaration (see tests/gen-23.cs for an example), our parent is a
11980 ConstructedType and it doesn't have its type set. So, first
11981 create our own TypeBuilder, then call constructed.Resolve() to get
11982 the parent's type and finally TypeBuilder.SetParent() it.
11984 * ecore.cs (TypeExpr.Name): New public virtual property.
11987 (ConstructedType): We're now a TypeExpr and not just an Expression.
11988 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
11989 arguments here; this is done later.
11990 (ConstructedType.Resolve): New public method to resolve the type
11991 arguments and bind them.
11993 2003-10-21 Martin Baulig <martin@ximian.com>
11995 * convert.cs: Use `TypeManager.IsValueType' instead of
11996 'type.IsValueType' everywhere.
11998 * typemanager.cs (TypeManager.IsValueType): Return true for type
11999 parameters. The reason for this is that we need to box a type
12000 parameter when converting it to a reference type.
12002 * cs-parser.jay: Added support for default value expressions.
12004 * generics.cs (DefaultValueExpression): New public class.
12006 2003-10-17 Martin Baulig <martin@ximian.com>
12008 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12009 TypeContainer so we can also use this for Interfaces.
12010 (TypeParameter.Resolve): Likewise.
12012 * interface.cs (Interface.DefineType): Added support for generic
12015 * cs-parser.jay: Added support for generic structs and interfaces.
12017 2003-10-17 Martin Baulig <martin@ximian.com>
12019 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12020 call generic methods :-)
12022 2003-10-16 Martin Baulig <martin@ximian.com>
12024 * cs-parser.jay (namespace_or_type_name): Only create a
12025 GenericMemberAccess if we actually have type arguments.
12027 2003-10-13 Martin Baulig <martin@ximian.com>
12029 * class.cs (Method.Define): If we're a generic method, call
12030 TypeBuilder.DefineGenericMethod () before resolving
12032 (MethodData): Added .ctor which takes an additional MethodBuilder
12033 argument; this is used for generic methods.
12034 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12035 we already have a MethodBuilder.
12037 2003-10-10 Martin Baulig <martin@ximian.com>
12039 * class.cs (Method): Added .ctor which takes a `GenericMethod'
12040 instead of a `DeclSpace'. This is used for generic methods.
12042 * cs-parser.jay (method_header): Added support for generic
12043 methods; create a `GenericMethod' instance and pass it to the
12044 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12045 parameters and locals.
12047 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12048 since we already have the location. Check whether we're a generic
12049 type declaration or a generic method and create the correct type
12052 * generic.cs (TypeParameter.DefineMethod): New public method.
12053 (GenericMethod): New public class; derives from DeclSpace and is
12054 used for generic methods.
12056 2003-10-09 Martin Baulig <martin@ximian.com>
12058 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12060 (MethodCore.DoDefineParameters): Removed the TypeContainer
12061 argument; use the DeclSpace which was passed to the .ctor instead.
12062 (MethodCore.CheckParameter): Take a DeclSpace instead of a
12063 TypeContainer; we only need a DeclSpace here.
12065 2003-10-09 Martin Baulig <martin@ximian.com>
12067 * class.cs (MethodData): Added additional `DeclSpace ds' argument
12069 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12070 EmitContext's .ctor.
12072 2003-10-09 Martin Baulig <martin@ximian.com>
12074 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12075 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12076 AsAccessible(), moved them as well.
12078 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12080 2003-10-07 Miguel de Icaza <miguel@ximian.com>
12082 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12083 generation for >=, as spotted by Paolo, bug 48679.
12084 Patch from David Waite.
12086 * cs-tokenizer.cs: Add handling for #pragma.
12088 * cs-parser.jay: Allow for both yield and yield return in the
12089 syntax. The anti-cobolization of C# fight will go on!
12091 * class.cs (TypeBuilder.DefineType): Catch error condition here
12092 (Parent.DefineType erroring out and returning null).
12094 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12095 coping with enumerations variables, we were mistakenly processing
12096 them as a regular value type instead of built-in types. Fixes the
12099 * typemanager.cs (IsBuiltinOrEnum): New method.
12101 2003-09-30 Miguel de Icaza <miguel@ximian.com>
12103 * cs-parser.jay: Upgrade: yield now needs the return clause.
12105 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12107 * cs-parser.jay : Renamed yyName to yyNames related to jay.
12109 2003-09-29 Martin Baulig <martin@ximian.com>
12111 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12112 inflated generic methods.
12114 * generics.cs (ConstructedType): Distinguish between open and
12115 closed constructed types; correctly resolve the arguments.
12117 2003-09-22 Martin Baulig <martin@ximian.com>
12119 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12120 all type arguments meet their constraints.
12122 2003-09-19 Martin Baulig <martin@ximian.com>
12124 * decl.cs (MemberCache.SetupCacheForInterface): Take a
12125 `MemberCache parent' argument. Normally, an interface doesn't
12126 have a parent type except System.Object, but we use this in gmcs
12127 for generic type parameters.
12129 2003-09-18 Martin Baulig <martin@ximian.com>
12131 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12132 on `type.IsInterface'; don't check whether the type has a parent
12133 to determine whether it's an interface.
12135 2003-09-17 Martin Baulig <martin@ximian.com>
12137 * generic.cs (ConstructedType.ToString): Always use `name' as the
12140 2003-09-15 Martin Baulig <martin@ximian.com>
12142 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12144 * generic.cs (Constraints.Resolve): New public method; this is
12145 called to resolve the constraint types and to check whether all
12146 the constraints are correct.
12147 (Constraints.Types): New public property.
12148 (TypeParameter.Resolve): New public method; resolves all the
12149 type's constraints.
12151 * class.cs (TypeContainer.DefineType): Call
12152 TypeParameter.Resolve() before actually defining the type.
12154 2003-09-15 Martin Baulig <martin@ximian.com>
12156 * class.cs (TypeContainer.DefineType): Added an error flag to
12157 avoid reporting duplicate CS0146's ("class definition is
12160 * driver.cs (Driver.MainDriver): Abort if
12161 RootContext.ResolveTree() reported any errors.
12163 2003-09-07 Martin Baulig <martin@ximian.com>
12165 * report.cs (Error, Warning): Added overloaded versions which take
12166 a `params object[] args' and call String.Format().
12168 2003-09-07 Martin Baulig <martin@ximian.com>
12170 * decl.cs (DeclSpace..ctor): Don't call
12171 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12172 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
12173 (DeclSpace.RecordDecl): New method.
12175 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12177 2003-09-02 Ravi Pratap <ravi@ximian.com>
12179 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12180 value attributes to be applied to ParameterBuilders.
12182 * class.cs (MethodCore.LabelParameters): Make static and more
12183 generic so that it can be used from other places - like interface
12184 methods, for instance.
12186 * interface.cs (Interface.Emit): Call LabelParameters before
12187 emitting attributes on the InterfaceMethod.
12189 2003-09-07 Martin Baulig <martin@ximian.com>
12191 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12192 if the number of type parameters doesn't match.
12194 2003-09-04 Martin Baulig <martin@ximian.com>
12196 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12197 for arrays of generic type params (ie. `!0[]').
12199 2003-09-04 Martin Baulig <martin@ximian.com>
12201 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12204 2003-09-04 Martin Baulig <martin@ximian.com>
12206 * decl.cs (DeclSpace.LookupGeneric): New method.
12207 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12210 * generic.cs (TypeParameterExpr): Take a TypeParameter as
12211 argument, not just a string.
12212 (TypeParameter.Define): New public method; this is called to
12213 actually define the generic parameter; after this, you can use the
12214 new `Type' property to get the type.
12216 2003-09-04 Martin Baulig <martin@ximian.com>
12218 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12219 is now an ArrayList; initialize the result of the `TypeParameters'
12221 (DeclSpace.GetGenericData): Removed.
12222 (DeclSpace.LookupGeneric): Temporarily removed; we need to
12223 implement this in a different way.
12224 (DeclSpace.GetTypeParameters): Removed; there's now a
12225 `TypeParameters' property.
12226 (DeclSpace.TypeParameters): New public property.
12228 * generic.cs (Constraints): Make this class public.
12229 (TypeParameter): New public class.
12231 2003-09-04 Martin Baulig <martin@ximian.com>
12233 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
12234 generic parameters.
12236 * class.cs (TypeContainer.DefineType): Call
12237 TypeBuilder.DefineGenericParameter () on all generic parameters if
12238 this is a generic type.
12240 2003-08-28 Martin Baulig <martin@ximian.com>
12242 * sample-stack.il: Compile this with ilasm: "ilasm /dll
12245 * sample-hello.cs: Compile this with gmcs: "gmcs
12246 /r:sample-stack.dll sample-hello.cs".
12248 2003-08-28 Martin Baulig <martin@ximian.com>
12250 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12251 the parameters to the generic type.
12253 2003-08-28 Martin Baulig <martin@ximian.com>
12255 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
12257 2003-08-28 Martin Baulig <martin@ximian.com>
12259 * cs-parser.jay (opt_type_argument_list): Use
12260 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
12261 (primary_expression): Replace `qualified_identifier' with `type_name'.
12262 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
12264 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
12265 parser to check whether it is syntactically a type parameter list;
12266 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
12269 2003-08-26 Martin Baulig <martin@ximian.com>
12271 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12272 resolving aliases; fixes #47927.
12274 2003-08-26 Martin Baulig <martin@ximian.com>
12276 * statement.cs (Using.DoResolve): This is internally emitting a
12277 try/finally clause, so we need to set ec.NeedExplicitReturn if we
12278 do not always return. Fixes #47681.
12280 2003-08-26 Martin Baulig <martin@ximian.com>
12282 * decl.cs (MemberCore): Moved WarningNotHiding(),
12283 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12285 (AdditionResult): Make this nested in DeclSpace.
12286 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12287 argument; call NamespaceEntry.Define() unless we're nested in a
12290 * namespace.cs (Namespace.DefineName): New public function. This
12291 is called from DeclSpace's .ctor to add
12292 (Namespace.Lookup): Include DeclSpaces in the lookup.
12294 * class.cs (Operator): Derive from MemberBase, not MemberCore.
12296 * const.cs (Const): Derive from MemberBase, not MemberCore.
12298 2003-08-25 Martin Baulig <martin@ximian.com>
12300 * convert.cs (Convert.ExplicitReferenceConversion): When
12301 converting from an interface type to a class, unbox if the target
12302 type is a struct type. Fixes #47822.
12304 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12306 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12309 2003-08-22 Martin Baulig <martin@ximian.com>
12311 * class.cs (TypeManager.DefineType): When defining a nested type,
12312 call DefineType() on our parent; fixes #47801.
12314 2003-08-22 Martin Baulig <martin@ximian.com>
12316 * class.cs (MethodData.Define): While checking if a method is an
12317 interface implementation, improve the test a bit more to fix #47654.
12319 2003-08-22 Martin Baulig <martin@ximian.com>
12321 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12322 correctly; fixes #47722.
12324 2003-08-22 Martin Baulig <martin@ximian.com>
12326 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12327 LocalVariableReference, ensure it's not read-only. Fixes #47536.
12329 * statement.cs (Fixed.DoResolve): Make all variables read-only.
12331 2003-08-22 Martin Baulig <martin@ximian.com>
12333 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12334 can only be assigned in static constructors. Fixes #47161.
12336 2003-08-22 Martin Baulig <martin@ximian.com>
12338 Rewrote and improved the flow analysis code.
12340 * flowbranching.cs (FlowBranching): Make this class abstract.
12341 (FlowBranching.CreateBranching): New static function to create a
12342 new flow branching.
12343 (FlowBranchingBlock, FlowBranchingException): New classes.
12344 (FlowBranching.UsageVector.Type): New public readonly field.
12345 (FlowBranching.UsageVector.Breaks): Removed the setter.
12346 (FlowBranching.UsageVector.Returns): Removed the setter.
12347 (FlowBranching.UsageVector): Added Break(), Return(),
12348 NeverReachable() and Throw() methods to modify the reachability.
12349 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12350 done by FlowBranching.Merge().
12351 (FlowBranching.UsageVector.MergeChild): New method; merges the
12352 merge result into the current vector.
12353 (FlowBranching.Merge): New abstract method to merge a branching.
12355 2003-08-12 Martin Baulig <martin@ximian.com>
12357 * expression.cs (Indirection.CacheTemporaries): Create the
12358 LocalTemporary with the pointer type, not its element type.
12360 2003-08-10 Miguel de Icaza <miguel@ximian.com>
12362 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12363 token was a keyword or not.
12365 Add `error' options where an IDENTIFIER was expected; Provide
12366 CheckToken and CheckIdentifierToken convenience error reporting
12369 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12371 * decl.cs: Rename `NamespaceEntry Namespace' public field into
12372 NameSpaceEntry NameSpaceEntry.
12374 (LookupInterfaceOrClass): Avoid creating a full qualified name
12375 from namespace and name: avoid doing lookups when we know the
12376 namespace is non-existant. Use new Tree.LookupByNamespace which
12377 looks up DeclSpaces based on their namespace, name pair.
12379 * driver.cs: Provide a new `parser verbose' to display the
12380 exception thrown during parsing. This is turned off by default
12381 now, so the output of a failure from mcs is more graceful.
12383 * namespace.cs: Track all the namespaces defined in a hashtable
12386 (IsNamespace): New method
12388 2003-08-09 Miguel de Icaza <miguel@ximian.com>
12390 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
12391 we know that we need to concatenate (full typename can never be
12396 * statement.cs: Use a bitfield; Do not initialize to null things
12397 which are done by the constructor by default.
12399 * cs-parser.jay: bug fix, parameter was 4, not 3.
12401 * expression.cs: Just use the property;
12403 * statement.cs: No need for GetVariableInfo method.
12405 2003-08-08 Martin Baulig <martin@ximian.com>
12407 * flowanalysis.cs (FlowReturns): This is now nested in the
12408 `FlowBranching' class.
12409 (MyBitVector): Moved this here from statement.cs.
12410 (FlowBranching.SiblingType): New enum type.
12411 (FlowBranching.CreateSibling): Added `SiblingType' argument.
12413 2003-08-07 Martin Baulig <martin@ximian.com>
12415 * flowanalysis.cs (FlowBranchingType): This is now nested in the
12416 `FlowBranching' class and called `BranchingType'.
12418 2003-08-07 Martin Baulig <martin@ximian.com>
12420 * flowanalysis.cs: Moved all the control flow analysis code into
12423 2003-08-07 Martin Baulig <martin@ximian.com>
12425 * assign.cs (Assign.DoResolve): `target' must either be an
12426 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
12429 2003-08-07 Miguel de Icaza <miguel@ximian.com>
12431 * expression.cs (BinaryMethod): This kind of expression is created by the
12432 Binary class if it determines that the operator has to be handled
12435 (BinaryDelegate): This kind of expression is created if we are
12436 dealing with a + or - operator on delegates.
12438 (Binary): remove method, argumetns, and DelegateOperator: when
12439 dealing with methods,
12441 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12443 * statement.cs (Block): use bitfields for the three extra booleans
12444 we had in use. Remove unused topblock parameter.
12446 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12448 * assign.cs: Drop extra unneeded tests.
12450 2003-08-06 Miguel de Icaza <miguel@ximian.com>
12452 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12454 * statement.cs (Foreach): Use VariableStorage instead of
12457 * codegen.cs (VariableStorage): New class used by clients that
12458 require a variable stored: locals or fields for variables that
12459 need to live across yield.
12461 Maybe provide a convenience api for EmitThis+EmitLoad?
12463 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12466 2003-08-05 Miguel de Icaza <miguel@ximian.com>
12468 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12469 RemapParameterLValue): New methods that are used to turn a
12470 precomputed FieldInfo into an expression like this:
12474 The idea is to use this instead of making LocalVariableReference
12475 have more than one meaning.
12477 * cs-parser.jay: Add error production to BASE.
12479 * ecore.cs: Deal with TypeManager.GetField returning null, which
12480 is now a valid return value.
12482 (FieldExprNoAddress): New expression for Fields whose address can
12485 * expression.cs (LocalVariableReference): During the resolve
12486 phases, create new expressions if we are in a remapping context.
12487 Remove code that dealt with remapping here.
12489 (ParameterReference): same.
12491 (ProxyInstance): New expression, like the `This' expression, but
12492 it is born fully resolved. We know what we are doing, so remove
12493 the errors that are targeted to user-provided uses of `this'.
12495 * statement.cs (Foreach): our variable is now stored as an
12496 Expression; During resolution, follow the protocol, dont just
12497 assume it will return this.
12499 2003-08-06 Martin Baulig <martin@ximian.com>
12501 * support.cs (SeekableStreamReader.cs): New public class.
12503 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12504 SeekableStreamReader instead of the normal StreamReader.
12506 2003-08-04 Martin Baulig <martin@ximian.com>
12508 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12509 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12510 deambiguate casts and delegate invocations.
12511 (parenthesized_expression): Use the new tokens to ensure this is
12512 not a cast of method invocation.
12514 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12515 when reading a `)' and Deambiguate_CloseParens () was previously
12518 * expression.cs (ParenthesizedExpression): New class. This is
12519 just used for the CS0075 test.
12520 (Binary.DoResolve): Check for CS0075.
12522 2003-07-29 Ravi Pratap <ravi@ximian.com>
12524 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12525 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12526 reference comparison.
12528 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12529 examine the ReturnType for equality - this is necessary in the
12530 cases of implicit and explicit operators whose signature also
12531 includes the return type.
12533 2003-07-26 Miguel de Icaza <miguel@ximian.com>
12535 * namespace.cs: Cache the result of the namespace computation,
12536 instead of computing it every time.
12538 2003-07-24 Miguel de Icaza <miguel@ximian.com>
12540 * decl.cs: Use a global arraylist that we reuse over invocations
12541 to avoid excesive memory consumption. Reduces memory usage on an
12542 mcs compile by one meg (45 average).
12544 * typemanager.cs (LookupTypeReflection): In .NET pointers are
12545 private, work around that.
12547 2003-07-23 Miguel de Icaza <miguel@ximian.com>
12549 * literal.cs (IntLiteral): Define Zero and One static literals.
12551 * cs-parser.jay (integer_literal): use static literals to reduce
12552 memory usage for the most used literals (0, 1 and -1). 211kb
12553 reduced in memory usage.
12555 Replace all calls to `new ArrayList' with `new
12556 ArrayList(4)' which is a good average number for most allocations,
12557 and also requires only 16 bytes of memory for its buffer by
12560 This reduced MCS memory usage in seven megabytes for the RSS after
12563 2003-07-28 Ravi Pratap <ravi@ximian.com>
12565 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12566 handle params methods the correct way by forming only one
12567 applicable set with params and normal methods in them. Earlier we
12568 were looking at params methods only if we found no normal methods
12569 which was not the correct thing to do.
12571 (Invocation.BetterFunction): Take separate arguments indicating
12572 when candidate and the best method are params methods in their
12575 This fixes bugs #43367 and #46199.
12577 * attribute.cs: Documentation updates.
12579 (CheckAttribute): Rename to CheckAttributeTarget.
12580 (GetValidPlaces): Rename to GetValidTargets.
12582 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12583 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12587 2003-07-28 Miguel de Icaza <miguel@ximian.com>
12589 * codegen.cs: Compute IsGeneric correctly.
12591 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
12594 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
12595 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
12596 regressions, and I was chasing more bugs than I required.
12598 * interface.cs: Use expressions for base type names (like classes
12599 and structs have been doing for a while now), and resolve that.
12600 This patch should probably go into head as well.
12602 This makes it one less user of FindType.
12604 2003-07-24 Miguel de Icaza <miguel@ximian.com>
12606 This compiler can not self host currently. Need to fix that.
12608 * Makefile: compile to `gmcs.exe'
12610 * driver.cs: Turn on v2 by default on gmcs.
12612 * generic.cs (ConstructedType): Does no longer take a container
12613 type argument; That will be taken care of later.
12615 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
12616 Use SimpleName to resolve for now, so we can continue the work on
12617 the parser, until we get Type.GetType that understands generics.
12619 (ConstructedType.ToString): Implement
12621 (TypeArguments.Resolve): Resolve the child expressions as types.
12623 * cs-parser.jay: Rename interface_constraints to
12624 type_parameter_constraints
12626 (namespace_or_type_name): Only use constructed types for the basic
12627 construction, we will deal with identifier<...> later.
12629 (type/type_name): No longer call DecomposeQI, as
12630 namespace_or_type_name is always decoded now.
12632 2003-07-22 Ravi Pratap <ravi@ximian.com>
12634 * expression.cs (Invocation.OverloadResolve): Follow the spec more
12635 closely: we eliminate methods in base types when we have an
12636 applicable method in a top-level type.
12638 Please see section 14.5.5.1 for an exact description of what goes
12641 This fixes bug #45127 and a host of other related to corlib compilation.
12643 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12644 array is the method corresponding to the top-level type (this is
12645 because of the changes made to icall.c) so we change this
12648 (MethodGroupExpr.Name): This too.
12650 * typemanager.cs (GetElementType): New method which does the right
12651 thing when compiling corlib.
12653 * everywhere: Make use of the above in the relevant places.
12655 2003-07-22 Martin Baulig <martin@ximian.com>
12657 * cs-parser.jay (invocation_expression): Moved
12658 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12659 `cast_expression', but create a InvocationOrCast which later
12660 resolves to either an Invocation or a Cast.
12662 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12663 method; call this before EmitStatement() to make sure that this
12664 expression can be used as a statement.
12666 * expression.cs (InvocationOrCast): New class; resolves to either
12667 an Invocation or a Cast.
12669 * statement.cs (StatementExpression): Call ResolveStatement() on
12670 the ExpressionStatement before emitting it.
12672 2003-07-21 Martin Baulig <martin@ximian.com>
12674 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12675 `ref' and `out' attributes match; fixes #46220.
12676 (MemberAccess.ResolveMemberAccess): You can't reference a type
12677 through an expression; fixes #33180.
12678 (Indexers.GetIndexersForType): Don't return the indexers from
12679 interfaces the class implements; fixes #46502.
12681 2003-07-21 Martin Baulig <martin@ximian.com>
12683 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12684 CS0661 checks; fixes bug #30442.
12686 2003-07-21 Martin Baulig <martin@ximian.com>
12688 * decl.cs (AdditionResult): Added `Error'.
12690 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12692 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
12693 cs0031.cs actually work.
12695 2003-07-20 Miguel de Icaza <miguel@ximian.com>
12697 * cs-parser.jay (namespace_name): do not use
12698 namespace_or_type_name, use qualified_identifier, because
12699 namespace_or_type_name will soon return a composed expression
12700 instead of a string.
12702 (namespace_or_type_name): Instead of returning a string, now this
12703 production returns an expression.
12705 * codegen.cs (EmitContext): Setup IsGeneric property based on
12706 whether our DeclSpace is generic, our the method is generic.
12708 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
12709 the method is generic.
12711 * cs-parser.jay (type_arguments, opt_type_argument_list,
12712 type_parameters, type_parameter_list, opt_type_parameter_list,
12713 type_parameter,, opt_type_parameter_constraints_clauses,
12714 type_parameter_constraints_clauses,
12715 type_parameter_constraint_clause, type_parameter_constraint,
12716 interface_constraints): Add new production
12718 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
12719 DeclSpace is generic or not.
12721 (DeclSpace.SetParameterInfo): New routine, used to set the
12722 parameter info for a type.
12724 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
12725 returns a GenericTypeExpr
12727 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
12728 generic, lookup the generic argument.
12730 * attribute.cs: Do not allow TypeParameterExpressions in
12733 * class.cs: Do not allow the Main method to be defined in a
12736 * expression.cs (SizeOf): Do not allow generic types to be used as
12737 arguments to sizeof.
12739 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
12740 it: whether a type is generic or not. Only works for types we are
12741 currently building for now.
12743 2003-07-20 Martin Baulig <martin@ximian.com>
12745 * namespace.cs: Fixed that bug which caused a crash when compiling
12746 the debugger's GUI.
12748 2003-07-20 Miguel de Icaza <miguel@ximian.com>
12750 * typemanager.cs (LookupTypeReflection): Never expose types which
12751 are NotPublic, NestedPrivate, NestedAssembly, or
12752 NestedFamANDAssem. We used to return these, and later do a check
12753 that would report a meaningful error, but the problem is that we
12754 would not get the real match, if there was a name override.
12756 2003-07-18 Miguel de Icaza <miguel@ximian.com>
12758 * namespace.cs (Namespace, Name): Do not compute the namespace
12759 name dynamically, compute it in the constructor. This reduced
12760 memory usage by 1697 KB.
12762 * driver.cs: Use --pause to pause at the end.
12764 2003-07-17 Peter Williams <peter@newton.cx>
12766 * Makefile: Change the name of the test target so that it doesn't
12767 conflict with the recursive test target.
12769 2003-07-17 Miguel de Icaza <miguel@ximian.com>
12771 * expression.cs (LocalVariableReference.Emit, EmitAssign,
12772 AddressOf): Do not use EmitThis, that was wrong, use the actual
12775 2003-07-15 Miguel de Icaza <miguel@ximian.com>
12777 * class.cs (MethodData.Define): While checking if a method is an
12778 interface implementation, improve the test: If we are not public
12779 (use new test here: use the computed MethodAttributes directly,
12780 instead of the parsed modifier flags) check if the `implementing'
12781 method comes from an interface or not.
12783 * pending.cs (VerifyPendingMethods): Slightly better error
12786 * makefile: add test target that does the mcs bootstrap.
12788 2003-07-16 Ravi Pratap <ravi@ximian.com>
12790 * interface.cs (Define): Do nothing here since there are no
12791 members to populate etc. Move the attribute emission out of here
12792 since this was just totally the wrong place to put it. Attribute
12793 application happens during the 'Emit' phase, not in the 'Define'
12796 (Emit): Add this method and move the attribute emission here
12798 * rootcontext.cs (EmitCode): Call the Emit method on interface
12801 2003-07-14 Ravi Pratap M <ravi@ximian.com>
12803 * expression.cs (OverloadResolve): Report error only if Location
12804 is not 'Null' which means that there was a probe going on.
12806 2003-07-14 Martin Baulig <martin@ximian.com>
12808 * expression.cs (ConditionalLogicalOperator): New public class to
12809 implement user defined conditional logical operators.
12810 This is section 14.11.2 in the spec and bug #40505.
12812 2003-07-14 Martin Baulig <martin@ximian.com>
12814 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12816 2003-07-14 Martin Baulig <martin@ximian.com>
12818 * codegen.cs (EmitContext.InFixedInitializer): New public field.
12820 * ecore.cs (IVariable.VerifyFixed): New interface method.
12822 * expression.cs (Unary.ResolveOperator): When resolving the `&'
12823 operator, check whether the variable is actually fixed. Fixes bug
12824 #36055. Set a variable definitely assigned when taking its
12825 address as required by the spec.
12827 * statement.cs (LocalInfo.IsFixed): New field.
12828 (LocalInfo.MakePinned): Set `IsFixed' to true.
12830 2003-07-14 Ravi Pratap M <ravi@ximian.com>
12832 * attribute.cs (Attribute.Resolve): While doing a Member lookup
12833 for .ctors, ensure that we only ask for members declared in the
12834 attribute type (BindingFlags.DeclaredOnly).
12838 * expression.cs (Error_WrongNumArguments): Report error 1501
12839 correctly the way CSC does.
12841 2003-07-13 Martin Baulig <martin@ximian.com>
12843 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12844 lookup on the fully qualified name, to make things like "X.X" work
12845 where "X.X" is a fully qualified type name, but we also have a
12846 namespace "X" in the using list. Fixes #41975.
12848 2003-07-13 Martin Baulig <martin@ximian.com>
12850 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12851 function. If we're a CompoundAssign, we need to create an embedded
12852 CompoundAssign, not an embedded Assign.
12853 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12856 2003-07-13 Martin Baulig <martin@ximian.com>
12858 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12859 work to fix bug #46088.
12861 2003-07-13 Ravi Pratap <ravi@ximian.com>
12863 * class.cs (Operator.Emit): Do not emit attributes here - it is
12864 taken care of by the Method class that we delegate too. This takes
12865 care of bug #45876.
12867 2003-07-10 Martin Baulig <martin@ximian.com>
12869 * expression.cs (TypeOfVoid): New class.
12870 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
12872 2003-07-10 Martin Baulig <martin@ximian.com>
12874 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12877 2003-07-10 Martin Baulig <martin@ximian.com>
12879 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12880 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12882 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12884 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12886 2003-07-10 Martin Baulig <martin@ximian.com>
12888 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12889 of decimal. Fixes #42850.
12891 NOTE: I also fixed the created byte blob, but this doesn't work on
12892 the MS runtime and csc never produces any byte blobs for decimal
12895 2003-07-10 Martin Baulig <martin@ximian.com>
12897 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12898 structs; fixes #32068.
12899 (Block.AddChildVariableNames): Fixed #44302.
12901 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12903 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12905 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12907 * attribute.cs: And this test is onger needed.
12909 2003-07-08 Martin Baulig <martin@ximian.com>
12911 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12912 inaccessible types. Fixes #36313.
12914 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12916 * namespace.cs (NamespaceEntry): Create implicit entries for all
12917 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12918 implicit entries for N1.N2 and N1.
12920 2003-07-08 Martin Baulig <martin@ximian.com>
12922 Rewrote the handling of namespaces to fix a lot of the issues
12923 wrt. `using' aliases etc.
12925 * namespace.cs (Namespace): Splitted this class into a
12926 per-assembly `Namespace' and a per-file `NamespaceEntry'.
12928 * typemanager.cs (TypeManager.IsNamespace): Removed.
12929 (TypeManager.ComputeNamespaces): Only compute namespaces from
12930 loaded assemblies here, not the namespaces from the assembly we're
12931 currently compiling.
12933 2003-07-08 Martin Baulig <martin@ximian.com>
12935 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12937 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12939 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12942 I thought about the memory savings here, but LookupTypeReflection
12943 is used under already very constrained scenarios. Compiling
12944 corlib or mcs only exposes one hit, so it would not really reduce
12945 any memory consumption.
12947 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12949 * typemanager.cs: fixes bug #45889 by only adding public types from
12950 other assemblies to the list of known types.
12952 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12954 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12955 on the type we resolved.
12957 2003-07-05 Martin Baulig <martin@ximian.com>
12959 * pending.cs (PendingImplementation.ParentImplements): Don't
12960 create the proxy if the parent is abstract.
12962 * class.cs (TypeContainer.DefineIndexers): Process explicit
12963 interface implementations first. Fixes #37714.
12965 2003-07-04 Miguel de Icaza <miguel@ximian.com>
12967 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12968 defined recursively; but since we modify the input parameters
12969 (left is set to `this' temporarily), we reset this value if the
12970 left_is_explicit is false, which gives the original semantics to
12973 * literal.cs (NullPointer): new class used to represent a null
12974 literal in a pointer context.
12976 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12977 type is a pointer, use a NullPointer object instead of a
12978 NullLiteral. Closes 43687
12980 (ExplicitConversion): Convert pointer values using
12981 the conv opcode to the proper type.
12983 * ecore.cs (New): change ValueTypeVariable property into a method,
12984 that returns whether the valuetype is suitable for being used.
12986 * expression.cs (Binary.DoNumericPromotions): Only return if we
12987 the int constant was a valid uint, and we can return both left and
12988 right as uints. If not, we continue processing, to trigger the
12989 type conversion. This fixes 39018.
12991 * statement.cs (Block.EmitMeta): During constant resolution, set
12992 the CurrentBlock property on the emitcontext, so that we resolve
12993 constants propertly.
12995 2003-07-02 Martin Baulig <martin@ximian.com>
12997 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12998 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13000 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13001 than emitting it here.
13003 * statement.cs: Fixed some more flow analysis bugs.
13005 2003-07-02 Martin Baulig <martin@ximian.com>
13007 * class.cs (MethodData.Define): When implementing interface
13008 methods, set Final unless we're Virtual.
13010 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13011 check work for interface methods.
13013 2003-07-01 Martin Baulig <martin@ximian.com>
13015 * ecore.cs (EmitContext.This): Replaced this property with a
13016 GetThis() method which takes a Location argument. This ensures
13017 that we get the correct error location for a CS0188.
13019 2003-07-01 Miguel de Icaza <miguel@ximian.com>
13021 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13022 ImplicitStandardConversion.
13024 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13026 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
13028 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13031 2003-06-30 Miguel de Icaza <miguel@ximian.com>
13033 * class.cs (Constructor.Define): Turn off initlocals for unsafe
13036 (MethodData.Define): Turn off initlocals for unsafe methods.
13038 2003-06-29 Miguel de Icaza <miguel@ximian.com>
13040 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13041 complete; Fixes #37521.
13043 * delegate.cs: Use Modifiers.TypeAttr to compute the
13044 TypeAttributes, instead of rolling our own. This makes the flags
13045 correct for the delegates.
13047 2003-06-28 Miguel de Icaza <miguel@ximian.com>
13049 * class.cs (Constructor.Define): Set the private flag for static
13050 constructors as well.
13052 * cs-parser.jay (statement_expression): Set the return value to
13053 null, to avoid a crash when we catch an error.
13055 2003-06-24 Miguel de Icaza <miguel@ximian.com>
13057 * cs-parser.jay: Applied patch from Jackson that adds support for
13058 extern and unsafe modifiers to destructor declarations.
13060 * expression.cs: Report error 21 if the user is trying to index a
13063 * driver.cs: Add an error message, suggested by the bug report.
13065 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13066 if we do not have a ": this ()" constructor initializer. Fixes 45149
13068 2003-06-14 Miguel de Icaza <miguel@ximian.com>
13070 * namespace.cs: Add some information to reduce FAQs.
13072 2003-06-13 Miguel de Icaza <miguel@ximian.com>
13074 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13075 underlying enumeration types. Fixes #43915.
13077 * expression.cs: Treat ushort/short as legal values to be used in
13078 bitwise operations.
13080 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13082 * delegate.cs: transfer custom attributes for paramenters from
13083 the delegate declaration to Invoke and BeginInvoke.
13085 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13087 * attribute.cs: handle custom marshalers and emit marshal info
13090 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
13092 * makefile.gnu: Added anonymous.cs to the compiler sources.
13094 2003-05-28 Miguel de Icaza <miguel@ximian.com>
13096 * iterators.cs: Change the name of the proxy class to include two
13099 * cs-parser.jay: Update grammar to include anonymous methods.
13101 * anonymous.cs: new file.
13103 2003-05-27 Miguel de Icaza <miguel@ximian.com>
13105 * class.cs (Field.Define): Add missing test for pointers and
13108 2003-05-27 Ravi Pratap <ravi@ximian.com>
13110 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13111 we use the stobj opcode.
13113 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13114 since it wasn't the correct fix.
13116 It still is puzzling that we are required to use stobj for IntPtr
13117 which seems to be a ValueType.
13119 2003-05-26 Miguel de Icaza <miguel@ximian.com>
13121 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13122 during regular simple name resolution. Now, the trick is that
13123 instead of returning for processing the simplename, we do a
13124 TypeManager.LookupType (ie, a rooted lookup as opposed to a
13125 contextual lookup type). If a match is found, return that, if
13126 not, return for further composition.
13128 This fixes long-standing 30485.
13130 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13131 using the address to initialize an object, do an Stobj instead of
13132 using the regular Stelem.
13134 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13135 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13136 Because if we are a BaseIndexerAccess that value will be true.
13139 * statement.cs (GotoCase.Resolve): Return after reporting an
13140 error, do not attempt to continue.
13142 * expression.cs (PointerArithmetic.Emit): If our operand is a
13143 long, convert our constants to match the operand before
13144 multiplying. Convert to I type before adding. Fixes 43670.
13146 2003-05-14 Ravi Pratap <ravi@ximian.com>
13148 * enum.cs (ImplicitConversionExists) : Rename to
13149 ImplicitEnumConversionExists to remove ambiguity.
13151 * ecore.cs (NullCast): New type of cast expression class which
13152 basically is very similar to EmptyCast with the difference being
13153 it still is a constant since it is used only to cast a null to
13155 (eg. (string) null)
13157 * convert.cs (ImplicitReferenceConversion): When casting a null
13158 literal, we return a NullCast.
13160 * literal.cs (NullLiteralTyped): Remove - I don't see why this
13161 should be around anymore.
13163 The renaming (reported was slightly wrong). Corrections:
13165 ConvertImplicitStandard -> ImplicitConversionStandard
13166 ConvertExplicitStandard -> ExplicitConversionStandard
13168 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13169 before passing them in !
13171 * convert.cs (ImplicitConversionStandard): When comparing for
13172 equal expr and target types, ensure that expr is not a
13175 In general, we must not be checking (expr_type ==
13176 target_type) in the top level conversion methods
13177 (ImplicitConversion, ExplicitConversion etc). This checking is
13178 done in the methods that they delegate to.
13180 2003-05-20 Miguel de Icaza <miguel@ximian.com>
13182 * convert.cs: Move Error_CannotConvertType,
13183 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13184 ImplicitNumericConversion, ImplicitConversionExists,
13185 ImplicitUserConversionExists, StandardConversionExists,
13186 FindMostEncompassedType, FindMostSpecificSource,
13187 FindMostSpecificTarget, ImplicitUserConversion,
13188 ExplicitUserConversion, GetConversionOperators,
13189 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13190 TryImplicitIntConversion, Error_CannotConvertImplicit,
13191 ConvertImplicitRequired, ConvertNumericExplicit,
13192 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13193 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13196 Perform the following renames:
13198 StandardConversionExists -> ImplicitStandardConversionExists
13199 ConvertImplicit -> ImplicitConversion
13200 ConvertImplicitStandard -> ImplicitStandardConversion
13201 TryImplicitIntConversion -> ImplicitIntConversion
13202 ConvertImplicitRequired -> ImplicitConversionRequired
13203 ConvertNumericExplicit -> ExplicitNumericConversion
13204 ConvertReferenceExplicit -> ExplicitReferenceConversion
13205 ConvertExplicit -> ExplicitConversion
13206 ConvertExplicitStandard -> ExplicitStandardConversion
13208 2003-05-19 Martin Baulig <martin@ximian.com>
13210 * statement.cs (TypeInfo.StructInfo): Made this type protected.
13211 (TypeInfo): Added support for structs having structs as fields.
13213 * ecore.cs (FieldExpr): Implement IVariable.
13214 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13215 VariableInfo for the field.
13217 2003-05-18 Martin Baulig <martin@ximian.com>
13219 * expression.cs (This.DoResolve): Report a CS0027 if we're
13220 emitting a field initializer.
13222 2003-05-18 Martin Baulig <martin@ximian.com>
13224 * expression.cs (This.ResolveBase): New public function.
13225 (This.DoResolve): Check for CS0188.
13227 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13230 * ecore.cs (MethodGroupExpr.DoResolve): Set the
13231 `instance_expression' to null if we don't have any non-static
13234 2003-05-18 Martin Baulig <martin@ximian.com>
13236 Reworked the way how local variables and parameters are handled by
13237 the flow analysis code.
13239 * statement.cs (TypeInfo, VariableMap): New public classes.
13240 (VariableInfo): New public class. This is now responsible for
13241 checking whether a variable has been assigned. It is used for
13242 parameters and local variables.
13243 (Block.EmitMeta): Take the InternalParameters as argument; compute
13244 the layout of the flow vectors here.
13245 (Block.LocalMap, Block.ParameterMap): New public properties.
13246 (FlowBranching): The .ctor doesn't get the InternalParameters
13247 anymore since Block.EmitMeta() now computes the layout of the flow
13249 (MyStructInfo): This class is now known as `StructInfo' and nested
13250 in `TypeInfo'; we don't access this directly anymore.
13252 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13253 property and removed IsAssigned(), IsFieldAssigned(),
13254 SetAssigned() and SetFieldAssigned(); we now call them on the
13255 VariableInfo so we don't need to duplicate this code everywhere.
13257 * expression.cs (ParameterReference): Added `Block block' argument
13259 (LocalVariableReference, ParameterReference, This): The new
13260 VariableInfo class is now responsible for all the definite
13263 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13264 IsParameterAssigned, SetParameterAssigned): Removed.
13266 2003-05-18 Martin Baulig <martin@ximian.com>
13268 * typemanager.cs (InitCoreTypes): Try calling
13269 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13270 the 3-args-version. Corlib now also needs our `void_type'.
13271 (GetMethod): Added overloaded version which takes an optional
13272 `bool report_errors' to allow lookups of optional methods.
13274 2003-05-12 Martin Baulig <martin@ximian.com>
13276 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13277 only used for locals and not for parameters.
13279 2003-05-12 Miguel de Icaza <miguel@ximian.com>
13281 * support.cs (InternalParameters.ParameterType): Return the
13282 ExternalType of the parameter.
13284 * parameter.cs (Parameter.ExternalType): drop the two arguments,
13287 2003-05-11 Miguel de Icaza <miguel@ximian.com>
13289 * class.cs (MethodData.Define): Do not set the `newslot' on
13290 interface members, if they are also flagged as "override".
13292 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13293 better code for ++i and i++. This only works for static fields
13294 and local variables.
13296 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13297 want to pull the DeclSpace out of the builder_to_declspace instead
13298 of the TypeBuilder (like in TypeContainer.FindMembers).
13300 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13301 instead of LookupTypeContainer. Fixes the crash on .NET for
13302 looking up interface members.
13304 * const.cs: Create our own emit context during the Definition
13305 stage, so that constants are evaluated in the proper context, when
13306 a recursive definition happens.
13308 2003-05-11 Martin Baulig <martin@ximian.com>
13310 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
13311 new block for a switch section.
13312 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13313 the adding/lookup in the switch block. Fixes #39828.
13315 2003-05-09 Miguel de Icaza <miguel@ximian.com>
13317 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13318 functionality: I needed to convert the data after I had performed
13319 the add/sub operation into the operands type size.
13321 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13322 pass the type for the box operation, otherwise the resulting
13323 object would have been of type object.
13325 (BoxedCast): Add constructor to specify the type to box as.
13327 2003-05-07 Miguel de Icaza <miguel@ximian.com>
13329 * iterators.cs: I was reusing the `count' variable inadvertently,
13330 take steps to not allow this to happen.
13332 2003-05-06 Miguel de Icaza <miguel@ximian.com>
13334 * attribute.cs (Attribute.Resolve): Params attributes are encoded
13335 by creating an array at the point where the params starts and
13336 putting all those arguments there, then adjusting the size of the
13339 2003-05-05 Miguel de Icaza <miguel@ximian.com>
13341 * expression.cs (New.AddressOf): Implement interface
13342 IMemoryLocation. This is used when the `new' operator is used in
13343 the context of an invocation to a method on a value type.
13345 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13348 * namespace.cs: Also check the using aliases here.
13350 * driver.cs: Move the test for using validity after the types have
13351 been entered, so we do a single pass that also includes the using
13354 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13355 in the regular case. CreateSiblingForFinally is doing extra
13358 * attribute.cs (GetAttributeArgumentExpression): Store the result
13359 on an out value, and use the return value to indicate failure
13360 instead of using null (which is a valid return for Constant.GetValue).
13362 * statement.cs: Perform the analysis flow for the increment
13363 portion after the statement, because this will be the real flow of
13364 execution. Fixes #42385
13366 * codegen.cs (EmitContext.EmitArgument,
13367 EmitContext.EmitStoreArgument): New helper functions when the
13368 RemapToProxy flag is set.
13370 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13373 Add support for remapping parameters.
13375 * iterators.cs: Propagate parameter values; Store parameter
13376 values in the proxy classes.
13378 2003-05-04 Miguel de Icaza <miguel@ximian.com>
13380 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
13381 need a proxy reference; I do not know what I was thinking
13383 * cs-parser.jay (constructor_initializer): catch another error,
13384 and display nice message.
13386 (field_declaration): catch void field declaration
13387 to flag a better error.
13389 * class.cs (MemberBase.CheckBase): Report an error instead of a
13390 warning if a new protected member is declared in a struct.
13391 (Field.Define): catch the error of readonly/volatile.
13393 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13395 (FieldExpr.AddressOf): ditto. Catch error where the address of a
13396 volatile variable is taken
13398 2003-05-02 Miguel de Icaza <miguel@ximian.com>
13400 * statement.cs (Fixed.Resolve): Report an error if we are not in
13403 2003-05-01 Miguel de Icaza <miguel@ximian.com>
13405 * typemanager.cs: reuse the code that handles type clashes for
13406 delegates and enumerations.
13408 * class.cs (Report28): Always report.
13410 * expression.cs (EncodeAsAttribute): Allow nulls here.
13412 2003-04-28 Miguel de Icaza <miguel@ximian.com>
13414 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13415 the functionality for testing whether an expression is valid for
13416 an attribute here. Also handle the case of arrays of elements
13419 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13420 encoding a linear array into an array of objects that are suitable
13421 to be passed to an CustomAttributeBuilder.
13423 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13425 * ecore.cs: (FieldExpr): Handle field remapping here.
13427 * iteratators.cs: Pass the instance variable (if the method is an
13428 instance method) to the constructors, so we can access the field
13429 variables on the class.
13431 TODO: Test this with structs. I think the THIS variable on
13432 structs might have to be a pointer, and not a refenrece
13434 2003-04-27 Miguel de Icaza <miguel@ximian.com>
13436 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13437 local variables to fields in a proxy class.
13439 * iterators.cs (PopulateProxy): Rename our internal fields to
13441 Create a <THIS> field if we are an instance method, so we can
13442 reference our parent container variables.
13443 (MapVariable): Called back from the EmitContext code to enter a
13444 new variable to field mapping into the proxy class (we just create
13448 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13449 for using the remapped locals to fields.
13451 I placed the code here, because that gives the same semantics to
13452 local variables, and only changes the Emit code.
13454 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13455 statements inside iterators.
13456 (VariableInfo): Add a FieldBuilder for the cases when we are
13457 remapping local variables to fields in a proxy class
13459 * ecore.cs (SimpleNameResolve): Avoid testing two times for
13460 current_block != null.
13462 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13463 not cope with strings, as it has been moved to the
13464 TableSwitchEmit. Fixed bug in switch generation.
13466 * expression.cs (New.DoResolve): Provide more context for the user
13467 when reporting an error.
13469 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13472 * expression.cs (MemberAccess.DoResolve): When we get a type back,
13473 check the permissions for it. Note than in a type-resolution
13474 context the check was already present in DeclSpace.ResolveType,
13475 but was missing from the MemberAccess.
13477 (ArrayCreation.CheckIndices): warn if the user has
13478 more nested levels of expressions, but there are no more
13479 dimensions specified. Avoids crash on bug 41906.
13481 2003-04-26 Miguel de Icaza <miguel@ximian.com>
13483 * statement.cs (Block): replace Implicit bool, for a generic
13485 New flag: `Unchecked'. This is used during the EmitMeta phase
13486 (which is out-of-line with the regular Resolve/Emit process for a
13487 statement, as this is done ahead of time, but still gets a chance
13488 to call constant resolve).
13490 (Block.Flags): new enum for adding a new flag.
13492 (Block.EmitMeta): track the state of unchecked.
13494 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13495 to enable constant resolution to work there as well.
13497 2003-04-22 Miguel de Icaza <miguel@ximian.com>
13499 * typemanager.cs (ienumerable_type): Also look up
13500 System.Collections.IEnumerable.
13502 2003-04-21 Miguel de Icaza <miguel@ximian.com>
13504 TODO: Test more than one conditional per method.
13506 * class.cs (Indexer.Define): Report the location where the user is
13507 referencing the unsupported feature.
13509 (MethodData): Overload the use of `conditionals' to
13510 minimize the creation of needless ArrayLists. This saves roughly
13511 212kb on my machine.
13513 (Method): Implement the new IIteratorContainer interface.
13514 (Method.SetYields): Implement the method by setting the ModFlags
13515 to contain METHOD_YIELDS.
13517 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13518 which just got set to null.
13520 * iterators.cs: New file.
13522 (Yield, YieldBreak): New statements.
13524 * statement.cs (Return.Resolve): Flag an error if we are used in
13525 an iterator method.
13527 * codegen.cs (InIterator): New flag set if the code is being
13528 compiled in an iterator method.
13530 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
13531 internal modifier, and we just use it to avoid adding extra
13532 fields, as this is seldom used.
13534 * cs-parser.jay: Add yield_statement (yield and yield break).
13536 * driver.cs: New flag -v2 to turn on version 2 features.
13538 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13539 hashtable when v2 is enabled.
13541 2003-04-20 Miguel de Icaza <miguel@ximian.com>
13543 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13544 there is already a namespace defined with this name.
13546 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13547 people upgraded their corlibs.
13549 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13550 always use fully qualified types, no need to use the compiler
13553 (TypeManager.IsNamespace): Use binarysearch.
13555 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13556 AddDelegate): I did not quite use the new IsValid API properly: I
13557 have to pass the short-name and the fullname. I was passing only
13558 the basename instead of the fullname sometimes.
13560 (TypeContainer.DefineType): call NamespaceClash.
13562 * interface.cs (Interface.DefineType): use NamespaceClash before
13565 * delegate.cs (Delegate.DefineType): use NamespaceClash before
13568 * enum.cs: (Enum.DefineType): use NamespaceClash before
13571 * typemanager.cs (: 3-line patch that gives us some tasty 11%
13572 speed increase. First, use the negative_hits cache when we get a
13573 negative. Second, add the type with its full original name
13574 instead of the new . and + encoded name (reflection uses + to
13575 separate type from a nested type). Use LookupTypeReflection
13576 directly which bypasses the type->name hashtable (that we already
13577 know does not contain the type.
13579 * decl.cs (DeclSpace.ResolveTypeExpr): track the
13580 location/container type.
13582 * driver.cs: When passing utf8, use directly the UTF8Encoding.
13584 2003-04-19 Miguel de Icaza <miguel@ximian.com>
13586 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13588 * delegate.cs (NewDelegate.Resolve): Test whether an instance
13589 method is being referenced in the method group from a static
13590 context, and report error 120 if so.
13592 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13595 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13596 is created, we create the A namespace).
13598 * cs-parser.jay: A namespace also introduces a DeclarationFound.
13601 2003-04-18 Miguel de Icaza <miguel@ximian.com>
13603 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13604 invocation to ModuleBuilder.GetType with the same values will
13605 return a new type instance, so we need to cache its return
13608 * expression.cs (Binary.ResolveOperator): Only allow the compare
13609 operators on enums if they are of the same type.
13611 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13612 types of ValueType on their own case. Before we were giving them
13613 the same treatment as objects.
13615 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13616 fullname. Short name is used to compare against container name.
13617 Fullname is used to check against defined namespace names.
13619 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13620 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13622 (Method.CheckBase): Call parent.
13623 (MemberBase.CheckBase): Check for protected members on sealed
13625 (PropertyBase.CheckBase): Call parent.
13626 (Field.Define): Call parent.
13628 * report.cs: Negative error codes are now mapped to 8000 - code,
13629 so that the display is render more nicely.
13631 * typemanager.cs: Do not use try/catch, instead report a regular
13634 (GetPointerType, GetReferenceType): These methods provide
13635 mechanisms to obtain the T* and T& from a T. We had the code
13636 previously scattered around the code base, and it also used
13637 TypeManager.LookupType that would go through plenty of caches.
13638 This one goes directly to the type source.
13640 In some places we did the Type.GetType followed by
13641 ModuleBuilder.GetType, but not in others, so this unifies the
13642 processing as well.
13644 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13645 statements now that we have namespace information.
13647 * typemanager.cs (IsNamespace): New method, returns whether the
13648 string presented is a namespace or not.
13650 (ComputeNamespaces): New public entry point, computes the list of
13651 available namespaces, using the GetNamespaces API call in Mono, or
13652 the slower version in MS.NET.
13654 Now before we start the semantic analysis phase, we have a
13655 complete list of namespaces including everything that the user has
13658 Deleted old code to cache namespaces in .nsc files.
13660 2003-04-17 Miguel de Icaza <miguel@ximian.com>
13662 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13663 class/struct location definition Location for the implicit
13664 constructor location.
13666 (Operator.Define): Use the location of the operator for the
13667 implicit Method definition.
13669 (Constructor.Emit): use the constructor location for the implicit
13670 base initializer constructor.
13672 * ecore.cs: Remove ITypeExpression. This interface is now gone,
13673 and the Expression class now contains two new methods:
13675 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
13676 isolate type lookup from the rest of the resolution process.
13678 Since we use Expressions to hold type definitions due to the way
13679 we parse the input we have historically overloaded Resolve to
13680 perform the Type lookups if a special flag is passed. Now this is
13681 eliminated and two methods take their place.
13683 The differences in the two methods between xStep and xTerminal is
13684 that xStep is involved in our current lookup system that uses
13685 SimpleNames to compose a name, while xTerminal is used just to
13686 catch the case where the simplename lookup failed.
13688 2003-04-16 Miguel de Icaza <miguel@ximian.com>
13690 * expression.cs (ResolveMemberAccess): Remove redundant code.
13691 TypeExpr expressions are always born fully resolved.
13693 * interface.cs (PopulateMethod): Do not lookup the types twice.
13694 We were doing it once during SemanticAnalysis and once during
13697 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13698 in local variable type definitions, were being returned as a
13699 SimpleName (we decomposed everything into a string), that is
13700 because primary_expression was being used instead of a type in the
13701 grammar (reduce/reduce conflicts).
13703 The part that was wrong is that we converted the expression into a
13704 string (an oversimplification in one hand, compounded with primary
13705 expressions doing string concatenation).
13711 Would return "A.B.C[]" as a SimpleName. This stopped things like
13712 using clauses from working on this particular context. And a type
13713 was being matched directly against "A.B.C[]".
13715 We now use the correct approach, and allow for ComposedCast to be
13716 part of the unary expression. So the "A.B.C []" become a composed
13717 cast of "A.B.C" (as a nested group of MemberAccess with a
13718 SimpleName at the end) plus the rank composition "[]".
13722 2003-04-10 Miguel de Icaza <miguel@ximian.com>
13724 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13725 for the access level checking.
13727 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
13728 `TypeContainer container', because I kept getting confused when I
13729 was debugging this code.
13731 * expression.cs (Indexers): Instead of tracking getters/setters,
13732 we now track them in parallel. We create one arraylist less, but
13733 most importantly it is possible now for the LValue code to find a
13734 matching get for a set.
13736 (IndexerAccess.DoResolveLValue): Update the code.
13737 GetIndexersForType has been modified already to extract all the
13738 indexers from a type. The code assumed it did not.
13740 Also make the code set the correct return type for the indexer.
13741 This was fixed a long time ago for properties, but was missing for
13742 indexers. It used to be void_type.
13744 (Binary.Emit): Test first for doubles instead of
13745 floats, as they are more common.
13747 (Binary.EmitBranchable): Use the .un version of the branch opcodes
13748 when dealing with floats and the <=, >= operators. This fixes bug
13751 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13752 to load the array value by emitting a load on the foreach variable
13753 type. This was incorrect.
13755 We now emit the code to load an element using the the array
13756 variable type, and then we emit the conversion operator.
13760 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
13762 * attribute.cs: Avoid allocation of ArrayLists in the common case.
13764 2003-04-09 Miguel de Icaza <miguel@ximian.com>
13766 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13767 test for protection before we test for signatures.
13769 (MethodSignature.ToString): implement.
13771 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13772 to the case where we reduced into a LongConstant.
13774 * decl.cs (CheckAccessLevel): If the type is an array, we can not
13775 depend on whether the information is acurrate, because the
13776 Microsoft runtime will always claim that the array type is public,
13777 regardless of the real state.
13779 If the type is a pointer, another problem happens: the type is
13780 reported as non-public in Microsoft.
13782 In both cases we have to call CheckAccessLevel recursively with
13783 the underlying type as the argument to be tested.
13785 2003-04-08 Miguel de Icaza <miguel@ximian.com>
13787 * assign.cs (Assign.Emit): If we are dealing with a compound
13788 assignment expression, we should use the code path that stores the
13789 intermediate result in a temporary value. This fixes #40903.
13791 *expression.cs (Indirection.ToString): Provide ToString method for
13794 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
13796 * class.cs: Null out fields holding references to Block objects so
13797 they can be garbage collected.
13799 * expression.cs (OverloadResolve): Remove unused local.
13801 2003-04-07 Martin Baulig <martin@ximian.com>
13803 * codegen.cs (EmitContext.CurrentFile): New public field.
13804 (EmitContext.Mark): Use the CurrentFile to check whether the
13805 location is in the correct file.
13806 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13808 2003-04-07 Martin Baulig <martin@ximian.com>
13810 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13812 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13813 location. [FIXME: The location argument which gets passed to this
13814 method is sometimes wrong!]
13816 2003-04-07 Nick Drochak <ndrochak@gol.com>
13818 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13820 2003-04-07 Miguel de Icaza <miguel@ximian.com>
13822 * expression.cs (Indirection.EmitAssign): We were using the
13823 temporary, but returning immediately instead of continuing the
13826 2003-04-06 Martin Baulig <martin@ximian.com>
13828 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13829 if it's a nested child, but also deriving from the outer class.
13832 * typemanager.cs (IsNestedChildOf): Make this work if it's a
13833 nested child, but also deriving from the outer class. See
13835 (FilterWithClosure): We may access private members of the outer
13836 class if we're a nested child and deriving from the outer class.
13837 (RealMemberLookup): Only set `closure_private_ok' if the
13838 `original_bf' contained BindingFlags.NonPublic.
13840 2003-04-05 Martin Baulig <martin@ximian.com>
13842 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
13843 probe if its a type parameter, and if so, flag an error.
13845 * decl.cs: Move here the SetParameterInfo code from class.cs.
13846 Handle IsGeneric here.
13848 Handle a variety of errors in the parameter info definition.
13850 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
13851 type parameters here.
13853 * cs-parser.jay (class_declaration): report errors for parameters
13856 2003-01-21 Miguel de Icaza <miguel@ximian.com>
13858 * generic.cs: New file, contains support code for generics.
13860 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
13861 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
13863 Update parser for the above removals.
13865 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
13866 now taken care of in the parser.
13868 2003-04-02 Miguel de Icaza <miguel@ximian.com>
13870 * class.cs (Event.Define): Do not allow abstract events to have
13873 2003-04-01 Miguel de Icaza <miguel@ximian.com>
13875 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13876 block in event declarations.
13878 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13879 value type, get its address.
13881 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13882 leaving a class on the stack instead of a boolean value (int
13883 0/1). Change the code so we compare against null, and then the
13884 result against zero.
13886 * class.cs (TypeContainer.GetClassBases): We were checking for the
13887 parent class being sealed too late.
13889 * expression.cs (Binary.Emit): For <= and >= when dealing with
13890 floating point values, use cgt.un and clt.un instead of cgt and
13893 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
13895 * statement.cs: Apply the same optimization as MS: skip the
13896 GetEnumerator returning an IEnumerator, and use the one returning a
13897 CharEnumerator instead. This allows us to avoid the try-finally block
13900 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
13902 * cs-parser.jay: Attributes cannot be applied to
13903 namespaces. Fixes #40473
13905 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13908 (Add*): check if the name is valid using the full name for constants,
13909 fields, properties and events.
13911 2003-03-28 Miguel de Icaza <miguel@ximian.com>
13913 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13914 char constants to be part of the enumeration.
13916 * expression.cs (Conditional.DoResolve): Add support for operator
13917 true. Implements the missing functionality from 14.12
13919 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13920 operator true/false as required by the spec.
13922 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13923 implicit conversion to boolean.
13925 * statement.cs (Statement.ResolveBoolean): A boolean expression is
13926 also one where the type implements `operator true'.
13928 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13929 get an expression that will invoke operator true based on an
13932 (GetConversionOperators): Removed the hack that called op_True
13935 (Expression.ResolveBoolean): Move this from Statement.
13937 2003-03-17 Miguel de Icaza <miguel@ximian.com>
13939 * ecore.cs (FieldExpr): do not allow initialization of initonly
13940 fields on derived classes
13942 2003-03-13 Martin Baulig <martin@ximian.com>
13944 * statement.cs (Block.Emit): Call ig.BeginScope() and
13945 ig.EndScope() when compiling with debugging info; call
13946 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13948 2003-03-08 Miguel de Icaza <miguel@ximian.com>
13950 * expression.cs (Indexers): Do not construct immediately, allow
13951 for new members to be appended as we go. Fixes 38143
13953 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13955 * expression.cs: save/restore context when resolving an unchecked
13958 2003-03-05 Miguel de Icaza <miguel@ximian.com>
13960 * cfold.cs: Catch division by zero in modulus operator during
13963 2003-03-03 Miguel de Icaza <miguel@ximian.com>
13965 * interface.cs (Interface.DefineMembers): Avoid defining members
13968 2003-02-27 Miguel de Icaza <miguel@ximian.com>
13970 * driver.cs: handle the +/- options for -noconfig
13972 * statement.cs (Unckeched.Resolve): Also track the state of
13973 unchecked in the Resolve phase.
13975 2003-02-27 Martin Baulig <martin@ximian.com>
13977 * ecore.cs (Expression.MemberLookup): Don't create a
13978 MethodGroupExpr for something which is not a method. Fixes #38291.
13980 2003-02-25 Miguel de Icaza <miguel@ximian.com>
13982 * class.cs (MemberBase.CheckParameters): Also check that the type
13983 is unmanaged if it is a pointer.
13985 * expression.cs (SizeOf.Resolve): Add location information.
13987 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13988 a managed type is declared.
13990 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13991 parameter modifiers as well. Fixes bug 38606
13993 * class.cs: Very sad. Am backing out the speed up changes
13994 introduced by the ArrayList -> Array in the TypeContainer, as they
13995 were not actually that much faster, and introduced a bug (no error
13996 reports on duplicated methods).
13998 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13999 source first, this will guarantee that we have a valid expression
14000 before calling in lower levels functions that will require a
14001 resolved object. Then use this original_source in the
14002 target.ResolveLValue instead of the original source that was
14005 Another change. Use target.Resolve instead of LValueResolve.
14006 Although we are resolving for LValues, we will let the Assign code
14007 take care of that (it will be called again from Resolve). This
14008 basically allows code like this:
14010 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14011 class Y { void A (X x) { x [0] += o; }
14013 The problem was that the indexer was trying to resolve for
14014 set_Item (idx, object o) and never finding one. The real set_Item
14015 was set_Item (idx, X). By delaying the process we get the right
14020 2003-02-23 Martin Baulig <martin@ximian.com>
14022 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14023 while calling DoEmit ().
14025 * codegen.cs (EmitContext.Mark): Don't mark locations in other
14026 source files; if you use the #line directive inside a method, the
14027 compiler stops emitting line numbers for the debugger until it
14028 reaches the end of the method or another #line directive which
14029 restores the original file.
14031 2003-02-23 Martin Baulig <martin@ximian.com>
14033 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14035 2003-02-23 Martin Baulig <martin@ximian.com>
14037 * statement.cs (Block.AddChildVariableNames): We need to call this
14038 recursively, not just for our immediate children.
14040 2003-02-23 Martin Baulig <martin@ximian.com>
14042 * class.cs (Event.Define): Always make the field private, like csc does.
14044 * typemanager.cs (TypeManager.RealMemberLookup): Make events
14045 actually work, fixes bug #37521.
14047 2003-02-23 Miguel de Icaza <miguel@ximian.com>
14049 * delegate.cs: When creating the various temporary "Parameters"
14050 classes, make sure that we call the ComputeAndDefineParameterTypes
14051 on those new parameters (just like we do with the formal ones), to
14052 allow them to be resolved in the context of the DeclSpace.
14054 This fixes the bug that Dick observed in Bugzilla #38530.
14056 2003-02-22 Miguel de Icaza <miguel@ximian.com>
14058 * expression.cs (ResolveMemberAccess): When resolving a constant,
14059 do not attempt to pull a constant if the value was not able to
14060 generate a valid constant.
14062 * const.cs (LookupConstantValue): Do not report more errors than required.
14064 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14066 * expression.cs: fixes bug #38328.
14068 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14070 * class.cs: Changed all the various members that can be part of a
14071 class from being an ArrayList to be an Array of the right type.
14072 During the DefineType type_list, interface_list, delegate_list and
14073 enum_list are turned into types, interfaces, delegates and enums
14076 And during the member population, indexer_list, event_list,
14077 constant_list, field_list, instance_constructor_list, method_list,
14078 operator_list and property_list are turned into their real arrays.
14080 Although we could probably perform this operation earlier, for
14081 good error reporting we need to keep the lists and remove the
14082 lists for longer than required.
14084 This optimization was triggered by Paolo profiling the compiler
14085 speed on the output of `gen-sample-program.pl' perl script.
14087 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14088 not crash in methods like MemberLookupFailed that use this field.
14090 This problem arises when the compiler fails to resolve a type
14091 during interface type definition for example.
14093 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14095 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14096 inherit from System.Object, so we have to stop at null, not only
14097 when reaching System.Object.
14099 2003-02-17 Miguel de Icaza <miguel@ximian.com>
14101 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14102 DeclaredOnly because the parent indexer might have had a different
14103 name, but did not loop until the top of the hierarchy was reached.
14105 The problem this one fixes is 35492: when a class implemented an
14106 indexer from an interface, we were getting the interface method
14107 (which was abstract) and we were flagging an error (can not invoke
14110 This also keeps bug 33089 functioning, and test-148 functioning.
14112 * typemanager.cs (IsSpecialMethod): The correct way of figuring
14113 out if a method is special is to see if it is declared in a
14114 property or event, or whether it is one of the predefined operator
14115 names. This should fix correctly #36804.
14117 2003-02-15 Miguel de Icaza <miguel@ximian.com>
14119 The goal here is to remove the dependency on EmptyCast.Peel ().
14120 Killing it completely.
14122 The problem is that currently in a number of places where
14123 constants are expected, we have to "probe" for an EmptyCast, and
14124 Peel, which is not the correct thing to do, as this will be
14125 repetitive and will likely lead to errors.
14127 The idea is to remove any EmptyCasts that are used in casts that
14128 can be reduced to constants, so we only have to cope with
14131 This bug hunt was triggered by Bug 37363 and the desire to remove
14132 the duplicate pattern where we were "peeling" emptycasts to check
14133 whether they were constants. Now constants will always be
14136 * ecore.cs: Use an enumconstant here instead of wrapping with
14139 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14140 throwing me off. By handling this we can get rid of a few hacks.
14142 * statement.cs (Switch): Removed Peel() code.
14144 2003-02-14 Miguel de Icaza <miguel@ximian.com>
14146 * class.cs: Location information for error 508
14148 * expression.cs (New.DoResolve): Add a guard against double
14149 resolution of an expression.
14151 The New DoResolve might be called twice when initializing field
14152 expressions (see EmitFieldInitializers, the call to
14153 GetInitializerExpression will perform a resolve on the expression,
14154 and later the assign will trigger another resolution
14156 This leads to bugs (#37014)
14158 * delegate.cs: The signature for EndInvoke should contain any ref
14159 or out parameters as well. We were not doing this in the past.
14161 * class.cs (Field.Define): Do not overwrite the type definition
14162 inside the `volatile' group. Turns out that volatile enumerations
14163 were changing the type here to perform a validity test, which
14166 2003-02-12 Miguel de Icaza <miguel@ximian.com>
14168 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14169 and structs, we do not want to load the instance variable
14171 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14172 enum_type has to be handled like an object reference (implicit
14173 conversions exists from this to object), but the regular IsClass
14174 and IsValueType tests will never return true for this one.
14176 Also we use TypeManager.IsValueType instead of type.IsValueType,
14177 just for consistency with the rest of the code (this is only
14178 needed if we ever use the construct exposed by test-180.cs inside
14179 corlib, which we dont today).
14181 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
14183 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14186 2003-02-09 Martin Baulig <martin@ximian.com>
14188 * namespace.cs (Namespace..ctor): Added SourceFile argument.
14189 (Namespace.DefineNamespaces): New static public method; this is
14190 called when we're compiling with debugging to add all namespaces
14191 to the symbol file.
14193 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14194 pass it to the Namespace's .ctor.
14196 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14197 and MethodBase arguments; pass the namespace ID to the symwriter;
14198 pass the MethodBase instead of the token to the symwriter.
14199 (SymbolWriter.DefineNamespace): New method to add a namespace to
14202 2003-02-09 Martin Baulig <martin@ximian.com>
14204 * symbolwriter.cs: New file. This is a wrapper around
14205 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
14206 methods here in near future.
14208 2003-02-09 Martin Baulig <martin@ximian.com>
14210 * codegen.cs (EmitContext.Mark): Just pass the arguments to
14211 ILGenerator.MarkSequencePoint() which are actually used by the
14214 2003-02-09 Martin Baulig <martin@ximian.com>
14216 * location.cs (SourceFile): New public sealed class. This
14217 contains the name and an index which is used in the location's token.
14218 (Location): Reserve an appropriate number of bits in the token for
14219 the source file instead of walking over that list, this gives us a
14220 really huge performance improvement when compiling with debugging.
14222 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14223 `SourceFile' argument instead of a string.
14224 (Driver.ProcessFile): Add all the files via Location.AddFile(),
14225 but don't parse/tokenize here, we need to generate the list of all
14226 source files before we do that.
14227 (Driver.ProcessFiles): New static function. Parses/tokenizes all
14230 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14231 instead of a string.
14233 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14236 2003-02-09 Martin Baulig <martin@ximian.com>
14238 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14239 filename on `#line default'.
14241 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14243 * statement.cs: don't clear the pinned var when the fixed statement
14244 returns from the method (fixes bug#37752).
14246 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14248 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
14251 2003-02-07 Martin Baulig <martin@ximian.com>
14253 * driver.cs: Removed the `--debug-args' command line argument.
14255 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14256 automatically by the AsssemblyBuilder.
14257 (CodeGen.InitializeSymbolWriter): We don't need to call any
14258 initialization function on the symbol writer anymore. This method
14259 doesn't take any arguments.
14261 2003-02-03 Miguel de Icaza <miguel@ximian.com>
14263 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14264 from referenced assemblies as well.
14266 2003-02-02 Martin Baulig <martin@ximian.com>
14268 * class.cs (MethodData.Emit): Generate debugging info for external methods.
14270 2003-02-02 Martin Baulig <martin@ximian.com>
14272 * class.cs (Constructor.Emit): Open the symbol writer before
14273 emitting the constructor initializer.
14274 (ConstructorInitializer.Emit): Call ec.Mark() to allow
14275 single-stepping through constructor initializers.
14277 2003-01-30 Miguel de Icaza <miguel@ximian.com>
14279 * class.cs: Handle error 549: do not allow virtual methods in
14282 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14284 * decl.cs: Check access levels when resolving types
14286 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14288 * statement.cs: Add parameters and locals set in catch blocks that might
14289 return to set vector
14291 2003-01-29 Miguel de Icaza <miguel@ximian.com>
14293 * class.cs (Operator): Set the SpecialName flags for operators.
14295 * expression.cs (Invocation.DoResolve): Only block calls to
14296 accessors and operators on SpecialName methods.
14298 (Cast.TryReduce): Handle conversions from char constants.
14301 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14303 * statement.cs: small memory and time optimization in FlowBranching.
14305 2003-01-28 Pedro Mart <yoros@wanadoo.es>
14307 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14308 problem that the last fix but in the other sid (Set).
14310 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14311 access when there is no indexer in the hierarchy.
14313 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14315 * class.cs: Combine some if statements.
14317 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14319 * driver.cs: fixed bug #37187.
14321 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
14323 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14324 any indexer, it's needed to build a list with all the indexers in the
14325 hierarchy (AllGetters), else we have problems. Fixes #35653.
14327 2003-01-23 Miguel de Icaza <miguel@ximian.com>
14329 * class.cs (MethodData.Define): It is wrong for an interface
14330 implementation to be static in both cases: explicit and implicit.
14331 We were only handling this in one case.
14333 Improve the if situation there to not have negations.
14335 * class.cs (Field.Define): Turns out that we do not need to check
14336 the unsafe bit on field definition, only on usage. Remove the test.
14338 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14340 * driver.cs: use assembly.Location instead of Codebase (the latest
14341 patch made mcs fail when using MS assemblies).
14343 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
14345 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14346 get the path to *corlib.dll.
14348 2003-01-21 Nick Drochak <ndrochak@gol.com>
14352 * typemanager.cs: Remove compiler warnings
14354 2003-01-20 Duncan Mak <duncan@ximian.com>
14356 * AssemblyInfo.cs: Bump the version number to 0.19.
14358 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14360 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14362 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
14364 * class.cs (Constructor::Emit): Emit debugging info for constructors.
14366 2003-01-17 Miguel de Icaza <miguel@ximian.com>
14368 * cs-parser.jay: Small fix: we were not comparing the constructor
14369 name correctly. Thanks to Zoltan for the initial pointer.
14371 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14373 * cs-tokenizer.cs: Set file name when specified with #line
14375 2003-01-15 Miguel de Icaza <miguel@ximian.com>
14377 * cs-parser.jay: Only perform the constructor checks here if we
14378 are named like the class; This will help provider a better
14379 error. The constructor path is taken when a type definition is
14380 not found, but most likely the user forgot to add the type, so
14381 report that rather than the constructor error.
14383 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14385 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14388 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14390 * cs-parser.jay: Add cleanup call.
14392 2003-01-13 Duncan Mak <duncan@ximian.com>
14394 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14395 consistent with other methods.
14397 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14399 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14401 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14403 * attribute.cs: only set GuidAttr to true when we have a
14406 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14410 * typemanager.cs: fixes to allow mcs compile corlib with the new
14411 Type.IsSubclassOf fix.
14413 2003-01-08 Miguel de Icaza <miguel@ximian.com>
14415 * expression.cs (LocalVariableReference.DoResolve): Classify a
14416 constant as a value, not as a variable. Also, set the type for
14419 * cs-parser.jay (fixed_statement): take a type instead of a
14420 pointer_type, so we can produce a better error message later.
14422 * statement.cs (Fixed.Resolve): Flag types that are not pointers
14425 (For.DoEmit): Make inifinite loops have a
14426 non-conditional branch back.
14428 (Fixed.DoEmit): First populate the pinned variables, then emit the
14429 statement, then clear the variables. Before I was emitting the
14430 code once for each fixed piece.
14433 2003-01-08 Martin Baulig <martin@ximian.com>
14435 * statement.cs (FlowBranching.MergeChild): A break in a
14436 SWITCH_SECTION does not leave a loop. Fixes #36155.
14438 2003-01-08 Martin Baulig <martin@ximian.com>
14440 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14441 lives in the same number space than `param_map'. Fixes #36154.
14443 2003-01-07 Miguel de Icaza <miguel@ximian.com>
14445 * cs-parser.jay (constructor_declaration): Set the
14446 Constructor.ModFlags before probing for it. This makes the
14447 compiler report 514, 515 and 132 (the code was there, but got
14450 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14451 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14452 (GotoCase.Resolve): Set `Returns' to ALWAYS.
14454 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14456 * enum.cs: create the enum static fields using the enum type.
14458 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14460 * class.cs: don't try to create the ParamBuilder for the return
14461 type if it's not needed (and handle it breaking for the ms runtime
14464 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14466 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14468 2002-12-29 Miguel de Icaza <miguel@ximian.com>
14470 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14471 the command. This showed up while compiling the JANET source
14472 code, which used \r as its only newline separator.
14474 2002-12-28 Miguel de Icaza <miguel@ximian.com>
14476 * class.cs (Method.Define): If we are an operator (because it
14477 reuses our code), then set the SpecialName and HideBySig. #36128
14479 2002-12-22 Miguel de Icaza <miguel@ximian.com>
14481 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14482 exception, report error 120 `object reference required'.
14484 * driver.cs: Add --pause option, used during to measure the size
14485 of the process as it goes with --timestamp.
14487 * expression.cs (Invocation.DoResolve): Do not allow methods with
14488 SpecialName to be invoked.
14490 2002-12-21 Miguel de Icaza <miguel@ximian.com>
14492 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14493 number before adding it.
14495 2002-12-21 Ravi Pratap <ravi@ximian.com>
14497 * ecore.cs (StandardImplicitConversion): When in an unsafe
14498 context, we allow conversion between void * to any other pointer
14499 type. This fixes bug #35973.
14501 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14503 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14504 is not thrown when extensionless outputs are used
14506 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14508 * rootcontext.cs: fixed compilation of corlib.
14510 2002-12-19 Miguel de Icaza <miguel@ximian.com>
14512 * attribute.cs (Attributes.Contains): Add new method.
14514 * class.cs (MethodCore.LabelParameters): if the parameter is an
14515 `out' parameter, check that no attribute `[In]' has been passed.
14517 * enum.cs: Handle the `value__' name in an enumeration.
14519 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
14521 * decl.cs: Added special case to allow overrides on "protected
14524 2002-12-18 Ravi Pratap <ravi@ximian.com>
14526 * attribute.cs (Attributes.AddAttributeSection): Rename to this
14527 since it makes much more sense.
14529 (Attributes.ctor): Don't require a Location parameter.
14531 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14533 * attribute.cs (ApplyAttributes): Remove extra Location parameters
14534 since we already have that information per attribute.
14536 * everywhere : make appropriate changes.
14538 * class.cs (LabelParameters): Write the code which actually
14539 applies attributes to the return type. We can't do this on the MS
14540 .NET runtime so we flag a warning in the case an exception is
14543 2002-12-18 Miguel de Icaza <miguel@ximian.com>
14545 * const.cs: Handle implicit null conversions here too.
14547 2002-12-17 Ravi Pratap <ravi@ximian.com>
14549 * class.cs (MethodCore.LabelParameters): Remove the extra
14550 Type [] parameter since it is completely unnecessary. Instead
14551 pass in the method's attributes so that we can extract
14552 the "return" attribute.
14554 2002-12-17 Miguel de Icaza <miguel@ximian.com>
14556 * cs-parser.jay (parse): Use Report.Error to flag errors instead
14557 of ignoring it and letting the compile continue.
14559 * typemanager.cs (ChangeType): use an extra argument to return an
14560 error condition instead of throwing an exception.
14562 2002-12-15 Miguel de Icaza <miguel@ximian.com>
14564 * expression.cs (Unary.TryReduce): mimic the code for the regular
14565 code path. Perform an implicit cast in the cases where we can
14566 implicitly convert to one of the integral types, and then reduce
14567 based on that constant. This fixes bug #35483.
14569 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14571 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14573 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14575 * namespace.cs: fixed bug #35489.
14577 2002-12-12 Miguel de Icaza <miguel@ximian.com>
14579 * class.cs: Remove some dead code.
14581 * cs-parser.jay: Estimate the number of methods needed
14582 (RootContext.MethodCount);
14584 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14585 numbers instead of StringBuilders.
14587 * support.cs (PtrHashtable): Add constructor with initial size;
14588 We can now reduce reallocations of the method table.
14590 2002-12-10 Ravi Pratap <ravi@ximian.com>
14592 * attribute.cs (ApplyAttributes): Keep track of the emitted
14593 attributes on a per-target basis. This fixes bug #35413.
14595 2002-12-10 Miguel de Icaza <miguel@ximian.com>
14597 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14598 default to the Windows 1252 encoding.
14600 (UnixParseOption): Support version, thanks to Alp for the missing
14603 * AssemblyInfo.cs: Add nice assembly information.
14605 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14608 * cs-parser.jay: Allow a trailing comma before the close bracked
14609 in the attribute_section production.
14611 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14612 address of the instance was being taken, I will take this out,
14613 because we take the address of the object immediately here.
14615 2002-12-09 Ravi Pratap <ravi@ximian.com>
14617 * typemanager.cs (AreMultipleAllowed): Take care of the most
14618 obvious case where attribute type is not in the current assembly -
14621 2002-12-08 Miguel de Icaza <miguel@ximian.com>
14623 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14624 definitions, instead of doing that afterwards.
14626 Also we use a nice little hack, depending on the constructor, we
14627 know if we are a "composed" name or a simple name. Hence, we
14628 avoid the IndexOf test, and we avoid
14630 * codegen.cs: Add code to assist in a bug reporter to track down
14631 the source of a compiler crash.
14633 2002-12-07 Ravi Pratap <ravi@ximian.com>
14635 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14636 types have been emitted for a given element and flag an error
14637 if something which does not have AllowMultiple set is used more
14640 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14641 attribute types and their corresponding AllowMultiple properties
14643 (AreMultipleAllowed): Check the property for a given type.
14645 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14646 property in the case we have a TypeContainer.
14648 (Attributes.AddAttribute): Detect duplicates and just skip on
14649 adding them. This trivial fix catches a pretty gross error in our
14650 attribute emission - global attributes were being emitted twice!
14652 Bugzilla bug #33187 is now fixed.
14654 2002-12-06 Miguel de Icaza <miguel@ximian.com>
14656 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14657 instead of pp_and).
14659 * expression.cs (Binary.ResolveOperator): I can only use the
14660 Concat (string, string, string) and Concat (string, string,
14661 string, string) if the child is actually a concatenation of
14664 2002-12-04 Miguel de Icaza <miguel@ximian.com>
14666 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14667 context where we need a 2-character lookahead.
14669 * pending.cs (PendingImplementation): Rework so we can keep track
14670 of interface types all the time, and flag those which were
14671 implemented by parents as optional.
14673 2002-12-03 Miguel de Icaza <miguel@ximian.com>
14675 * expression.cs (Binary.ResolveOperator): Use
14676 String.Concat(string,string,string) or
14677 String.Concat(string,string,string,string) when possible.
14679 * typemanager: More helper methods.
14682 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14684 * pending.cs: remove the bogus return from GetMissingInterfaces()
14685 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14687 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14689 * namespace.cs: avoid duplicated 'using xxx' being added to
14690 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14691 when we get more than one 'using' statement for the same namespace.
14692 Report a CS0105 warning for it.
14694 2002-11-30 Miguel de Icaza <miguel@ximian.com>
14696 * cs-tokenizer.cs (consume_identifier): use read directly, instead
14697 of calling getChar/putback, uses internal knowledge of it.
14699 (xtoken): Reorder tokenizer so most common patterns are checked
14700 first. This reduces the compilation time in another 5% (from 8.11s
14701 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14703 The parsing time is 22% of the compilation in mcs, and from that
14704 64% is spent on the tokenization process.
14706 I tried using a binary search for keywords, but this is slower
14707 than the hashtable. Another option would be to do a couple of
14710 * Not use a StringBuilder, instead use an array of chars,
14711 with a set value. Notice that this way we could catch
14712 the 645 error without having to do it *afterwards*.
14714 * We could write a hand-parser to avoid the hashtable
14715 compares altogether.
14717 The identifier consumption process takes 37% of the tokenization
14718 time. Another 15% is spent on is_number. 56% of the time spent
14719 on is_number is spent on Int64.Parse:
14721 * We could probably choose based on the string length to
14722 use Int32.Parse or Int64.Parse and avoid all the 64-bit
14725 Another 3% is spend on wrapping `xtoken' in the `token' function.
14727 Handle 0xa0 as whitespace (#34752)
14729 2002-11-26 Miguel de Icaza <miguel@ximian.com>
14731 * typemanager.cs (IsCLRType): New routine to tell whether a type
14732 is one of the builtin types.
14734 Maybe it needs to use TypeCodes to be faster. Maybe we could use
14735 typecode in more places instead of doing pointer comparissions.
14736 We could leverage some knowledge about the way the typecodes are
14739 New code to cache namespaces in assemblies, it is currently not
14740 invoked, to be used soon.
14742 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14744 * expression.cs (Binary.ResolveOperator): specially handle
14745 strings, and do not perform user-defined operator overloading for
14748 2002-11-24 Miguel de Icaza <miguel@ximian.com>
14750 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14751 internalcall as it is a pretty simple operation; Avoid whenever
14752 possible to call Char.IsLetter.
14754 (consume_identifier): Cut by half the number of
14755 hashtable calls by merging the is_keyword and GetKeyword behavior.
14757 Do not short-circuit, because if we do, we
14758 report errors (ie, #if false && true would produce an invalid
14762 2002-11-24 Martin Baulig <martin@ximian.com>
14764 * expression.cs (Cast.TryReduce): If we're in checked syntax,
14765 check constant ranges and report a CS0221. Fixes #33186.
14767 2002-11-24 Martin Baulig <martin@ximian.com>
14769 * cs-parser.jay: Make this work for uninitialized variable
14770 declarations in the `for' initializer. Fixes #32416.
14772 2002-11-24 Martin Baulig <martin@ximian.com>
14774 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14775 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
14777 2002-11-24 Martin Baulig <martin@ximian.com>
14779 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14780 argument; if true, we also check for user-defined conversions.
14781 This is only needed if both arguments are of a user-defined type.
14782 Fixes #30443, added test-175.cs.
14783 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14785 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14787 2002-11-24 Martin Baulig <martin@ximian.com>
14789 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14790 function to get the store opcode.
14791 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14792 only emit the Ldelema if the store opcode is Stobj. You must run
14793 both test-34 and test-167 to test this. Fixes #34529.
14795 2002-11-23 Martin Baulig <martin@ximian.com>
14797 * ecore.cs (Expression.MemberLookup): Added additional
14798 `qualifier_type' argument which is used when we're being called
14799 from MemberAccess.DoResolve() and null if we're called from a
14801 (Expression.MemberLookupFailed): New method to report errors; this
14802 does the CS1540 check and reports the correct error message.
14804 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14805 argument for the CS1540 check and redone the way how we're dealing
14806 with private members. See the comment in the source code for details.
14807 (FilterWithClosure): Reverted this back to revision 1.197; renamed
14808 `closure_start_type' to `closure_qualifier_type' and check whether
14809 it's not null. It was not this filter being broken, it was just
14810 being called with the wrong arguments.
14812 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14813 and pass it the correct `qualifier_type'; this also does the error
14816 2002-11-22 Miguel de Icaza <miguel@ximian.com>
14818 * expression.cs (Invocation.EmitParams): If the we are dealing
14819 with a non-built-in value type, load its address as well.
14821 (ArrayCreation): Use a a pretty constant instead
14822 of the hardcoded value 2. Use 6 instead of 2 for the number of
14823 static initializers.
14825 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14826 because they are not really value types, just glorified integers.
14828 * driver.cs: Do not append .exe, the CSC compiler does not do it.
14830 * ecore.cs: Remove redundant code for enumerations, make them use
14831 the same code path as everything else, fixes the casting issue
14832 with enumerations in Windows.Forms.
14834 * attribute.cs: Do only cast to string if it is a string, the
14835 validation happens later.
14837 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14838 people upgrade their corlibs.
14840 * ecore.cs: Oops, enumerations were not following the entire code path
14842 2002-11-21 Miguel de Icaza <miguel@ximian.com>
14844 * typemanager.cs (FilterWithClosure): Commented out the test for
14845 1540 in typemanager.cs, as it has problems when accessing
14846 protected methods from a parent class (see test-174.cs).
14848 * attribute.cs (Attribute.ValidateGuid): new method.
14849 (Attribute.Resolve): Use above.
14851 2002-11-19 Miguel de Icaza <miguel@ximian.com>
14853 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14855 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14856 handling for enumerations, as we only needed the TypeContainer
14857 functionality to begin with (this is required for the fix below to
14858 work for enums that reference constants in a container class for
14861 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14863 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14864 a valid TypeBuilder to perform lookups on.o
14866 * class.cs (InheritableMemberSignatureCompare): Use true in the
14867 call to GetGetMethod and GetSetMethod, because we are comparing
14868 the signature, and we need to get the methods *even* if they are
14871 (PropertyBase.CheckBase): ditto.
14873 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14874 GotoCase.Resolve): Use Peel on EmpytCasts.
14876 * ecore.cs (EmptyCast): drop child, add Peel method.
14878 2002-11-17 Martin Baulig <martin@ximian.com>
14880 * ecore.cs (EmptyCast.Child): New public property.
14882 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14883 label resolved to an EmptyCast. Fixes #34162.
14884 (GotoCase.Resolve): Likewise.
14885 (Block.EmitMeta): Likewise.
14887 2002-11-17 Martin Baulig <martin@ximian.com>
14889 * expression.cs (Invocation.BetterConversion): Prefer int over
14890 uint; short over ushort; long over ulong for integer literals.
14891 Use ImplicitConversionExists instead of StandardConversionExists
14892 since we also need to check for user-defined implicit conversions.
14893 Fixes #34165. Added test-173.cs.
14895 2002-11-16 Martin Baulig <martin@ximian.com>
14897 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14898 with the `true' and `false' literals. Fixes #33151.
14900 2002-11-16 Martin Baulig <martin@ximian.com>
14902 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14903 October 22nd; don't do the cs1540 check for static members.
14905 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14906 now using our own filter here and doing the cs1540 check again.
14908 2002-11-16 Martin Baulig <martin@ximian.com>
14910 * support.cs (InternalParameters): Don't crash if we don't have
14911 any fixed parameters. Fixes #33532.
14913 2002-11-16 Martin Baulig <martin@ximian.com>
14915 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14916 when looking up static methods to make this work on Windows.
14919 2002-11-16 Martin Baulig <martin@ximian.com>
14921 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14922 a setter rather than using PropertyInfo.CanWrite.
14924 2002-11-15 Nick Drochak <ndrochak@gol.com>
14926 * class.cs: Allow acces to block member by subclasses. Fixes build
14929 2002-11-14 Martin Baulig <martin@ximian.com>
14931 * class.cs (Constructor.Emit): Added the extern/block check.
14934 2002-11-14 Martin Baulig <martin@ximian.com>
14936 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14937 iteration while looking for indexers, this is needed because the
14938 indexer may have a different name in our base classes. Fixed the
14939 error reporting (no indexers at all, not get accessor, no
14940 overloaded match). Fixes bug #33089.
14941 (IndexerAccess.DoResolveLValue): Likewise.
14943 2002-11-14 Martin Baulig <martin@ximian.com>
14945 * class.cs (PropertyBase.CheckBase): Make this work for multiple
14946 indexers. Fixes the first part of bug #33089.
14947 (MethodSignature.InheritableMemberSignatureCompare): Added support
14950 2002-11-13 Ravi Pratap <ravi@ximian.com>
14952 * attribute.cs (Attribute.Resolve): Catch the
14953 NullReferenceException and report it since it isn't supposed to
14956 2002-11-12 Miguel de Icaza <miguel@ximian.com>
14958 * expression.cs (Binary.EmitBranchable): Also handle the cases for
14959 LogicalOr and LogicalAnd that can benefit from recursively
14960 handling EmitBranchable. The code now should be nice for Paolo.
14962 2002-11-08 Miguel de Icaza <miguel@ximian.com>
14964 * typemanager.cs (LookupType): Added a negative-hit hashtable for
14965 the Type lookups, as we perform quite a number of lookups on
14966 non-Types. This can be removed once we can deterministically tell
14967 whether we have a type or a namespace in advance.
14969 But this might require special hacks from our corlib.
14973 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14974 and double which avoids a conversion from an integer to a double.
14976 * expression.cs: tiny optimization, avoid calling IsConstant,
14977 because it effectively performs the lookup twice.
14979 2002-11-06 Miguel de Icaza <miguel@ximian.com>
14981 But a bogus return here to keep the semantics of the old code
14982 until the Mono runtime is fixed.
14984 * pending.cs (GetMissingInterfaces): New method used to remove all
14985 the interfaces that are already implemented by our parent
14986 classes from the list of pending methods.
14988 * interface.cs: Add checks for calls after ResolveTypeExpr.
14990 2002-11-05 Miguel de Icaza <miguel@ximian.com>
14992 * class.cs (Class.Emit): Report warning 67: event not used if the
14993 warning level is beyond 3.
14995 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14996 being a NullLiteral.
14998 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15001 * class.cs (TypeContainer.GetClassBases): Cover a missing code
15002 path that might fail if a type can not be resolved.
15004 * expression.cs (Binary.Emit): Emit unsigned versions of the
15007 * driver.cs: use error 5.
15009 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15011 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15013 2002-11-01 Miguel de Icaza <miguel@ximian.com>
15015 * cs-parser.jay (switch_section): A beautiful patch from Martin
15016 Baulig that fixed 33094.
15018 2002-10-31 Miguel de Icaza <miguel@ximian.com>
15020 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15021 Check whether the base is abstract and report an error if so.
15023 * expression.cs (IndexerAccess.DoResolveLValue,
15024 IndexerAccess.DoResolve): ditto.
15026 (Invocation.DoResolve): ditto.
15028 (Invocation.FullMethodDesc): Improve the report string.
15030 * statement.cs (Block): Eliminate IsVariableDefined as it is
15031 basically just a wrapper for GetVariableInfo.
15033 * ecore.cs (SimpleName): Use new
15035 * support.cs (ReflectionParamter.ParameterType): We unwrap the
15036 type, as we return the actual parameter ref/unref state on a
15039 2002-10-30 Miguel de Icaza <miguel@ximian.com>
15041 * support.cs: Return proper flags REF/OUT fixing the previous
15044 * expression.cs: Reverted last patch, that was wrong. Is_ref is
15045 not used to mean `ref' but `ref or out' in ParameterReference
15047 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15048 full type signature instead of calling TypeManger.CSharpName
15051 * support.cs (InternalParameters.ParameterDesc): Do not compare
15052 directly to the modflags, because REF/OUT will actually be bitsets
15055 * delegate.cs (VerifyMethod): Check also the modifiers.
15057 * cs-tokenizer.cs: Fix bug where floating point values with an
15058 exponent where a sign was missing was ignored.
15060 * driver.cs: Allow multiple assemblies to be specified in a single
15063 2002-10-28 Miguel de Icaza <miguel@ximian.com>
15065 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
15066 because identifiers after a parenthesis would end up in this kind
15067 of production, and we needed to desamiguate it for having casts
15070 (UserDefinedType *) xxx
15072 2002-10-24 Miguel de Icaza <miguel@ximian.com>
15074 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15075 we should set on the Bindingflags.NonPublic, but not turn on
15076 private_ok. private_ok controls whether a Private member is
15077 returned (this is chekced on the filter routine), while the
15078 BindingFlags.NonPublic just controls whether private/protected
15079 will be allowed. This fixes the problem part of the problem of
15080 private properties being allowed to be used in derived classes.
15082 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15083 so we can call the children DoResolveLValue method (this will
15084 properly signal errors on lvalue assignments to base properties)
15086 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15087 getter are null, and we have a property info, we know that this
15088 happened because the lookup failed, so we report an error 122 for
15089 protection level violation.
15091 We also silently return if setter and getter are null in the
15092 resolve functions, this condition only happens if we have flagged
15093 the error before. This is the other half of the problem.
15095 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15096 not have accessibility information, that is why we were returning
15097 true in the filter function in typemanager.cs.
15099 To properly report 122 (property is inaccessible because of its
15100 protection level) correctly, we report this error in ResolveAccess
15101 by failing if both the setter and the getter are lacking (ie, the
15104 DoResolve and DoLResolve have been modified to check for both
15105 setter/getter being null and returning silently, the reason being
15106 that I did not want to put the knowledge about this error in upper
15109 int old = Report.Errors;
15110 x = new PropertyExpr (...);
15111 if (old != Report.Errors)
15116 So the property expr is returned, but it is invalid, so the error
15117 will be flagged during the resolve process.
15119 * class.cs: Remove InheritablePropertySignatureCompare from the
15120 class, as we no longer depend on the property signature to compute
15121 whether it is possible to implement a method or not.
15123 The reason is that calling PropertyInfo.GetGetMethod will return
15124 null (in .NET, in Mono it works, and we should change this), in
15125 cases where the Get Method does not exist in that particular
15130 class X { public virtual int A { get { return 1; } } }
15132 class Z : Y { public override int A { get { return 2; } } }
15134 Would fail in Z because the parent (Y) would not have the property
15135 defined. So we avoid this completely now (because the alternative
15136 fix was ugly and slow), and we now depend exclusively on the
15139 (PropertyBase.CheckBase): Use a method-base mechanism to find our
15140 reference method, instead of using the property.
15142 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15143 routines are gone now.
15145 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15146 names, they were incorrectly named.
15148 * cs-tokenizer.cs: Return are more gentle token on failure.
15150 * pending.cs (PendingImplementation.InterfaceMethod): This routine
15151 had an out-of-sync index variable, which caused it to remove from
15152 the list of pending methods the wrong method sometimes.
15154 2002-10-22 Miguel de Icaza <miguel@ximian.com>
15156 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15157 CanWrite, because those refer to this particular instance of the
15158 property, and do not take into account the fact that we can
15159 override single members of a property.
15161 Constructor requires an EmitContext. The resolution process does
15162 not happen here, but we need to compute the accessors before,
15163 because the resolution does not always happen for properties.
15165 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15166 subclass, before we did not update this flag, but we did update
15169 (GetAccessors): Drop this routine, as it did not work in the
15170 presence of partially overwritten set/get methods.
15172 Notice that this broke the cs1540 detection, but that will require
15175 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15179 * driver.cs: issue a warning instead of an error if we don't support
15180 debugging for the platform. Also ignore a couple of errors that may
15181 arise when trying to write the symbols. Undo my previous patch.
15183 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15185 * driver.cs: ignore /debug switch except for Unix platforms.
15187 2002-10-23 Nick Drochak <ndrochak@gol.com>
15189 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15191 2002-10-21 Miguel de Icaza <miguel@ximian.com>
15193 * driver.cs: Do not make mcs-debug conditional, so we do not break
15194 builds that use it.
15196 * statement.cs (UsageVector.MergeChildren): I would like Martin to
15197 review this patch. But basically after all the children variables
15198 have been merged, the value of "Breaks" was not being set to
15199 new_breaks for Switch blocks. I think that it should be set after
15200 it has executed. Currently I set this to the value of new_breaks,
15201 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15202 conservative, but I do not understand this code very well.
15204 I did not break anything in the build, so that is good ;-)
15206 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15208 2002-10-20 Mark Crichton <crichton@gimp.org>
15210 * cfold.cs: Fixed compile blocker. Really fixed it this time.
15212 2002-10-20 Nick Drochak <ndrochak@gol.com>
15214 * cfold.cs: Fixed compile blocker.
15216 2002-10-20 Miguel de Icaza <miguel@ximian.com>
15218 * driver.cs: I was chekcing the key, not the file.
15220 2002-10-19 Ravi Pratap <ravi@ximian.com>
15222 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15223 message that we were generating - we just need to silently return
15226 2002-10-19 Miguel de Icaza <miguel@ximian.com>
15228 * class.cs (Event.Define): Change my previous commit, as this
15229 breaks the debugger. This is a temporary hack, as it seems like
15230 the compiler is generating events incorrectly to begin with.
15232 * expression.cs (Binary.ResolveOperator): Added support for
15233 "U operator - (E x, E y)"
15235 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15238 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15239 init-only variables, but this path did not take into account that
15240 there might be also instance readonly variables. Correct this
15243 This fixes bug 32253
15245 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15248 * driver.cs: Change the extension for modules to `netmodule'
15250 * cs-parser.jay: Improved slightly the location tracking for
15251 the debugger symbols.
15253 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15254 modifiers that were specified instead of the hardcoded value
15255 (FamAndAssem). This was basically ignoring the static modifier,
15256 and others. Fixes 32429.
15258 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15259 fixed a bug in the process (32476)
15261 * expression.cs (ArrayAccess.EmitAssign): Patch from
15262 hwang_rob@yahoo.ca that fixes bug 31834.3
15264 2002-10-18 Miguel de Icaza <miguel@ximian.com>
15266 * driver.cs: Make the module extension .netmodule.
15268 2002-10-16 Miguel de Icaza <miguel@ximian.com>
15270 * driver.cs: Report an error if the resource file is not found
15271 instead of crashing.
15273 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15274 false, like Emit does.
15276 2002-10-16 Nick Drochak <ndrochak@gol.com>
15278 * typemanager.cs: Remove unused private member. Also reported mcs
15279 bug to report this as a warning like csc.
15281 2002-10-15 Martin Baulig <martin@gnome.org>
15283 * statement.cs (Statement.Emit): Made this a virtual method; emits
15284 the line number info and calls DoEmit().
15285 (Statement.DoEmit): New protected abstract method, formerly knows
15286 as Statement.Emit().
15288 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15290 2002-10-11 Miguel de Icaza <miguel@ximian.com>
15292 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15293 have fixed a remaining problem: not every AddXXXX was adding a
15294 fully qualified name.
15296 Now everyone registers a fully qualified name in the DeclSpace as
15297 being defined instead of the partial name.
15299 Downsides: we are slower than we need to be due to the excess
15300 copies and the names being registered this way.
15302 The reason for this is that we currently depend (on the corlib
15303 bootstrap for instance) that types are fully qualified, because
15304 we dump all the types in the namespace, and we should really have
15305 types inserted into the proper namespace, so we can only store the
15306 basenames in the defined_names array.
15308 2002-10-10 Martin Baulig <martin@gnome.org>
15310 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15311 from bug #31834, see the bug report for a testcase which is
15314 2002-10-10 Martin Baulig <martin@gnome.org>
15316 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15317 flow analysis code for this.
15319 * statement.cs (Do, While, For): Tell the flow analysis code about
15321 (FlowBranching.UsageVector): Added support for infinite loops.
15322 (Block.Resolve): Moved the dead code elimination here and use flow
15325 2002-10-09 Miguel de Icaza <miguel@ximian.com>
15327 * class.cs (Field.Define): Catch cycles on struct type
15330 * typemanager.cs (IsUnmanagedtype): Do not recursively check
15331 fields if the fields are static. We only need to check instance
15334 * expression.cs (As.DoResolve): Test for reference type.
15336 * statement.cs (Using.ResolveExpression): Use
15337 ConvertImplicitRequired, not ConvertImplicit which reports an
15339 (Using.ResolveLocalVariableDecls): ditto.
15341 * expression.cs (Binary.ResolveOperator): Report errors in a few
15342 places where we had to.
15344 * typemanager.cs (IsUnmanagedtype): Finish implementation.
15346 2002-10-08 Miguel de Icaza <miguel@ximian.com>
15348 * expression.cs: Use StoreFromPtr instead of extracting the type
15349 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
15351 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15352 an enumeration value to a System.Enum, but System.Enum is not a
15353 value type, but an class type, so we need to box.
15355 (Expression.ConvertExplicit): One codepath could return
15356 errors but not flag them. Fix this. Fixes #31853
15358 * parameter.cs (Resolve): Do not allow void as a parameter type.
15360 2002-10-06 Martin Baulig <martin@gnome.org>
15362 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15363 if it's a class type and not a struct. Fixes #31815.
15365 2002-10-06 Martin Baulig <martin@gnome.org>
15367 * statement.cs: Reworked the flow analysis code a bit to make it
15368 usable for dead code elimination.
15370 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15372 * cs-parser.jay: allow empty source files. Fixes bug #31781.
15374 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15376 * expression.cs (ComposedCast.DoResolveType): A quick workaround
15377 to fix the test 165, will investigate deeper.
15379 2002-10-04 Martin Baulig <martin@gnome.org>
15381 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15382 finally blocks actually work.
15383 (Try.Resolve): We don't need to create a sibling for `finally' if
15384 there is no finally block.
15386 2002-10-04 Martin Baulig <martin@gnome.org>
15388 * class.cs (Constructor.Define): The default accessibility for a
15389 non-default constructor is private, not public.
15391 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15393 * class.cs (Constructor): Make AllowedModifiers public, add
15396 * cs-parser.jay: Perform the modifiers test here, as the
15397 constructor for the Constructor class usually receives a zero
15398 because of the way we create it (first we create, later we
15399 customize, and we were never checking the modifiers).
15401 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15402 is a version of LookupTypeReflection that includes the type-name
15403 cache. This can be used as a fast path for functions that know
15404 the fully qualified name and are only calling into *.GetType() to
15405 obtain a composed type.
15407 This is also used by TypeManager.LookupType during its type
15410 (LookupType): We now also track the real type name, as sometimes
15411 we can get a quey for the real type name from things like
15412 ComposedCast. This fixes bug 31422.
15414 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15415 complete type fullname, it does not have to go through the type
15416 resolution system to obtain the composed version of the type (for
15417 obtaining arrays or pointers).
15419 (Conditional.Emit): Use the EmitBoolExpression to
15420 generate nicer code, as requested by Paolo.
15422 (ArrayCreation.CheckIndices): Use the patch from
15423 hwang_rob@yahoo.ca to validate the array initializers.
15425 2002-10-03 Miguel de Icaza <miguel@ximian.com>
15427 * class.cs (ConstructorInitializer.Emit): simplify code by using
15428 Invocation.EmitCall, and at the same time, fix the bugs in calling
15429 parent constructors that took variable arguments.
15431 * ecore.cs (Expression.ConvertNumericExplicit,
15432 Expression.ImplicitNumericConversion): Remove the code that
15433 manually wrapped decimal (InternalTypeConstructor call is now gone
15436 * expression.cs (Cast.TryReduce): Also handle decimal types when
15437 trying to perform a constant fold on the type.
15439 * typemanager.cs (IsUnmanagedtype): Partially implemented.
15441 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15442 that only turned off an error report, and did nothing else.
15444 2002-10-02 Miguel de Icaza <miguel@ximian.com>
15446 * driver.cs: Handle and ignore /fullpaths
15448 2002-10-01 Miguel de Icaza <miguel@ximian.com>
15450 * expression.cs (Binary.ResolveOperator): Catch the case where
15451 DoNumericPromotions returns true,
15453 (Binary.DoNumericPromotions): Simplify the code, and the tests.
15455 2002-09-27 Miguel de Icaza <miguel@ximian.com>
15457 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15460 2002-09-26 Miguel de Icaza <miguel@ximian.com>
15462 * ecore.cs (ConvertNumericExplicit): It is not enough that the
15463 conversion exists, but it is also required that the conversion be
15464 performed. This manifested in "(Type64Enum) 2".
15466 * class.cs (TypeManager.AddMethod): The fix is not to change
15467 AddEnum, because that one was using a fully qualified name (every
15468 DeclSpace derivative does), but to change the AddMethod routine
15469 that was using an un-namespaced name. This now correctly reports
15470 the duplicated name.
15472 Revert patch until I can properly fix it. The issue
15473 is that we have a shared Type space across all namespaces
15474 currently, which is wrong.
15476 Options include making the Namespace a DeclSpace, and merge
15477 current_namespace/current_container in the parser.
15479 2002-09-25 Miguel de Icaza <miguel@ximian.com>
15481 * cs-parser.jay: Improve error reporting when we get a different
15482 kind of expression in local_variable_type and
15483 local_variable_pointer_type.
15485 Propagate this to avoid missleading errors being reported.
15487 * ecore.cs (ImplicitReferenceConversion): treat
15488 TypeManager.value_type as a target just like object_type. As
15493 Is valid, and needs to result in the int 1 being boxed before it
15494 is assigned to the value type v.
15496 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15497 to validate the enumeration name.
15499 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15500 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
15501 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15503 * ecore.cs (TryImplicitIntConversion): When doing an
15504 implicit-enumeration-conversion, check if the type is 64-bits and
15505 perform a conversion before passing to EnumConstant.
15507 2002-09-23 Miguel de Icaza <miguel@ximian.com>
15509 * decl.cs (Error_AmbiguousTypeReference); New routine used to
15510 report ambiguous type references. Unlike the MS version, we
15511 report what the ambiguity is. Innovation at work ;-)
15513 (DeclSpace.FindType): Require a location argument to
15514 display when we display an ambiguous error.
15516 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15518 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15520 * expression.cs (EmitDynamicInitializers): Apply patch from
15521 hwang_rob@yahoo.ca that fixes the order in which we emit our
15524 2002-09-21 Martin Baulig <martin@gnome.org>
15526 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15527 delegate takes no arguments.
15529 2002-09-20 Miguel de Icaza <miguel@ximian.com>
15531 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15534 * expression.cs: Extract the underlying type.
15536 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15538 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15540 2002-09-19 Miguel de Icaza <miguel@ximian.com>
15542 * class.cs (TypeContainer.DefineType): We can not use the nice
15543 PackingSize with the size set to 1 DefineType method, because it
15544 will not allow us to define the interfaces that the struct
15547 This completes the fixing of bug 27287
15549 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15550 means also structs. This fixes part of the problem.
15551 (Expresion.ImplicitReferenceConversionExists): ditto.
15553 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15554 error if there were no errors reported during the type lookup
15555 process, to avoid duplicates or redundant errors. Without this
15556 you would get an ambiguous errors plus a type not found. We have
15557 beaten the user enough with the first error.
15559 (DeclSparce.FindType): Emit a warning if we have an ambiguous
15562 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15563 during the resolution process, stop the lookup, this avoids
15564 repeated error reports (same error twice).
15566 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15568 * typemanager.cs (LookupType): Redo the type lookup code to match
15569 the needs of System.Reflection.
15571 The issue is that System.Reflection requires references to nested
15572 types to begin with a "+" sign instead of a dot. So toplevel
15573 types look like: "NameSpace.TopLevelClass", and nested ones look
15574 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15577 2002-09-19 Martin Baulig <martin@gnome.org>
15579 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15580 says that a method always returns or always throws an exception,
15581 don't report the CS0161.
15583 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15584 set `Returns = new_returns'.
15586 2002-09-19 Martin Baulig <martin@gnome.org>
15588 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15589 to an enum constant, check for a CS0176.
15591 2002-09-18 Miguel de Icaza <miguel@ximian.com>
15593 * class.cs (TypeContainer.CheckPairedOperators): Now we check
15594 for operators that must be in pairs and report errors.
15596 * ecore.cs (SimpleName.DoResolveType): During the initial type
15597 resolution process, when we define types recursively, we must
15598 check first for types in our current scope before we perform
15599 lookups in the enclosing scopes.
15601 * expression.cs (MakeByteBlob): Handle Decimal blobs.
15603 (Invocation.VerifyArgumentsCompat): Call
15604 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15605 I thought we were supposed to always call this, but there are a
15606 few places in the code where we dont do it.
15608 2002-09-17 Miguel de Icaza <miguel@ximian.com>
15610 * driver.cs: Add support in -linkres and -resource to specify the
15611 name of the identifier.
15613 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15615 * ecore.cs (StandardConversionExists): Sync with the conversion
15616 code: allow anything-* to void* conversions.
15618 (FindMostSpecificSource): Use an Expression argument
15619 instead of a Type, because we might be handed over a Literal which
15620 gets a few more implicit conversions that plain types do not. So
15621 this information was being lost.
15623 Also, we drop the temporary type-holder expression when not
15626 2002-09-17 Martin Baulig <martin@gnome.org>
15628 * class.cs (PropertyBase.CheckBase): Don't check the base class if
15629 this is an explicit interface implementation.
15631 2002-09-17 Martin Baulig <martin@gnome.org>
15633 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15634 different `IndexerName' attributes.
15636 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15637 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15638 virtual CommonResolve().
15640 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15642 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15643 and convert that to the UnderlyingType.
15645 * statement.cs (Foreach.Resolve): Indexers are just like variables
15646 or PropertyAccesses.
15648 * cs-tokenizer.cs (consume_string): Track line numbers and columns
15649 inside quoted strings, we were not doing this before.
15651 2002-09-16 Martin Baulig <martin@gnome.org>
15653 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15654 resolve it. This is needed for the definite assignment check of the
15655 instance expression, fixes bug #29846.
15656 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15658 2002-09-16 Nick Drochak <ndrochak@gol.com>
15660 * parameter.cs: Fix compile error. Cannot reference static member
15661 from an instance object. Is this an mcs bug?
15663 2002-09-14 Martin Baulig <martin@gnome.org>
15665 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15666 multiple times. Fixes bug #30295, added test-166.cs.
15668 2002-09-14 Martin Baulig <martin@gnome.org>
15670 * statement.cs (Block.Emit): Don't emit unreachable code.
15671 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15672 `break' statements.
15673 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15675 2002-09-14 Martin Baulig <martin@gnome.org>
15677 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15680 2002-09-14 Martin Baulig <martin@gnome.org>
15682 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15683 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15684 be false on the ms runtime.
15686 2002-09-13 Martin Baulig <martin@gnome.org>
15688 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15689 the CS0038 error message.
15691 2002-09-12 Miguel de Icaza <miguel@ximian.com>
15693 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15694 constant inside, return it.
15696 2002-09-12 Martin Baulig <martin@gnome.org>
15698 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15699 implicit conversion can be done between enum types.
15701 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15702 check whether an implicit conversion to the current enum's UnderlyingType
15703 exists and report an error if not.
15705 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15706 without debugging support.
15708 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15709 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
15711 2002-09-12 Martin Baulig <martin@gnome.org>
15713 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15715 * ecore.cs (IMemberExpr.DeclaringType): New property.
15716 (SimpleName.SimpleNameResolve): Check whether we're accessing a
15717 nonstatic member of an outer type (CS0038).
15719 2002-09-11 Miguel de Icaza <miguel@ximian.com>
15721 * driver.cs: Activate the using-error detector at warning level
15722 4 (at least for MS-compatible APIs).
15724 * namespace.cs (VerifyUsing): Small buglett fix.
15726 * pending.cs (PendingImplementation): pass the container pointer.
15728 * interface.cs (GetMethods): Allow for recursive definition. Long
15729 term, I would like to move every type to support recursive
15730 definitions, not the current ordering mechanism that we have right
15733 The situation is this: Attributes are handled before interfaces,
15734 so we can apply attributes to interfaces. But some attributes
15735 implement interfaces, we will now handle the simple cases
15736 (recursive definitions will just get an error).
15738 * parameter.cs: Only invalidate types at the end if we fail to
15741 2002-09-09 Martin Baulig <martin@gnome.org>
15743 * ecore.cs (PropertyExpr.Emit): Also check for
15744 TypeManager.system_int_array_get_length so this'll also work when
15745 compiling corlib. Fixes #30003.
15747 2002-09-09 Martin Baulig <martin@gnome.org>
15749 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15750 and throw an exception if we can't get the type's size. Fixed #30040,
15753 2002-09-09 Martin Baulig <martin@gnome.org>
15755 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15757 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15758 context. Fixes bug #30027.
15760 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15761 virtual functions. Fixes bug #30043, added test-164.cs.
15763 2002-09-08 Ravi Pratap <ravi@ximian.com>
15765 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15767 2002-09-08 Nick Drochak <ndrochak@gol.com>
15769 * driver.cs: Use an object to get the windows codepage since it's not a
15772 2002-09-08 Miguel de Icaza <miguel@ximian.com>
15774 * statement.cs (For.Emit): for infinite loops (test == null)
15775 return whether there is a break inside, not always "true".
15777 * namespace.cs (UsingEntry): New struct to hold the name of the
15778 using definition, the location where it is defined, and whether it
15779 has been used in a successful type lookup.
15781 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15786 2002-09-06 Ravi Pratap <ravi@ximian.com>
15788 * attribute.cs : Fix incorrect code which relied on catching
15789 a NullReferenceException to detect a null being passed in
15790 where an object was expected.
15792 2002-09-06 Miguel de Icaza <miguel@ximian.com>
15794 * statement.cs (Try): flag the catch variable as assigned
15796 * expression.cs (Cast): Simplified by using ResolveType instead of
15797 manually resolving.
15799 * statement.cs (Catch): Fix bug by using ResolveType.
15801 2002-09-06 Ravi Pratap <ravi@ximian.com>
15803 * expression.cs (BetterConversion): Special case for when we have
15804 a NullLiteral as the argument and we have to choose between string
15805 and object types - we choose string the way csc does.
15807 * attribute.cs (Attribute.Resolve): Catch the
15808 NullReferenceException and report error #182 since the Mono
15809 runtime no more has the bug and having this exception raised means
15810 we tried to select a constructor which takes an object and is
15813 2002-09-05 Ravi Pratap <ravi@ximian.com>
15815 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15816 message (1502, 1503) when we can't locate a method after overload
15817 resolution. This is much more informative and closes the bug
15820 * interface.cs (PopulateMethod): Return if there are no argument
15821 types. Fixes a NullReferenceException bug.
15823 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15824 expressions too. Previously we were checking only in one place for
15825 positional arguments leaving out named arguments.
15827 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15828 type to the enum type is not allowed. Remove code corresponding to
15831 (ConvertNumericExplicit): Allow explicit conversions from
15832 the underlying type to enum type. This precisely follows the spec
15833 and closes a bug filed by Gonzalo.
15835 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15838 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15840 2002-09-03 Miguel de Icaza <miguel@ximian.com>
15842 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15843 it was important that we stored the right value after the
15844 reduction in `converted'.
15846 2002-09-04 Martin Baulig <martin@gnome.org>
15848 * location.cs (Location.SymbolDocument): Use full pathnames for the
15851 2002-08-30 Miguel de Icaza <miguel@ximian.com>
15853 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15854 of the expression resolve mechanism, because that will catch the
15855 SimpleName error failures.
15857 (Conditional): If we can not resolve the
15858 expression, return, do not crash.
15860 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15863 (location): display token name instead of its number.
15865 2002-08-28 Martin Baulig <martin@gnome.org>
15867 * expression.cs (Binary.ResolveOperator): Don't silently return
15868 but return an error if an operator cannot be applied between two
15871 2002-08-28 Martin Baulig <martin@gnome.org>
15873 * class.cs (Constructor.Define): Set the permission attributes
15874 correctly instead of making all constructors public.
15876 2002-08-28 Martin Baulig <martin@gnome.org>
15878 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15879 for private members before reporting a CS0103; if we find anything,
15882 2002-08-28 Martin Baulig <martin@gnome.org>
15884 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15885 to check whether `closure_start_type == closure_invocation_type',
15886 we also need to check whether `m.DeclaringType == closure_invocation_type'
15887 before bypassing the permission checks. We might be accessing
15888 protected/private members from the base class.
15889 (TypeManager.RealMemberLookup): Only set private_ok if private
15890 members were requested via BindingFlags.NonPublic.
15892 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15894 * expression.cs (MemberAccess.ResolveMemberAccess): Set
15895 MethodGroupExpr.IsExplicitImpl if appropriate.
15896 (Invocation.DoResolve): Don't report the CS0120 for explicit
15897 interface implementations.
15899 2002-08-27 Martin Baulig <martin@gnome.org>
15901 * expression.cs (Invocation.DoResolve): If this is a static
15902 method and we don't have an InstanceExpression, we must report
15905 2002-08-25 Martin Baulig <martin@gnome.org>
15907 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15908 `==' between a valuetype and an object.
15910 2002-08-25 Miguel de Icaza <miguel@ximian.com>
15912 * ecore.cs (TypeExpr): Provide a ToString method.
15914 2002-08-24 Martin Baulig <martin@gnome.org>
15916 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15917 now called proggie.dbg and it's a binary file.
15919 2002-08-23 Martin Baulig <martin@gnome.org>
15921 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15923 2002-08-23 Martin Baulig <martin@gnome.org>
15925 * struct.cs (MyStructInfo.ctor): Make this work with empty
15926 structs; it's not allowed to use foreach() on null.
15928 2002-08-23 Martin Baulig <martin@gnome.org>
15930 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15931 writer the full pathname of the generated assembly.
15933 2002-08-23 Martin Baulig <martin@gnome.org>
15935 * statements.cs (FlowBranching.UsageVector.MergeChildren):
15936 A `finally' block never returns or breaks; improved handling of
15939 2002-08-23 Martin Baulig <martin@gnome.org>
15941 * statement.cs (Throw.Resolve): Allow `throw null'.
15943 2002-08-23 Martin Baulig <martin@gnome.org>
15945 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15946 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15947 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
15948 MemberLookup would return a wrong event if this is an explicit
15949 interface implementation and the class has an event with the same
15952 2002-08-23 Martin Baulig <martin@gnome.org>
15954 * statement.cs (Block.AddChildVariableNames): New public method.
15955 (Block.AddChildVariableName): Likewise.
15956 (Block.IsVariableNameUsedInChildBlock): Likewise.
15957 (Block.AddVariable): Check whether a variable name has already
15958 been used in a child block.
15960 * cs-parser.jay (declare_local_variables): Mark all variable names
15961 from the current block as being used in a child block in the
15964 2002-08-23 Martin Baulig <martin@gnome.org>
15966 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15967 find the symbol writer.
15969 * driver.cs: csc also allows the arguments to /define being
15970 separated by commas, not only by semicolons.
15972 2002-08-23 Martin Baulig <martin@gnome.org>
15974 * interface.cs (Interface.GetMembers): Added static check for events.
15976 2002-08-15 Martin Baulig <martin@gnome.org>
15978 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15979 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15981 * ecore.cs (Expression.MemberLookup): Added documentation and explained
15982 why the MethodData.EmitDestructor() change was necessary.
15984 2002-08-20 Martin Baulig <martin@gnome.org>
15986 * class.cs (TypeContainer.FindMembers): Added static check for events.
15988 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15990 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15991 use Type.GetEvents(), not Type.FindMembers().
15993 2002-08-20 Martin Baulig <martin@gnome.org>
15995 * decl.cs (MemberCache): Added a special method cache which will
15996 be used for method-only searched. This ensures that a method
15997 search will return a MethodInfo with the correct ReflectedType for
16000 2002-08-20 Martin Baulig <martin@gnome.org>
16002 * decl.cs (DeclSpace.FindMembers): Made this public.
16004 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16006 * delegate.cs: fixed build on windows.
16007 [FIXME: Filed as bug #29150: MCS must report these errors.]
16009 2002-08-19 Ravi Pratap <ravi@ximian.com>
16011 * ecore.cs (StandardConversionExists): Return a false
16012 if we are trying to convert the void type to anything else
16013 since that is not allowed.
16015 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16016 we flag error 70 in the event an event is trying to be accessed
16017 directly from outside the declaring type.
16019 2002-08-20 Martin Baulig <martin@gnome.org>
16021 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16022 MemberCache from typemanager.cs to decl.cs.
16024 2002-08-19 Martin Baulig <martin@gnome.org>
16026 * class.cs (TypeContainer): Implement IMemberContainer.
16027 (TypeContainer.DefineMembers): Create the MemberCache.
16028 (TypeContainer.FindMembers): Do better BindingFlags checking; only
16029 return public members if BindingFlags.Public was given, check
16030 whether members are static.
16032 2002-08-16 Martin Baulig <martin@gnome.org>
16034 * decl.cs (DeclSpace.Define): Splitted this in Define and
16035 DefineMembers. DefineMembers is called first and initializes the
16038 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
16039 DefineMembers() on all our DeclSpaces.
16041 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16042 but call DefineMembers() on all nested interfaces. We call their
16043 Define() in our new Define() function.
16045 * interface.cs (Interface): Implement IMemberContainer.
16046 (Interface.Define): Moved all code except the attribute stuf to
16048 (Interface.DefineMembers): Initialize the member cache.
16050 * typemanager.cs (IMemberFinder): Removed this interface, we don't
16051 need this anymore since we can use MemberCache.FindMembers directly.
16053 2002-08-19 Martin Baulig <martin@gnome.org>
16055 * typemanager.cs (MemberCache): When creating the cache for an
16056 interface type, add all inherited members.
16057 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16058 to `out bool used_cache' and documented it.
16059 (TypeManager.MemberLookup): If we already used the cache in the first
16060 iteration, we don't need to do the interfaces check.
16062 2002-08-19 Martin Baulig <martin@gnome.org>
16064 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
16065 here from IMemberFinder and don't implement this interface anymore.
16066 (DeclSpace.MemberCache): Moved here from IMemberFinder.
16068 * typemanager.cs (IMemberFinder): This interface is now only used by
16069 classes which actually support the member cache.
16070 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16071 since we only put DeclSpaces into this Hashtable.
16072 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16073 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16075 2002-08-16 Martin Baulig <martin@gnome.org>
16077 * typemanager.cs (ICachingMemberFinder): Removed.
16078 (IMemberFinder.MemberCache): New property.
16079 (TypeManager.FindMembers): Merged this with RealFindMembers().
16080 This function will never be called from TypeManager.MemberLookup()
16081 so we can't use the cache here, just the IMemberFinder.
16082 (TypeManager.MemberLookup_FindMembers): Check whether the
16083 IMemberFinder has a MemberCache and call the cache's FindMembers
16085 (MemberCache): Rewrote larger parts of this yet another time and
16086 cleaned it up a bit.
16088 2002-08-15 Miguel de Icaza <miguel@ximian.com>
16090 * driver.cs (LoadArgs): Support quoting.
16092 (Usage): Show the CSC-like command line arguments.
16094 Improved a few error messages.
16096 2002-08-15 Martin Baulig <martin@gnome.org>
16098 * typemanager.cs (IMemberContainer.Type): New property.
16099 (IMemberContainer.IsInterface): New property.
16101 The following changes are conditional to BROKEN_RUNTIME, which is
16102 defined at the top of the file.
16104 * typemanager.cs (MemberCache.MemberCache): Don't add the base
16105 class'es members, but add all members from TypeHandle.ObjectType
16106 if we're an interface.
16107 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16108 is the current type.
16109 (MemberCache.CacheEntry.Container): Removed this field.
16110 (TypeHandle.GetMembers): Include inherited members.
16112 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16114 * typemanager.cs: fixed compilation and added a comment on a field that
16117 2002-08-15 Martin Baulig <martin@gnome.org>
16119 * class.cs (ConstructorInitializer.Resolve): In the
16120 Expression.MemberLookup call, use the queried_type as
16123 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16124 declared' attribute, it's always true.
16125 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16126 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16127 temporary wrapper for FindMembers which tells MemberLookup whether
16128 members from the base classes are included in the return value.
16129 This will go away soon.
16130 (TypeManager.MemberLookup): Use this temporary hack here; once the
16131 new MemberCache is completed, we don't need to do the DeclaredOnly
16132 looping here anymore since the MemberCache will take care of this.
16133 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16134 (MemberCache): When creating the MemberCache for a class, get
16135 members from the current class and all its base classes.
16136 (MemberCache.CacheEntry.Container): New field. This is a
16137 temporary hack until the Mono runtime is fixed to distinguish
16138 between ReflectedType and DeclaringType. It allows us to use MCS
16139 with both the MS runtime and the unfixed Mono runtime without
16140 problems and without accecting performance.
16141 (MemberCache.SearchMembers): The DeclaredOnly looping from
16142 TypeManager.MemberLookup is now done here.
16144 2002-08-14 Martin Baulig <martin@gnome.org>
16146 * statement.cs (MyStructInfo.MyStructInfo): Don't call
16147 Type.GetFields on dynamic types but get the fields from the
16148 corresponding TypeContainer.
16149 (MyStructInfo.GetStructInfo): Added check for enum types.
16151 * typemanager.cs (MemberList.IsSynchronized): Implemented.
16152 (MemberList.SyncRoot): Implemented.
16153 (TypeManager.FilterWithClosure): No need to check permissions if
16154 closure_start_type == closure_invocation_type, don't crash if
16155 closure_invocation_type is null.
16157 2002-08-13 Martin Baulig <martin@gnome.org>
16159 Rewrote TypeContainer.FindMembers to use a member cache. This
16160 gives us a speed increase of about 35% for the self-hosting MCS
16161 build and of about 15-20% for the class libs (both on GNU/Linux).
16163 * report.cs (Timer): New class to get enhanced profiling. This
16164 whole class is "TIMER" conditional since it remarkably slows down
16167 * class.cs (MemberList): New class. This is an IList wrapper
16168 which we're now using instead of passing MemberInfo[]'s around to
16169 avoid copying this array unnecessarily.
16170 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16171 (ICachingMemberFinder, IMemberContainer): New interface.
16172 (TypeManager.FilterWithClosure): If `criteria' is null, the name
16173 has already been checked, otherwise use it for the name comparision.
16174 (TypeManager.FindMembers): Renamed to RealMemberFinder and
16175 provided wrapper which tries to use ICachingMemberFinder.FindMembers
16176 if possible. Returns a MemberList, not a MemberInfo [].
16177 (TypeHandle): New class, implements IMemberContainer. We create
16178 one instance of this class per type, it contains a MemberCache
16179 which is used to do the member lookups.
16180 (MemberCache): New class. Each instance of this class contains
16181 all members of a type and a name-based hash table.
16182 (MemberCache.FindMembers): This is our new member lookup
16183 function. First, it looks up all members of the requested name in
16184 the hash table. Then, it walks this list and sorts out all
16185 applicable members and returns them.
16187 2002-08-13 Martin Baulig <martin@gnome.org>
16189 In addition to a nice code cleanup, this gives us a performance
16190 increase of about 1.4% on GNU/Linux - not much, but it's already
16191 half a second for the self-hosting MCS compilation.
16193 * typemanager.cs (IMemberFinder): New interface. It is used by
16194 TypeManager.FindMembers to call FindMembers on a TypeContainer,
16195 Enum, Delegate or Interface.
16196 (TypeManager.finder_to_member_finder): New PtrHashtable.
16197 (TypeManager.finder_to_container): Removed.
16198 (TypeManager.finder_to_delegate): Removed.
16199 (TypeManager.finder_to_interface): Removed.
16200 (TypeManager.finder_to_enum): Removed.
16202 * interface.cs (Interface): Implement IMemberFinder.
16204 * delegate.cs (Delegate): Implement IMemberFinder.
16206 * enum.cs (Enum): Implement IMemberFinder.
16208 * class.cs (TypeContainer): Implement IMemberFinder.
16210 2002-08-12 Martin Baulig <martin@gnome.org>
16212 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16214 2002-08-12 Martin Baulig <martin@gnome.org>
16216 * ecore.cs (ITypeExpression): New interface for expressions which
16218 (TypeExpression): Renamed to TypeLookupExpression.
16219 (Expression.DoResolve): If we're doing a types-only lookup, the
16220 expression must implement the ITypeExpression interface and we
16221 call DoResolveType() on it.
16222 (SimpleName): Implement the new ITypeExpression interface.
16223 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16224 hack, the situation that we're only looking up types can't happen
16225 anymore when this method is called. Moved the type lookup code to
16226 DoResolveType() and call it.
16227 (SimpleName.DoResolveType): This ITypeExpression interface method
16228 is now doing the types-only lookup.
16229 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16230 (ResolveFlags): Added MaskExprClass.
16232 * expression.cs (MemberAccess): Implement the ITypeExpression
16234 (MemberAccess.DoResolve): Added support for a types-only lookup
16235 when we're called via ITypeExpression.DoResolveType().
16236 (ComposedCast): Implement the ITypeExpression interface.
16238 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
16239 Expression.Resolve() with ResolveFlags.Type instead.
16241 2002-08-12 Martin Baulig <martin@gnome.org>
16243 * interface.cs (Interface.Define): Apply attributes.
16245 * attribute.cs (Attribute.ApplyAttributes): Added support for
16246 interface attributes.
16248 2002-08-11 Martin Baulig <martin@gnome.org>
16250 * statement.cs (Block.Emit): Only check the "this" variable if we
16251 do not always throw an exception.
16253 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16254 whether the property has a set accessor.
16256 2002-08-11 Martin Baulig <martin@gnome.org>
16258 Added control flow analysis support for structs.
16260 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16261 with control flow analysis turned off.
16262 (IVariable): New interface.
16263 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16264 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16265 (FieldExpr.DoResolve): Resolve the instance expression with flow
16266 analysis turned off and do the definite assignment check after the
16267 resolving when we know what the expression will resolve to.
16269 * expression.cs (LocalVariableReference, ParameterReference):
16270 Implement the new IVariable interface, only call the flow analysis
16271 code if ec.DoFlowAnalysis is true.
16272 (This): Added constructor which takes a Block argument. Implement
16273 the new IVariable interface.
16274 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16275 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16276 This does the definite assignment checks for struct members.
16278 * class.cs (Constructor.Emit): If this is a non-static `struct'
16279 constructor which doesn't have any initializer, call
16280 Block.AddThisVariable() to tell the flow analysis code that all
16281 struct elements must be initialized before control returns from
16284 * statement.cs (MyStructInfo): New public class.
16285 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16286 argument to this indexer. If non-zero, check an individual struct
16287 member, not the whole struct.
16288 (FlowBranching.CheckOutParameters): Check struct members.
16289 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16290 overloaded versions of these methods which take an additional
16291 `int field_idx' argument to check struct members.
16292 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16293 overloaded versions of these methods which take an additional
16294 `string field_name' argument to check struct member.s
16295 (VariableInfo): Implement the IVariable interface.
16296 (VariableInfo.StructInfo): New public property. Returns the
16297 MyStructInfo instance of the variable if it's a struct or null.
16298 (Block.AddThisVariable): New public method. This is called from
16299 Constructor.Emit() for non-static `struct' constructor which do
16300 not have any initializer. It creates a special variable for the
16301 "this" instance variable which will be checked by the flow
16302 analysis code to ensure that all of the struct's fields are
16303 initialized before control returns from the constructor.
16304 (UsageVector): Added support for struct members. If a
16305 variable/parameter is a struct with N members, we reserve a slot
16306 in the usage vector for each member. A struct is considered fully
16307 initialized if either the struct itself (slot 0) or all its
16308 members are initialized.
16310 2002-08-08 Martin Baulig <martin@gnome.org>
16312 * driver.cs (Driver.MainDriver): Only report an error CS5001
16313 if there were no compilation errors.
16315 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16316 `UnsafeContext' property to determine whether the parent is in
16317 unsafe context rather than checking the parent's ModFlags:
16318 classes nested in an unsafe class are unsafe as well.
16320 2002-08-08 Martin Baulig <martin@gnome.org>
16322 * statement.cs (UsageVector.MergeChildren): Distinguish between
16323 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16324 we return. Added test17() and test18() to test-154.cs.
16326 2002-08-08 Martin Baulig <martin@gnome.org>
16328 * typemanager.cs (TypeManager.FilterWithClosure): If we have
16329 Family access, make sure the invoking type isn't a subclass of the
16330 queried type (that'd be a CS1540).
16332 * ecore.cs (Expression.MemberLookup): Added overloaded version of
16333 this method which takes an additional `Type invocation_type'.
16335 * expression.cs (BaseAccess.DoResolve): Use the base type as
16336 invocation and query type.
16337 (MemberAccess.DoResolve): If the lookup failed and we're about to
16338 report a CS0122, try a lookup with the ec.ContainerType - if this
16339 succeeds, we must report a CS1540.
16341 2002-08-08 Martin Baulig <martin@gnome.org>
16343 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16344 (MethodGroupExpr): Implement the IMemberExpr interface.
16346 * expression (MemberAccess.ResolveMemberAccess): No need to have
16347 any special code for MethodGroupExprs anymore, they're now
16350 2002-08-08 Martin Baulig <martin@gnome.org>
16352 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16353 Family, FamANDAssem and FamORAssem permissions.
16354 (TypeManager.IsSubclassOrNestedChildOf): New public method.
16356 2002-08-08 Martin Baulig <martin@gnome.org>
16358 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16359 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16362 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16364 * driver.cs: implemented /resource option to embed managed resources.
16366 2002-08-07 Martin Baulig <martin@gnome.org>
16368 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16369 (FieldBase.HasFieldInitializer): New public property.
16370 (FieldBase.GetInitializerExpression): New public method. Resolves and
16371 returns the field initializer and makes sure it is only resolved once.
16372 (TypeContainer.EmitFieldInitializers): Call
16373 FieldBase.GetInitializerExpression to get the initializer, this ensures
16374 that it isn't resolved multiple times.
16376 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
16377 the resolving process (SimpleName/MemberLookup) that we're currently
16378 emitting a field initializer (which must not access any instance members,
16379 this is an error CS0236).
16381 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16382 argument, if the `IsFieldInitializer' flag is set, we must report and
16383 error CS0236 and not an error CS0120.
16385 2002-08-07 Martin Baulig <martin@gnome.org>
16387 * ecore.cs (IMemberExpr): New public interface.
16388 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16389 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16390 if the expression is an IMemberExpr.
16392 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16393 to be null, implicitly default to `this' if we're non-static in
16394 this case. Simplified the code a lot by using the new IMemberExpr
16395 interface. Also fixed bug #28176 here.
16397 2002-08-06 Martin Baulig <martin@gnome.org>
16399 * cs-parser.jay (SimpleLookup): Removed. We need to create
16400 ParameterReferences during semantic analysis so that we can do a
16401 type-only search when resolving Cast, TypeOf and SizeOf.
16402 (block): Pass the `current_local_parameters' to the Block's
16405 * class.cs (ConstructorInitializer): Added `Parameters parameters'
16406 argument to the constructor.
16407 (ConstructorInitializer.Resolve): Create a temporary implicit
16408 block with the parameters.
16410 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16411 references here if we aren't doing a type-only search.
16413 * statement.cs (Block): Added constructor which takes a
16414 `Parameters parameters' argument.
16415 (Block.Parameters): New public property.
16417 * support.cs (InternalParameters.Parameters): Renamed `parameters'
16418 to `Parameters' and made it public readonly.
16420 2002-08-06 Martin Baulig <martin@gnome.org>
16422 * ecore.cs (Expression.Warning): Made this public as well.
16424 * report.cs (Report.Debug): Print the contents of collections.
16426 2002-08-06 Martin Baulig <martin@gnome.org>
16428 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
16429 used to tell Resolve() which kinds of expressions it may return.
16430 (Expression.Resolve): Added overloaded version of this method which
16431 takes a `ResolveFlags flags' argument. This can be used to tell
16432 Resolve() which kinds of expressions it may return. Reports a
16434 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16435 ResolveFlags.SimpleName.
16436 (Expression.Error118): Added overloaded version of this method which
16437 takes a `ResolveFlags flags' argument. It uses the flags to determine
16438 which kinds of expressions are allowed.
16440 * expression.cs (Argument.ResolveMethodGroup): New public method.
16441 Resolves an argument, but allows a MethodGroup to be returned.
16442 This is used when invoking a delegate.
16444 * TODO: Updated a bit.
16446 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16448 Fixed compilation with csc.
16450 * ecore.cs: Expression.Error made public. Is this correct? Should
16451 Warning be made public too?
16453 * expression.cs: use ea.Location instead of ea.loc.
16454 [FIXME: Filed as bug #28607: MCS must report these errors.]
16456 2002-08-06 Martin Baulig <martin@gnome.org>
16458 * ecore.cs (Expression.loc): Moved the location here instead of
16459 duplicating it in all derived classes.
16460 (Expression.Location): New public property.
16461 (Expression.Error, Expression.Warning): Made them non-static and
16462 removed the location argument.
16463 (Expression.Warning): Added overloaded version which takes an
16464 `int level' argument.
16465 (Expression.Error118): Make this non-static and removed the
16466 expression and location arguments.
16467 (TypeExpr): Added location argument to the constructor.
16469 * expression.cs (StaticCallExpr): Added location argument to
16471 (Indirection, PointerArithmetic): Likewise.
16472 (CheckedExpr, UnCheckedExpr): Likewise.
16473 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16474 (StringPtr): Likewise.
16477 2002-08-05 Martin Baulig <martin@gnome.org>
16479 * expression.cs (BaseAccess.DoResolve): Actually report errors.
16481 * assign.cs (Assign.DoResolve): Check whether the source
16482 expression is a value or variable.
16484 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16485 while resolving the corresponding blocks.
16487 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16488 an error, don't silently return null.
16490 * statement.cs (Block.AddVariable): Do the error reporting here
16491 and distinguish between CS0128 and CS0136.
16492 (Block.DoResolve): Report all unused labels (warning CS0164).
16493 (LabeledStatement): Pass the location to the constructor.
16494 (LabeledStatement.HasBeenReferenced): New property.
16495 (LabeledStatement.Resolve): Set it to true here.
16497 * statement.cs (Return.Emit): Return success even after reporting
16498 a type mismatch error (CS0126 or CS0127), this is what csc does and
16499 it avoids confusing the users with any consecutive errors.
16501 2002-08-05 Martin Baulig <martin@gnome.org>
16503 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16505 * const.cs (Const.LookupConstantValue): Catch circular definitions.
16507 * expression.cs (MemberAccess.DoResolve): Silently return if an
16508 error has already been reported.
16510 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16511 error has already been reported.
16513 2002-08-05 Martin Baulig <martin@gnome.org>
16515 * statement.cs (UsageVector): Only initialize the `parameters'
16516 vector if we actually have any "out" parameters.
16518 2002-08-05 Martin Baulig <martin@gnome.org>
16520 * expression.cs (Binary.ResolveOperator): When combining delegates,
16521 they must have the same type.
16523 2002-08-05 Martin Baulig <martin@gnome.org>
16525 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16526 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16527 work with the ms runtime and we also don't need it: if we're a
16528 PropertyBuilder and not in the `indexer_arguments' hash, then we
16529 are a property and not an indexer.
16531 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16532 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16533 since the latter one doesn't work with the ms runtime.
16535 2002-08-03 Martin Baulig <martin@gnome.org>
16537 Fixed bugs #27998 and #22735.
16539 * class.cs (Method.IsOperator): New public field.
16540 (Method.CheckBase): Report CS0111 if there's already a method
16541 with the same parameters in the current class. Report CS0508 when
16542 attempting to change the return type of an inherited method.
16543 (MethodData.Emit): Report CS0179 if a method doesn't have a body
16544 and it's not marked abstract or extern.
16545 (PropertyBase): New abstract base class for Property and Indexer.
16546 (PropertyBase.CheckBase): Moved here from Property and made it work
16548 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16549 the same so we can reuse it there.
16550 (Property, Indexer): Derive from PropertyBase.
16551 (MethodSignature.inheritable_property_signature_filter): New delegate
16552 to find properties and indexers.
16554 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16555 argument and improved error reporting.
16557 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16558 EmptyReadOnlyParameters and made it a property.
16560 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16561 version of this method which takes a `PropertyInfo indexer'.
16562 (TypeManager.RegisterIndexer): New method.
16564 * class.cs: Added myself as author of this file :-)
16566 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16568 * class.cs: fixed compilation on windoze.
16570 2002-08-03 Martin Baulig <martin@gnome.org>
16572 * interface.cs (Interface.GetInterfaceBases): Check whether all
16573 base interfaces are at least as accessible than the current one.
16575 * class.cs (TypeContainer.GetClassBases): Check whether base types
16576 are at least as accessible than the current type.
16577 (TypeContainer.AsAccessible): Implemented and made non-static.
16578 (MemberBase.CheckParameters): Report errors if the accessibility
16581 * delegate.cs (Delegate.Delegate): The default visibility is
16582 internal for top-level types and private for nested types.
16583 (Delegate.Define): Report errors if the accessibility checks fail.
16585 * enum.cs (Enum.Enum): The default visibility is internal for
16586 top-level types and private for nested types.
16587 (Enum.DefineType): Compute the correct visibility.
16589 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16590 function which takes a `bool is_toplevel' instead of a TypeContainer.
16592 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16595 2002-08-02 Martin Baulig <martin@gnome.org>
16597 * expression.cs (LocalVariableReferenc): Added constructor which
16598 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16599 (LocalVariableReference.IsReadOnly): New property.
16600 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16601 variable is readonly, use our own readonly flag to do this; you can
16602 use the new constructor to get a writable reference to a read-only
16605 * cs-parser.jay (foreach_statement, using_statement): Get a writable
16606 reference to the local variable.
16608 2002-08-01 Miguel de Icaza <miguel@ximian.com>
16610 * rootcontext.cs (ResolveCore): Also include System.Exception
16612 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16613 we reach an EmptyStatement.
16615 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16618 * expression.cs (Binary.ResolveOperator): Check error result in
16621 use brtrue/brfalse directly and avoid compares to null.
16623 2002-08-02 Martin Baulig <martin@gnome.org>
16625 * class.cs (TypeContainer.Define): Define all nested interfaces here.
16626 Fixes bug #28407, added test-155.cs.
16628 2002-08-01 Martin Baulig <martin@gnome.org>
16630 * class.cs (Event.EmitDefaultMethod): Make this work with static
16631 events. Fixes #28311, added verify-3.cs.
16633 2002-08-01 Martin Baulig <martin@gnome.org>
16635 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16636 `is_disposable' fields.
16637 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16638 `hm.is_disposable' if we're using the collection pattern.
16639 (Foreach.EmitCollectionForeach): Use the correct type for the
16640 enumerator's local variable, only emit the try/finally block if
16641 necessary (fixes #27713).
16643 2002-08-01 Martin Baulig <martin@gnome.org>
16645 * ecore.cs (Expression.report118): Renamed to Error118 and made
16648 * statement.cs (Throw.Resolve): Check whether the expression is of
16649 the correct type (CS0118) and whether the type derives from
16650 System.Exception (CS0155).
16651 (Catch.Resolve): New method. Do the type lookup here and check
16652 whether it derives from System.Exception (CS0155).
16653 (Catch.CatchType, Catch.IsGeneral): New public properties.
16655 * typemanager.cs (TypeManager.exception_type): Added.
16657 2002-07-31 Miguel de Icaza <miguel@ximian.com>
16659 * driver.cs: Updated About function.
16661 2002-07-31 Martin Baulig <martin@gnome.org>
16663 Implemented Control Flow Analysis.
16665 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16666 (EmitContext.CurrentBranching): Added.
16667 (EmitContext.StartFlowBranching): Added.
16668 (EmitContext.EndFlowBranching): Added.
16669 (EmitContext.KillFlowBranching): Added.
16670 (EmitContext.IsVariableAssigned): Added.
16671 (EmitContext.SetVariableAssigned): Added.
16672 (EmitContext.IsParameterAssigned): Added.
16673 (EmitContext.SetParameterAssigned): Added.
16674 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16675 Added control flow analysis stuff here.
16677 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16678 resolve the expression as lvalue.
16679 (LocalVariableReference.DoResolve): Check whether the variable has
16680 already been assigned.
16681 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16682 the parameter as assigned here.
16683 (ParameterReference.DoResolve): Check whether the parameter has already
16685 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16686 expression as lvalue.
16688 * statement.cs (FlowBranching): New class for the flow analysis code.
16689 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16690 (LabeledStatement.IsDefined): New public property.
16691 (LabeledStatement.AddUsageVector): New public method to tell flow
16692 analyis that the label may be reached via a forward jump.
16693 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16695 (VariableInfo.Number): New public field. This is used by flow analysis
16696 to number all locals of a block.
16697 (Block.CountVariables): New public property. This is the number of
16698 local variables in this block (including the locals from all parent
16700 (Block.EmitMeta): Number all the variables.
16702 * statement.cs: Added flow analysis support to all classes.
16704 2002-07-31 Martin Baulig <martin@gnome.org>
16706 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16707 To get debugging messages, compile mcs with /define:MCS_DEBUG and
16708 then use this argument.
16710 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16712 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16713 use this to specify /define options.
16715 2002-07-29 Martin Baulig <martin@gnome.org>
16717 * statement.cs (Fixed): Moved all code that does variable lookups
16718 and resolvings from Emit to Resolve.
16720 * statement.cs (For): Moved all code that does variable lookups
16721 and resolvings from Emit to Resolve.
16723 * statement.cs (Using): Moved all code that does variable lookups
16724 and resolvings from Emit to Resolve.
16726 2002-07-29 Martin Baulig <martin@gnome.org>
16728 * attribute.cs (Attribute.Resolve): Explicitly catch a
16729 System.NullReferenceException when creating the
16730 CustromAttributeBuilder and report a different warning message.
16732 2002-07-29 Martin Baulig <martin@gnome.org>
16734 * support.cs (ParameterData.ParameterName): Added method to
16735 get the name of a parameter.
16737 * typemanager.cs (TypeManager.IsValueType): New public method.
16739 2002-07-29 Martin Baulig <martin@gnome.org>
16741 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
16742 is a flag which specifies that it's either ref or out.
16743 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16744 the out parameter to `out Parameter.Modifier mod', also set the
16745 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16747 * support.cs (InternalParameters.ParameterModifier): Distinguish
16748 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16749 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16751 * expression.cs (Argument.GetParameterModifier): Distinguish
16752 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16753 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16755 2002-07-29 Martin Baulig <martin@gnome.org>
16757 * expression.cs (ParameterReference.ParameterReference): Added
16758 `Location loc' argument to the constructor.
16760 * cs-parser.jay: Pass location to ParameterReference.
16762 2002-07-28 Miguel de Icaza <miguel@ximian.com>
16764 * statement.cs (Try): Initialize the location.
16766 * cs-parser.jay: pass location to Try.
16768 * expression.cs (Unary.Reduce): Change the prototype to return
16769 whether a constant fold could be performed or not. The result is
16770 returned in an out parameters. In the case of Indirection and
16771 AddressOf, we want to perform the full tests.
16773 2002-07-26 Miguel de Icaza <miguel@ximian.com>
16775 * statement.cs (Statement.Emit): Flag dead code.
16777 2002-07-27 Andrew Birkett <andy@nobugs.org>
16779 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16781 2002-07-27 Martin Baulig <martin@gnome.org>
16783 * class.cs (MethodData.Define): Put back call to
16784 TypeManager.AddMethod(), accidentally commented this out.
16786 * report.cs (Debug): New public method to print debugging information,
16787 this is `[Conditional ("DEBUG")]'.
16789 2002-07-26 Martin Baulig <martin@gnome.org>
16791 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16792 (switch_statement): Push the current_block to the switch_stack and
16793 pop it again when we're done with the switch.
16794 (switch_section): The new block is a child of the current_block.
16795 Fixes bug #24007, added test-152.cs.
16797 2002-07-27 Martin Baulig <martin@gnome.org>
16799 * expression.cs (Invocation.EmitArguments): When calling a varargs
16800 function with only its fixed arguments, we need to pass an empty
16803 2002-07-27 Martin Baulig <martin@gnome.org>
16805 Mono 0.13 has been released.
16807 2002-07-25 Miguel de Icaza <miguel@ximian.com>
16809 * driver.cs: Rename --resource to --linkres, because that is what
16810 we do currently, we dont support --resource yet.
16812 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16814 2002-07-25 Martin Baulig <martin@gnome.org>
16816 * class.cs (MethodData): New public class. This is a `method builder'
16817 class for a method or one accessor of a Property/Indexer/Event.
16818 (MethodData.GetMethodFlags): Moved here from MemberBase.
16819 (MethodData.ApplyAttributes): Likewise.
16820 (MethodData.ApplyObsoleteAttribute): Likewise.
16821 (MethodData.ApplyConditionalAttribute): Likewise.
16822 (MethodData.ApplyDllImportAttribute): Likewise.
16823 (MethodData.CheckAbstractAndExternal): Likewise.
16824 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16825 (MethodData.Emit): Formerly known as Method.Emit().
16826 (MemberBase): Moved everything which was specific to a single
16827 accessor/method to MethodData.
16828 (Method): Create a new MethodData and call Define() and Emit() on it.
16829 (Property, Indexer, Event): Create a new MethodData objects for each
16830 accessor and call Define() and Emit() on them.
16832 2002-07-25 Martin Baulig <martin@gnome.org>
16834 Made MethodCore derive from MemberBase to reuse the code from there.
16835 MemberBase now also checks for attributes.
16837 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16838 (MemberBase.GetMethodFlags): Moved here from class Method and marked
16840 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16841 `CallingConventions cc' and `Attributes opt_attrs' arguments.
16842 (MemberBase.ApplyAttributes): New virtual method; applies the
16843 attributes to a method or accessor.
16844 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16845 (MemberBase.ApplyConditionalAttribute): Likewise.
16846 (MemberBase.ApplyDllImportAttribute): Likewise.
16847 (MemberBase.CheckAbstractAndExternal): Likewise.
16848 (MethodCore.ParameterTypes): This is now a property instead of a
16849 method, it's initialized from DoDefineParameters().
16850 (MethodCore.ParameterInfo): Removed the set accessor.
16851 (MethodCore.DoDefineParameters): New protected virtual method to
16852 initialize ParameterTypes and ParameterInfo.
16853 (Method.GetReturnType): We can now simply return the MemberType.
16854 (Method.GetMethodFlags): Override the MemberBase version and add
16855 the conditional flags.
16856 (Method.CheckBase): Moved some code from Define() here, call
16857 DoDefineParameters() here.
16858 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16859 here to avoid some larger code duplication.
16860 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16861 ensure that abstract and external accessors don't declare a body.
16863 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16864 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16865 lookup in the attribute's parent classes, so we need to abort as soon
16866 as we found the first match.
16867 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16868 the attribute has no arguments.
16870 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16873 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16875 * cs-parser.jay: reverted previous patch.
16877 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16879 * cs-parser.jay: fixed bug #22119.
16881 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16883 * attribute.cs: fixed compilation. The error was:
16884 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
16885 be assigned to before control leaves the current method."
16886 [FIXME: Filed as bug #28186: MCS must report this error.]
16888 2002-07-25 Martin Baulig <martin@gnome.org>
16890 * attribute.cs (Attribute.Conditional_GetConditionName): New static
16891 method to pull the condition name ouf of a Conditional attribute.
16892 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16893 the obsolete message and error flag out of an Obsolete attribute.
16895 * class.cs (Method.GetMethodFlags): New public method to get the
16896 TypeManager.MethodFlags for this method.
16897 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16899 (Method.Define): Get and apply the Obsolete and Conditional attributes;
16900 if we're overriding a virtual function, set the new private variable
16901 `parent_method'; call the new TypeManager.AddMethod().
16903 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
16904 the MethodBuilder and the Method in a PtrHashtable.
16905 (TypeManager.builder_to_method): Added for this purpose.
16906 (TypeManager.MethodFlags): Added IsObsoleteError.
16907 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
16908 Obsolete and Conditional arguments in MethodBuilders. If we discover
16909 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16910 the message from the attribute.
16912 2002-07-24 Martin Baulig <martin@gnome.org>
16914 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16915 preprocessor directives, ensure that the argument to #define/#undef is
16916 exactly one identifier and that it's actually an identifier.
16918 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16921 2002-07-24 Martin Baulig <martin@gnome.org>
16923 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16924 initialize it to TypeManager.object_type in the constructor.
16925 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16926 of the `hm.get_current' method if we're using the collection pattern.
16927 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16928 for the explicit conversion to make it work when we're using the collection
16929 pattern and the `Current' property has a different return type than `object'.
16932 2002-07-24 Martin Baulig <martin@gnome.org>
16934 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16935 does not match, but don't report any errors. This method is called in
16936 order for all methods in a MethodGroupExpr until a matching method is
16937 found, so we don't want to bail out if the first method doesn't match.
16938 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16939 matches, report the 123. Fixes #28070.
16941 2002-07-24 Martin Baulig <martin@gnome.org>
16943 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16944 TypeManager.TypeToCoreType() to the top of the method so the
16945 following equality checks will work. Fixes #28107.
16947 2002-07-24 Martin Baulig <martin@gnome.org>
16949 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16950 operand is of type uint, and the other operand is of type sbyte,
16951 short or int, the operands are converted to type long." -
16952 Actually do what this comment already told us. Fixes bug #28106,
16955 2002-07-24 Martin Baulig <martin@gnome.org>
16957 * class.cs (MethodBase): New abstract class. This is now a base
16958 class for Property, Indexer and Event to avoid some code duplication
16959 in their Define() and DefineMethods() methods.
16960 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16961 generic methods for Define() and DefineMethods().
16962 (FieldBase): Derive from MemberBase, not MemberCore.
16963 (Property): Derive from MemberBase, not MemberCore.
16964 (Property.DefineMethod): Moved all the code from this method to the
16965 new MethodBase.DefineAccessor(), just call it with appropriate
16967 (Property.Define): Call the new Property.DoDefine(), this does some
16968 sanity checks and we don't need to duplicate the code everywhere.
16969 (Event): Derive from MemberBase, not MemberCore.
16970 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16971 accessors, this will also make them work with interface events.
16972 (Indexer): Derive from MemberBase, not MemberCore.
16973 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16974 (Indexer.Define): Use the new MethodBase functions.
16976 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16977 argument to the constructor.
16978 (Interface.FindMembers): Added support for interface events.
16979 (Interface.PopluateEvent): Implemented.
16981 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
16983 2002-07-22 Miguel de Icaza <miguel@ximian.com>
16985 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16986 but this is required to check for a method name being the same as
16987 the containing class.
16991 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16993 * interface.cs: initialize variable.
16995 2002-07-23 Martin Baulig <martin@gnome.org>
16997 Implemented the IndexerName attribute in interfaces.
16999 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17000 name if this is an explicit interface implementation.
17001 (Indexer.InterfaceIndexerName): New public variable. If we're
17002 implementing an interface indexer, this is the IndexerName in that
17003 interface. Otherwise, it's the IndexerName.
17004 (Indexer.DefineMethod): If we're implementing interface indexer,
17005 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
17006 and Pending.ImplementIndexer methods.
17007 (Indexer.Define): Also define the PropertyBuilder if we're
17008 implementing an interface indexer and this is neither an explicit
17009 interface implementation nor do the IndexerName match the one in
17012 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17013 If a method is defined here, then we always need to create a proxy
17014 for it. This is used when implementing interface indexers.
17015 (Pending.IsInterfaceIndexer): New public method.
17016 (Pending.ImplementIndexer): New public method.
17017 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17018 This is used when implementing interface indexers to define a proxy
17020 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17021 define a proxy if necessary.
17023 * interface.cs (Interface.IndexerName): New public variable.
17024 (Interface.PopulateIndexer): Set the IndexerName.
17025 (Interface.DefineIndexers): New private method. Populate all the
17026 indexers and make sure their IndexerNames match.
17028 * typemanager.cs (IndexerPropertyName): Added support for interface
17031 2002-07-22 Martin Baulig <martin@gnome.org>
17033 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17034 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17035 ret if HasReturnLabel.
17036 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17039 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17040 and set the ec.LoopBeginTryCatchLevel.
17041 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17042 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17043 the current ec.TryCatchLevel, the branch goes out of an exception
17044 block. In this case, we need to use Leave and not Br.
17046 2002-07-22 Martin Baulig <martin@gnome.org>
17048 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17049 block unless the block does not always return or it is contained in
17050 another try { ... } catch { ... } block. Fixes bug #26506.
17051 Added verify-1.cs to the test suite.
17053 2002-07-22 Martin Baulig <martin@gnome.org>
17055 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17056 then we do not always return. Fixes bug #24985.
17058 2002-07-22 Martin Baulig <martin@gnome.org>
17060 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17061 lookup on a per-class level; ie. walk up the class hierarchy until we
17062 found at least one applicable method, then choose the best among them.
17063 Fixes bug #24463 and test-29.cs.
17065 2002-07-22 Martin Baulig <martin@gnome.org>
17067 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17068 return types of the methods. The return type is not part of the
17069 signature and we must not check it to make the `new' modifier work.
17070 Fixes bug #27999, also added test-147.cs.
17071 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17073 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17074 on the method's return type.
17076 2002-07-21 Martin Baulig <martin@gnome.org>
17078 * assign.cs: Make this work if the rightmost source is a constant and
17079 we need to do an implicit type conversion. Also adding a few more tests
17080 to test-38.cs which should have caught this.
17082 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17083 target in the makefile for this. The makefile.gnu is primarily intended
17084 for end-users who don't want to debug the compiler.
17086 2002-07-21 Martin Baulig <martin@gnome.org>
17088 * assign.cs: Improved the Assign class so it can now handle embedded
17089 assignments (X = Y = Z = something). As a side-effect this'll now also
17090 consume less local variables. test-38.cs now passes with MCS, added
17091 a few new test cases to that test.
17093 2002-07-20 Martin Baulig <martin@gnome.org>
17095 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17096 instructions. Fixes bug #27977, also added test-146.cs.
17098 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17100 * cs-tokenizer.cs: fixed getHex ().
17102 2002-07-19 Martin Baulig <martin@gnome.org>
17104 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17105 not Type.GetType() to lookup the array type. This is needed when
17106 we're constructing an array of a user-defined type.
17107 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17108 single-dimensional arrays, but also for single-dimensial arrays of
17111 2002-07-19 Martin Baulig <martin@gnome.org>
17113 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17114 this function is called, it's not allowed to share LocalBuilders
17115 among ILGenerators.
17117 2002-07-19 Martin Baulig <martin@gnome.org>
17119 * expression.cs (Argument.Resolve): Report an error 118 when trying
17120 to pass a type as argument.
17122 2002-07-18 Martin Baulig <martin@gnome.org>
17124 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17125 Conv_R_Un for the signed `long' type.
17127 2002-07-15 Miguel de Icaza <miguel@ximian.com>
17129 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17130 `expr' for the temporary result, as that will fail if we do
17131 multiple resolves on the same expression.
17133 2002-07-05 Miguel de Icaza <miguel@ximian.com>
17135 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17136 ec.TypeContainer for looking up aliases.
17138 * class.cs (TypeContainer): Remove LookupAlias from here.
17140 * decl.cs (DeclSpace); Move here.
17142 2002-07-01 Miguel de Icaza <miguel@ximian.com>
17144 * class.cs (FindMembers): Only call filter if the constructor
17145 bulider is not null.
17147 Also handle delegates in `NestedTypes' now. Now we will perform
17148 type lookups using the standard resolution process. This also
17151 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17152 This uses Expressions (the limited kind that can be parsed by the
17153 tree) instead of strings.
17155 * expression.cs (ComposedCast.ToString): Implement, used to flag
17156 errors since now we have to render expressions.
17158 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
17161 * ecore.cs (SimpleName.ToString): ditto.
17163 * cs-parser.jay: Instead of using strings to assemble types, use
17164 Expressions to assemble the type (using SimpleName, ComposedCast,
17165 MemberAccess). This should fix the type lookups in declarations,
17166 because we were using a different code path for this.
17168 * statement.cs (Block.Resolve): Continue processing statements
17169 even when there is an error.
17171 2002-07-17 Miguel de Icaza <miguel@ximian.com>
17173 * class.cs (Event.Define): Also remove the `remove' method from
17174 the list of pending items.
17176 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17177 generate more compact code.
17179 2002-07-17 Martin Baulig <martin@gnome.org>
17181 * const.cs (Const.LookupConstantValue): Add support for constant
17182 `unchecked' and `checked' expressions.
17183 Also adding test case test-140.cs for this.
17185 2002-07-17 Martin Baulig <martin@gnome.org>
17187 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17188 check whether mi.ReturnType implements the IEnumerator interface; the
17189 `==' and the IsAssignableFrom() will fail in this situation.
17191 2002-07-16 Ravi Pratap <ravi@ximian.com>
17193 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
17196 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17198 * expression.cs: fixed bug #27811.
17200 2002-07-14 Miguel de Icaza <miguel@ximian.com>
17202 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17203 Molaro: when we are a ref, the value already contains a pointer
17204 value, do not take the address of it.
17206 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17207 * removed mb-parser.jay and mb-tokenizer.cs
17209 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17211 * expression.cs: check against the building corlib void type.
17213 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17215 * ecore.cs: fix for valuetype static readonly fields: when
17216 initializing them, we need their address, not the address of a copy.
17218 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17220 * typemanager.cs: register also enum_type in corlib.
17222 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17224 * class.cs: allow calling this (but not base) initializers in structs.
17226 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17228 * ecore.cs: make sure we compare against the building base types
17231 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17233 * typemanager.cs: fix TypeToCoreType() to handle void and object
17234 (corlib gets no more typerefs after this change).
17236 2002-07-12 Miguel de Icaza <miguel@ximian.com>
17238 * expression.cs (ArrayCreation.EmitArrayArguments): use
17239 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17241 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17242 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
17243 array indexes, the runtime actually forbids them.
17245 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17246 for array arguments here.
17248 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17249 instead of the default for ValueTypes.
17251 (New.DoEmit): Use IsValueType instead of
17252 IsSubclassOf (value_type)
17253 (New.DoResolve): ditto.
17254 (Invocation.EmitCall): ditto.
17256 * assign.cs (Assign): ditto.
17258 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17259 Statements *are* currently doing part of their resolution during
17262 Expressions do always resolve during resolve, but statements are
17263 only required to propagate resolution to their children.
17265 2002-07-11 Miguel de Icaza <miguel@ximian.com>
17267 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17269 (LoadAssembly): Do not add the dll if it is already specified
17271 (MainDriver): Add the System directory to the link path at the end,
17272 after all the other -L arguments.
17274 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17275 wrong opcode for loading bytes and bools (ldelem.i1 instead of
17276 ldelem.u1) and using the opposite for sbytes.
17278 This fixes Digger, and we can finally run it.
17280 * driver.cs (UnixParseOption): Move the option parsing here.
17281 (CSCParseOption): Implement CSC-like parsing of options.
17283 We now support both modes of operation, the old Unix way, and the
17284 new CSC-like way. This should help those who wanted to make cross
17285 platform makefiles.
17287 The only thing broken is that /r:, /reference: and /lib: are not
17288 implemented, because I want to make those have the same semantics
17289 as the CSC compiler has, and kill once and for all the confussion
17290 around this. Will be doing this tomorrow.
17292 * statement.cs (Unsafe.Resolve): The state is checked during
17293 resolve, not emit, so we have to set the flags for IsUnsfe here.
17295 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17297 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17298 not catch the Error_ObjectRefRequired in SimpleName (as it is
17299 possible to have a class/instance variable name that later gets
17300 deambiguated), we have to check this here.
17302 2002-07-10 Ravi Pratap <ravi@ximian.com>
17304 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17305 make static and put into Expression.
17307 (Event.Define): Register the private field of the event with the
17308 TypeManager so that GetFieldFromEvent can get at it.
17310 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17311 keep track of the private field associated with an event which
17314 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17317 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17319 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17321 * expression.cs (Binary.EmitBranchable): this routine emits the
17322 Binary expression in a branchable context. This basically means:
17323 we need to branch somewhere, not just get the value on the stack.
17325 This works together with Statement.EmitBoolExpression.
17327 * statement.cs (Statement.EmitBoolExpression): Use
17330 2002-07-09 Miguel de Icaza <miguel@ximian.com>
17332 * statement.cs (For): Reduce the number of jumps in loops.
17334 (For): Implement loop inversion for the For statement.
17336 (Break): We can be breaking out of a Try/Catch controlled section
17337 (foreach might have an implicit try/catch clause), so we need to
17338 use Leave instead of Br.
17340 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17341 now). If the instace expression supports IMemoryLocation, we use
17342 the AddressOf method from the IMemoryLocation to extract the
17343 address instead of emitting the instance.
17345 This showed up with `This', as we were emitting the instance
17346 always (Emit) instead of the Address of This. Particularly
17347 interesting when This is a value type, as we dont want the Emit
17348 effect (which was to load the object).
17350 2002-07-08 Miguel de Icaza <miguel@ximian.com>
17352 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17354 * statement.cs (Checked): Set the CheckedState during the resolve
17355 process too, as the ConvCast operations track the checked state on
17356 the resolve process, and not emit.
17358 * cs-parser.jay (namespace_member_declaration): Flag that we have
17359 found a declaration when we do. This is used to flag error 1529
17361 * driver.cs: Report ok when we display the help only.
17363 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
17365 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17367 2002-07-04 Miguel de Icaza <miguel@ximian.com>
17369 * cs-tokenizer.cs (define): We also have to track locally the
17370 defines. AllDefines is just used for the Conditional Attribute,
17371 but we also need the local defines for the current source code.
17373 2002-07-03 Miguel de Icaza <miguel@ximian.com>
17375 * statement.cs (While, For, Do): These loops can exit through a
17376 Break statement, use this information to tell whether the
17377 statement is the last piece of code.
17379 (Break): Flag that we break.
17381 * codegen.cs (EmitContexts): New `Breaks' state variable.
17383 2002-07-03 Martin Baulig <martin@gnome.org>
17385 * class.cs (TypeContainer.MethodModifiersValid): Allow override
17386 modifiers in method declarations in structs. Otherwise, you won't
17387 be able to override things like Object.Equals().
17389 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17391 * class.cs (Method, Property, Indexer): Do not allow the public
17392 modifier to be used in explicit interface implementations.
17394 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17395 override modifiers in method declarations in structs
17397 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
17399 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17400 integer or real overflow, report an error
17402 2002-07-02 Martin Baulig <martin@gnome.org>
17404 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17405 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17406 to tell the runtime about our newly created System.Object and
17407 System.ValueType types.
17409 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17411 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17412 struct instead of Ldarg/Starg.
17414 2002-07-02 Martin Baulig <martin@gnome.org>
17416 * expression.cs (Indirection.Indirection): Call
17417 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17419 2002-07-02 Martin Baulig <martin@gnome.org>
17421 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17422 ValueType, call TypeManager.TypeToCoreType() on it.
17423 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17424 the OpCodes.Newarr argument.
17426 2002-07-02 Martin Baulig <martin@gnome.org>
17428 * expression.cs (Invocation.EmitCall): When compiling corlib,
17429 replace all calls to the system's System.Array type to calls to
17430 the newly created one.
17432 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17433 System.Array methods.
17434 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17435 from the system's System.Array type which must be replaced.
17437 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17439 * typemanager.cs: load unverifiable_code_ctor so we can build
17440 corlib using the correct type. Avoid using GetTypeCode() with
17442 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17443 TypeManager.object_type to allow building corlib.
17445 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17447 * ecore.cs: handle System.Enum separately in LoadFromPtr().
17449 2002-07-01 Martin Baulig <martin@gnome.org>
17451 * class.cs: Make the last change actually work, we need to check
17452 whether `ifaces != null' to avoid a crash.
17454 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17456 * class.cs: when we build structs without fields that implement
17457 interfaces, we need to add the interfaces separately, since there is
17458 no API to both set the size and add the interfaces at type creation
17461 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17463 * expression.cs: the dimension arguments to the array constructors
17464 need to be converted if they are a long.
17466 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17468 * class.cs: don't emit ldarg.0 if there is no parent constructor
17469 (fixes showstopper for corlib).
17471 2002-06-29 Martin Baulig <martin@gnome.org>
17473 MCS now compiles corlib on GNU/Linux :-)
17475 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17476 ie. check for MethodImplOptions.InternalCall.
17478 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17479 and TypeManager.attribute_type are null, so we must explicitly check
17480 whether parent is not null to find out whether it's an attribute type.
17481 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17482 and SetBuilder, not only if the property is neither abstract nor external.
17483 This is necessary to set the MethodImplOptions on the accessor methods.
17484 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17485 SetBuilder, see Property.Emit().
17487 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17488 populate "System.Object", "System.ValueType" and "System.Attribute" since
17489 they've already been populated from BootCorlib_PopulateCoreTypes().
17491 2002-06-29 Martin Baulig <martin@gnome.org>
17493 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17494 is the NullLiteral, we also need to make sure that target_type is not
17497 2002-06-29 Martin Baulig <martin@gnome.org>
17499 * rootcontext.cs (RootContext.ResolveCore): We must initialize
17500 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17501 before calling BootstrapCorlib_ResolveDelegate ().
17503 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17505 * statement.cs: fixed build-breaker. All tests passed ok.
17507 2002-06-27 Martin Baulig <martin@gnome.org>
17509 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17510 for System.Decimal when compiling corlib.
17512 2002-06-27 Martin Baulig <martin@gnome.org>
17514 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17515 switch blocks which contain nothing but a default clause.
17517 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
17519 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17521 2002-06-27 Martin Baulig <martin@gnome.org>
17523 * ecore.cs (PropertyExpr.PropertyExpr): Call
17524 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17526 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17527 is already a TypeBuilder.
17529 2002-06-27 Martin Baulig <martin@gnome.org>
17531 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17532 `target_type == TypeManager.array_type', not IsAssignableFrom() in
17533 the "from an array-type to System.Array" case. This makes it work
17534 when compiling corlib.
17536 2002-06-27 Martin Baulig <martin@gnome.org>
17538 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17539 non-static PropertyExpr, set its InstanceExpression. This makes
17540 the `ICollection.Count' property work in System/Array.cs.
17542 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
17544 * driver.cs: Made error handling more consistent. Errors now
17545 tracked by Report class, so many methods which used to return int
17546 now return void. Main() now prints success/failure and
17547 errors/warnings message.
17549 Renamed '--probe' compiler argument to '--expect-error'. Removed
17550 the magic number return values (123 and 124). Now, if the
17551 expected error occurs, the compiler exits with success (exit value
17552 0). If the compilation completes without seeing that particular
17553 error, the compiler exits with failure (exit value 1). The
17554 makefile in mcs/errors has been changed to handle the new behaviour.
17556 * report.cs: Made 'expected error' number a property and renamed
17557 it from 'Probe' to 'ExpectedError'.
17559 * genericparser.cs: Removed error handling support, since it is
17560 now all done by Report class.
17562 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17563 class, so parse() no longer returns an int.
17565 * namespace.cs: Use Report.Error instead of GenericParser.error
17567 2002-06-22 Miguel de Icaza <miguel@ximian.com>
17569 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17570 TypeContainer.AddOperator): At the front of the list put the
17571 explicit implementations, so they get resolved/defined first.
17573 2002-06-21 Miguel de Icaza <miguel@ximian.com>
17575 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17576 interface type is implemented by this TypeContainer. Used during
17577 explicit interface implementation.
17579 (Property.Define, Indexer.Define, Method.Define): Validate that
17580 the given interface in the explicit implementation is one of the
17581 base classes for the containing type.
17583 Also if we are explicitly implementing an interface, but there is
17584 no match in the pending implementation table, report an error.
17586 (Property.Define): Only define the property if we are
17587 not explicitly implementing a property from an interface. Use the
17588 correct name also for those properties (the same CSC uses,
17589 although that is really not needed).
17591 (Property.Emit): Do not emit attributes for explicitly implemented
17592 properties, as there is no TypeBuilder.
17594 (Indexer.Emit): ditto.
17596 Hiding then means that we do not really *implement* a pending
17597 implementation, which makes code fail.
17599 2002-06-22 Martin Baulig <martin@gnome.org>
17601 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17602 the return value of Object.GetType(). [FIXME: we need to do this whenever
17603 we get a type back from the reflection library].
17605 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17607 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17609 2002-06-20 Miguel de Icaza <miguel@ximian.com>
17611 * attribute.cs: Return null if we can not look up the type.
17613 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17614 the interface types found.
17616 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17617 interface types found.
17619 * typemanager.cs (GetInterfaces): Make this routine returns alll
17620 the interfaces and work around the lame differences between
17621 System.Type and System.Reflection.Emit.TypeBuilder in the results
17622 result for GetInterfaces.
17624 (ExpandInterfaces): Given an array of interface types, expand and
17625 eliminate repeated ocurrences of an interface. This expands in
17626 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17629 2002-06-21 Martin Baulig <martin@gnome.org>
17631 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17634 2002-06-21 Martin Baulig <martin@gnome.org>
17636 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
17637 and called with one of the core types, return the corresponding typebuilder for
17640 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17643 2002-06-21 Martin Baulig <martin@gnome.org>
17645 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17646 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17647 (Expression.ConvertReferenceExplicit): Likewise.
17649 * expression.cs (ElementAccess.DoResolve): Likewise.
17650 (ElementAccess.DoResolveLValue): Likewise.
17652 2002-06-10 Martin Baulig <martin@gnome.org>
17654 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17655 add the "value" parameter to the parameter list.
17657 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17660 2002-06-19 Miguel de Icaza <miguel@ximian.com>
17662 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17663 the argument to an int, uint, long or ulong, per the spec. Also
17664 catch negative constants in array creation.
17666 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17668 * class.cs: do not allow the same interface to appear twice in
17669 the definition list.
17671 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17673 * ecore.cs: don't use ldlen with System.Array.
17675 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17677 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17679 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17681 * modifiers.cs: produce correct field attributes for protected
17682 internal. Easy fix so miguel can work on ther harder stuff:-)
17684 2002-06-18 Miguel de Icaza <miguel@ximian.com>
17686 * pending.cs: New file. Move the code from class.cs here.
17687 Support clearning the pending flag for all methods (when not doing
17688 explicit interface implementation).
17690 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17692 * rootcontext.cs: added a couple more types needed to bootstrap.
17694 2002-06-17 Miguel de Icaza <miguel@ximian.com>
17696 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17697 constructor in the type, instead of any constructor in the type
17698 hierarchy. Thanks to Paolo for finding this bug (it showed up as
17699 a bug in the Mono runtime when applying the params attribute).
17701 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17702 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17704 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
17706 * expression.cs (Unary.ResolveOperator): Use TypeManager
17707 to resolve the type.
17709 2002-06-13 Ravi Pratap <ravi@ximian.com>
17711 * cs-parser.jay (enum_member_declaration): Pass in the attributes
17714 * enum.cs (AddEnumMember): Add support to store the attributes associated
17715 with each member too.
17717 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17718 field builders too - this takes care of the enum member case.
17720 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
17722 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17723 address-of operator on both value types and pointers.
17725 2002-06-10 Martin Baulig <martin@gnome.org>
17727 * interface.cs (Interface.PopulateIndexer): Add the indexer's
17728 PropertyBuilder to the `property_builders' list.
17730 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17731 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17732 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
17733 find any indexers which are inherited from an interface.
17735 2002-06-09 Martin Baulig <martin@gnome.org>
17737 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17738 the same type as the constant if necessary. There's also a test-130.cs
17741 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17743 * typemanager.cs (TypeManager.ChangeType): Previously known as
17744 Enum.ChangeEnumType().
17746 2002-06-09 Martin Baulig <martin@gnome.org>
17748 * expression.cs (Cast.TryReduce): Added support for consts.
17750 2002-06-08 Ravi Pratap <ravi@ximian.com>
17752 * class.cs (Accessor): Hold attributes information so we can pass
17755 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17756 Modify to pass in attributes attached to the methods.
17758 (add_accessor_declaration, remove_accessor_declaration): Ditto.
17760 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17761 to handle the Accessor kind :-)
17763 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17765 2002-06-08 Martin Baulig <martin@gnome.org>
17767 * expression.cs (Unary.TryReduceNegative): Added support for
17770 2002-06-08 Martin Baulig <martin@gnome.org>
17772 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17773 name can't be found in the `defined_names' - the caller will do a
17774 MemberLookup in this case and thus find methods in System.Enum
17775 such as Enum.IsDefined().
17777 2002-06-08 Martin Baulig <martin@gnome.org>
17779 * enum.cs (Enum.ChangeEnumType): This is a custom version of
17780 Convert.ChangeType() which works with TypeBuilder created types.
17781 (Enum.LookupEnumValue, Enum.Define): Use it here.
17783 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17784 `TypeBuilder.BaseType != null' check.
17785 (TypeContainer.FindMembers): Only lookup parent members if we
17786 actually have a parent.
17787 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17788 (ConstructorInitializer.Resolve): Likewise.
17790 * interface.cs (Interface.FindMembers): Added
17791 `TypeBuilder.BaseType != null' check.
17793 * rootcontext.cs (RootContext.ResolveCore): Added
17794 "System.Runtime.CompilerServices.IndexerNameAttribute" to
17795 classes_second_stage.
17797 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17798 debug_type and trace_type when compiling with --nostdlib.
17800 2002-06-07 Martin Baulig <martin@gnome.org>
17802 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17803 (AddField): Set it to true when adding a non-static field.
17804 (DefineType): Use `have_nonstatic_fields' to find out whether we
17805 have non-static fields, not `Fields != null'.
17807 2002-06-02 Miguel de Icaza <miguel@ximian.com>
17809 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17810 dereferencing a null on the static-field code path)
17812 2002-05-30 Martin Baulig <martin@gnome.org>
17814 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17815 to take command line arguments. Use reflection to call the new
17816 custom `Initialize' function on the symbol writer and pass it the
17817 command line arguments.
17819 * driver.cs (--debug-args): New command line argument to pass command
17820 line arguments to the symbol writer.
17822 2002-05-28 Miguel de Icaza <miguel@ximian.com>
17824 * assign.cs (DoResolve): Forgot to do the implicit conversion to
17825 the target type for indexers and properties. Thanks to Joe for
17828 2002-05-27 Miguel de Icaza <miguel@ximian.com>
17830 * typemanager.cs (MethodFlags): returns the method flags
17831 (Obsolete/ShouldIgnore) that control warning emission and whether
17832 the invocation should be made, or ignored.
17834 * expression.cs (Invocation.Emit): Remove previous hack, we should
17835 not do this on matching a base type, we should do this based on an attribute
17837 Only emit calls to System.Diagnostics.Debug and
17838 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17839 on the command line.
17841 * rootcontext.cs: Global settings for tracing and debugging.
17843 * cs-tokenizer.cs (define): New utility function to track
17844 defines. Set the global settings for TRACE and DEBUG if found.
17846 2002-05-25 Ravi Pratap <ravi@ximian.com>
17848 * interface.cs (Populate*): Pass in the TypeContainer as well as
17849 the DeclSpace as parameters so that we can create EmitContexts and
17850 then use that to apply attributes etc.
17852 (PopulateMethod, PopulateEvent, PopulateProperty)
17853 (PopulateIndexer): Apply attributes everywhere.
17855 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17858 (ApplyAttributes): Update accordingly.
17860 We now apply interface attributes for all members too.
17862 2002-05-26 Miguel de Icaza <miguel@ximian.com>
17864 * class.cs (Indexer.Define); Correctly check if we are explicit
17865 implementation (instead of checking the Name for a ".", we
17866 directly look up if the InterfaceType was specified).
17868 Delay the creation of the PropertyBuilder.
17870 Only create the PropertyBuilder if we are not an explicit
17871 interface implementation. This means that explicit interface
17872 implementation members do not participate in regular function
17873 lookups, and hence fixes another major ambiguity problem in
17874 overload resolution (that was the visible effect).
17876 (DefineMethod): Return whether we are doing an interface
17879 * typemanager.cs: Temporary hack until we get attributes in
17880 interfaces (Ravi is working on that) and we get IndexerName
17881 support in interfaces.
17883 * interface.cs: Register the indexers as properties.
17885 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17886 warning, I have verified that this is a bug in the .NET runtime
17887 (JavaScript suffers of the same problem).
17889 * typemanager.cs (MemberLookup): When looking up members for
17890 interfaces, the parent of an interface is the implicit
17891 System.Object (so we succeed in searches of Object methods in an
17892 interface method invocation. Example: IEnumerable x; x.ToString
17895 2002-05-25 Miguel de Icaza <miguel@ximian.com>
17897 * class.cs (Event): Events should also register if they do
17898 implement the methods that an interface requires.
17900 * typemanager.cs (MemberLookup); use the new GetInterfaces
17903 (GetInterfaces): The code used to lookup interfaces for a type is
17904 used in more than one place, factor it here.
17906 * driver.cs: Track the errors at the bottom of the file, we kept
17909 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17910 instance if the method we are calling is static!
17912 2002-05-24 Miguel de Icaza <miguel@ximian.com>
17914 * attribute.cs (ApplyAttributes): Make this function filter out
17915 the IndexerName attribute (as that attribute in reality is never
17916 applied) and return the string constant for the IndexerName
17919 * class.cs (TypeContainer.Emit): Validate that all the indexers
17920 have the same IndexerName attribute, and if so, set the
17921 DefaultName attribute on the class.
17923 * typemanager.cs: The return value might contain other stuff (not
17924 only methods). For instance, consider a method with an "Item"
17925 property and an Item method.
17927 * class.cs: If there is a problem with the parameter types,
17930 2002-05-24 Ravi Pratap <ravi@ximian.com>
17932 * ecore.cs (ImplicitConversionExists): Wrapper function which also
17933 looks at user defined conversion after making a call to
17934 StandardConversionExists - we need this for overload resolution.
17936 * expression.cs : Update accordingly the various method calls.
17938 This fixes 2 bugs filed against implicit user defined conversions
17940 2002-05-22 Miguel de Icaza <miguel@ximian.com>
17942 * statement.cs: Track the result of the assignment.
17944 2002-05-21 Miguel de Icaza <miguel@ximian.com>
17946 * expression.cs (MemberAccess): Improved error reporting for
17947 inaccessible members.
17949 2002-05-22 Martin Baulig <martin@gnome.org>
17951 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
17952 itself with debugging support.
17954 2002-05-22 Martin Baulig <martin@gnome.org>
17956 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17957 Removed, this isn't needed anymore.
17959 2002-05-20 Martin Baulig <martin@gnome.org>
17961 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17962 be underlying type for an enum.
17964 2002-05-20 Miguel de Icaza <miguel@ximian.com>
17966 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17967 that splits out the loading of just the core types.
17969 * rootcontext.cs (ResolveCore): Split the struct resolution in
17970 two, so we can load the enumeration underlying types before any
17973 * expression.cs (Is): Bandaid until we fix properly Switch (see
17974 bug #24985 for details).
17976 * typemanager.cs (ImplementsInterface): The hashtable will contain
17977 a null if there are no interfaces implemented.
17979 2002-05-18 Miguel de Icaza <miguel@ximian.com>
17981 * cs-parser.jay (indexer_declarator): It is fine to have array
17984 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17986 * typemanager.cs: (RegisterBuilder): New function used to register
17987 TypeBuilders that implement interfaces. Since
17988 TypeBuilder.GetInterfaces (as usual) does not work with lame
17990 (AddUserType): register interfaces.
17992 (ImplementsInterface): Use the builder_to_ifaces hash if we are
17993 dealing with TypeBuilder. Also, arrays are showing up as
17994 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17995 methods can not be invoked on them!
17997 * ecore.cs (ExplicitReferenceConversionExists): Made public.
17998 (ImplicitReferenceConversionExists): Split out from
17999 StandardConversionExists.
18001 * expression.cs (As): We were only implementing one of the three
18002 cases for the as operator. We now implement them all.
18003 (Is): Implement the various other cases for Is as well.
18005 * typemanager.cs (CACHE): New define used to control if we want or
18006 not the FindMembers cache. Seems to have a negative impact on
18007 performance currently
18009 (MemberLookup): Nested types have full acess to
18010 enclosing type members
18012 Remove code that coped with instance/static returns for events, we
18013 now catch this in RealFindMembers.
18015 (RealFindMembers): only perform static lookup if the instance
18016 lookup did not return a type or an event.
18018 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18020 * assign.cs (CompoundAssign): We pass more semantic information
18021 now to Compound Assignments than we did before: now we have all
18022 the information at hand, and now we resolve the target *before* we
18023 do the expression expansion, which allows the "CacheValue" method
18024 to have the effect we intended (before, a [x] += 1 would generate
18025 two differen ArrayAccess expressions from the ElementAccess,
18026 during the resolution process).
18028 (CompoundAssign.DoResolve): Resolve target and original_source here.
18030 2002-05-16 Miguel de Icaza <miguel@ximian.com>
18032 * expression.cs (ArrayAccess): dropped debugging information.
18034 * typemanager.cs: Small bug fix: I was always returning i_members,
18035 instead of one of i_members or s_members (depending on which had
18038 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
18039 method is invoked before any code generation takes place, and it
18040 is a mechanism to inform that the expression will be invoked more
18041 than once, and that the method should use temporary values to
18042 avoid having side effects
18044 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18046 * ecore.cs (Expression.CacheTemporaries): Provide empty default
18049 * expression.cs (Indirection, ArrayAccess): Add support for
18050 CacheTemporaries in these two bad boys.
18052 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18053 ldobj or ldind_ref.
18054 (StoreFromPtr): Handle stobj as well.
18056 * expression.cs (UnaryMutator): Share more code.
18058 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18059 down: I was not tracking the Filter function as well, which
18060 was affecting the results of the cache.
18062 2002-05-15 Miguel de Icaza <miguel@ximian.com>
18064 * attribute.cs: Remove the hack to handle the CharSet property on
18067 2002-05-14 Miguel de Icaza <miguel@ximian.com>
18069 * attribute.cs (DoResolve): More uglyness, we now only try to
18070 resolve the attribute partially, to extract the CharSet
18071 information (only if we are a StructLayout attribute). Otherwise
18073 (GetExtraTypeInfo): Add some code to conditionally kill in the
18074 future this. I am more and more convinced that the .NET
18075 framework has special code to handle the attribute setting on
18078 * expression.cs (IsParamsMethodApplicable): Revert my previous
18079 foreach change here, it was wrong.
18081 2002-05-13 Miguel de Icaza <miguel@ximian.com>
18083 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18084 (pp_expr): do not abort on unknown input, just return.
18085 (eval): abort if there are pending chars.
18087 * attribute.cs (Attribute.Resolve): Positional parameters are
18088 optional. Deal with that case.
18090 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18091 the Ansi/Unicode/Auto information for the type.
18093 (TypeContainer.DefineType): instantiate the EmitContext here, as
18094 we will be using it during the type definition (to resolve
18095 attributes) and during the emit phase.
18097 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18098 to pull type information out of the attributes
18100 (Attribute.Resolve): track the constructor builder, and allow for
18101 multiple invocations (structs and classes will use this).
18103 * ecore.cs (MemberLookupFinal): new version with all the
18104 parameters customizable.
18106 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18107 constructors. Return if the result value is null (as the error
18108 would have been flagged already by MemberLookupFinal)
18110 Do not allow instances of abstract classes or interfaces to be
18113 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18114 We have to compare the assembly property here when dealing with
18115 FamANDAssem and Assembly access modifiers, because we might be
18116 creating an assembly from *modules* (that means that we are not
18117 getting TypeBuilders for types defined in other modules that are
18118 part of this assembly).
18120 (Method.Emit): If the method is marked abstract and has a body,
18123 (TypeContainer.DefineMembers): If both the defined member and the
18124 parent name match are methods, then do not emit any warnings: let
18125 the Method.Define routine take care of flagging warnings. But if
18126 there is a mismatch (method overrides something else, or method is
18127 overriwritten by something, then emit warning).
18129 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18130 set to null, this means `do not check for the return type on the
18133 (Method.Define): set the return type for the method signature to
18134 null, so that we get methods with the same name and parameters and
18135 different return types. This is used to flag warning 114 (you are
18136 hiding a method, and you probably want to use the new/override
18139 * typemanager.cs (MemberLookup): Implemented proper access
18140 control, closing a long standing set of bug reports. The problem
18141 was that the Framework only has two bits: Public and NonPublic,
18142 and NonPublic includes private and protected methods, but we need
18143 to enforce the FamANDAssem, FamOrAssem and Family.
18145 2002-05-11 Miguel de Icaza <miguel@ximian.com>
18147 * statement.cs (GotoCase): Return true: Ammounts to giving up
18148 knowledge on whether we return or not, and letting the other case
18149 be responsible for it.
18151 2002-05-10 Miguel de Icaza <miguel@ximian.com>
18153 * driver.cs: Do not load directories for each file processed, only
18154 do it if there is a pattern.
18156 * ecore.cs: Report readonly assigns here as well, as we might have
18157 been resolved only by MemberAccess.
18159 (SimpleName.SimpleNameResolve): Also be useful for LValue
18160 resolution. We need this to propagate assign to local readonly variables
18162 * typemanager.cs: Use a ptrhashtable for the criteria, because we
18163 do not want to reuse potential criteria memory.
18165 * class.cs (MyEventBuilder): Set reflected_type;
18167 * ecore.cs (Constantify): Added support for constifying bools.
18169 (RootContext.LookupType): Added a cache for values looked up in
18170 the declaration space.
18172 * typemanager.cs (FindMembers): Now is a front-end to
18173 RealFindMembers, and provides a two-level hashtable-based cache to
18176 15% performance improvement: from 22.5 to 19.2 seconds.
18178 * expression.cs (IsParamsMethodApplicable): use foreach.
18179 (Invocation.DoResolve): ditto.
18180 (New.DoResolve): ditto.
18181 (ArrayCreation.DoResolve): ditto.
18183 * ecore.cs (FindMostEncompassingType): use foreach.
18185 * delegate.cs (NewDelegate.DoResolve): Use foreach
18187 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18188 (RemoveMethods): use foreach.
18190 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18191 nested foreach statements instead of for, and also break out of
18192 the inner loop once a match is found.
18194 (Invocation.OverloadResolve): Use foreach, simplify the code.
18196 2002-05-08 Miguel de Icaza <miguel@ximian.com>
18198 * cfold.cs (BinaryFold): During an enumeration evaluation context,
18199 we actually unwrap the expression to allow for extra information
18202 * expression.cs: Use Shr_Un on unsigned operations.
18204 2002-05-08 Ravi Pratap <ravi@ximian.com>
18206 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
18207 applicable operators was not being considered correctly. This closes
18208 the bug Miguel reported.
18210 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18212 * attribute.cs: check that the type derives from System.Attribute
18213 and report the correct error in that case (moved the duplicate code to
18214 its own method, too).
18216 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18218 * attribute.cs: lookup attribute type name as the spec says: first the
18219 bare attribute name and then name + "Attribute" (nant compiles with
18220 mcs after this fix).
18222 2002-05-07 Miguel de Icaza <miguel@ximian.com>
18224 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
18225 Because of the way we parse things, we should try to see if a
18226 UIntConstant can fit in an integer.
18228 2002-05-07 Ravi Pratap <ravi@ximian.com>
18230 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18231 when we are in an explicit context.
18233 (ConvertReferenceExplicit): When converting from Iface type S to Class
18234 T make sure the rules are implemented as an OR.
18236 * parameter.cs (ParameterType): Make it a property for now although the
18237 purpose really isn't anything immediate.
18239 * expression.cs (Is*Applicable): Do better checking on the parameter type
18240 of a ref/out parameter. The ones from the system assemblies are already
18241 marked with the correct type so we don't need to do any correction.
18243 * ecore.cs (StandardConversionExists): Conversion from Interface types to
18244 the object type is standard too so include that.
18246 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18248 * ecore.cs (StandardConversionExists): Augment with missing code:
18249 deal with IntConstant, LongConstants and Enumerations.
18251 * assign.cs: Report the error, instead of failing silently
18253 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18254 typecontainer that they are declared, because the
18255 typecontainer/namespace will have the list of using clauses that
18256 need to be applied.
18258 Assembly Attributes were escaping the normal registration
18261 (EmitCode): Apply attributes within an EmitContext that represents
18262 the container they were declared on.
18264 * cs-parser.jay: Track bases for structs. How did I get this wrong?
18266 2002-05-06 Ravi Pratap <ravi@ximian.com>
18268 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18269 Revamp completely - make much cleaner as we now operate only
18272 (FindMostSpecificSource, FindMostSpecificTarget): New methods
18273 to implement the logic detailed in the spec more correctly.
18275 (UserDefinedConversion): Update accordingly.
18277 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18279 * statement.cs: Return flow analysis information up.
18281 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18284 (token): Do not consume an extra character before calling
18287 2002-05-06 Piers Haken <piersh@friskit.com>
18289 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18291 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18293 * class.cs (Constructor.Emit): Set the IsStatic flag in the
18294 EmitContext during the instance constructor initializer
18295 resolution, to stop access to instance variables.
18297 This is mandated by the spec, last paragraph of the `constructor
18298 initializers' section.
18300 2002-05-05 Miguel de Icaza <miguel@ximian.com>
18302 * cs-parser.jay, class.cs (Accessor): new class used to represent
18303 an accessor (get or set). In the past we used `null' to represent
18304 a missing accessor. But this is ambiguous because there was no
18305 way to tell in abstract indexers/properties if one of them was
18308 Now there is a way of addressing that.
18310 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18311 instead of FindMembers.
18313 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18314 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18316 * attribute.cs: Treat indexers and properties as the same in terms
18317 of applying attributes
18319 * ecore.cs (FindMostEncompassedType): Use statically initialized
18320 EmptyExpressions()s like we do elsewhere to avoid creating useless
18321 objects (and we take this out of the tight loop).
18323 (GetConversionOperators): Move the code to extract the actual
18324 operators to a separate routine to clean things up.
18326 2002-05-04 Miguel de Icaza <miguel@ximian.com>
18328 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18329 events are always registered FieldBuilders.
18331 * class.cs (FieldBase): New class shared by Fields
18333 * delegate.cs: If we are a toplevel delegate, use our full name.
18334 If we are a nested delegate, then only use our tail name.
18336 2002-05-02 Ravi Pratap <ravi@ximian.com>
18338 * expression.cs (IsApplicable): Ensure that we add the "&" to
18339 ref/out types before comparing it with the type of the argument.
18341 (IsParamsMethodApplicable): Ditto.
18343 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
18346 * delegate.cs : Handle the case when we have more than one applicable
18347 method. Flag an error only when we finish checking all.
18349 2002-05-02 Miguel de Icaza <miguel@ximian.com>
18351 * expression.cs: Add support for boolean static initializers.
18353 2002-05-01 Miguel de Icaza <miguel@ximian.com>
18355 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18357 * parameter.cs (ComputeParameterTypes,
18358 ComputeAndDefineParameterTypes): Better error handling: now we
18359 clear the `types' cache if we fail during any of the type lookups.
18360 We also return the status code correctly to our caller
18362 * delegate.cs: If we fail to define a delegate, abort the extra
18365 * expression.cs (Binary.ResolveOperator): for
18366 operator==(object,object) and operator !=(object, object) we also
18367 have to verify that there is an implicit conversion from one to
18370 (ArrayAccess.DoResolve): Array Access can operate on
18373 2002-04-30 Miguel de Icaza <miguel@ximian.com>
18375 * assign.cs (CompoundAssign): A new class used as a "flag" that
18376 the assignment actually is happening as part of a compound
18377 assignment operator.
18379 During compound assignment, a few new rules exist to enable things
18386 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18387 to the type of x) if y is implicitly convertible to the type of x,
18388 and the operator is a builtin operator and the return type of the
18389 operator is explicitly convertible to the type of x.
18391 * rootcontext.cs: Reset warning level to 2. 4 catches various
18392 "interesting" features in mcs, we must clean this up at some
18393 point, but currently am trying to kill other bugs ;-)
18395 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18396 in container classes as well.
18398 * expression.cs (Binary.ResolveOperator): Handle string case
18399 before anything else (as operator overloading does emit an error
18400 before doing anything else).
18402 This code could go away when we move to a table driven model, but
18403 i could not come up with a good plan last night.
18405 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
18407 * typemanager.cs (CSharpName): reimplementation using regex.
18408 * class.cs: added null check for fields in Emit
18409 * rootcontext.cs: set warninglevel to 4
18411 2002-04-29 Miguel de Icaza <miguel@ximian.com>
18413 * typemanager.cs (CSharpName): reimplemented with Lupus
18416 2002-04-28 Miguel de Icaza <miguel@ximian.com>
18418 * statement.cs (If): correclty implement Resolve, because we were
18419 not catching sem errors in there. The same process is needed
18421 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18424 (Statement.Warning_DeadCodeFound): Factorize code.
18425 (While): Report dead code here too.
18427 (Statement): Added Resolve virtual method to allow
18428 for resolution split from the emit code.
18430 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18432 * statement.cs (EmitBoolExpression): No longer try to resolve the
18434 (MakeBoolean): New utility function that resolve, implicitly
18435 converts to boolean and tags the expression.
18438 (If, Do): Implement dead code elimination.
18439 (While): Implement loop inversion
18441 (Do, While, For, If): Resolve the expression prior to calling our
18444 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
18447 - added method Report28 (warning: program has more than one entry point)
18448 - added method IsEntryPoint, implements paragraph 10.1 of the spec
18449 - modified method Method.Define, the part at the end of the method
18451 * rootcontext.cs: added static public Location EntryPointLocation;
18453 * ../errors/cs0028.cs : Add test case for the above warning.
18456 - modified method CSharpName to allow arrays of primitive type to
18457 be printed nicely (e.g. instead of System.Int32[][] it now prints
18459 - added method CSharpSignature: returns the signature of a method
18460 in string format to be used in reporting errors, warnings, etc.
18462 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18465 2002-04-26 Ravi Pratap <ravi@ximian.com>
18467 * delegate.cs (Define): Fix extremely silly bug where I was
18468 setting the type of the 'object' parameter of the BeginInvoke
18469 method to System.IAsyncResult instead of System.Object ;-)
18471 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18473 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18476 (Constructor.Emit): return if we fail to initialize the
18477 constructor. Another door closed!
18479 * expression.cs (New.DoResolve): Improve error message (from -6 to
18480 1501). Use DeclaredOnly lookup to find the exact constructor.
18482 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18483 loop. This is useful.
18485 * cs-parser.jay: Adjust the default parameters so that destructors
18486 have the proper signature.
18488 2002-04-26 Martin Baulig <martin@gnome.org>
18490 * driver.cs (LoadAssembly): If `assembly' contains any characters
18491 which are only valid in path names and not in assembly names
18492 (currently slash, backslash and point), use Assembly.LoadFrom ()
18493 instead of Assembly.Load () on the `assembly' (before iteration
18494 over the link_paths).
18496 2002-04-26 Martin Baulig <martin@gnome.org>
18498 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18500 2002-04-25 Miguel de Icaza <miguel@ximian.com>
18502 * class.cs (Property): use the new typemanager.MemberLookup
18504 (TypeContainer.MemberLookup): Implement using the
18505 TypeManager.MemberLookup now.
18507 * typemanager.cs: Make MemberLookup a function of the TypeManager,
18508 and return MemberInfos, so that these can be used without an
18509 EmitContext (what we had before).
18511 2002-04-24 Miguel de Icaza <miguel@ximian.com>
18513 * expression.cs: Fix the case where the argument to params if the
18514 type of the params. I omitted handling this before. Fixed
18516 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18518 * driver.cs: Call BootCorlib_PopulateCoreType
18520 * class.cs (Property.CheckBase): Check for properties only, not
18523 * interface.cs: Temporary hack: try/catch around the
18524 CustomAttributeBuilder, because I am getting an exception that I
18527 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18528 types whose definitions are required to be there (attributes are
18529 defined before standard types).
18531 Compute definitions as we boot the various types, as they are used
18532 immediately (value_type class will need object_type, but if we do
18533 not initialize object_type, we will pass a null, which will let
18534 the runtime pick the System.Object from the existing corlib, which
18535 is not what we want).
18537 2002-04-22 Patrik Torstensson <totte@labs2.com>
18539 * cs-tokenizer.cs: fixed a number of trim() issues.
18541 2002-04-22 Ravi Pratap <ravi@ximian.com>
18543 * expression.cs (Argument.Type): Ensure that we return the correct
18544 type when we have out or ref parameters [in which case we
18547 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18549 * class.cs (Property, Indexer): Allow extern modifier in there.
18551 * typemanager.cs (InitBaseTypes): Initializes object_type and
18552 value_type, since those will be used early on during the bootstrap
18553 process to compile corlib.
18555 (InitCoreTypes): Move code from here to InitBaseTypes.
18557 2002-04-21 Miguel de Icaza <miguel@ximian.com>
18559 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18560 single-dimension arrays as using the ldlen opcode.
18562 Daniel Lewis discovered this optimization.
18564 * typemanager.cs: Add signature for System.Array::get_Length
18566 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18568 * statement.cs: report the error when the foreach does not apply to an
18569 array nor a collection.
18571 2002-04-19 Miguel de Icaza <miguel@ximian.com>
18573 * expression.cs: Add implicit conversions to the operator ~.
18575 * constant.cs (DecimalConstant.Emit): Emit decimal value.
18577 * typemanager.cs: Locate the decimal constructor.
18579 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18581 * attribute.cs: use the new property of TypeOf.
18582 * expression.cs: added 'get' property around typearg.
18584 These changes fix a build breaker reported by NickD. Is this the
18585 correct way to fix? If not, please, revert my changes and make it
18588 2002-04-17 Miguel de Icaza <miguel@ximian.com>
18590 * attribute.cs: Add support for typeof in attribute invocations.
18591 I am not sure that this is right though.
18593 2002-04-14 Duncan Mak <duncan@ximian.com>
18595 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18596 Binary.Operator.Division case.
18598 2002-04-13 Ravi Pratap <ravi@ximian.com>
18600 * class.cs (DefineType): Ensure that we do a proper check on
18601 attribute types and also register it with the TypeManager.
18603 (TypeContainer.Targets): The default for attribute types is
18604 AttributeTargets.All.
18606 * attribute.cs (ApplyAttributes): Registering the attribute type
18607 is done elsewhere, not when we discover we have a Usage attribute.
18609 2002-04-12 Ravi Pratap <ravi@ximian.com>
18611 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18612 and get rid of is_delegate parameter.
18614 * everywhere : update.
18616 2002-04-12 Ravi Pratap <ravi@ximian.com>
18618 * cs-parser.jay (compilation_unit): Revamp completely to use
18619 some new ideas that I got from Rhys' grammar to solve the problems
18620 with assembly level attributes.
18622 (outer_declaration): New grammar production.
18624 (attribute_sections): Add.
18626 (opt_attributes): Base on attribute_sections
18628 (namespace_declaration): Allow opt_attributes to tackle the case
18629 when we have assembly level attributes - we are clever in this
18632 * attribute.cs (ApplyAttributes): Do not worry about assembly
18633 attributes in the non-global context.
18635 * rootcontext.cs (AddGlobalAttributes): Go back to using this
18636 instead of SetGlobalAttributes.
18638 * class.cs, rootcontext.cs : Ensure we define and generate
18639 attribute types before anything else.
18641 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18642 and flag the new error -20 for the case when the attribute type
18643 does not have valid targets specified. csc does not catch this.
18645 * ../errors/errors.txt : update for error # -20
18647 2002-04-11 Ravi Pratap <ravi@ximian.com>
18649 * support.cs (InternalParameters.ParameterModifier): Do some null
18650 checking and return sane values.
18652 * class.cs (Method.Define): If we are a PInvoke method, ensure
18653 that we are static and extern. Report error # 601
18655 * ../errors/cs0601.cs : Add test case for the above error.
18657 2002-04-07 Ravi Pratap <ravi@ximian.com>
18659 * rootcontext.cs (attribute_types): We need to keep type of
18660 all attribute types separately and emit code for them first.
18662 (RegisterAttribute) : Implement.
18664 * class.cs (DefineType): Check if the current Type is a custom
18665 attribute type and register it accordingly.
18667 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18668 adding the first attribute twice and rename to
18670 (SetGlobalAttributes): this.
18672 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18675 * attribute.cs (ApplyAttributes): Take an additional argument telling us
18676 if we are processing global arguments. Hmm, I am unsure of this.
18678 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18680 * expression.cs: added static array of strings to avoid calling
18681 Enum.ToString () for Operator in Binary. Significant recover of
18684 2002-04-10 Miguel de Icaza <miguel@ximian.com>
18686 * class.cs (FindMembers): Allow the Builders of the various
18687 members to be null. If they are skip them. This only happens
18688 during the PInvoke declaration.
18690 2002-04-09 Miguel de Icaza <miguel@ximian.com>
18692 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18693 failure, so we do not keep going afterwards.
18695 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18696 wanted to pass `false' as the `is_delegate' argument. If this is
18697 the case, why not use delegate_type == null to mean `is_delegate =
18698 false' and anything else as is_delegate = true.
18700 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
18702 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18703 code for the section, not the beginning of the tests.
18705 2002-04-08 Miguel de Icaza <miguel@ximian.com>
18707 * cfold.cs: Handle operator + (Enum x, Underlying x)
18709 * expression.cs (Binary): same. Warn about errors where we have
18710 Enum/Enum in operator + as well.
18712 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
18715 - added support for switch(bool)
18716 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18717 - add TableSwitchEmit() to handle table-based switch statements
18719 2002-04-05 Ravi Pratap <ravi@ximian.com>
18721 * expression.cs (Invocation.OverloadResolve): Factor out code which
18722 does parameter compatibility checking with arguments so that we can
18723 re-use the code even from Delegate.VerifyApplicability
18725 (VerifyArgumentsCompat): Move above code here.
18727 * delegate.cs (VerifyApplicability): Get rid of duplicate code
18728 and instead make a call to the above method.
18730 2002-03-31 Ravi Pratap <ravi@ximian.com>
18732 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18733 We use it to keep track of classes which are attribute types.
18735 2002-04-02 Miguel de Icaza <miguel@ximian.com>
18737 * delegate.cs (Delegate.Define): Correctly define the types in the
18738 presence of fixed and array parameters.
18740 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18743 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18744 include NonPublic after the first iteration.
18746 * class.cs (Indexer.CheckBase): Only check if both parents are
18749 * cs-parser.jay (accessor_body): If empty, set to null.
18751 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18752 same code path here to resolve constants names that we did have in
18753 MemberAccess.DoResolve. There is too much code duplicated here.
18755 2002-04-01 Miguel de Icaza <miguel@ximian.com>
18757 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18759 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18762 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18763 tokens, numbers and strings.
18765 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18768 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18769 asyncronous parameters and the regular parameters.
18771 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18772 specify the target directory.
18774 * expression.cs: (This.DoResolve): Simplify
18775 (As.Emit): Optimize, do not generate IsInst if the expression is
18776 always of the given type.
18778 (Is.DoResolve): Bug fix, we were reporting both always/never for
18781 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18782 creating too many unnecessary arrays.
18784 2002-03-31 Miguel de Icaza <miguel@ximian.com>
18786 * class.cs (EmitFieldInitializer): Use Assign expression to assign
18787 fields instead of rolling our own initializer. Takes care of all
18788 implicit conversions, and drops unnecessary static checks/argument.
18790 2002-03-31 Dick Porter <dick@ximian.com>
18792 * driver.cs: use the GetDirectories() return values properly, and
18793 use "/" as path separator.
18795 2002-03-30 Miguel de Icaza <miguel@ximian.com>
18797 * expression.cs (Unary): Optimize - - expr into expr.
18798 (Binary): Optimize a + (-b) into a -b.
18800 * codegen.cs (CodeGen): Made all methods static.
18802 2002-03-29 Miguel de Icaza <miguel@ximian.com>
18806 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18807 TypeBuilder property.
18809 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18812 * tree.cs: Removed the various RecordXXXX, and replaced with a
18813 single RecordDecl. Removed all the accessor methods, and just
18814 left a single access point Type
18816 * enum.cs: Rename DefineEnum to DefineType.
18818 * decl.cs: New abstract method `DefineType' used to unify the
18819 Defines for Enumerations, Interfaces, TypeContainers and
18822 (FindType): Moved LookupInterfaceOrClass here. Moved the
18823 LookupBaseClasses method that used to live in class.cs and
18824 interface.cs here, and renamed to FindType.
18826 * delegate.cs: Implement DefineType. Take advantage of the
18827 refactored pattern for locating the parent builder without taking
18828 the parent_builder argument (which we know does not work if we are
18829 nested, and triggering a toplevel definition).
18831 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18833 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18834 accessibility of a member has changed during override and report
18837 * class.cs (Method.Define, Property.Define): Only complain on
18838 overrides if the method is private, any other accessibility is
18839 fine (and since we just checked the permission is the same, we are
18842 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18843 and elif are processed always. The other pre-processing
18844 directives are only processed if we are "taking" the path
18846 2002-03-29 Martin Baulig <martin@gnome.org>
18848 * class.cs (Method.Emit): Only emit symbolic debugging info if the
18849 current location is not Null.
18851 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18852 a separate method so we can profile it.
18854 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18855 `span.Seconds' are just seconds, but no minutes or hours.
18856 (MainDriver): Profile the CodeGen.SaveSymbols calls.
18858 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18860 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18861 Remove the gratuitous set of Final:
18863 // If an interface implementation, then we can set Final.
18864 if (((flags & MethodAttributes.Abstract) == 0) &&
18865 implementing.DeclaringType.IsInterface)
18866 flags |= MethodAttributes.Final;
18868 I do not know what I was smoking when I used that.
18871 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18872 step into fixing the name resolution issues for delegates and
18873 unifying the toplevel name resolution.
18875 2002-03-28 Martin Baulig <martin@gnome.org>
18877 * class.cs (Method.Emit): If we have a symbol writer, call its
18878 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18879 tell it about the current method.
18881 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18882 writer that we're going to emit the first byte of IL code for a new
18883 statement (a new source line).
18884 (EmitContext.EmitTopBlock): If we have a symbol writer, call
18885 EmitContext.Mark() before emitting any code.
18887 * location.cs (SymbolDocument): Return null when we're Null.
18889 * statement.cs (Statement): Moved the `Location loc' variable here.
18890 (Statement.EmitBoolExpression): If we have a symbol writer, call
18891 ec.Mark() before emitting any code to tell it that we're at the
18892 beginning of a new statement.
18893 (StatementExpression): Added `Location' argument to the constructor.
18894 (Block): Added public readonly variable `StartLocation' and public
18895 variable `EndLocation'. The latter is to be set using SetEndLocation().
18896 (Block): Added constructor which takes a start and end location.
18897 (Block.SetEndLocation): New method. This sets the end location.
18898 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18899 local variables we create.
18900 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18901 each statement and do also mark the begin and end of the block.
18903 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18904 tell it the current lexer.Location, use Location.Null for the end of the
18906 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18907 current block, set its end location using SetEndLocation().
18908 (statement_expression): StatementExpression constructor now takes the
18909 lexer.Location as additional argument.
18910 (for_statement, declare_local_variables): Likewise.
18911 (declare_local_variables): When creating a new implicit block, use the
18912 new Block constructor and pass it the lexer.Location.
18914 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18916 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18917 members also on the parent interfaces recursively.
18919 2002-03-27 Miguel de Icaza <miguel@ximian.com>
18921 * report.cs: Use new formats, since Gonzalo finished the missing
18924 * expression.cs (Binary.ResolveOperator): added missing operator|
18925 operator& and operator^ for bool/bool.
18927 * cs-parser.jay: CheckDef now takes a Location argument that is
18928 used to report errors more precisly (instead of reporting the end
18929 of a definition, we try to track something which is a lot closer
18930 to the source of the problem).
18932 * cs-tokenizer.cs: Track global token use, so we can properly flag
18933 the use of #define/#undef after the first token has been seen.
18935 Also, rename the reportXXXX to Error_DescriptiveName
18937 * decl.cs (DeclSpace.IsTopLevel): Move property here from
18938 TypeContainer, so that Enum and Interface can use this too.
18940 * class.cs (TypeContainer.LookupInterfaceOrClass,
18941 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18942 `builder' argument. Typically this was used to pass the parent
18943 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18946 The problem is that a nested class could trigger the definition of
18947 a toplevel class, and the builder would be obviously wrong in that
18950 So we drop this argument, and we compute dynamically the
18951 TypeBuilder/ModuleBuilder (the correct information was available
18952 to us anyways from DeclSpace.Parent)
18954 * interface.cs (Interface.DefineInterface): Drop builder
18955 parameter cleanup like class.cs
18957 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
18960 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18963 (Try.Emit): Propagate the returns value from the statement.
18965 (Return.Emit): Even if we are leavning
18967 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18969 * modifiers.cs: Fix the computation of MethodAttributes flags.
18971 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18973 * driver.cs: allow compilation of files that start with '/'.
18974 Add a default case when checking the argument of --target.
18976 2002-03-25 Miguel de Icaza <miguel@ximian.com>
18978 * interface.cs: Implement the same search algorithm for types in
18979 the interface code.
18981 * delegate.cs: Do not allow multiple definition.
18983 * Recovered ChangeLog that got accidentally amputated
18985 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18987 * rootcontext.cs: Load manually enum to allow core classes to
18988 contain enumerations.
18990 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18991 Update to new static methods in TypeManager.
18993 * typemanager.cs (GetMethod, GetConstructor): Use our
18994 implementation of FindMembers to find the members, since during
18995 corlib compilation, the types are TypeBuilders and GetMethod and
18996 GetConstructor do not work.
18998 Make all methods in TypeManager static.
19000 (InitCodeHelpers): Split the functionality from
19001 the InitCodeTypes function.
19003 * driver.cs: Call InitCodeHelpers after we have populated the
19006 * cs-parser.jay (delegate_declaration): we did not used to compute
19007 the delegate name correctly for void delegates.
19009 2002-03-24 Miguel de Icaza <miguel@ximian.com>
19011 * rootcontext.cs (RootContext): Init the interface_resolve_order
19012 and type_container_resolve_order always.
19014 (ResolveCore, BootstrapCorlib_ResolveClass,
19015 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19016 compiler when compiling with --nostdlib
19018 * class.cs (TypeContainer.DefineType): Check that our parent is
19019 not null. This test is most important when we are bootstraping
19022 * codegen.cs: Split out the symbol writing code.
19024 2002-03-25 Martin Baulig <martin@gnome.org>
19026 * driver.cs (-g): Made -g an alias for --debug.
19028 2002-03-24 Martin Baulig <martin@gnome.org>
19030 * codegen.cs (SymbolWriter): New public variable. Returns the
19031 current symbol writer.
19032 (CodeGen): Added `bool want_debugging_support' argument to the
19033 constructor. If true, tell the ModuleBuild that we want debugging
19034 support and ask it for the ISymbolWriter.
19035 (Save): If we have a symbol writer, call it's Close() method after
19036 saving the assembly.
19038 * driver.c (--debug): New command line argument to create a
19039 debugger information file.
19041 * location.cs (SymbolDocument): New public property. Returns an
19042 ISymbolDocumentWriter object for the current source file or null
19043 if we don't have a symbol writer.
19045 2002-03-21 Miguel de Icaza <miguel@ximian.com>
19047 * driver.cs (LoadAssembly): Correctly return when all the paths
19048 have been tried and not before.
19050 * statement.cs (Switch.Emit): return the actual coverage for this
19051 statement (returns/not-returns)
19053 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19054 switch of the statement if we are the last switch section. That
19055 kills two problems: try/catch problems (we used to emit an empty
19056 nop at the end) and switch statements where all branches would
19059 2002-03-19 Miguel de Icaza <miguel@ximian.com>
19061 * driver.cs: Add default assemblies (the equivalent to the
19062 Microsoft CSC.RSP file)
19064 * cs-tokenizer.cs: When updating `cols and setting it to zero,
19065 also update tokens_seen and set it to false.
19067 * driver.cs: Implement --recurse for Mike.
19069 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19070 correctly splitting out the paths.
19072 2002-03-18 Miguel de Icaza <miguel@ximian.com>
19074 * interface.cs (Interface.PopulateProperty): Instead of using
19075 `parent' as the declaration space for the set parameters, use
19078 * support.cs (InternalParameters): InternalParameters constructor
19079 takes a DeclSpace instead of a TypeContainer.
19081 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19082 types are being initialized, load the address of it before calling
19085 (New): Provide a mechanism to disable the generation of local
19086 value type temporaries when the caller will be providing us with
19087 an address to store it.
19089 (ArrayCreation.EmitDynamicInitializers): Use it.
19091 2002-03-17 Miguel de Icaza <miguel@ximian.com>
19093 * expression.cs (Invocation.EmitArguments): Only probe for array
19094 property if there is more than one argument. Sorry about that.
19096 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19097 empty param arrays.
19099 * class.cs (Method.LabelParameters): Fix incorrect code path that
19100 prevented the `ParamArrayAttribute' from being applied to the
19103 2002-03-16 Miguel de Icaza <miguel@ximian.com>
19105 * support.cs (ReflectionParameters): Correctly compute whether the
19106 last argument is a params array. Fixes the problem with
19109 * typemanager.cs: Make the assemblies array always be non-null
19110 (empty, but non-null)
19112 * tree.cs (RecordDecl): New function that abstracts the recording
19113 of names. This reports error 101, and provides a pointer to the
19114 previous declaration. Fixes a crash in the compiler.
19116 * cs-parser.jay (constructor_declaration): Update to new grammar,
19117 and provide a constructor_body that can be empty.
19119 2002-03-15 Miguel de Icaza <miguel@ximian.com>
19121 * driver.cs: Add support for --resources.
19123 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19124 Make all types for the various array helper methods be integer.
19126 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19127 CheckState to ConvCast.
19129 (ConvCast): Now it takes a `checked' state argument, to avoid
19130 depending on the emit context for the conversion, and just using
19131 the resolve time setting.
19133 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19134 instead of Invocation.EmitArguments. We do not emit the original
19135 arguments, instead we emit those which have been converted to
19136 unsigned int expressions.
19138 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19140 * codegen.cs: ditto.
19142 * expression.cs (LocalVariableReference): Drop the use of the
19143 Store function that depended on the variable index.
19145 * statement.cs (VariableInfo): Drop the `Idx' property from this
19146 class, as this is not taking into account the indexes for
19147 temporaries tat we generate during the execution, getting the
19150 * class.cs: First emit class initializers, then call the parent
19153 * expression.cs (Binary): Fix opcode emision.
19154 (UnaryMutator.EmitCode): Support checked code generation
19156 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19157 matches for events for both the Static and Instance scans,
19158 pointing to the same element. Fix that.
19160 2002-03-14 Miguel de Icaza <miguel@ximian.com>
19162 * rootcontext.cs (ResolveTree): Always set the
19163 interface_resolve_order, because nested interfaces will be calling
19166 * class.cs (GetInterfaceOrClass): Track the same resolution
19167 process used by TypeManager.LookupType. This fixes the nested
19168 type lookups in class declarations (separate path from
19171 (TypeContainer.DefineType): Also define nested interfaces.
19172 (TypeContainer.RegisterOrder): New public function used to
19173 register the order in which child interfaces need to be closed.
19175 Nested interfaces need to be closed after their parents have been
19178 * interface.cs (InterfaceAttr): Put all the logic for computing
19179 the interface attribute here.
19181 (DefineInterface): Register our interface order with the
19182 RootContext or with the TypeContainer depending on the case.
19184 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19186 * cs-parser.jay: rework foreach statement to work with the new
19187 changes to the policy on SimpleNames.
19189 * report.cs: support Stacktrace on warnings as well.
19191 * makefile: drop --unsafe and /unsafe from the compile.
19193 2002-03-13 Ravi Pratap <ravi@ximian.com>
19195 * ecore.cs (StandardConversionExists): Modify to take an Expression
19196 as the first parameter. Ensure we do null -> reference type conversion
19199 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19200 temporary Expression objects.
19202 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19204 * interface.cs: workaround bug in method overloading resolution
19205 (there is already a bugzilla bug for it).
19207 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19209 We could also solve this problem by having a separate path for
19210 performing type lookups, instead of DoResolve, we could have a
19211 ResolveType entry point, and only participating pieces of the
19212 production (simplename, deref, array) would implement this.
19214 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19215 signal SimpleName to only resolve type names and not attempt to
19216 resolve anything else.
19218 * expression.cs (Cast): Set the flag.
19220 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19222 * class.cs: Only report 108 if there is no `new' modifier.
19224 * cs-parser.jay: rework foreach statement to work with the new
19225 changes to the policy on SimpleNames.
19227 * report.cs: support Stacktrace on warnings as well.
19229 * makefile: drop --unsafe and /unsafe from the compile.
19231 2002-03-11 Miguel de Icaza <miguel@ximian.com>
19233 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19234 lookups here, instead of doing that at parse time. This means
19235 that our grammar will not introduce `LocalVariableReferences' as
19236 expressions at this point. That solves the problem of code like
19240 static void Main ()
19244 This is only half the fix. The full fix requires parameters to
19245 also be handled in this way.
19247 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19248 makes the use more obvious of the DeclSpace. The
19249 ec.TypeContainer.TypeBuilder is now only used to pull the
19250 TypeBuilder for it.
19252 My theory is that I can get rid of the TypeBuilder completely from
19253 the EmitContext, and have typecasts where it is used (from
19254 DeclSpace to where it matters).
19256 The only pending problem is that the code that implements Aliases
19257 is on TypeContainer, and probably should go in DeclSpace.
19259 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19260 lookups here, instead of doing that at parse time. This means
19261 that our grammar will not introduce `LocalVariableReferences' as
19262 expressions at this point. That solves the problem of code like
19266 static void Main ()
19270 This is only half the fix. The full fix requires parameters to
19271 also be handled in this way.
19273 * class.cs (Property.DefineMethod): When implementing an interface
19274 method, set newslot, when implementing an abstract method, do not
19275 set the flag (before we tried never setting it, or always setting
19276 it, which is the difference).
19277 (Indexer.DefineMethod): same.
19278 (Method.DefineMethod): same.
19280 * ecore.cs: Only set the status used flag if we get back a Field.
19282 * attribute.cs: Temporary hack, so Paolo can keep working.
19284 2002-03-08 Ravi Pratap <ravi@ximian.com>
19286 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19287 the unmanaged type in the case we have a MarshalAs attribute.
19289 (Resolve): Handle the case when we are parsing the special MarshalAs
19290 attribute [we need to store the unmanaged type to use later]
19292 * typemanager.cs (marshal_as_attr_type): Built in type for the
19293 MarshalAs Attribute.
19295 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
19296 on parameters and accordingly set the marshalling info.
19298 2002-03-09 Miguel de Icaza <miguel@ximian.com>
19300 * class.cs: Optimizing slightly by removing redundant code after
19301 we switched to the `NoTypes' return value.
19302 (Property.DefineMethod): use NoTypes here too.
19304 This fixes the bug I introduced in my last batch of changes.
19306 2002-03-05 Ravi Pratap <ravi@ximian.com>
19308 * tree.cs (RecordEnum): Add. We now keep track of enums too.
19310 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19311 Enums since those are types too.
19313 * cs-parser.jay (enum_declaration): Record enums as we parse them.
19315 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
19316 thanks to a call during the lookup process.
19318 2002-03-07 Miguel de Icaza <miguel@ximian.com>
19320 * statement.cs (Foreach): Lots of work to accomodate a particular
19321 kind of foreach statement that I had not kept in mind. It is
19322 possible to have foreachs on classes that provide a GetEnumerator
19323 method that return objects that implement the "pattern" for using
19324 a foreach, there is no need to support GetEnumerator
19327 This is needed to compile nant.
19329 * decl.cs: Only report 114 if the member is not `Finalize' and if
19330 the warning level is at least 2.
19332 * class.cs: Moved the compare function from Method to
19335 (MethodSignature.InheritableMemberSignatureCompare): Add new
19336 filter function that is used to extract inheritable methods from a
19339 (Method.Define): Use the new `inheritable_method_signature_filter'
19342 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19345 2002-03-06 Miguel de Icaza <miguel@ximian.com>
19347 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19349 * cs-parser.jay: Add opt_semicolon to the interface declaration.
19351 * expression.cs: Pass location information to
19352 ConvertImplicitStandard.
19354 * class.cs: Added debugging code to track return values from
19357 2002-03-05 Miguel de Icaza <miguel@ximian.com>
19359 * expression.cs (Is.DoResolve): If either side of the `is' is an
19360 interface, do not flag the warning.
19362 * ecore.cs (ImplicitReferenceConversion): We need a separate test
19365 * report.cs: Allow for --fatal to be used with --probe.
19367 * typemanager.cs (NoTypes): Move the definition for the empty Type
19370 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19372 (TypeContainer.DefineProxy): New function used to proxy to parent
19373 implementations when implementing interfaces.
19374 (TypeContainer.ParentImplements): used to lookup if our parent
19375 implements a public function that is required by an interface.
19376 (TypeContainer.VerifyPendingMethods): Hook this up.
19378 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19379 `modules' and `assemblies' arraylists into arrays. We only grow
19380 these are the very early start up of the program, so this improves
19381 the speedof LookupType (nicely measured).
19383 * expression.cs (MakeByteBlob): Replaced unsafe code with
19384 BitConverter, as suggested by Paolo.
19386 * cfold.cs (ConstantFold.Binary): Special case: perform constant
19387 folding of string concatenation, but if either side is a string,
19388 and the other is not, then return null, and let the runtime use
19389 the concatenation on the string plus the object (using
19390 `Object.ToString').
19392 2002-03-04 Miguel de Icaza <miguel@ximian.com>
19394 Constant Folding has been implemented now.
19396 * expression.cs (Unary.Reduce): Do not throw an exception, catch
19397 the error instead on types that are not supported in one's
19400 * constant.cs (Constant and all children): New set of functions to
19401 perform implict and explicit conversions.
19403 * ecore.cs (EnumConstant): Implement the new functions to perform
19404 conversion by proxying to the child expression.
19406 * codegen.cs: (ConstantCheckState): Constant evaluation has its
19407 own separate setting that can not be turned off from the command
19408 line using --unchecked or --checked and is only controlled using
19409 the checked/unchecked statements and expressions. This setting is
19410 used by the constant folder to flag errors.
19412 * expression.cs (CheckedExpr, UncheckedExpr): Set the
19413 ConstantCheckState as well.
19415 During Resolve, they also have to flag the state, because the
19416 constant folder runs completely in the Resolve phase.
19418 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19421 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19423 * cfold.cs: New file, this file contains the constant folder.
19425 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19426 argument to track whether we are using the resulting address to
19427 load or store a value and provide better error messages.
19429 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19430 new AddressOf arguments.
19432 * statement.cs (Foreach.EmitCollectionForeach): Update
19434 * expression.cs (Argument.Emit): Call AddressOf with proper
19435 arguments to track usage.
19437 (New.DoEmit): Call AddressOf with new arguments.
19439 (Unary.Emit): Adjust AddressOf call.
19441 2002-03-01 Ravi Pratap <ravi@ximian.com>
19443 * cs-parser.jay (member_access): Change the case for pre-defined types
19444 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
19447 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19450 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19451 essentially like methods and apply attributes like MethodImplOptions to them too.
19453 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19456 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19457 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19460 * Update code everywhere accordingly.
19462 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19464 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19466 2002-02-28 Ravi Pratap <ravi@ximian.com>
19468 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19469 try performing lookups against those instead of jumping straight into using
19470 the 'using' clauses.
19472 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19474 (LookupType): Perform lookups in implicit parents too.
19476 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19477 sequence as RootContext.LookupType.
19479 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
19480 the various cases of namespace lookups into this method.
19482 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19484 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19485 in positional arguments)
19487 * class.cs (Operator): Update the AllowedModifiers to contain
19490 * cs-parser.jay: Update operator declaration to allow for the
19491 operator body to be empty.
19493 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19496 2002-02-27 Miguel de Icaza <miguel@ximian.com>
19498 * class.cs (Method.Emit): Label parameters.
19500 * driver.cs: Return 1 or 0 as the program exit code.
19502 2002-02-26 Miguel de Icaza <miguel@ximian.com>
19504 * expression.cs: Special case the `null' object when trying to
19505 auto-compute the type, as anything can be explicitly converted to
19508 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19509 spotting this Paolo.
19511 (Expression.ImplicitNumericConversion): Perform comparissions of
19512 the type using the underlying type in the case of an enumeration
19513 rather than using the enumeration type for the compare.
19515 Cope with the underlying == type case, which is not possible to
19518 (Expression.ConvertNumericExplicit): Perform comparissions of
19519 the type using the underlying type in the case of an enumeration
19520 rather than using the enumeration type for the compare.
19522 * driver.cs: If the user does not supply an extension, assume .exe
19524 * cs-parser.jay (if_statement): Rewrote so that we can track the
19525 location for the if statement.
19527 * expression.cs (Binary.ConstantFold): Only concat strings when
19528 the operation is "+", not everything ;-)
19530 * statement.cs (Statement.EmitBoolExpression): Take a location
19532 (If, While, Do): Track location.
19534 * expression.cs (Binary.ResolveOperator): In the object + string
19535 case, I was missing a call to ConvertImplicit
19537 2002-02-25 Ravi Pratap <ravi@ximian.com>
19539 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19540 Location arguments. Ensure we use RootContext.LookupType to do our work
19541 and not try to do a direct Type.GetType and ModuleBuilder.GetType
19543 * interface.cs (PopulateMethod): Handle the type of the parameter being
19546 * expression.cs (Invocation.BetterFunction): Handle the case when we
19547 have a params method with no fixed arguments and a call is made with no
19550 2002-02-25 Miguel de Icaza <miguel@ximian.com>
19552 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19553 the verbatim-string-literal
19555 * support.cs (InternalParameters.ParameterModifier): handle null
19557 (InternalParameters.ParameterType): ditto.
19559 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19560 duplicating the name of the variable parameter.
19561 (GetParameterByName): Fix bug where we were not looking up array
19562 paramters if they were the only present (thanks Paolo!).
19563 (GetParameterInfo): We only have an empty set of types if both
19564 fixed and array are set to null.
19565 (GetParameterInfo-idx): Handle FixedParameter == null
19567 * cs-parser.jay: Handle the case where there is no catch
19568 statements (missing null test).
19570 2002-02-22 Miguel de Icaza <miguel@ximian.com>
19572 * driver.cs (MainDriver): Be conservative on our command line
19575 Catch DirectoryNotFoundException when calling GetFiles.
19577 (SplitPathAndPattern): Used to split the input specification into
19578 a path and a pattern that we can feed to Directory.GetFiles.
19580 2002-02-21 Miguel de Icaza <miguel@ximian.com>
19582 * statement.cs (Fixed): Implement the last case of the Fixed
19583 statement (string handling).
19585 * expression.cs (StringPtr): New class used to return a char * to
19586 a string; Used by the Fixed statement.
19588 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
19590 * expression.cs (Binary.ResolveOperator): Remove redundant
19591 MemberLookup pn parent type.
19592 Optimize union call, we do not need a union if the types are the same.
19593 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19596 Specialize the use of MemberLookup everywhere, instead of using
19597 the default settings.
19599 (StackAlloc): Implement stackalloc keyword.
19601 * cs-parser.jay: Add rule to parse stackalloc.
19603 * driver.cs: Handle /h, /help, /?
19605 * expression.cs (MakeByteBlob): Removed the hacks we had in place
19606 before we supported unsafe code.
19608 * makefile: add --unsafe to the self compilation of mcs.
19610 2002-02-20 Miguel de Icaza <miguel@ximian.com>
19612 * expression.cs (PointerArithmetic): New class that is used to
19613 perform pointer arithmetic.
19614 (Binary.Resolve): Handle pointer arithmetic
19615 Handle pointer comparission.
19616 (ArrayPtr): Utility expression class that is used to take the
19617 address of an array.
19619 (ElementAccess): Implement array access for pointers
19621 * statement.cs (Fixed): Implement fixed statement for arrays, we
19622 are missing one more case before we are done.
19624 * expression.cs (Indirection): Implement EmitAssign and set the
19625 ExprClass to Variable. This allows pointer dereferences to be
19626 treated as variables, and to have values assigned to them.
19628 * ecore.cs (Expression.StoreFromPtr): New utility function to
19629 store values dereferencing.
19631 2002-02-20 Ravi Pratap <ravi@ximian.com>
19633 * expression.cs (Binary.ResolveOperator): Ensure that we are
19634 not trying to operate on a void type - this fixes the reported
19637 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19638 the parent implementation is sealed.
19640 * ../errors/cs0239.cs : Add.
19642 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19644 * typemanager.cs (unverifiable_code_type): Corresponds to
19645 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19646 which have unsafe code in them.
19648 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
19651 2002-02-19 Miguel de Icaza <miguel@ximian.com>
19653 * cs-tokenizer.cs: Add support for @"litreal strings"
19655 Make tokenizer accept pre-processor directives
19656 on any column (remove the old C-like limitation).
19658 * rootcontext.cs (EmitCode): Emit any global attributes.
19659 (AddGlobalAttributes): Used to keep track of assembly attributes.
19661 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19663 * cs-parser.jay: Add support for global attributes.
19665 2002-02-17 Miguel de Icaza <miguel@ximian.com>
19667 * expression.cs (Indirection): New helper class. Unary will
19668 create Indirection classes to be able to implement the
19669 IMemoryLocation interface on it.
19671 2002-02-16 Miguel de Icaza <miguel@ximian.com>
19673 * cs-parser.jay (fixed_statement): reference the right statement.
19675 * statement.cs (Fixed.Emit): Finish implementing the fixed
19676 statement for the &x case.
19678 2002-02-14 Miguel de Icaza <miguel@ximian.com>
19680 * class.cs (Property.Define, Method.Define): Remove newslot when
19683 * modifiers.cs: My use of NewSlot when `Abstract' was set was
19684 wrong. NewSlot should only be used if the `new' keyword is present.
19686 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19687 locating our system dir. Sorry about this.
19689 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19691 * driver.cs (GetSystemDir): Compute correctly the location of our
19692 system assemblies. I was using the compiler directory instead of
19693 the library directory.
19695 2002-02-13 Ravi Pratap <ravi@ximian.com>
19697 * expression.cs (BetterFunction): Put back in what Miguel commented out
19698 since it is the correct fix. The problem is elsewhere ;-)
19700 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19701 parameters of the parms method are themselves compatible or not !
19703 (StandardConversionExists): Fix very dangerous bug where we were forgetting
19704 to check that a class implements an interface before saying that an implicit
19705 conversion was allowed. Use ImplementsInterface to do the checking.
19707 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19709 * class.cs (Method.Define): Track whether we are an explicit
19710 implementation or not. And only call DefineMethodOverride if we
19711 are an explicit implementation.
19713 (Property.DefineMethod): Ditto.
19715 2002-02-11 Ravi Pratap <ravi@ximian.com>
19717 * expression.cs (BetterFunction): Catch hideous bug which was
19718 preventing us from detecting ambiguous calls due to implicit casts i.e
19721 2002-01-29 Miguel de Icaza <miguel@ximian.com>
19723 * support.cs (Pair): Remove un-needed method. I figured why I was
19724 getting the error in cs-parser.jay, the variable in a foreach loop
19725 is readonly, and the compiler does not really treat this as a variable.
19727 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
19728 instead of EQUALS in grammar.
19730 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19732 * expression.cs (Unary.DoResolve): Check whether the argument is
19735 2002-01-28 Miguel de Icaza <miguel@ximian.com>
19737 * support.cs: Api for Pair to set a value. Despite the fact that
19738 the variables are public the MS C# compiler refuses to compile
19739 code that accesses the field if the variable is part of a foreach
19742 * statement.cs (Fixed): Begin implementation of the fixed
19745 (Block.AddVariable): Return the VariableInfo on success and null
19746 on failure instead of true/false.
19748 * cs-parser.jay (foreach): Catch errors on variables already
19749 defined (we were ignoring this value before) and properly unwind
19750 the block hierarchy
19752 (fixed_statement): grammar for the fixed statement.
19754 2002-01-25 Miguel de Icaza <miguel@ximian.com>
19756 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19757 pointer types to be incretemented.
19759 (SizeOf): Implement.
19761 * cs-parser.jay (pointer_member_access): Implement
19762 expr->IDENTIFIER production.
19764 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19765 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19768 (Unary): Implement indirection.
19770 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19771 use in non-unsafe context).
19773 (SimpleName.DoResolve): Check for pointers in field access on safe
19776 (Expression.LoadFromPtr): Factor the load-indirect code in this
19777 function. This was duplicated in UnboxCast and ParameterReference
19779 2002-01-24 Miguel de Icaza <miguel@ximian.com>
19781 * expression.cs (ComposedCast): report an error if a pointer cast
19782 is used in a safe region.
19784 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19785 pointer type casts in unsafe context.
19787 * codegen.cs (EmitContext): Set up IsUnsafe.
19789 * cs-parser.jay (non_expression_type): Add productions for pointer
19792 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19793 code. We should not use force into static mode if the method is
19794 not virtual. Fixes bug in MIS
19796 * statement.cs (Do.Emit, While.Emit, For.Emit,
19797 Statement.EmitBoolExpression): Add support to Do and While to
19798 propagate infinite loop as `I do return' semantics.
19800 Improve the For case to also test for boolean constants.
19802 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19803 to the list of attributes we can add.
19805 Remove `EmitContext' argument.
19807 * class.cs (Method.Define): Apply parameter attributes.
19808 (Constructor.Define): Apply parameter attributes.
19809 (MethodCore.LabelParameters): Move here the core of labeling
19812 * support.cs (ReflectionParameters.ParameterModifier,
19813 InternalParameters.ParameterModifier): Use IsByRef on the type and
19814 only return the OUT bit for these parameters instead of in/out/ref
19817 This is because I miss-understood things. The ParameterInfo.IsIn
19818 and IsOut represent whether the parameter has the [In] and [Out]
19821 2002-01-22 Miguel de Icaza <miguel@ximian.com>
19823 * ecore.cs (FieldExpr.Emit): Release temporaries.
19825 * assign.cs (LocalTemporary.Release): new function.
19827 * codegen.cs (EmitContext.GetTemporaryStorage,
19828 EmitContext.FreeTemporaryStorage): Rework the way we deal with
19829 temporary storage. Now we can "put back" localbuilders when we
19832 2002-01-21 Miguel de Icaza <miguel@ximian.com>
19834 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19835 need to make a copy of the variable to generate verifiable code.
19837 2002-01-19 Miguel de Icaza <miguel@ximian.com>
19839 * driver.cs: Compute dynamically the system directory.
19841 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19842 Slower, but more generally useful. Used by the abstract
19843 registering implementation.
19845 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19846 the rules for the special rule on Type/instances. First check if
19847 we have the same name, and if so, try that special static path
19848 rather than the instance path.
19850 2002-01-18 Miguel de Icaza <miguel@ximian.com>
19852 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19855 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19856 Enum, ValueType, Delegate or Array for non-corlib compiles.
19858 * cs-tokenizer.cs: Catch long identifiers (645)
19860 * typemanager.cs (IndexerPropetyName): Ravi never tested this
19863 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19864 fix, we were returning too early, so we were not registering
19865 pending methods from abstract classes.
19867 Do not register pending methods if the class is abstract.
19869 * expression.cs (Conditional.DoResolve): Report circular implicit
19870 conversions when we neecd to compute it for conditional
19873 (Is.DoResolve): If the expression is always of the provided type,
19874 flag warning 183. If the expression can not ever be of the
19875 provided type flag warning 184.
19877 * class.cs: Catch 169 as well.
19879 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19882 2002-01-18 Nick Drochak <ndrochak@gol.com>
19884 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
19886 2002-01-17 Miguel de Icaza <miguel@ximian.com>
19888 * interface.cs: (PopulateMethod): Check for pointers being defined
19889 only if the unsafe context is active.
19890 (PopulateProperty): ditto.
19891 (PopulateIndexer): ditto.
19893 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19894 specified. If pointers are present, make sure that they are
19895 present in an unsafe context.
19896 (Constructor, Constructor.Define): ditto.
19897 (Field, Field.Define): ditto.
19898 (Property, Property.Define): ditto.
19899 (Event, Event.Define): ditto.
19901 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19902 hashtable if there are classes or structs defined.
19904 * expression.cs (LocalVariableReference.DoResolve): Simplify this
19905 code, as the constant resolution moved.
19907 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19908 the metadata, so we can flag error 133.
19910 * decl.cs (MemberCore.UnsafeOK): New function to test that a
19911 pointer is being declared in an unsafe context.
19913 2002-01-16 Miguel de Icaza <miguel@ximian.com>
19915 * modifiers.cs (Modifiers.Check): Require a Location argument.
19916 Report error 227 for Unsafe use.
19918 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19920 * statement.cs (For.Emit): If the test is null, then report that
19921 we do `return', as we wont reach anything afterwards.
19923 (Switch.SwitchGoverningType): Track the expression that matched
19926 * driver.cs: Allow negative numbers as an error code to flag.
19928 * cs-parser.jay: Handle 1551.
19930 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19932 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19934 * cs-parser.jay: Report 1518 (type declaration can only contain
19935 class, struct, interface, enum or delegate)
19937 (switch_label): Report 1523 (keywords `case' or `default' must
19940 (opt_switch_sections): Report 1522 (empty switch)
19942 * driver.cs: Report 1515 (response file specified multiple times)
19943 Report 1516 (Source file specified multiple times).
19945 * expression.cs (Argument.Resolve): Signal 1510
19947 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19948 access not allowed in static code)
19950 2002-01-11 Ravi Pratap <ravi@ximian.com>
19952 * typemanager.cs (IsPointerType): Utility method which we are going
19955 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19956 the object type, so we take care of that.
19958 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19960 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19961 added to non-params parameters :-)
19963 * typemanager.cs (CSharpName): Include 'void' type too.
19965 (void_ptr_type): Include in the set of core types.
19967 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
19970 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
19973 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
19974 completely forgotten about it.
19976 2002-01-10 Ravi Pratap <ravi@ximian.com>
19978 * cs-parser.jay (pointer_type): Add. This begins our implementation
19979 of parsing rules for unsafe code.
19981 (unsafe_statement): Implement.
19983 (embedded_statement): Modify to include the above.
19985 * statement.cs (Unsafe): Implement new class for unsafe blocks.
19987 * codegen.cs (EmitContext.InUnsafe): Add. This determines
19988 if the current context is an unsafe one.
19990 * cs-parser.jay (local_variable_pointer_type): Since local variable types
19991 are handled differently, we need separate rules for them.
19993 (local_variable_declaration): Update to use local_variable_pointer_type
19994 to allow variable declarations of unmanaged pointer types.
19996 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19997 in unsafe contexts.
19999 * ../errors/cs0214.cs : Add.
20001 2002-01-16 Nick Drochak <ndrochak@gol.com>
20003 * makefile: remove 'response' file when cleaning.
20005 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20007 * cs-parser.jay: Report 1524.
20009 2002-01-14 Miguel de Icaza <miguel@ximian.com>
20011 * typemanager.cs (RegisterMethod): drop checking if we have
20012 registered this from here
20014 2002-01-12 Miguel de Icaza <miguel@ximian.com>
20016 * class.cs (Method.EmitDestructor): Implement calling our base
20019 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20020 value of InFinally.
20022 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20023 this routine and will wrap the call in a try/catch block. Deal
20026 2002-01-11 Miguel de Icaza <miguel@ximian.com>
20028 * ecore.cs (Expression.MemberLookup): instead of taking a
20029 parameter `same_type' that was used to tell whether we could
20030 access private members we compute our containing type from the
20033 (FieldExpr): Added partial support for volatile fields. This does
20034 not work for volatile fields exposed from assemblies, as I can not
20035 figure out how to extract the modreq from it.
20037 Updated all the source files to use this.
20039 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20040 because it is referenced by MemberLookup very often.
20042 2002-01-09 Ravi Pratap <ravi@ximian.com>
20044 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20045 TypeBuilder.GetCustomAttributes to retrieve what we need.
20047 Get rid of redundant default_member_attr_type as this is the same as
20048 default_member_type which already exists.
20050 * interface.cs, attribute.cs : Update accordingly.
20052 2002-01-08 Miguel de Icaza <miguel@ximian.com>
20054 * typemanager.cs: Enable IndexerPropertyName again. It does not
20055 work for TYpeBuilders though. Ravi, can you please fix this?
20057 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20059 * expression.cs (Argument.Emit): Handle the case of ref objects
20060 being passed to ref functions;
20062 (ParameterReference.EmitLoad): Loads the content of the pointer
20063 without dereferencing.
20065 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20067 * cs-tokenizer.cs: Implemented the pre-processing expressions.
20069 2002-01-08 Ravi Pratap <ravi@ximian.com>
20071 * class.cs (Indexer.DefineMethod): Incorporate the interface
20072 type in the name of the method if we are doing explicit interface
20075 * expression.cs (ConversionExists): Remove as it is completely obsolete.
20077 (BetterConversion): Fix extremely trivial bug where we were referring to
20078 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20081 * ../errors/bug16.cs : Add although we have fixed it.
20083 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20085 * expression.cs (BaseIndexer): Begin implementation.
20087 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20089 * cs-parser.jay (indexer_declarator): Use qualified_identifier
20090 production directly to remove a shift/reduce, and implement
20091 explicit interface implementation.
20093 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20094 after a floating point suffix.
20096 * expression.cs (DoNumericPromotions): Improved the conversion for
20097 uint/uint. If we have a constant, we avoid doing a typecast to a
20100 * class.cs (Indexer): Implement explicit interface implementation
20103 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20105 * class.cs: make the default instance constructor public and hidebysig.
20107 2001-01-03 Ravi Pratap <ravi@ximian.com>
20109 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20110 so we can call it from elsewhere.
20112 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20113 we emit it internally if the class has a defined indexer; otherwise the user
20114 emits it by decorating the class definition with the DefaultMemberAttribute.
20116 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20117 attribute is not used on a type which defines an indexer.
20119 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20120 character when we skip whitespace.
20122 * ../errors/cs0646.cs : Add.
20124 2002-01-03 Miguel de Icaza <miguel@ximian.com>
20126 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20129 * makefile: Add practical target `mcs3.exe' which builds the third
20130 generation compiler.
20132 * expression.cs (New): Fix structures constructor calling.
20134 * class.cs (Property, Method, Indexer): Emit Final flag on the
20135 method if we are an interface implementation and we are not
20138 * ecore.cs (PropertyExpr): New public field `IsBase', tells
20139 whether this property is referencing a `base' method.
20141 * expression.cs (Invocation.EmitCall): take an extra argument:
20142 is_base, this is used to determine whether the `call' or
20143 `callvirt' opcode should be used.
20146 * delegate.cs: update EmitCall.
20148 * class.cs (Method.Define): Set NewSlot for the cases where we are
20149 not implementing an interface method.
20151 (Property.Define): ditto.
20153 2002-01-02 Miguel de Icaza <miguel@ximian.com>
20155 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20156 'r'. Allows mcs to parse itself fully.
20158 2002-01-02 Ravi Pratap <ravi@ximian.com>
20160 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20161 of the number of initializers that require the InitializeArray method.
20163 (CheckIndices): Store the Expression in all cases - not the plain value. Also
20164 update the above field where necessary.
20166 (MakeByteBlob): Update accordingly.
20168 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
20171 (EmitDynamicInitializers): Update in accordance with the new optimization.
20173 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20174 same OpCode applies.
20176 * cs-parser.jay : Fix some glaring errors I introduced.
20178 2002-01-01 Ravi Pratap <ravi@ximian.com>
20180 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20181 so that we can check for name clashes there too.
20183 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20184 for interface indexers.
20186 * interfaces.cs (Define): Emit the default member attribute.
20188 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20189 variable was being referred to while setting the value ;-)
20191 2002-01-01 Miguel de Icaza <miguel@ximian.com>
20193 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20194 byte-by-byte information when we know the data is zero.
20196 Make the block always a multiple of 4, because
20197 DefineInitializedData has a bug.
20199 * assign.cs: Fix, we should assign from the temporary, not from
20202 * expression.cs (MakeByteBlob): Fix my incorrect code.
20204 2001-12-31 Miguel de Icaza <miguel@ximian.com>
20206 * typemanager.cs (EnumToUnderlying): This function is used to get
20207 the underlying type from an enumeration, because it does not
20210 * constant.cs: Use the I4_S form for values between -128 and 127.
20212 * statement.cs (Block.LookupLabel): Looks up a label.
20213 (Block): Drop support for labeled blocks.
20215 (LabeledStatement): New kind of statement that represents a label
20218 (Goto): Finally implement this bad boy.
20220 * cs-parser.jay: Update to reflect new mechanism to implement
20223 2001-12-30 Miguel de Icaza <miguel@ximian.com>
20225 * codegen.cs (EmitContext.This): a codegen property that keeps the
20226 a single instance of this instead of creating many different this
20229 * delegate.cs (Delegate.DoResolve): Update to use the property;
20231 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20233 * expression.cs (BaseAccess.DoResolve): Ditto.
20235 2001-12-29 Ravi Pratap <ravi@ximian.com>
20237 * typemanager.cs (methodimpl_attr_type): Add to hold the type
20238 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20240 (InitCoreTypes): Update accordingly.
20242 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20243 so we can quickly store the state.
20245 (ApplyAttributes): Set the correct implementation flags
20246 for InternalCall methods.
20248 2001-12-29 Miguel de Icaza <miguel@ximian.com>
20250 * expression.cs (EmitCall): if a method is not virtual, then do
20251 not use callvirt on it.
20253 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20254 user defined stuff) requires the use of stobj, which takes an
20255 address on the stack instead of an array and an index. So emit
20256 the Ldelema operation for it.
20258 (EmitStoreOpcode): Use stobj for valuetypes.
20260 (UnaryMutator.EmitCode): Use the right 1 value depending on
20261 whether we are dealing with int64/uint64, float or doubles.
20263 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20264 constructors that I implemented last night.
20266 (Constructor.IsDefault): Fix to work properly for static
20269 * cs-parser.jay (CheckDef): report method signature errors.
20270 Update error number 103 to be 132.
20272 * decl.cs: New AdditionResult enumeration value: MethodExists.
20273 Although we do this check for methods later on in the semantic
20274 analysis, catching repeated default constructors is so easy that
20275 we catch these here.
20277 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20280 (ParameterReference.EmitAssign, Emit): handle
20283 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20284 (ArrayAccess.EmitStoreOpcode): ditto.
20286 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20288 * expression.cs (MakeByteBlob): Complete all the missing types
20289 (uint, short, ushort, byte, sbyte)
20291 * class.cs: Only init instance field initializers on instance
20294 Rename `constructors' to instance_constructors.
20296 (TypeContainer.AddConstructor): Only add constructors to the list
20297 if it is not static.
20299 Make sure that we handle default_static_constructor independently
20300 everywhere where we handle instance_constructors
20302 2001-12-28 Miguel de Icaza <miguel@ximian.com>
20304 * class.cs: Do not lookup or create a base initializer for a
20305 static constructor.
20307 (ConstructorInitializer.Resolve): use the proper type to lookup
20310 * cs-parser.jay: Report error 1585 (modifiers between type and name).
20312 * enum.cs, interface.cs: Remove CloseType, this is taken care by
20315 * decl.cs: CloseType is now an virtual method, the default
20316 implementation just closes this type.
20318 2001-12-28 Ravi Pratap <ravi@ximian.com>
20320 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20321 to PreserveSig by default. Also emit HideBySig on such methods.
20323 Basically, set the defaults to standard values.
20325 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20326 argument, if candidate is better, it can't be worse than the best !
20328 (Invocation): Re-write bits to differentiate between methods being
20329 applicable in their expanded form and their normal form - for params
20332 Get rid of use_standard everywhere as only standard conversions are allowed
20333 in overload resolution.
20335 More spec conformance.
20337 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20339 * driver.cs: Add --timestamp, to see where the compiler spends
20342 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20343 `this' in static code.
20345 (SimpleName.DoResolve): Implement in terms of a helper function
20346 that allows static-references to be passed upstream to
20349 (Expression.ResolveWithSimpleName): Resolve specially simple
20350 names when called by MemberAccess to implement the special
20353 (Expression.ImplicitReferenceConversion): Handle conversions from
20354 Null to reference types before others, as Null's type is
20357 * expression.cs (Invocation.EmitCall): Handle the special case of
20358 calling methods declared on a reference type from a ValueType
20359 (Base classes System.Object and System.Enum)
20361 (MemberAccess.Resolve): Only perform lookups on Enumerations if
20362 the left hand side is a TypeExpr, not on every enumeration.
20364 (Binary.Resolve): If types are reference types, then do a cast to
20365 object on operators != and == of both arguments.
20367 * typemanager.cs (FindMembers): Extract instance and static
20368 members if requested.
20370 * interface.cs (PopulateProperty): Use void_type instead of null
20371 as the return type for the setter method.
20373 (PopulateIndexer): ditto.
20375 2001-12-27 Ravi Pratap <ravi@ximian.com>
20377 * support.cs (ReflectionParameters): Fix minor bug where we
20378 were examining the wrong parameter for the ParamArray attribute.
20380 Cope with requests for the type of the parameter at position
20381 greater than the params parameter's. We now return the element
20382 type of the params array as that makes more sense.
20384 * expression.cs (Invocation.IsParamsMethodApplicable): Update
20385 accordingly as we no longer have to extract the element type
20388 (Invocation.OverloadResolve): Update.
20390 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20392 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20393 against IEnumerator, test whether the return value is a descendant
20394 of the IEnumerator interface.
20396 * class.cs (Indexer.Define): Use an auxiliary method to implement
20397 the other bits of the method definition. Begin support for
20398 explicit interface implementation.
20400 (Property.DefineMethod): Use TypeManager.void_type instead of null
20401 for an empty return value.
20403 2001-12-26 Miguel de Icaza <miguel@ximian.com>
20405 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20406 dealing with a FieldExpr which is composed of a FieldBuilder, in
20407 the code path we did extract the constant, but we should have
20408 obtained the underlying value to be able to cast it (otherwise we
20409 end up in an infinite loop, this is what Ravi was running into).
20411 (ArrayCreation.UpdateIndices): Arrays might be empty.
20413 (MemberAccess.ResolveMemberAccess): Add support for section
20414 14.5.4.1 that deals with the special case of E.I when E is a type
20415 and something else, that I can be a reference to a static member.
20417 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20418 handle a particular array type to create byte blobs, it is just
20419 something we dont generate byteblobs for.
20421 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20424 * location.cs (Push): remove the key from the hashtable that we
20425 are about to add. This happens for empty files.
20427 * driver.cs: Dispose files after we have parsed them.
20429 (tokenize): new function that only runs the tokenizer on its
20430 input, for speed testing.
20432 2001-12-26 Ravi Pratap <ravi@ximian.com>
20434 * class.cs (Event.Define): Define the private field only if there
20435 are no accessors defined.
20437 * expression.cs (ResolveMemberAccess): If there is no associated
20438 field with the event, that means we have an event defined with its
20439 own accessors and we should flag error cs0070 since transforming
20440 ourselves into a field is not valid in that case.
20442 * ecore.cs (SimpleName.DoResolve): Same as above.
20444 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20445 and charset to sane values.
20447 2001-12-25 Ravi Pratap <ravi@ximian.com>
20449 * assign.cs (DoResolve): Perform check on events only if they
20450 are being accessed outside the declaring type.
20452 * cs-parser.jay (event_declarations): Update rules to correctly
20453 set the type of the implicit parameter etc.
20455 (add_accessor, remove_accessor): Set current local parameters.
20457 * expression.cs (Binary): For delegate addition and subtraction,
20458 cast the return value from the method into the appropriate delegate
20461 2001-12-24 Ravi Pratap <ravi@ximian.com>
20463 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20464 of these as the workaround is unnecessary.
20466 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20467 delegate data - none of that is needed at all.
20469 Re-write bits to extract the instance expression and the delegate method
20472 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
20475 * attribute.cs (ApplyAttributes): New method to take care of common tasks
20476 of attaching attributes instead of duplicating code everywhere.
20478 * everywhere : Update code to do attribute emission using the above method.
20480 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20482 * expression.cs (IsParamsMethodApplicable): if there are not
20483 parameters, return immediately.
20485 * ecore.cs: The 0 literal can be implicity converted to an enum
20488 (SimpleName.DoResolve): First lookup the type, then lookup the
20491 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20492 want to get its address. If the InstanceExpression is not
20493 addressable, store the result in a temporary variable, then get
20496 * codegen.cs: Only display 219 errors on warning level or above.
20498 * expression.cs (ArrayAccess): Make it implement the
20499 IMemoryLocation interface.
20501 (Binary.DoResolve): handle the operator == (object a, object b)
20502 and operator != (object a, object b) without incurring into a
20503 BoxedCast (because 5 != o should never be performed).
20505 Handle binary enumerator operators.
20507 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20508 value type, otherwise use Ldelem_ref.
20510 Use precomputed names;
20512 (AddressOf): Implement address of
20514 * cs-parser.jay (labeled_statement): Fix recursive block
20515 addition by reworking the production.
20517 * expression.cs (New.DoEmit): New has a special case:
20519 If we are dealing with a ValueType, we have a few
20520 situations to deal with:
20522 * The target of New is a ValueType variable, that is
20523 easy, we just pass this as the variable reference
20525 * The target of New is being passed as an argument,
20526 to a boxing operation or a function that takes a
20529 In this case, we need to create a temporary variable
20530 that is the argument of New.
20533 2001-12-23 Ravi Pratap <ravi@ximian.com>
20535 * rootcontext.cs (LookupType): Check that current_type is not null before
20536 going about looking at nested types.
20538 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20539 not implement the IAssignMethod interface any more.
20541 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20542 where we tranform them into FieldExprs if they are being resolved from within
20543 the declaring type.
20545 * ecore.cs (SimpleName.DoResolve): Do the same here.
20547 * assign.cs (DoResolve, Emit): Clean up code considerably.
20549 * ../errors/bug10.cs : Add.
20551 * ../errors/cs0070.cs : Add.
20553 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20555 * assign.cs : Get rid of EventIsLocal everywhere.
20557 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20559 * ecore.cs (ConvertIntLiteral): finished the implementation.
20561 * statement.cs (SwitchLabel): Convert the value we are using as a
20562 key before looking up the table.
20564 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20566 * codegen.cs (EmitTopBlock): Require a Location argument now.
20568 * cs-parser.jay (constructor_declarator): We need to setup
20569 current_local_parameters before we parse the
20570 opt_constructor_initializer, to allow the variables to be bound
20571 to the constructor arguments.
20573 * rootcontext.cs (LookupType): First lookup nested classes in our
20574 class and our parents before we go looking outside our class.
20576 * expression.cs (ConstantFold): Extract/debox the values at the
20579 * rootcontext.cs (EmitCode): Resolve the constants first before we
20580 resolve the types. This is not really needed, but it helps debugging.
20582 * statement.cs: report location.
20584 * cs-parser.jay: pass location to throw statement.
20586 * driver.cs: Small bug fix.
20588 * report.cs: Updated format to be 4-zero filled digits.
20590 2001-12-22 Ravi Pratap <ravi@ximian.com>
20592 * expression.cs (CheckIndices): Fix minor bug where the wrong
20593 variable was being referred to ;-)
20595 (DoEmit): Do not call EmitStaticInitializers when the
20596 underlying type is System.Object.
20598 2001-12-21 Ravi Pratap <ravi@ximian.com>
20600 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20601 and do the usual workaround for SRE.
20603 * class.cs (MyEventBuilder.EventType): New member to get at the type
20604 of the event, quickly.
20606 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20608 * assign.cs (Assign.DoResolve): Handle the case when the target
20609 is an EventExpr and perform the necessary checks.
20611 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20614 (SimpleName.MemberStaticCheck): Include check for EventExpr.
20616 (EventExpr): Set the type in the constructor itself since we
20617 are meant to be born fully resolved.
20619 (EventExpr.Define): Revert code I wrote earlier.
20621 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20622 instance expression is null. The instance expression is a This in that case
20623 or a null, depending on whether it is a static method or not.
20625 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20626 refers to more than one method.
20628 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20629 and accordingly flag errors.
20631 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20633 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20635 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20637 * location.cs (ToString): Provide useful rutine.
20639 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20641 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20642 objects, return the actual integral boxed.
20644 * statement.cs (SwitchLabel): define an ILLabel for each
20647 (Switch.CheckSwitch): If the value is a Literal, extract
20648 the underlying literal.
20650 Also in the unused hashtable we had, add the SwitchLabel so we can
20651 quickly look this value up.
20653 * constant.cs: Implement a bunch of new constants. Rewrite
20654 Literal based on this. Made changes everywhere to adapt to this.
20656 * expression.cs (Expression.MakeByteBlob): Optimize routine by
20657 dereferencing array only once, and also copes with enumrations.
20659 bytes are two bytes wide, not one.
20661 (Cast): Perform constant conversions.
20663 * ecore.cs (TryImplicitIntConversion): Return literals instead of
20664 wrappers to the literals here.
20666 * expression.cs (DoNumericPromotions): long literals can converted
20667 to ulong implicity (this is taken care of elsewhere, but I was
20668 missing this spot).
20670 * ecore.cs (Expression.Literalize): Make the return type Literal,
20671 to improve type checking.
20673 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20675 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20677 * literal.cs: Revert code from ravi that checked the bounds. The
20678 bounds are sane by the definition of the type itself.
20680 * typemanager.cs: Fix implementation of ImplementsInterface. We
20681 need to actually look up in our parent hierarchy for interfaces
20684 * const.cs: Use the underlying type for enumerations
20686 * delegate.cs: Compute the basename for the delegate creation,
20687 that should fix the delegate test case, and restore the correct
20688 Type Lookup semantics in rootcontext
20690 * rootcontext.cs: Revert Ravi's last patch. The correct way of
20691 referencing a nested type with the Reflection API is using the "+"
20694 * cs-parser.jay: Do not require EOF token at the end.
20696 2001-12-20 Ravi Pratap <ravi@ximian.com>
20698 * rootcontext.cs (LookupType): Concatenate type names with
20699 a '.' instead of a '+' The test suite passes again.
20701 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20702 field of the enumeration.
20704 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20705 the case when the member is an EventExpr.
20707 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20708 static has an associated instance expression.
20710 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20712 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20714 * class.cs (Event.Define): Register event and perform appropriate checks
20717 We define the Add and Remove methods even if the use provides none because
20718 in that case, we provide default implementations ourselves.
20720 Define a private field of the type of the event. This is done by the CSC compiler
20721 and we should be doing it too ;-)
20723 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20724 More methods we use in code we generate.
20726 (multicast_delegate_type, delegate_type): Two separate types since the distinction
20729 (InitCoreTypes): Update accordingly for the above.
20731 * class.cs (Event.Emit): Generate code for default accessors that we provide
20733 (EmitDefaultMethod): Do the job in the above.
20735 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
20738 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20740 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20741 builders even if we were missing one.
20743 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20744 pass the Basename as our class name instead of the Name. The
20745 basename will be correctly composed for us.
20747 * parameter.cs (Paramters): Now takes a Location argument.
20749 * decl.cs (DeclSpace.LookupType): Removed convenience function and
20750 make all the code call directly LookupType in RootContext and take
20751 this chance to pass the Location information everywhere.
20753 * Everywhere: pass Location information.
20755 2001-12-19 Miguel de Icaza <miguel@ximian.com>
20757 * class.cs (Constructor.Define): Updated way of detecting the
20758 length of the parameters.
20760 (TypeContainer.DefineType): Use basename as the type name for
20763 (TypeContainer.Define): Do not recursively define types here, as
20764 definition is taken care in order by the RootContext.
20766 * tree.cs: Keep track of namespaces in a per-file basis.
20768 * parameter.cs (Parameter.ComputeSignature): Update to use
20771 (Parameters.GetSignature): ditto.
20773 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20774 instead of a TypeContainer.
20776 (Interface.SemanticAnalysis): Use `this' instead of our parent to
20777 resolve names. Because we need to be resolve in our context, not
20780 * driver.cs: Implement response files.
20782 * class.cs (TypeContainer.DefineType): If we are defined, do not
20783 redefine ourselves.
20785 (Event.Emit): Emit the code for add/remove handlers.
20786 (Event.Define): Save the MethodBuilders for add/remove.
20788 * typemanager.cs: Use pair here too.
20790 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20791 DictionaryEntry requires the first argument to be non-null.
20793 (enum_declaration): Compute full name for registering the
20796 (delegate_declaration): Instead of using
20797 formal_parameter_list, use opt_formal_parameter_list as the list
20800 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20801 (EventParsing): New property that controls whether `add' and
20802 `remove' are returned as tokens or identifiers (for events);
20804 2001-12-19 Ravi Pratap <ravi@ximian.com>
20806 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20807 use MyEventBuilder only and let it wrap the real builder for us.
20809 (MyEventBuilder): Revamp constructor etc.
20811 Implement all operations that we perform on EventBuilder in precisely the same
20814 (FindMembers): Update to use the EventBuilder member.
20816 (Event.Emit): Update accordingly.
20818 2001-12-18 Ravi Pratap <ravi@ximian.com>
20820 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20821 by calling the appropriate methods.
20823 (GetCustomAttributes): Make stubs as they cannot possibly do anything
20826 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20828 2001-12-17 Ravi Pratap <ravi@ximian.com>
20830 * delegate.cs (Delegate.Populate): Check that the return type
20831 and various parameters types are indeed accessible.
20833 * class.cs (Constructor.Define): Same here.
20835 (Field.Define): Ditto.
20837 (Event.Define): Ditto.
20839 (Operator.Define): Check that the underlying Method defined itself
20840 correctly - so it's MethodBuilder should not be null.
20842 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20843 expression happens to be null.
20845 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20846 members but as of now we don't seem to be able to do anything really useful with it.
20848 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20849 not the EventBuilder.
20851 2001-12-18 Miguel de Icaza <miguel@ximian.com>
20853 * cs-tokenizer.cs: Add support for defines.
20854 Add support for #if, #elif, #else, #endif
20856 (eval_var): evaluates a variable.
20857 (eval): stubbed for evaluating functions.
20859 * cs-parser.jay: Pass the defines information
20861 * driver.cs: Add --define command line option.
20863 * decl.cs: Move MemberCore here.
20865 Make it the base class for DeclSpace. This allows us to catch and
20866 report 108 and 109 for everything now.
20868 * class.cs (TypeContainer.Define): Extract all the members
20869 before populating and emit the warning 108 (new keyword required
20870 to override) instead of having each member implement this.
20872 (MemberCore.Define): New abstract method, we will be using this in
20873 the warning reporting engine in Populate.
20875 (Operator.Define): Adjust to new MemberCore protocol.
20877 * const.cs (Const): This does not derive from Expression, it is a
20878 temporary object we use to create fields, it is a MemberCore.
20880 * class.cs (Method.Define): Allow the entry point to be in a
20883 * driver.cs: Rewrite the argument handler to clean it up a bit.
20885 * rootcontext.cs: Made it just an auxiliary namespace feature by
20886 making everything static.
20888 * driver.cs: Adapt code to use RootContext type name instead of
20891 * delegate.cs: Remove RootContext argument.
20893 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20896 * class.cs (Event.Define): The lookup can fail.
20898 * cs-tokenizer.cs: Begin implementation of pre-procesor.
20900 * expression.cs: Resolve the this instance before invoking the code.
20902 2001-12-17 Miguel de Icaza <miguel@ximian.com>
20904 * cs-parser.jay: Add a production in element_access that allows
20905 the thing to become a "type" reference. This way we can parse
20906 things like "(string [])" as a type.
20908 Note that this still does not handle the more complex rules of
20912 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
20914 * ecore.cs: (CopyNewMethods): new utility function used to
20915 assemble the list of methods from running FindMembers.
20917 (MemberLookup): Rework FindMembers so that
20919 2001-12-16 Miguel de Icaza <miguel@ximian.com>
20921 * class.cs (TypeContainer): Remove Delegates who fail to be
20924 * delegate.cs (Populate): Verify that we dont get null return
20925 values. TODO: Check for AsAccessible.
20927 * cs-parser.jay: Use basename to emit error 574 (destructor should
20928 have the same name as container class), not the full name.
20930 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20931 possible representation.
20933 Also implements integer type suffixes U and L.
20935 2001-12-15 Miguel de Icaza <miguel@ximian.com>
20937 * expression.cs (ArrayCreation.DoResolve): We need to do the
20938 argument resolution *always*.
20940 * decl.cs: Make this hold the namespace. Hold the root context as
20942 (LookupType): Move here.
20944 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20946 * location.cs (Row, Name): Fixed the code, it was always returning
20947 references to the first file.
20949 * interface.cs: Register properties defined through interfaces.
20951 * driver.cs: Add support for globbing on the command line
20953 * class.cs (Field): Make it derive from MemberCore as well.
20956 2001-12-15 Ravi Pratap <ravi@ximian.com>
20958 * class.cs (Event::Define): Check that the type of the event is a delegate
20959 type else flag error #66.
20961 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20964 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20965 values of EntryPoint, CharSet etc etc.
20967 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20969 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20970 be null and we should ignore this. I am not sure if this is really clean. Apparently,
20971 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20972 which needs this to do its work.
20974 * ../errors/cs0066.cs : Add.
20976 2001-12-14 Miguel de Icaza <miguel@ximian.com>
20978 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20981 * class.cs: (MethodSignature.MethodSignature): Removed hack that
20982 clears out the parameters field.
20983 (MemberSignatureCompare): Cleanup
20985 (MemberCore): New base class used to share code between MethodCore
20988 (RegisterRequiredImplementations) BindingFlags.Public requires
20989 either BindingFlags.Instace or Static. Use instance here.
20991 (Property): Refactored code to cope better with the full spec.
20993 * parameter.cs (GetParameterInfo): Return an empty array instead
20996 * class.cs (Property): Abstract or extern properties have no bodies.
20998 * parameter.cs (GetParameterInfo): return a zero-sized array.
21000 * class.cs (TypeContainer.MethodModifiersValid): Move all the
21001 method modifier validation to the typecontainer so we can reuse
21002 this on properties.
21004 (MethodCore.ParameterTypes): return an empty sized array of types.
21006 (Property.Define): Test property modifier validity.
21008 Add tests for sealed/override too.
21010 (Method.Emit): abstract or extern methods have no bodies.
21012 2001-12-14 Ravi Pratap <ravi@ximian.com>
21014 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21017 (Method::Define, ::Emit): Modify accordingly.
21019 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21021 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21023 * makefile: Pass in /unsafe.
21025 2001-12-13 Miguel de Icaza <miguel@ximian.com>
21027 * class.cs (MakeKey): Kill routine.
21029 * class.cs (TypeContainer.Define): Correctly define explicit
21030 method implementations (they require the full interface name plus
21033 * typemanager.cs: Deply the PtrHashtable here and stop using the
21034 lame keys. Things work so much better.
21036 This of course broke everyone who depended on `RegisterMethod' to
21037 do the `test for existance' test. This has to be done elsewhere.
21039 * support.cs (PtrHashtable): A hashtable that avoid comparing with
21040 the object stupid Equals method (because, that like fails all over
21041 the place). We still do not use it.
21043 * class.cs (TypeContainer.SetRequiredInterface,
21044 TypeContainer.RequireMethods): Killed these two routines and moved
21045 all the functionality to RegisterRequiredImplementations.
21047 (TypeContainer.RegisterRequiredImplementations): This routine now
21048 registers all the implementations required in an array for the
21049 interfaces and abstract methods. We use an array of structures
21050 which can be computed ahead of time to reduce memory usage and we
21051 also assume that lookups are cheap as most classes will not
21052 implement too many interfaces.
21054 We also avoid creating too many MethodSignatures.
21056 (TypeContainer.IsInterfaceMethod): Update and optionally does not
21057 clear the "pending" bit if we find that there are problems with
21060 (TypeContainer.VerifyPendingMethods): Update to report errors of
21061 methods that look like implementations but are not.
21063 (TypeContainer.Define): Add support for explicit interface method
21066 2001-12-12 Miguel de Icaza <miguel@ximian.com>
21068 * typemanager.cs: Keep track of the parameters here instead of
21069 being a feature of the TypeContainer.
21071 * class.cs: Drop the registration of parameters here, as
21072 InterfaceMethods are also interface declarations.
21074 * delegate.cs: Register methods with the TypeManager not only with
21075 the TypeContainer. This code was buggy.
21077 * interface.cs: Full registation here.
21079 2001-12-11 Miguel de Icaza <miguel@ximian.com>
21081 * expression.cs: Remove reducer for binary expressions, it can not
21084 * const.cs: Put here the code that used to go into constant.cs
21086 * constant.cs: Put here the code for constants, this is a new base
21087 class for Literals.
21089 * literal.cs: Make Literal derive from Constant.
21091 2001-12-09 Miguel de Icaza <miguel@ximian.com>
21093 * statement.cs (Return.Emit): Report error 157 if the user
21094 attempts to return from a finally block.
21096 (Return.Emit): Instead of emitting a return, jump to the end of
21099 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21100 LocalBuilder to store the result of the function. ReturnLabel is
21101 the target where we jump.
21104 2001-12-09 Radek Doulik <rodo@ximian.com>
21106 * cs-parser.jay: remember alias in current namespace
21108 * ecore.cs (SimpleName::DoResolve): use aliases for types or
21111 * class.cs (LookupAlias): lookup alias in my_namespace
21113 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21115 (LookupAlias): lookup alias in this and if needed in parent
21118 2001-12-08 Miguel de Icaza <miguel@ximian.com>
21122 * rootcontext.cs: (ModuleBuilder) Made static, first step into
21123 making things static. I need this to avoid passing the
21124 TypeContainer when calling ParameterType.
21126 * support.cs (InternalParameters.ParameterType): Remove ugly hack
21127 that did string manipulation to compute the type and then call
21128 GetType. Use Parameter.ParameterType instead.
21130 * cs-tokenizer.cs: Consume the suffix for floating values.
21132 * expression.cs (ParameterReference): figure out whether this is a
21133 reference parameter or not. Kill an extra variable by computing
21134 the arg_idx during emission.
21136 * parameter.cs (Parameters.GetParameterInfo): New overloaded
21137 function that returns whether a parameter is an out/ref value or not.
21139 (Parameter.ParameterType): The type of the parameter (base,
21140 without ref/out applied).
21142 (Parameter.Resolve): Perform resolution here.
21143 (Parameter.ExternalType): The full type (with ref/out applied).
21145 * statement.cs (Using.Emit, Using.EmitExpression): Implement
21146 support for expressions on the using statement.
21148 2001-12-07 Miguel de Icaza <miguel@ximian.com>
21150 * statement.cs (Using.EmitLocalVariableDecls): Split the
21151 localvariable handling of the using statement.
21153 (Block.EmitMeta): Keep track of variable count across blocks. We
21154 were reusing slots on separate branches of blocks.
21156 (Try.Emit): Emit the general code block, we were not emitting it.
21158 Check the type of the declaration to be an IDisposable or
21159 something that can be implicity converted to it.
21161 Emit conversions if required.
21163 * ecore.cs (EmptyExpression): New utility class.
21164 (Expression.ImplicitConversionExists): New utility function.
21166 2001-12-06 Miguel de Icaza <miguel@ximian.com>
21168 * statement.cs (Using): Implement.
21170 * expression.cs (LocalVariableReference): Support read only variables.
21172 * statement.cs: Remove the explicit emit for the Leave opcode.
21173 (VariableInfo): Add a readonly field.
21175 2001-12-05 Miguel de Icaza <miguel@ximian.com>
21177 * ecore.cs (ConvCast): new class used to encapsulate the various
21178 explicit integer conversions that works in both checked and
21179 unchecked contexts.
21181 (Expression.ConvertNumericExplicit): Use new ConvCast class to
21182 properly generate the overflow opcodes.
21184 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21186 * statement.cs: The correct type for the EmptyExpression is the
21187 element_type, not the variable type. Ravi pointed this out.
21189 2001-12-04 Ravi Pratap <ravi@ximian.com>
21191 * class.cs (Method::Define): Handle PInvoke methods specially
21192 by using DefinePInvokeMethod instead of the usual one.
21194 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21195 above to do the task of extracting information and defining the method.
21197 2001-12-04 Ravi Pratap <ravi@ximian.com>
21199 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21200 of the condition for string type.
21202 (Emit): Move that here.
21204 (ArrayCreation::CheckIndices): Keep string literals in their expression
21207 (EmitDynamicInitializers): Handle strings appropriately.
21209 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21211 * codegen.cs (EmitContext): Replace multiple variables with a
21212 single pointer to the current Switch statement.
21214 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21217 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21221 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21224 (Foreach.Emit): Foreach on arrays was not setting
21225 up the loop variables (for break/continue).
21227 (GotoCase): Semi-implented.
21229 2001-12-03 Ravi Pratap <ravi@ximian.com>
21231 * attribute.cs (CheckAttribute): Handle system attributes by using
21232 Attribute.GetAttributes to examine information we need.
21234 (GetValidPlaces): Same here.
21236 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21238 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21240 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21242 (Method::Define): Set appropriate flags if we have a DllImport attribute.
21244 (Method::Emit): Handle the case when we are a PInvoke method.
21246 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21248 * expression.cs: Use ResolveWithSimpleName on compound names.
21250 2001-12-02 Ravi Pratap <ravi@ximian.com>
21252 * constant.cs (EmitConstant): Make sure we resolve the associated expression
21253 before trying to reduce it.
21255 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21257 * constant.cs (LookupConstantValue): Implement.
21259 (EmitConstant): Use the above in emitting the constant.
21261 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21262 that are user-defined by doing a LookupConstantValue on them.
21264 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21267 2001-11-29 Miguel de Icaza <miguel@ximian.com>
21269 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21271 (BaseAccess.DoResolve): Implement.
21273 (MemberAccess.DoResolve): Split this routine into a
21274 ResolveMemberAccess routine that can be used independently
21276 2001-11-28 Miguel de Icaza <miguel@ximian.com>
21278 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21279 As that share bits of the implementation. Is returns a boolean,
21280 while As returns the Type that is being probed.
21282 2001-12-01 Ravi Pratap <ravi@ximian.com>
21284 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21285 instead of a Literal - much easier.
21287 (EnumInTransit): Remove - utterly useless :-)
21289 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21291 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21293 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21294 chain when we have no associated expression.
21296 2001-11-30 Ravi Pratap <ravi@ximian.com>
21298 * constant.cs (Define): Use Location while reporting the errror.
21300 Also emit a warning when 'new' is used and there is no inherited
21303 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
21306 (LookupEnumValue): Implement to lookup an enum member's value and define it
21309 (Populate): Re-write accordingly to use the above routine.
21311 2001-11-27 Miguel de Icaza <miguel@ximian.com>
21313 * expression.cs (This): Fix prototype for DoResolveLValue to
21314 override the base class DoResolveLValue.
21316 * cs-parser.cs: Report errors cs574 and cs575 (destructor
21319 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21320 (we need to load the address of the field here). This fixes
21323 (FieldExpr.DoResolveLValue): Call the DoResolve
21324 function to initialize the Instance expression.
21326 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21327 correctly the GetEnumerator operation on a value type.
21329 * cs-parser.jay: Add more simple parsing error catches.
21331 * statement.cs (Switch): Add support for string switches.
21332 Handle null specially.
21334 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
21336 2001-11-28 Ravi Pratap <ravi@ximian.com>
21338 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21340 (declare_local_constant): New helper function.
21342 * statement.cs (AddConstant): Keep a separate record of constants
21344 (IsConstant): Implement to determine if a variable is a constant.
21346 (GetConstantExpression): Implement.
21348 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21350 * statement.cs (IsVariableDefined): Re-write.
21352 2001-11-27 Ravi Pratap <ravi@ximian.com>
21354 * class.cs (TypeContainer::FindMembers): Look for constants
21355 in the case when we are looking for MemberTypes.Field
21357 * expression.cs (MemberAccess::DoResolve): Check that in the
21358 case we are a FieldExpr and a Literal, we are not being accessed
21359 by an instance reference.
21361 * cs-parser.jay (local_constant_declaration): Implement.
21363 (declaration_statement): Implement for constant declarations.
21365 2001-11-26 Miguel de Icaza <miguel@ximian.com>
21367 * statement.cs (Switch): Catch double defaults.
21369 (Switch): More work on the switch() statement
21370 implementation. It works for integral values now, need to finish
21374 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21376 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21377 integer literals into other integer literals. To be used by
21380 2001-11-24 Ravi Pratap <ravi@ximian.com>
21382 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21385 (EmitDynamicInitializers): Cope with the above since we extract data
21386 directly from ArrayData now.
21388 (ExpectInitializers): Keep track of whether initializers are mandatory
21391 (Bounds): Make it a hashtable to prevent the same dimension being
21392 recorded for every element in that dimension.
21394 (EmitDynamicInitializers): Fix bug which prevented the Set array method
21397 Also fix bug which was causing the indices to be emitted in the reverse
21400 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21402 * expression.cs (ArrayCreation): Implement the bits that Ravi left
21403 unfinished. They do not work, because the underlying code is
21406 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21408 * cs-parser.jay: Remove bogus fixme.
21410 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21411 on Switch statement.
21413 2001-11-23 Ravi Pratap <ravi@ximian.com>
21415 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21418 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21419 parameter. Apparently, any expression is allowed.
21421 (ValidateInitializers): Update accordingly.
21423 (CheckIndices): Fix some tricky bugs thanks to recursion.
21425 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
21426 I was being completely brain-dead.
21428 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21429 and re-write acordingly.
21431 (DelegateInvocation): Re-write accordingly.
21433 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21435 (MakeByteBlob): Handle types more correctly.
21437 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21438 initialization from expressions but it is incomplete because I am a complete
21441 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21443 * statement.cs (If.Emit): Fix a bug that generated incorrect code
21444 on If. Basically, we have to return `true' (ie, we do return to
21445 our caller) only if both branches of the if return.
21447 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21448 short-circuit operators, handle them as short circuit operators.
21450 (Cast.DoResolve): Resolve type.
21451 (Cast.Cast): Take an expression as the target type.
21453 * cs-parser.jay (cast_expression): Remove old hack that only
21454 allowed a limited set of types to be handled. Now we take a
21455 unary_expression and we resolve to a type during semantic
21458 Use the grammar productions from Rhys to handle casts (this is
21459 not complete like Rhys syntax yet, we fail to handle that corner
21460 case that C# has regarding (-x), but we will get there.
21462 2001-11-22 Ravi Pratap <ravi@ximian.com>
21464 * class.cs (EmitFieldInitializer): Take care of the case when we have a
21465 field which is an array type.
21467 * cs-parser.jay (declare_local_variables): Support array initialization too.
21469 * typemanager.cs (MakeKey): Implement.
21471 (everywhere): Use the above appropriately.
21473 * cs-parser.jay (for_statement): Update for array initialization while
21474 declaring variables.
21476 * ecore.cs : The error message was correct, it's the variable's names that
21477 were misleading ;-) Make the code more readable.
21479 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21480 the correct type etc.
21482 (ConvertExplicit): Handle Enum types by examining the underlying type.
21484 2001-11-21 Ravi Pratap <ravi@ximian.com>
21486 * parameter.cs (GetCallingConvention): Always return
21487 CallingConventions.Standard for now.
21489 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21491 * expression.cs (Binary.ResolveOperator): Update the values of `l'
21492 and `r' after calling DoNumericPromotions.
21494 * ecore.cs: Fix error message (the types were in the wrong order).
21496 * statement.cs (Foreach.ProbeCollectionType): Need to pass
21497 BindingFlags.Instance as well
21499 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21500 implicit int literal conversion in an empty cast so that we
21501 propagate the right type upstream.
21503 (UnboxCast): new class used to unbox value types.
21504 (Expression.ConvertExplicit): Add explicit type conversions done
21507 (Expression.ImplicitNumericConversion): Oops, forgot to test for
21508 the target type before applying the implicit LongLiterals to ULong
21511 2001-11-21 Miguel de Icaza <miguel@ximian.com>
21513 * cs-parser.jay (for_statement): Reworked the way For works: now
21514 we declare manually any variables that are introduced in
21515 for_initializer to solve the problem of having out-of-band code
21516 emition (that is what got for broken).
21518 (declaration_statement): Perform the actual variable declaration
21519 that used to be done in local_variable_declaration here.
21521 (local_variable_declaration): Do not declare anything, just pass
21522 the information on a DictionaryEntry
21524 2001-11-20 Ravi Pratap <ravi@ximian.com>
21526 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21527 re-write of the logic to now make it recursive.
21529 (UpdateIndices): Re-write accordingly.
21531 Store element data in a separate ArrayData list in the above methods.
21533 (MakeByteBlob): Implement to dump the array data into a byte array.
21535 2001-11-19 Ravi Pratap <ravi@ximian.com>
21537 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21540 * constant.cs (Define): Implement.
21542 (EmitConstant): Re-write fully.
21544 Pass in location info.
21546 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21549 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21550 DictionaryEntry since we need location info too.
21552 (constant_declaration): Update accordingly.
21554 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21555 code into another method : UpdateIndices.
21557 2001-11-18 Ravi Pratap <ravi@ximian.com>
21559 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21560 some type checking etc.
21562 2001-11-17 Ravi Pratap <ravi@ximian.com>
21564 * expression.cs (ArrayCreation::ValidateInitializers): Implement
21565 bits to provide dimension info if the user skips doing that.
21567 Update second constructor to store the rank correctly.
21569 2001-11-16 Ravi Pratap <ravi@ximian.com>
21571 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21572 and try to implement.
21574 * ../errors/cs0150.cs : Add.
21576 * ../errors/cs0178.cs : Add.
21578 2001-11-16 Miguel de Icaza <miguel@ximian.com>
21580 * statement.cs: Implement foreach on multi-dimensional arrays.
21582 * parameter.cs (Parameters.GetParameterByName): Also lookup the
21583 name of the params argument.
21585 * expression.cs: Use EmitStoreOpcode to get the right opcode while
21586 initializing the array.
21588 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21589 we can use this elsewhere.
21591 * statement.cs: Finish implementation of foreach for single
21594 * cs-parser.jay: Use an out-of-band stack to pass information
21595 around, I wonder why I need this.
21597 foreach_block: Make the new foreach_block the current_block.
21599 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21600 function used to return a static Parameters structure. Used for
21601 empty parameters, as those are created very frequently.
21603 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21605 2001-11-15 Ravi Pratap <ravi@ximian.com>
21607 * interface.cs : Default modifier is private, not public. The
21608 make verify test passes again.
21610 2001-11-15 Ravi Pratap <ravi@ximian.com>
21612 * support.cs (ReflectionParameters): Fix logic to determine
21613 whether the last parameter is a params one. Test 9 passes again.
21615 * delegate.cs (Populate): Register the builders we define with
21616 RegisterParameterForBuilder. Test 19 passes again.
21618 * cs-parser.jay (property_declaration): Reference $6 instead
21619 of $$ to get at the location.
21621 (indexer_declaration): Similar stuff.
21623 (attribute): Ditto.
21625 * class.cs (Property): Register parameters for the Get and Set methods
21626 if they exist. Test 23 passes again.
21628 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21629 call to EmitArguments as we are sure there aren't any params arguments.
21630 Test 32 passes again.
21632 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21633 IndexOutOfRangeException.
21635 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21636 Test 33 now passes again.
21638 2001-11-15 Miguel de Icaza <miguel@ximian.com>
21640 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21641 broke a bunch of things. Will have to come up with a better way
21642 of tracking locations.
21644 * statement.cs: Implemented foreach for single dimension arrays.
21646 2001-11-09 Miguel de Icaza <miguel@ximian.com>
21648 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21649 an error. This removes the lookup from the critical path.
21651 * cs-parser.jay: Removed use of temporary_loc, which is completely
21654 2001-11-14 Miguel de Icaza <miguel@ximian.com>
21656 * support.cs (ReflectionParameters.ParameterModifier): Report
21657 whether the argument is a PARAMS argument or not.
21659 * class.cs: Set the attribute `ParamArrayAttribute' on the
21660 parameter argument.
21662 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21663 and cons_param_array_attribute (ConstructorInfo for
21664 ParamArrayAttribute).,
21666 * codegen.cs: Emit the return using the `Return' statement, that
21667 way we can report the error correctly for missing return values.
21669 * class.cs (Method.Emit): Clean up.
21671 * expression.cs (Argument.Resolve): Take another argument: the
21672 location where this argument is used. Notice that this is not
21673 part of the "Argument" class as to reduce the size of the
21674 structure (we know the approximate location anyways).
21676 Test if the argument is a variable-reference, if not, then
21677 complain with a 206.
21679 (Argument.Emit): Emit addresses of variables.
21681 (Argument.FullDesc): Simplify.
21683 (Invocation.DoResolve): Update for Argument.Resolve.
21685 (ElementAccess.DoResolve): ditto.
21687 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21688 method should be virtual, as this method is always virtual.
21690 (NewDelegate.DoResolve): Update for Argument.Resolve.
21692 * class.cs (ConstructorInitializer.DoResolve): ditto.
21694 * attribute.cs (Attribute.Resolve): ditto.
21696 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21698 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21700 * expression.cs (ParameterReference): Drop IStackStorage and implement
21701 IAssignMethod instead.
21703 (LocalVariableReference): ditto.
21705 * ecore.cs (FieldExpr): Drop IStackStorage and implement
21706 IAssignMethod instead.
21708 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21710 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21711 enumerations that are used in heavily used structures derive from
21712 byte in a laughable and pathetic attempt to reduce memory usage.
21713 This is the kind of pre-optimzations that you should not do at
21714 home without adult supervision.
21716 * expression.cs (UnaryMutator): New class, used to handle ++ and
21717 -- separatedly from the other unary operators. Cleans up the
21718 code, and kills the ExpressionStatement dependency in Unary.
21720 (Unary): Removed `method' and `Arguments' from this class, making
21721 it smaller, and moving it all to SimpleCall, so I can reuse this
21722 code in other locations and avoid creating a lot of transient data
21723 strucutres when not required.
21725 * cs-parser.jay: Adjust for new changes.
21727 2001-11-11 Miguel de Icaza <miguel@ximian.com>
21729 * enum.cs (Enum.Populate): If there is a failure during
21732 * cs-parser.jay (opt_enum_base): we used to catch type errors
21733 here, but this is really incorrect. The type error should be
21734 catched during semantic analysis.
21736 2001-12-11 Ravi Pratap <ravi@ximian.com>
21738 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21739 current_local_parameters as expected since I, in my stupidity, had forgotten
21742 * attribute.cs (GetValidPlaces): Fix stupid bug.
21744 * class.cs (Method::Emit): Perform check on applicability of attributes.
21746 (Constructor::Emit): Ditto.
21748 (Field::Emit): Ditto.
21750 (Field.Location): Store location information.
21752 (Property, Event, Indexer, Operator): Ditto.
21754 * cs-parser.jay (field_declaration): Pass in location for each field.
21756 * ../errors/cs0592.cs : Add.
21758 2001-11-12 Ravi Pratap <ravi@ximian.com>
21760 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21762 (InitCoreTypes): Update accordingly.
21764 (RegisterAttrType, LookupAttr): Implement.
21766 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21767 info about the same.
21769 (Resolve): Update to populate the above as necessary.
21771 (Error592): Helper.
21773 (GetValidPlaces): Helper to the above.
21775 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21777 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21779 2001-11-12 Ravi Pratap <ravi@ximian.com>
21781 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21783 * ../errors/cs0617.cs : Add.
21785 2001-11-11 Ravi Pratap <ravi@ximian.com>
21787 * enum.cs (Emit): Rename to Populate to be more consistent with what
21788 we expect it to do and when exactly it is called.
21790 * class.cs, rootcontext.cs : Update accordingly.
21792 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21793 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21795 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21797 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21798 of a fieldinfo using the above, when dealing with a FieldBuilder.
21800 2001-11-10 Ravi Pratap <ravi@ximian.com>
21802 * ../errors/cs0031.cs : Add.
21804 * ../errors/cs1008.cs : Add.
21806 * ../errrors/cs0543.cs : Add.
21808 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21811 (FindMembers): Implement.
21813 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21814 enums and delegates too.
21816 (enum_types): Rename to builder_to_enum.
21818 (delegate_types): Rename to builder_to_delegate.
21820 * delegate.cs (FindMembers): Implement.
21822 2001-11-09 Ravi Pratap <ravi@ximian.com>
21824 * typemanager.cs (IsEnumType): Implement.
21826 * enum.cs (Emit): Re-write parts to account for the underlying type
21827 better and perform checking etc.
21829 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21830 of the underlying type.
21832 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21835 * enum.cs (error31): Helper to report error #31.
21837 * cs-parser.jay (enum_declaration): Store location of each member too.
21839 * enum.cs (member_to_location): New hashtable.
21841 (AddEnumMember): Update location hashtable.
21843 (Emit): Use the location of each member while reporting errors.
21845 2001-11-09 Miguel de Icaza <miguel@ximian.com>
21847 * cs-parser.jay: A for_initializer if is a
21848 local_variable_declaration really ammount to have an implicit
21849 block with the variable declaration and no initializer for for.
21851 * statement.cs (For.Emit): Cope with null initializers.
21853 This fixes the infinite loop on for initializers.
21855 2001-11-08 Miguel de Icaza <miguel@ximian.com>
21857 * enum.cs: More cleanup.
21859 * ecore.cs: Remove dead code.
21861 * class.cs (Property.Emit): More simplification.
21862 (Event.Emit): ditto.
21864 Reworked to have less levels of indentation.
21866 2001-11-08 Ravi Pratap <ravi@ximian.com>
21868 * class.cs (Property): Emit attributes.
21878 * enum.cs (Emit): Ditto.
21880 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21883 * class.cs (Field, Event, etc.): Move attribute generation into the
21884 Emit method everywhere.
21886 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21887 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21888 as we had no way of defining nested enums !
21890 * rootcontext.cs : Adjust code accordingly.
21892 * typemanager.cs (AddEnumType): To keep track of enum types separately.
21894 2001-11-07 Ravi Pratap <ravi@ximian.com>
21896 * expression.cs (EvalConstantExpression): Move into ecore.cs
21898 * enum.cs (Enum): Rename some members and make them public and readonly
21899 according to our convention.
21901 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21904 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21906 (Enum::Emit): Write a simple version for now which doesn't try to compute
21907 expressions. I shall modify this to be more robust in just a while.
21909 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21911 (TypeContainer::CloseType): Create the Enum types too.
21913 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21915 * expression.cs (EvalConstantExpression): Get rid of completely.
21917 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21918 user-defined values and other cases.
21920 (IsValidEnumLiteral): Helper function.
21922 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
21923 out there in the case we had a literal FieldExpr.
21925 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21927 (Literalize): Revamp a bit to take two arguments.
21929 (EnumLiteral): New class which derives from Literal to wrap enum literals.
21931 2001-11-06 Ravi Pratap <ravi@ximian.com>
21933 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21935 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21937 (Resolve): Use the above to ensure we have proper initializers.
21939 2001-11-05 Ravi Pratap <ravi@ximian.com>
21941 * expression.cs (Expression::EvalConstantExpression): New method to
21942 evaluate constant expressions.
21944 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21946 2001-11-07 Miguel de Icaza <miguel@ximian.com>
21948 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21951 (Binary.ResolveOperator): Handle operator != (object a, object b)
21952 and operator == (object a, object b);
21954 (Binary.DoNumericPromotions): Indicate whether the numeric
21955 promotion was possible.
21957 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21960 Made the ArrayAccess implement interface IAssignMethod instead of
21961 IStackStore as the order in which arguments are passed reflects
21964 * assign.cs: Instead of using expr.ExprClass to select the way of
21965 assinging, probe for the IStackStore/IAssignMethod interfaces.
21967 * typemanager.cs: Load InitializeArray definition.
21969 * rootcontext.cs (RootContext.MakeStaticData): Used to define
21970 static data that can be used to initialize arrays.
21972 2001-11-05 Miguel de Icaza <miguel@ximian.com>
21974 * expression.cs: Handle operator== and operator!= for booleans.
21976 (Conditioal.Reduce): Implement reducer for the ?: operator.
21978 (Conditional.Resolve): Implement dead code elimination.
21980 (Binary.Resolve): Catch string literals and return a new
21981 concatenated string.
21983 (Unary.Reduce): Implement reduction of unary expressions.
21985 * ecore.cs: Split out the expression core handling here.
21987 (Expression.Reduce): New method used to perform constant folding
21988 and CSE. This is needed to support constant-expressions.
21990 * statement.cs (Statement.EmitBoolExpression): Pass true and false
21991 targets, and optimize for !x.
21993 2001-11-04 Ravi Pratap <ravi@ximian.com>
21995 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21996 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21997 set custom atttributes.
21999 * literal.cs (Literal::GetValue): New abstract method to return the actual
22000 value of the literal, cast as an object.
22002 (*Literal): Implement GetValue method.
22004 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22005 expressions to the arraylist but objects of type Argument.
22007 * class.cs (TypeContainer::Emit): Emit our attributes too.
22009 (Method::Emit, Constructor::Emit): Ditto.
22011 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22012 to be ignoring earlier.
22014 2001-11-03 Ravi Pratap <ravi@ximian.com>
22016 * attribute.cs (AttributeSection::Define): Implement to do the business
22017 of constructing a CustomAttributeBuilder.
22019 (Attribute): New trivial class. Increases readability of code.
22021 * cs-parser.jay : Update accordingly.
22023 (positional_argument_list, named_argument_list, named_argument): New rules
22025 (attribute_arguments): Use the above so that we are more correct.
22027 2001-11-02 Ravi Pratap <ravi@ximian.com>
22029 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22030 to perform all checks for a method with a params parameter.
22032 (Invocation::OverloadResolve): Update to use the above method and therefore
22033 cope correctly with params method invocations.
22035 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
22038 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22039 constructors in our parent too because we can't afford to miss out on
22042 * attribute.cs (AttributeSection): New name for the class Attribute
22044 Other trivial changes to improve readability.
22046 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22047 use the new class names.
22049 2001-11-01 Ravi Pratap <ravi@ximian.com>
22051 * class.cs (Method::Define): Complete definition for params types too
22053 (Indexer::Define): Ditto.
22055 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22056 Cope everywhere with a request for info about the array parameter.
22058 2001-11-01 Ravi Pratap <ravi@ximian.com>
22060 * tree.cs (RecordNamespace): Fix up to check for the correct key.
22062 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
22063 local_variable_type to extract the string corresponding to the type.
22065 (local_variable_type): Fixup the action to use the new helper method.
22067 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
22070 * expression.cs : Clean out code which uses the above.
22072 2001-10-31 Ravi Pratap <ravi@ximian.com>
22074 * typemanager.cs (RegisterMethod): Check if we already have an existing key
22075 and bale out if necessary by returning a false.
22077 (RegisterProperty): Ditto.
22079 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22080 and print out appropriate error messages.
22082 * interface.cs (everywhere): Ditto.
22084 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22085 location to constructor.
22087 * class.cs (Property, Event, Indexer): Update accordingly.
22089 * ../errors/cs111.cs : Added.
22091 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22092 of a method, as laid down by the spec.
22094 (Invocation::OverloadResolve): Use the above method.
22096 2001-10-31 Ravi Pratap <ravi@ximian.com>
22098 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22099 now take a TypeContainer and a Parameters object.
22101 (ParameterData): Modify return type of ParameterModifier method to be
22102 Parameter.Modifier and not a string.
22104 (ReflectionParameters, InternalParameters): Update accordingly.
22106 * expression.cs (Argument::GetParameterModifier): Same here.
22108 * support.cs (InternalParameters::ParameterType): Find a better way of determining
22109 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22110 symbol in it at all so maybe this is only for now.
22112 2001-10-30 Ravi Pratap <ravi@ximian.com>
22114 * support.cs (InternalParameters): Constructor now takes an extra argument
22115 which is the actual Parameters class.
22117 (ParameterDesc): Update to provide info on ref/out modifiers.
22119 * class.cs (everywhere): Update call to InternalParameters to pass in
22120 the second argument too.
22122 * support.cs (ParameterData): Add ParameterModifier, which is a method
22123 to return the modifier info [ref/out etc]
22125 (InternalParameters, ReflectionParameters): Implement the above.
22127 * expression.cs (Argument::ParameterModifier): Similar function to return
22128 info about the argument's modifiers.
22130 (Invocation::OverloadResolve): Update to take into account matching modifiers
22133 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22134 a new SetFormalParameters object which we pass to InternalParameters.
22136 2001-10-30 Ravi Pratap <ravi@ximian.com>
22138 * expression.cs (NewArray): Merge into the ArrayCreation class.
22140 2001-10-29 Ravi Pratap <ravi@ximian.com>
22142 * expression.cs (NewArray): Merge classes NewBuiltinArray and
22143 NewUserdefinedArray into one as there wasn't much of a use in having
22146 * expression.cs (Argument): Change field's name to ArgType from Type.
22148 (Type): New readonly property which returns the proper type, taking into
22149 account ref/out modifiers.
22151 (everywhere): Adjust code accordingly for the above.
22153 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22154 whether we are emitting for a ref or out parameter.
22156 * expression.cs (Argument::Emit): Use the above field to set the state.
22158 (LocalVariableReference::Emit): Update to honour the flag and emit the
22161 * parameter.cs (Attributes): Set the correct flags for ref parameters.
22163 * expression.cs (Argument::FullDesc): New function to provide a full desc.
22165 * support.cs (ParameterData): Add method ParameterDesc to the interface.
22167 (ReflectionParameters, InternalParameters): Implement the above method.
22169 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22172 (Invocation::FullMethodDesc): Ditto.
22174 2001-10-29 Miguel de Icaza <miguel@ximian.com>
22176 * cs-parser.jay: Add extra production for the second form of array
22179 * expression.cs (ArrayCreation): Update to reflect the above
22182 * Small changes to prepare for Array initialization.
22184 2001-10-28 Miguel de Icaza <miguel@ximian.com>
22186 * typemanager.cs (ImplementsInterface): interface might be null;
22187 Deal with this problem;
22189 Also, we do store negative hits on the cache (null values), so use
22190 this instead of calling t.GetInterfaces on the type everytime.
22192 2001-10-28 Ravi Pratap <ravi@ximian.com>
22194 * typemanager.cs (IsBuiltinType): New method to help determine the same.
22196 * expression.cs (New::DoResolve): Get rid of array creation code and instead
22197 split functionality out into different classes.
22199 (New::FormArrayType): Move into NewBuiltinArray.
22201 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22204 (NewBuiltinArray): New class to handle creation of built-in arrays.
22206 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22207 account creation of one-dimensional arrays.
22209 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22211 (NewUserdefinedArray::DoResolve): Implement.
22213 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22215 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22216 we maintain inside the TypeManager. This is necessary to perform lookups on the
22219 (LookupType): Update to perform GetType on the module builders too.
22221 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22223 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22225 2001-10-23 Ravi Pratap <ravi@ximian.com>
22227 * expression.cs (New::DoResolve): Implement guts of array creation.
22229 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22231 2001-10-27 Miguel de Icaza <miguel@ximian.com>
22233 * expression.cs: Fix bug I introduced lsat night that broke
22236 (Expression.Resolve): Report a 246 error (can not resolve name)
22237 if we find a SimpleName in the stream.
22239 (Expression.ResolveLValue): Ditto.
22241 (Expression.ResolveWithSimpleName): This function is a variant of
22242 ResolveName, this one allows SimpleNames to be returned without a
22243 warning. The only consumer of SimpleNames is MemberAccess
22245 2001-10-26 Miguel de Icaza <miguel@ximian.com>
22247 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22248 might arrive here. I have my doubts that this is correct.
22250 * statement.cs (Lock): Implement lock statement.
22252 * cs-parser.jay: Small fixes to support `lock' and `using'
22254 * cs-tokenizer.cs: Remove extra space
22256 * driver.cs: New flag --checked, allows to turn on integer math
22259 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22260 Threading.Monitor.Exit
22262 2001-10-23 Miguel de Icaza <miguel@ximian.com>
22264 * expression.cs (IndexerAccess::DoResolveLValue): Set the
22265 Expression Class to be IndexerAccess.
22267 Notice that Indexer::DoResolve sets the eclass to Value.
22269 2001-10-22 Miguel de Icaza <miguel@ximian.com>
22271 * class.cs (TypeContainer::Emit): Emit code for indexers.
22273 * assign.cs (IAssignMethod): New interface implemented by Indexers
22274 and Properties for handling assignment.
22276 (Assign::Emit): Simplify and reuse code.
22278 * expression.cs (IndexerAccess, PropertyExpr): Implement
22279 IAssignMethod, clean up old code.
22281 2001-10-22 Ravi Pratap <ravi@ximian.com>
22283 * typemanager.cs (ImplementsInterface): New method to determine if a type
22284 implements a given interface. Provides a nice cache too.
22286 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22289 (ConvertReferenceExplicit): Ditto.
22291 * delegate.cs (Delegate::Populate): Update to define the parameters on the
22292 various methods, with correct names etc.
22294 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
22295 Operator.UnaryNegation.
22297 * cs-parser.jay (operator_declarator): Be a little clever in the case where
22298 we have a unary plus or minus operator.
22300 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
22303 * everywhere : update accordingly.
22305 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22308 * class.cs (Method::Define): For the case where we are implementing a method
22309 inherited from an interface, we need to set the MethodAttributes.Final flag too.
22310 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22312 2001-10-21 Ravi Pratap <ravi@ximian.com>
22314 * interface.cs (FindMembers): Implement to work around S.R.E
22317 * typemanager.cs (IsInterfaceType): Implement.
22319 (FindMembers): Update to handle interface types too.
22321 * expression.cs (ImplicitReferenceConversion): Re-write bits which
22322 use IsAssignableFrom as that is not correct - it doesn't work.
22324 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22325 and accordingly override EmitStatement.
22327 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22328 using the correct logic :-)
22330 2001-10-19 Ravi Pratap <ravi@ximian.com>
22332 * ../errors/cs-11.cs : Add to demonstrate error -11
22334 2001-10-17 Miguel de Icaza <miguel@ximian.com>
22336 * assign.cs (Assign::Resolve): Resolve right hand side first, and
22337 then pass this as a hint to ResolveLValue.
22339 * expression.cs (FieldExpr): Add Location information
22341 (FieldExpr::LValueResolve): Report assignment to readonly
22344 (Expression::ExprClassFromMemberInfo): Pass location information.
22346 (Expression::ResolveLValue): Add new method that resolves an
22349 (Expression::DoResolveLValue): Default invocation calls
22352 (Indexers): New class used to keep track of indexers in a given
22355 (IStackStore): Renamed from LValue, as it did not really describe
22356 what this did. Also ResolveLValue is gone from this interface and
22357 now is part of Expression.
22359 (ElementAccess): Depending on the element access type
22361 * typemanager.cs: Add `indexer_name_type' as a Core type
22362 (System.Runtime.CompilerServices.IndexerNameAttribute)
22364 * statement.cs (Goto): Take a location.
22366 2001-10-18 Ravi Pratap <ravi@ximian.com>
22368 * delegate.cs (Delegate::VerifyDelegate): New method to verify
22369 if two delegates are compatible.
22371 (NewDelegate::DoResolve): Update to take care of the case when
22372 we instantiate a delegate from another delegate.
22374 * typemanager.cs (FindMembers): Don't even try to look up members
22375 of Delegate types for now.
22377 2001-10-18 Ravi Pratap <ravi@ximian.com>
22379 * delegate.cs (NewDelegate): New class to take care of delegate
22382 * expression.cs (New): Split the delegate related code out into
22383 the NewDelegate class.
22385 * delegate.cs (DelegateInvocation): New class to handle delegate
22388 * expression.cs (Invocation): Split out delegate related code into
22389 the DelegateInvocation class.
22391 2001-10-17 Ravi Pratap <ravi@ximian.com>
22393 * expression.cs (New::DoResolve): Implement delegate creation fully
22394 and according to the spec.
22396 (New::DoEmit): Update to handle delegates differently.
22398 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22399 because of which we were printing out arguments in reverse order !
22401 * delegate.cs (VerifyMethod): Implement to check if the given method
22402 matches the delegate.
22404 (FullDelegateDesc): Implement.
22406 (VerifyApplicability): Implement.
22408 * expression.cs (Invocation::DoResolve): Update to accordingly handle
22409 delegate invocations too.
22411 (Invocation::Emit): Ditto.
22413 * ../errors/cs1593.cs : Added.
22415 * ../errors/cs1594.cs : Added.
22417 * delegate.cs (InstanceExpression, TargetMethod): New properties.
22419 2001-10-16 Ravi Pratap <ravi@ximian.com>
22421 * typemanager.cs (intptr_type): Core type for System.IntPtr
22423 (InitCoreTypes): Update for the same.
22425 (iasyncresult_type, asynccallback_type): Ditto.
22427 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22430 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22433 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22434 the builders for the 4 members of a delegate type :-)
22436 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22439 * expression.cs (New::DoResolve): Implement guts for delegate creation.
22441 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22443 2001-10-15 Miguel de Icaza <miguel@ximian.com>
22445 * statement.cs (Break::Emit): Implement.
22446 (Continue::Emit): Implement.
22448 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
22449 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
22450 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
22451 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
22454 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22455 properties that track the label for the current loop (begin of the
22456 loop and end of the loop).
22458 2001-10-15 Ravi Pratap <ravi@ximian.com>
22460 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22461 use of emitting anything at all.
22463 * class.cs, rootcontext.cs : Get rid of calls to the same.
22465 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22467 (Populate): Define the constructor correctly and set the implementation
22470 * typemanager.cs (delegate_types): New hashtable to hold delegates that
22473 (AddDelegateType): Implement.
22475 (IsDelegateType): Implement helper method.
22477 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22479 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22480 and accordingly handle it.
22482 * delegate.cs (Populate): Take TypeContainer argument.
22483 Implement bits to define the Invoke method. However, I still haven't figured out
22484 how to take care of the native int bit :-(
22486 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
22487 Qualify the name of the delegate, not its return type !
22489 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22492 (StandardConversionExists): Checking for array types turns out to be recursive.
22494 (ConvertReferenceExplicit): Implement array conversion.
22496 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22498 2001-10-12 Ravi Pratap <ravi@ximian.com>
22500 * cs-parser.jay (delegate_declaration): Store the fully qualified
22501 name as it is a type declaration.
22503 * delegate.cs (ReturnType, Name): Rename members to these. Make them
22506 (DefineDelegate): Renamed from Define. Does the same thing essentially,
22507 as TypeContainer::DefineType.
22509 (Populate): Method in which all the definition of the various methods (Invoke)
22512 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22515 (CloseDelegate): Finally creates the delegate.
22517 * class.cs (TypeContainer::DefineType): Update to define delegates.
22518 (Populate, Emit and CloseType): Do the same thing here too.
22520 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22521 delegates in all these operations.
22523 2001-10-14 Miguel de Icaza <miguel@ximian.com>
22525 * expression.cs: LocalTemporary: a new expression used to
22526 reference a temporary that has been created.
22528 * assign.cs: Handle PropertyAccess back here, so that we can
22529 provide the proper semantic access to properties.
22531 * expression.cs (Expression::ConvertReferenceExplicit): Implement
22532 a few more explicit conversions.
22534 * modifiers.cs: `NEW' modifier maps to HideBySig.
22536 * expression.cs (PropertyExpr): Make this into an
22537 ExpressionStatement, and support the EmitStatement code path.
22539 Perform get/set error checking, clean up the interface.
22541 * assign.cs: recognize PropertyExprs as targets, and if so, turn
22542 them into toplevel access objects.
22544 2001-10-12 Miguel de Icaza <miguel@ximian.com>
22546 * expression.cs: PropertyExpr::PropertyExpr: use work around the
22549 * typemanager.cs: Keep track here of our PropertyBuilders again to
22550 work around lameness in SRE.
22552 2001-10-11 Miguel de Icaza <miguel@ximian.com>
22554 * expression.cs (LValue::LValueResolve): New method in the
22555 interface, used to perform a second resolution pass for LValues.
22557 (This::DoResolve): Catch the use of this in static methods.
22559 (This::LValueResolve): Implement.
22561 (This::Store): Remove warning, assigning to `this' in structures
22564 (Invocation::Emit): Deal with invocation of
22565 methods on value types. We need to pass the address to structure
22566 methods rather than the object itself. (The equivalent code to
22567 emit "this" for structures leaves the entire structure on the
22568 stack instead of a pointer to it).
22570 (ParameterReference::DoResolve): Compute the real index for the
22571 argument based on whether the method takes or not a `this' pointer
22572 (ie, the method is static).
22574 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22575 value types returned from functions when we need to invoke a
22576 method on the sturcture.
22579 2001-10-11 Ravi Pratap <ravi@ximian.com>
22581 * class.cs (TypeContainer::DefineType): Method to actually do the business of
22582 defining the type in the Modulebuilder or Typebuilder. This is to take
22583 care of nested types which need to be defined on the TypeBuilder using
22584 DefineNestedMethod.
22586 (TypeContainer::GetClassBases): Implement. Essentially the code from the
22587 methods in RootContext, only ported to be part of TypeContainer.
22589 (TypeContainer::GetInterfaceOrClass): Ditto.
22591 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22593 * interface.cs (Interface::DefineInterface): New method. Does exactly
22594 what RootContext.CreateInterface did earlier, only it takes care of nested types
22597 (Interface::GetInterfaces): Move from RootContext here and port.
22599 (Interface::GetInterfaceByName): Same here.
22601 * rootcontext.cs (ResolveTree): Re-write.
22603 (PopulateTypes): Re-write.
22605 * class.cs (TypeContainer::Populate): Populate nested types too.
22606 (TypeContainer::Emit): Emit nested members too.
22608 * typemanager.cs (AddUserType): Do not make use of the FullName property,
22609 instead just use the name argument passed in as it is already fully
22612 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22613 to TypeContainer mapping to see if a type is user-defined.
22615 * class.cs (TypeContainer::CloseType): Implement.
22617 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22618 the default constructor.
22620 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22623 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22625 * interface.cs (CloseType): Create the type here.
22627 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22630 Remove all the methods which are now in TypeContainer.
22632 2001-10-10 Ravi Pratap <ravi@ximian.com>
22634 * delegate.cs (Define): Re-write bits to define the delegate
22637 2001-10-10 Miguel de Icaza <miguel@ximian.com>
22639 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22641 * expression.cs (ImplicitReferenceConversion): handle null as well
22642 as a source to convert to any reference type.
22644 * statement.cs (Return): Perform any implicit conversions to
22645 expected return type.
22647 Validate use of return statement.
22649 * codegen.cs (EmitContext): Pass the expected return type here.
22651 * class.cs (Method, Constructor, Property): Pass expected return
22652 type to EmitContext.
22654 2001-10-09 Miguel de Icaza <miguel@ximian.com>
22656 * expression.cs: Make DoResolve take an EmitContext instead of a
22659 Replaced `l' and `location' for `loc', for consistency.
22661 (Error, Warning): Remove unneeded Tc argument.
22663 * assign.cs, literal.cs, constant.cs: Update to new calling
22666 * codegen.cs: EmitContext now contains a flag indicating whether
22667 code is being generated in a static method or not.
22669 * cs-parser.jay: DecomposeQI, new function that replaces the old
22670 QualifiedIdentifier. Now we always decompose the assembled
22671 strings from qualified_identifier productions into a group of
22674 2001-10-08 Miguel de Icaza <miguel@ximian.com>
22676 * rootcontext.cs: Deal with field-less struct types correctly now
22677 by passing the size option to Define Type.
22679 * class.cs: Removed hack that created one static field.
22681 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22683 * statement.cs: Moved most of the code generation here.
22685 2001-10-09 Ravi Pratap <ravi@ximian.com>
22687 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22690 (ElementAccess): Remove useless bits for now - keep checks as the spec
22693 2001-10-08 Ravi Pratap <ravi@ximian.com>
22695 * expression.cs (ElementAccess::DoResolve): Remove my crap code
22696 and start performing checks according to the spec.
22698 2001-10-07 Ravi Pratap <ravi@ximian.com>
22700 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22701 rank_specifiers instead.
22703 (rank_specifiers): Change the order in which the rank specifiers are stored
22705 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22707 * expression.cs (ElementAccess): Implement the LValue interface too.
22709 2001-10-06 Ravi Pratap <ravi@ximian.com>
22711 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22712 except that user defined conversions are not included.
22714 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
22715 perform the conversion of the return type, if necessary.
22717 (New::DoResolve): Check whether we are creating an array or an object
22718 and accordingly do the needful.
22720 (New::Emit): Same here.
22722 (New::DoResolve): Implement guts of array creation.
22724 (New::FormLookupType): Helper function.
22726 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22728 * codegen.cs: Removed most of the code generation here, and move the
22729 corresponding code generation bits to the statement classes.
22731 Added support for try/catch/finalize and throw.
22733 * cs-parser.jay: Added support for try/catch/finalize.
22735 * class.cs: Catch static methods having the flags override,
22736 virtual or abstract.
22738 * expression.cs (UserCast): This user cast was not really doing
22739 what it was supposed to do. Which is to be born in fully resolved
22740 state. Parts of the resolution were being performed at Emit time!
22744 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22746 * expression.cs: Implicity convert the result from UserCast.
22748 2001-10-05 Ravi Pratap <ravi@ximian.com>
22750 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22751 prevented it from working correctly.
22753 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22754 merely ConvertImplicit.
22756 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22758 * typemanager.cs: Make the LookupTypeContainer function static,
22759 and not per-instance.
22761 * class.cs: Make static FindMembers (the one that takes a Type
22764 * codegen.cs: Add EmitForeach here.
22766 * cs-parser.jay: Make foreach a toplevel object instead of the
22767 inline expansion, as we need to perform semantic analysis on it.
22769 2001-10-05 Ravi Pratap <ravi@ximian.com>
22771 * expression.cs (Expression::ImplicitUserConversion): Rename to
22772 UserDefinedConversion.
22774 (Expression::UserDefinedConversion): Take an extra argument specifying
22775 whether we look for explicit user conversions too.
22777 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22779 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22781 (ExplicitUserConversion): Make it a call to UserDefinedConversion
22782 with the appropriate arguments.
22784 * cs-parser.jay (cast_expression): Record location too.
22786 * expression.cs (Cast): Record location info.
22788 (Expression::ConvertExplicit): Take location argument.
22790 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22791 to determine if we are doing explicit conversions.
22793 (UserCast::Emit): Update accordingly.
22795 (Expression::ConvertExplicit): Report an error if everything fails.
22797 * ../errors/cs0030.cs : Add.
22799 2001-10-04 Miguel de Icaza <miguel@ximian.com>
22801 * modifiers.cs: If the ABSTRACT keyword is present, also set the
22802 virtual and newslot bits.
22804 * class.cs (TypeContainer::RegisterRequiredImplementations):
22805 Record methods we need.
22807 (TypeContainer::MakeKey): Helper function to make keys for
22808 MethodBases, since the Methodbase key is useless.
22810 (TypeContainer::Populate): Call RegisterRequiredImplementations
22811 before defining the methods.
22813 Create a mapping for method_builders_to_methods ahead of time
22814 instead of inside a tight loop.
22816 (::RequireMethods): Accept an object as the data to set into the
22817 hashtable so we can report interface vs abstract method mismatch.
22819 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22821 * report.cs: Make all of it static.
22823 * rootcontext.cs: Drop object_type and value_type computations, as
22824 we have those in the TypeManager anyways.
22826 Drop report instance variable too, now it is a global.
22828 * driver.cs: Use try/catch on command line handling.
22830 Add --probe option to debug the error reporting system with a test
22833 * report.cs: Add support for exiting program when a probe
22834 condition is reached.
22836 2001-10-03 Ravi Pratap <ravi@ximian.com>
22838 * expression.cs (Binary::DoNumericPromotions): Fix the case when
22839 we do a forcible conversion regardless of type, to check if
22840 ForceConversion returns a null.
22842 (Binary::error19): Use location to report error.
22844 (Unary::error23): Use location here too.
22846 * ../errors/cs0019.cs : Check in.
22848 * ../errors/cs0023.cs : Check in.
22850 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22851 case of a non-null MethodInfo object with a length of 0 !
22853 (Binary::ResolveOperator): Flag error if overload resolution fails to find
22854 an applicable member - according to the spec :-)
22855 Also fix logic to find members in base types.
22857 (Unary::ResolveOperator): Same here.
22859 (Unary::report23): Change name to error23 and make first argument a TypeContainer
22860 as I was getting thoroughly confused between this and error19 :-)
22862 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22863 (::FindMostEncompassedType): Implement.
22864 (::FindMostEncompassingType): Implement.
22865 (::StandardConversionExists): Implement.
22867 (UserImplicitCast): Re-vamp. We now need info about most specific
22868 source and target types so that we can do the necessary conversions.
22870 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22871 mathematical union with no duplicates.
22873 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22875 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22876 in order from base classes to child classes, so that we can in
22877 child classes look up in our parent for method names and
22878 attributes (required for handling abstract, virtual, new, override
22879 constructs: we need to instrospect our base class, and if we dont
22880 populate the classes in order, the introspection might be
22881 incorrect. For example, a method could query its parent before
22882 the parent has any methods and would determine that the parent has
22883 no abstract methods (while it could have had them)).
22885 (RootContext::CreateType): Record the order in which we define the
22888 2001-10-02 Miguel de Icaza <miguel@ximian.com>
22890 * class.cs (TypeContainer::Populate): Also method definitions can
22891 fail now, keep track of this.
22893 (TypeContainer::FindMembers): Implement support for
22894 DeclaredOnly/noDeclaredOnly flag.
22896 (Constructor::Emit) Return the ConstructorBuilder.
22898 (Method::Emit) Return the MethodBuilder.
22899 Check for abstract or virtual methods to be public.
22901 * rootcontext.cs (RootContext::CreateType): Register all the
22902 abstract methods required for the class to be complete and the
22903 interface methods that must be implemented.
22905 * cs-parser.jay: Report error 501 (method requires body if it is
22906 not marked abstract or extern).
22908 * expression.cs (TypeOf::Emit): Implement.
22910 * typemanager.cs: runtime_handle_type, new global type.
22912 * class.cs (Property::Emit): Generate code for properties.
22914 2001-10-02 Ravi Pratap <ravi@ximian.com>
22916 * expression.cs (Unary::ResolveOperator): Find operators on base type
22917 too - we now conform exactly to the spec.
22919 (Binary::ResolveOperator): Same here.
22921 * class.cs (Operator::Define): Fix minor quirk in the tests.
22923 * ../errors/cs0215.cs : Added.
22925 * ../errors/cs0556.cs : Added.
22927 * ../errors/cs0555.cs : Added.
22929 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22931 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22932 single integer which is really efficient
22934 2001-10-01 Ravi Pratap <ravi@ximian.com>
22936 * expression.cs (Expression::ImplicitUserConversion): Use location
22937 even in the case when we are examining True operators.
22939 * class.cs (Operator::Define): Perform extensive checks to conform
22940 with the rules for operator overloading in the spec.
22942 * expression.cs (Expression::ImplicitReferenceConversion): Implement
22943 some of the other conversions mentioned in the spec.
22945 * typemanager.cs (array_type): New static member for the System.Array built-in
22948 (cloneable_interface): For System.ICloneable interface.
22950 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22951 we start resolving the tree and populating types.
22953 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22955 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22957 * expression.cs (Expression::ExprClassFromMemberInfo,
22958 Expression::Literalize): Create literal expressions from
22959 FieldInfos which are literals.
22961 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22962 type casts, because they were wrong. The test suite in tests
22965 (ImplicitNumericConversion): ushort to ulong requires a widening
22968 Int32 constant to long requires widening cast as well.
22970 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22971 for integers because the type on the stack is not i4.
22973 2001-09-30 Miguel de Icaza <miguel@ximian.com>
22975 * expression.cs (report118): require location argument.
22977 * parameter.cs: Do not dereference potential null value.
22979 * class.cs: Catch methods that lack the `new' keyword when
22980 overriding a name. Report warnings when `new' is used without
22981 anything being there to override.
22983 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22985 * class.cs: Only add constructor to hashtable if it is non-null
22986 (as now constructors can fail on define).
22988 (TypeManager, Class, Struct): Take location arguments.
22990 Catch field instance initialization in structs as errors.
22992 accepting_filter: a new filter for FindMembers that is static so
22993 that we dont create an instance per invocation.
22995 (Constructor::Define): Catch errors where a struct constructor is
22998 * cs-parser.jay: Pass location information for various new
23001 * delegate.cs (Delegate): take a location argument.
23003 * driver.cs: Do not call EmitCode if there were problesm in the
23004 Definition of the types, as many Builders wont be there.
23006 * decl.cs (Decl::Decl): Require a location argument.
23008 * cs-tokenizer.cs: Handle properly hex constants that can not fit
23009 into integers, and find the most appropiate integer for it.
23011 * literal.cs: Implement ULongLiteral.
23013 * rootcontext.cs: Provide better information about the location of
23014 failure when CreateType fails.
23016 2001-09-29 Miguel de Icaza <miguel@ximian.com>
23018 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23021 * expression.cs (Binary::CheckShiftArguments): Add missing type
23023 (Binary::ResolveOperator): Add type to the logical and and logical
23024 or, Bitwise And/Or and Exclusive Or code paths, it was missing
23027 (Binary::DoNumericPromotions): In the case where either argument
23028 is ulong (and most signed types combined with ulong cause an
23029 error) perform implicit integer constant conversions as well.
23031 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23033 * expression.cs (UserImplicitCast): Method should always be
23035 (Invocation::BetterConversion): Simplified test for IntLiteral.
23037 (Expression::ImplicitNumericConversion): Split this routine out.
23038 Put the code that performs implicit constant integer conversions
23041 (Expression::Resolve): Become a wrapper around DoResolve so we can
23042 check eclass and type being set after resolve.
23044 (Invocation::Badness): Remove this dead function
23046 (Binary::ResolveOperator): Do not compute the expensive argumnets
23047 unless we have a union for it.
23049 (Probe::Emit): Is needs to do an isinst and then
23050 compare against null.
23052 (::CanConvert): Added Location argument. If the Location argument
23053 is null (Location.Null), then we do not report errors. This is
23054 used by the `probe' mechanism of the Explicit conversion. We do
23055 not want to generate an error for something that the user
23056 explicitly requested to be casted. But the pipeline for an
23057 explicit cast first tests for potential implicit casts.
23059 So for now, if the Location is null, it means `Probe only' to
23060 avoid adding another argument. Might have to revise this
23063 (ClassCast): New class used to type cast objects into arbitrary
23064 classes (used in Explicit Reference Conversions).
23066 Implement `as' as well.
23068 Reverted all the patches from Ravi below: they were broken:
23070 * The use of `level' as a mechanism to stop recursive
23071 invocations is wrong. That was there just to catch the
23072 bug with a strack trace but not as a way of addressing
23075 To fix the problem we have to *understand* what is going
23076 on and the interactions and come up with a plan, not
23077 just get things going.
23079 * The use of the type conversion cache that I proposed
23080 last night had an open topic: How does this work across
23081 protection domains. A user defined conversion might not
23082 be public in the location where we are applying the
23083 conversion, a different conversion might be selected
23084 (ie, private A->B (better) but public B->A (worse),
23085 inside A, A->B applies, but outside it, B->A will
23088 * On top of that (ie, even if the above is solved),
23089 conversions in a cache need to be abstract. Ie, `To
23090 convert from an Int to a Short use an OpcodeCast', not
23091 `To convert from an Int to a Short use the OpcodeCast on
23092 the variable 5' (which is what this patch was doing).
23094 2001-09-28 Ravi Pratap <ravi@ximian.com>
23096 * expression.cs (Invocation::ConversionExists): Re-write to use
23097 the conversion cache
23099 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23100 cache all conversions done, not just user-defined ones.
23102 (Invocation::BetterConversion): The real culprit. Use ConversionExists
23103 to determine if a conversion exists instead of acutually trying to
23104 perform the conversion. It's faster too.
23106 (Expression::ConvertExplicit): Modify to use ConversionExists to check
23107 and only then attempt the implicit conversion.
23109 2001-09-28 Ravi Pratap <ravi@ximian.com>
23111 * expression.cs (ConvertImplicit): Use a cache for conversions
23112 already found. Check level of recursion and bail out if necessary.
23114 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23116 * typemanager.cs (string_concat_string_string, string_concat_object_object):
23117 Export standard methods that we expect for string operations.
23119 * statement.cs (Block::UsageWarning): Track usage of variables and
23120 report the errors for not used variables.
23122 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23125 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23127 * codegen.cs: remove unnneded code
23129 * expression.cs: Removed BuiltinTypeAccess class
23131 Fix the order in which implicit conversions are
23134 The previous fixed dropped support for boxed conversions (adding a
23135 test to the test suite now)
23137 (UserImplicitCast::CanConvert): Remove test for source being null,
23138 that code is broken. We should not feed a null to begin with, if
23139 we do, then we should track the bug where the problem originates
23140 and not try to cover it up here.
23142 Return a resolved expression of type UserImplicitCast on success
23143 rather than true/false. Ravi: this is what I was talking about,
23144 the pattern is to use a static method as a "constructor" for
23147 Also, do not create arguments until the very last minute,
23148 otherwise we always create the arguments even for lookups that
23149 will never be performed.
23151 (UserImplicitCast::Resolve): Eliminate, objects of type
23152 UserImplicitCast are born in a fully resolved state.
23154 * typemanager.cs (InitCoreTypes): Init also value_type
23155 (System.ValueType).
23157 * expression.cs (Cast::Resolve): First resolve the child expression.
23159 (LValue): Add new method AddressOf to be used by
23162 Change the argument of Store to take an EmitContext instead of an
23163 ILGenerator, because things like FieldExpr need to be able to call
23164 their children expression to generate the instance code.
23166 (Expression::Error, Expression::Warning): Sugar functions for
23169 (Expression::MemberLookup): Accept a TypeContainer instead of a
23170 Report as the first argument.
23172 (Expression::ResolvePrimary): Killed. I still want to improve
23173 this as currently the code is just not right.
23175 (Expression::ResolveMemberAccess): Simplify, but it is still
23178 (Unary::Resolve): Catch errors in AddressOf operators.
23180 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23181 index to a byte for the short-version, or the compiler will choose
23182 the wrong Emit call, which generates the wrong data.
23184 (ParameterReference::Emit, ::Store): same.
23186 (FieldExpr::AddressOf): Implement.
23188 * typemanager.cs: TypeManager: made public variable instead of
23191 * driver.cs: document --fatal.
23193 * report.cs (ErrorMessage, WarningMessage): new names for the old
23194 Error and Warning classes.
23196 * cs-parser.jay (member_access): Turn built-in access to types
23197 into a normal simplename
23199 2001-09-27 Ravi Pratap <ravi@ximian.com>
23201 * expression.cs (Invocation::BetterConversion): Fix to cope
23202 with q being null, since this was introducing a bug.
23204 * expression.cs (ConvertImplicit): Do built-in conversions first.
23206 2001-09-27 Ravi Pratap <ravi@ximian.com>
23208 * expression.cs (UserImplicitCast::Resolve): Fix bug.
23210 2001-09-27 Ravi Pratap <ravi@ximian.com>
23212 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23213 I had introduced long ago (what's new ?).
23215 * expression.cs (UserImplicitCast::CanConvert): Static method to do
23216 the work of all the checking.
23217 (ConvertImplicit): Call CanConvert and only then create object if necessary.
23218 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23220 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23221 that is the right way.
23223 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
23224 overloading resolution. Use everywhere instead of cutting and pasting code.
23226 (Binary::ResolveOperator): Use MakeUnionSet.
23228 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
23229 we have to convert to bool types. Not complete yet.
23231 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23233 * typemanager.cs (TypeManager::CSharpName): support ushort.
23235 * expression.cs (Expression::TryImplicitIntConversion): Attempts
23236 to provide an expression that performsn an implicit constant int
23237 conversion (section 6.1.6).
23238 (Expression::ConvertImplicitRequired): Reworked to include
23239 implicit constant expression conversions.
23241 (Expression::ConvertNumericExplicit): Finished.
23243 (Invocation::Emit): If InstanceExpression is null, then it means
23244 that we perform a call on this.
23246 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23248 * expression.cs (Unary::Emit): Remove some dead code.
23249 (Probe): Implement Resolve and Emit for `is'.
23250 (Expression::ConvertImplicitRequired): Attempt to do constant
23251 expression conversions here. Maybe should be moved to
23252 ConvertImplicit, but I am not sure.
23253 (Expression::ImplicitLongConstantConversionPossible,
23254 Expression::ImplicitIntConstantConversionPossible): New functions
23255 that tell whether is it possible to apply an implicit constant
23256 expression conversion.
23258 (ConvertNumericExplicit): Started work on explicit numeric
23261 * cs-parser.jay: Update operator constants.
23263 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23264 (Parameters::GetSignature): Hook up VerifyArgs here.
23265 (Parameters::VerifyArgs): Verifies that no two arguments have the
23268 * class.cs (Operator): Update the operator names to reflect the
23269 ones that the spec expects (as we are just stringizing the
23272 * expression.cs (Unary::ResolveOperator): Fix bug: Use
23273 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23274 previous usage did only work for our methods.
23275 (Expression::ConvertImplicit): Handle decimal implicit numeric
23276 conversions as well.
23277 (Expression::InternalTypeConstructor): Used to invoke constructors
23278 on internal types for default promotions.
23280 (Unary::Emit): Implement special handling for the pre/post
23281 increment/decrement for overloaded operators, as they need to have
23282 the same semantics as the other operators.
23284 (Binary::ResolveOperator): ditto.
23285 (Invocation::ConversionExists): ditto.
23286 (UserImplicitCast::Resolve): ditto.
23288 2001-09-26 Ravi Pratap <ravi@ximian.com>
23290 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23291 operator, return after emitting body. Regression tests pass again !
23293 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23294 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23295 (Invocation::OverloadResolve): Ditto.
23296 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23298 * everywhere : update calls to the above methods accordingly.
23300 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23302 * assign.cs (Assign): Make it inherit from ExpressionStatement.
23304 * expression.cs (ExpressionStatement): New base class used for
23305 expressions that can appear in statements, so that we can provide
23306 an alternate path to generate expression that do not leave a value
23309 (Expression::Emit, and all the derivatives): We no longer return
23310 whether a value is left on the stack or not. Every expression
23311 after being emitted leaves a single value on the stack.
23313 * codegen.cs (EmitContext::EmitStatementExpression): Use the
23314 facilties of ExpressionStatement if possible.
23316 * cs-parser.jay: Update statement_expression.
23318 2001-09-25 Miguel de Icaza <miguel@ximian.com>
23320 * driver.cs: Change the wording of message
23322 2001-09-25 Ravi Pratap <ravi@ximian.com>
23324 * expression.cs (Binary::ResolveOperator): Had forgottten to set
23325 the type of the expression to the return type of the method if
23326 we have an overloaded operator match ! The regression tests pass again !
23327 (Unary::ResolveOperator): Ditto.
23329 * expression.cs (Invocation::ConversionExists): Correct the member lookup
23330 to find "op_Implicit", not "implicit" ;-)
23331 (UserImplicitCast): New class to take care of user-defined implicit conversions.
23332 (ConvertImplicit, ForceConversion): Take TypeContainer argument
23334 * everywhere : Correct calls to the above accordingly.
23336 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23337 (ConvertImplicit): Do user-defined conversion if it exists.
23339 2001-09-24 Miguel de Icaza <miguel@ximian.com>
23341 * assign.cs: track location.
23342 (Resolve): Use implicit conversions on assignment.
23344 * literal.cs: Oops. Not good, Emit of short access values should
23345 pass (Bytes) or the wrong argument will be selected.
23347 * expression.cs (Unary::Emit): Emit code for -expr.
23349 (Unary::ResolveOperator): Handle `Substract' for non-constants
23350 (substract from zero from the non-constants).
23351 Deal with Doubles as well.
23353 (Expression::ConvertImplicitRequired): New routine that reports an
23354 error if no implicit conversion exists.
23356 (Invocation::OverloadResolve): Store the converted implicit
23357 expressions if we make them
23359 2001-09-24 Ravi Pratap <ravi@ximian.com>
23361 * class.cs (ConstructorInitializer): Take a Location argument.
23362 (ConstructorBaseInitializer): Same here.
23363 (ConstructorThisInitializer): Same here.
23365 * cs-parser.jay : Update all calls accordingly.
23367 * expression.cs (Unary, Binary, New): Take location argument.
23368 Update accordingly everywhere.
23370 * cs-parser.jay : Update all calls to the above to take a location
23373 * class.cs : Ditto.
23375 2001-09-24 Ravi Pratap <ravi@ximian.com>
23377 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23378 (Invocation::BetterConversion): Same here
23379 (Invocation::ConversionExists): Ditto.
23381 (Invocation::ConversionExists): Implement.
23383 2001-09-22 Ravi Pratap <ravi@ximian.com>
23385 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23386 Also take an additional TypeContainer argument.
23388 * All over : Pass in TypeContainer as argument to OverloadResolve.
23390 * typemanager.cs (CSharpName): Update to check for the string type and return
23393 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23396 2001-09-21 Ravi Pratap <ravi@ximian.com>
23398 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23399 (Invocation::BetterFunction): Implement.
23400 (Invocation::BetterConversion): Implement.
23401 (Invocation::ConversionExists): Skeleton, no implementation yet.
23403 Okay, things work fine !
23405 2001-09-21 Miguel de Icaza <miguel@ximian.com>
23407 * typemanager.cs: declare and load enum_type, delegate_type and
23410 * expression.cs (Expression::Emit): Now emit returns a value that
23411 tells whether a value is left on the stack or not. This strategy
23412 might be reveted tomorrow with a mechanism that would address
23413 multiple assignments.
23414 (Expression::report118): Utility routine to report mismatches on
23417 (Unary::Report23): Report impossible type/operator combination
23420 (Unary::IsIncrementableNumber): Whether the type can be
23421 incremented or decremented with add.
23422 (Unary::ResolveOperator): Also allow enumerations to be bitwise
23424 (Unary::ResolveOperator): Implement ++, !, ~,
23426 (Invocation::Emit): Deal with new Emit convetion.
23428 * All Expression derivatives: Updated their Emit method to return
23429 whether they leave values on the stack or not.
23431 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23432 stack for expressions that are statements.
23434 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23436 * expression.cs (LValue): New interface. Must be implemented by
23438 (LocalVariableReference, ParameterReference, FieldExpr): Implement
23441 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23442 interface for generating code, simplifies the code.
23444 2001-09-20 Ravi Pratap <ravi@ximian.com>
23446 * expression.cs (everywhere): Comment out return statements in ::Resolve
23447 methods to avoid the warnings.
23449 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23451 * driver.cs (parse): Report error 2001 if we can not open the
23454 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23457 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23460 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23461 otherwise nested blocks end up with the same index.
23463 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23465 * expression.cs: Instead of having FIXMEs in the Resolve
23466 functions, throw exceptions so it is obvious that we are facing a
23469 * cs-parser.jay (invocation_expression): Pass Location information.
23471 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23472 Use a basename for those routines because .NET does not like paths
23475 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23478 2001-09-19 Miguel de Icaza <miguel@ximian.com>
23480 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23481 are loading the correct data types (throws an exception if not).
23482 (TypeManager::InitCoreTypes): Use CoreLookupType
23484 * expression.cs (Unary::ResolveOperator): return the child
23485 expression for expressions which are just +expr.
23486 (Unary::ResolveOperator): Return negative literals for -LITERAL
23487 expressions (otherwise they are Unary {Literal}).
23488 (Invocation::Badness): Take into account `Implicit constant
23489 expression conversions'.
23491 * literal.cs (LongLiteral): Implement long literal class.
23492 (IntLiteral): export the `Value' of the intliteral.
23494 2001-09-19 Ravi Pratap <ravi@ximian.com>
23496 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23498 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
23499 instead of 'Operator'
23501 * expression.cs (Binary::ResolveOperator): Update accordingly.
23502 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23505 * cs-parser.jay (unary_expression): Update to use the new names.
23507 * gen-treedump.cs (GetUnary): Same here.
23509 * expression.cs (Unary::Resolve): Implement.
23510 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
23511 operators are found instead of making noise ;-)
23512 (Unary::ResolveOperator): New method to do precisely the same thing which
23513 Binary::ResolveOperator does for Binary expressions.
23514 (Unary.method, .Arguments): Add.
23515 (Unary::OperName): Implement.
23516 (Unary::ForceConversion): Copy and Paste !
23518 * class.cs (Operator::Define): Fix a small bug for the case when we have
23521 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23522 for the inbuilt operators. Only overloading works for now ;-)
23524 2001-09-18 Miguel de Icaza <miguel@ximian.com>
23526 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23527 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23529 * expression.cs (This::Emit): Implement.
23530 (This::Resolve): Implement.
23531 (TypeOf:Resolve): Implement.
23532 (Expression::ResolveSimpleName): Add an implicit this to instance
23534 (MemberAccess::Resolve): Deal with Parameters and Fields.
23535 Bind instance variable to Field expressions.
23536 (FieldExpr::Instance): New field used to track the expression that
23537 represents the object instance.
23538 (FieldExpr::Resolve): Track potential errors from MemberLookup not
23540 (FieldExpr::Emit): Implement.
23542 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23543 the last instruction contains a return opcode to avoid generating
23544 the last `ret' instruction (this generates correct code, and it is
23545 nice to pass the peverify output).
23547 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23548 initializer for static and instance variables.
23549 (Constructor::Emit): Allow initializer to be null in the case of
23550 static constructors. Only emit initializer for instance
23553 (TypeContainer::FindMembers): Return a null array if there are no
23556 Also fix the code for the MemberTypes.Method branch, as it was not
23557 scanning that for operators (or tried to access null variables before).
23559 * assign.cs (Assign::Emit): Handle instance and static fields.
23563 * driver.cs: Stop compilation if there are parse errors.
23565 * cs-parser.jay (constructor_declaration): Provide default base
23566 initializer for non-static constructors.
23567 (constructor_declarator): Do not provide a default base
23568 initializers if none was specified.
23569 Catch the fact that constructors should not have parameters.
23571 * class.cs: Do not emit parent class initializers for static
23572 constructors, that should be flagged as an error.
23574 2001-09-18 Ravi Pratap <ravi@ximian.com>
23576 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23577 Move back code into TypeContainer::Populate.
23579 2001-09-18 Ravi Pratap <ravi@ximian.com>
23581 * class.cs (TypeContainer::AddConstructor): Fix the check to
23582 compare against Name, not Basename.
23583 (Operator::OpType): Change Plus and Minus to Add and Subtract.
23585 * cs-parser.jay : Update accordingly.
23587 * class.cs (TypeContainer::FindMembers): For the case where we are searching
23588 for methods, don't forget to look into the operators too.
23589 (RegisterMethodBuilder): Helper method to take care of this for
23590 methods, constructors and operators.
23591 (Operator::Define): Completely revamp.
23592 (Operator.OperatorMethod, MethodName): New fields.
23593 (TypeContainer::Populate): Move the registering of builders into
23594 RegisterMethodBuilder.
23595 (Operator::Emit): Re-write.
23597 * expression.cs (Binary::Emit): Comment out code path to emit method
23598 invocation stuff for the case when we have a user defined operator. I am
23599 just not able to get it right !
23601 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23603 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23606 (Expression::MemberLookup): Provide a version that allows to
23607 specify the MemberTypes and BindingFlags.
23609 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23610 so it was not fetching variable information from outer blocks.
23612 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23613 Beforefieldinit as it was buggy.
23615 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23616 that Ravi put here.
23618 * class.cs (Constructor::Emit): Only emit if block is not null.
23619 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23620 deal with this by semantically definining it as if the user had
23623 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23624 constructors as we now "emit" them at a higher level.
23626 (TypeContainer::DefineDefaultConstructor): Used to define the
23627 default constructors if none was provided.
23629 (ConstructorInitializer): Add methods Resolve and Emit.
23631 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23633 2001-09-17 Ravi Pratap <ravi@ximian.com>
23635 * class.cs (TypeContainer::EmitDefaultConstructor): Register
23636 the default constructor builder with our hashtable for methodbuilders
23639 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23640 and argument_count is 0 in which case we have a match.
23641 (Binary::ResolveOperator): More null checking and miscellaneous coding
23644 2001-09-17 Ravi Pratap <ravi@ximian.com>
23646 * rootcontext.cs (IsNameSpace): Compare against null.
23648 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23650 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23651 and Unary::Operator.
23653 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23656 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23657 we have overloaded operators.
23658 (Binary::ResolveOperator): Implement the part which does the operator overload
23661 * class.cs (Operator::Emit): Implement.
23662 (TypeContainer::Emit): Emit the operators we have too.
23664 * expression.cs (Binary::Emit): Update to emit the appropriate code for
23665 the case when we have a user-defined operator.
23667 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23669 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23671 2001-09-16 Ravi Pratap <ravi@ximian.com>
23673 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23674 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23675 (Constructor::Emit): Implement.
23676 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23677 if we have no work to do.
23678 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
23681 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23682 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23684 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23687 2001-09-15 Ravi Pratap <ravi@ximian.com>
23689 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23691 (Tree::RecordNamespace): Method to do what the name says ;-)
23692 (Tree::Namespaces): Property to get at the namespaces hashtable.
23694 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
23697 * rootcontext.cs (IsNamespace): Fixed it :-)
23699 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23701 * class.cs (TypeContainer::FindMembers): Add support for
23703 (MethodCore): New class that encapsulates both the shared aspects
23704 of a Constructor and a Method.
23705 (Method, Constructor): Factored pieces into MethodCore.
23707 * driver.cs: Added --fatal which makes errors throw exceptions.
23708 Load System assembly as well as part of the standard library.
23710 * report.cs: Allow throwing exceptions on errors for debugging.
23712 * modifiers.cs: Do not use `parent', instead use the real type
23713 container to evaluate permission settings.
23715 * class.cs: Put Ravi's patch back in. He is right, and we will
23716 have to cope with the
23718 2001-09-14 Ravi Pratap <ravi@ximian.com>
23720 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23721 FamORAssem, not FamANDAssem.
23723 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23725 * driver.cs: Added --parse option that only parses its input files
23728 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
23729 incorrect. IsTopLevel is not used to tell whether an object is
23730 root_types or not (that can be achieved by testing this ==
23731 root_types). But to see if this is a top-level *class* (not
23732 necessarly our "toplevel" container).
23734 2001-09-14 Ravi Pratap <ravi@ximian.com>
23736 * enum.cs (Enum::Define): Modify to call the Lookup method on the
23737 parent instead of a direct call to GetType.
23739 2001-09-14 Ravi Pratap <ravi@ximian.com>
23741 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23742 Modifiers.TypeAttr. This should just be a call to that method.
23744 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23745 object so that we can determine if we are top-level or not.
23747 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
23750 * enum.cs (Enum::Define): Ditto.
23752 * modifiers.cs (FieldAttr): Re-write.
23754 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23755 (TypeContainer::HaveStaticConstructor): New property to provide access
23756 to precisely that info.
23758 * modifiers.cs (MethodAttr): Re-write.
23759 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23761 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23762 of top-level types as claimed.
23764 2001-09-13 Miguel de Icaza <miguel@ximian.com>
23766 * expression.cs (MemberLookup): Fruitless attempt to lookup
23767 constructors. Maybe I need to emit default constructors? That
23768 might be it (currently .NET emits this for me automatically).
23769 (Invocation::OverloadResolve): Cope with Arguments == null.
23770 (Invocation::EmitArguments): new function, shared by the new
23771 constructor and us.
23772 (Invocation::Emit): Handle static and instance methods. Emit
23773 proper call instruction for virtual or non-virtual invocations.
23774 (New::Emit): Implement.
23775 (New::Resolve): Implement.
23776 (MemberAccess:Resolve): Implement.
23777 (MethodGroupExpr::InstanceExpression): used conforming to the spec
23778 to track instances.
23779 (FieldExpr::Resolve): Set type.
23781 * support.cs: Handle empty arguments.
23783 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23784 SimpleLookup): Auxiliary routines to help parse a qualifier
23787 Update qualifier_identifier rule.
23789 * codegen.cs: Removed debugging messages.
23791 * class.cs: Make this a global thing, this acts just as a "key" to
23792 objects that we might have around.
23794 (Populate): Only initialize method_builders_to_methods once.
23796 * expression.cs (PropertyExpr): Initialize type from the
23799 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23800 Resolve pattern. Attempt to implicitly convert value to boolean.
23803 * expression.cs: Set the type for the int32/int32 argument case.
23804 (Binary::ResolveOperator): Set the return type to boolean for
23805 comparission operators
23807 * typemanager.cs: Remove debugging print code.
23809 (Invocation::Resolve): resolve type.
23811 * class.cs: Allocate a MemberInfo of the correct size, as the code
23812 elsewhere depends on the test to reflect the correct contents.
23814 (Method::) Keep track of parameters, due to System.Reflection holes
23816 (TypeContainer::Populate): Keep track of MethodBuilders to Method
23819 (TypeContainer::FindMembers): Use ArrayList and then copy an array
23820 of the exact size and return that.
23822 (Class::LookupMethodByBuilder): New function that maps
23823 MethodBuilders to its methods. Required to locate the information
23824 on methods because System.Reflection bit us again.
23826 * support.cs: New file, contains an interface ParameterData and
23827 two implementations: ReflectionParameters and InternalParameters
23828 used to access Parameter information. We will need to grow this
23831 * expression.cs (Invocation::GetParameterData): implement a cache
23832 and a wrapper around the ParameterData creation for methods.
23833 (Invocation::OverloadResolve): Use new code.
23835 2001-09-13 Ravi Pratap <ravi@ximian.com>
23837 * class.cs (TypeContainer::EmitField): Remove and move into
23838 (Field::Define): here and modify accordingly.
23839 (Field.FieldBuilder): New member.
23840 (TypeContainer::Populate): Update accordingly.
23841 (TypeContainer::FindMembers): Implement.
23843 2001-09-13 Miguel de Icaza <miguel@ximian.com>
23845 * statement.cs: (VariableInfo::VariableType): New field to be
23846 initialized with the full type once it is resolved.
23848 2001-09-12 Miguel de Icaza <miguel@ximian.com>
23850 * parameter.cs (GetParameterInfo): Use a type cache to compute
23851 things only once, and to reuse this information
23853 * expression.cs (LocalVariableReference::Emit): Implement.
23854 (OpcodeCast::Emit): fix.
23856 (ParameterReference::Resolve): Implement.
23857 (ParameterReference::Emit): Implement.
23859 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23860 that are expressions need to stay as Expressions.
23862 * typemanager.cs (CSharpName): Returns the C# name of a type if
23865 * expression.cs (Expression::ConvertImplicit): New function that
23866 implements implicit type conversions.
23868 (Expression::ImplicitReferenceConversion): Implements implicit
23869 reference conversions.
23871 (EmptyCast): New type for transparent casts.
23873 (OpcodeCast): New type for casts of types that are performed with
23874 a sequence of bytecodes.
23876 (BoxedCast): New type used for casting value types into reference
23877 types. Emits a box opcode.
23879 (Binary::DoNumericPromotions): Implements numeric promotions of
23880 and computation of the Binary::Type.
23882 (Binary::EmitBranchable): Optimization.
23884 (Binary::Emit): Implement code emission for expressions.
23886 * typemanager.cs (TypeManager): Added two new core types: sbyte
23889 2001-09-12 Ravi Pratap <ravi@ximian.com>
23891 * class.cs (TypeContainer::FindMembers): Method which does exactly
23892 what Type.FindMembers does, only we don't have to use reflection. No
23893 implementation yet.
23895 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23896 typecontainer objects as we need to get at them.
23897 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23899 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23900 typecontainer object.
23902 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23903 of just a Report object.
23905 2001-09-11 Ravi Pratap <ravi@ximian.com>
23907 * class.cs (Event::Define): Go back to using the prefixes "add_" and
23909 (TypeContainer::Populate): Now define the delegates of the type too.
23910 (TypeContainer.Delegates): Property to access the list of delegates defined
23913 * delegates.cs (Delegate::Define): Implement partially.
23915 * modifiers.cs (TypeAttr): Handle more flags.
23917 2001-09-11 Ravi Pratap <ravi@ximian.com>
23919 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23921 (Operator::Define): Re-write logic to get types by using the LookupType method
23922 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23923 (Indexer::Define): Ditto.
23924 (Event::Define): Ditto.
23925 (Property::Define): Ditto.
23927 2001-09-10 Ravi Pratap <ravi@ximian.com>
23929 * class.cs (TypeContainer::Populate): Now define operators too.
23930 (TypeContainer.Operators): New property to access the list of operators
23932 (Operator.OperatorMethodBuilder): New member to hold the method builder
23933 for the operator we are defining.
23934 (Operator::Define): Implement.
23936 2001-09-10 Ravi Pratap <ravi@ximian.com>
23938 * class.cs (Event::Define): Make the prefixes of the accessor methods
23939 addOn_ and removeOn_
23941 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23942 of the location being passed in too. Ideally, this should go later since all
23943 error reporting should be done through the Report object.
23945 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23946 (Populate): Iterate thru the indexers we have and define them too.
23947 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23948 for the get and set accessors.
23949 (Indexer::Define): Implement.
23951 2001-09-09 Miguel de Icaza <miguel@ximian.com>
23953 * expression.cs (Binary::Resolve): Beginning of it. I scratched
23954 my previous implementation, did not work.
23956 * typemanager.cs: Add a couple of missing types (the longs).
23958 * literal.cs: Use TypeManager.bool_type instead of getting it.
23960 * expression.cs (EventExpr): New kind of expressions.
23961 (Expressio::ExprClassFromMemberInfo): finish
23963 2001-09-08 Miguel de Icaza <miguel@ximian.com>
23965 * assign.cs: Emit stores to static fields differently.
23967 2001-09-08 Ravi Pratap <ravi@ximian.com>
23969 * Merge in changes and adjust code to tackle conflicts. Backed out my
23970 code in Assign::Resolve ;-)
23972 2001-09-08 Ravi Pratap <ravi@ximian.com>
23974 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23975 instead Report.Error and also pass in the location.
23976 (CSharpParser::Lexer): New readonly property to return the reference
23977 to the Tokenizer object.
23978 (declare_local_variables): Use Report.Error with location instead of plain
23982 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23983 (Operator.CheckBinaryOperator): Ditto.
23985 * cs-parser.jay (operator_declarator): Update accordingly.
23987 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23988 (CheckBinaryOperator): Same here.
23990 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23991 on the name without any prefixes of namespace names etc. This is because we
23992 already might have something already fully qualified like
23993 'System.Console.WriteLine'
23995 * assign.cs (Resolve): Begin implementation. Stuck ;-)
23997 2001-09-07 Ravi Pratap <ravi@ximian.com>
23999 * cs-tokenizer.cs (location): Return a string which also contains
24002 * expression.cs (ElementAccess): New class for expressions of the
24003 type 'element access.'
24004 (BaseAccess): New class for expressions of the type 'base access.'
24005 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24008 * cs-parser.jay (element_access): Implement action.
24009 (base_access): Implement actions.
24010 (checked_expression, unchecked_expression): Implement.
24012 * cs-parser.jay (local_variable_type): Correct and implement.
24013 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24015 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24017 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24018 name and the specifiers.
24020 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24022 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
24023 making them all public ;-)
24025 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24028 2001-09-07 Miguel de Icaza <miguel@ximian.com>
24030 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24032 (FieldExpr, PropertyExprs): New resolved expressions.
24033 (SimpleName::MemberStaticCheck): Perform static checks for access
24034 to non-static fields on static methods. Maybe this should be
24035 generalized for MemberAccesses.
24036 (SimpleName::ResolveSimpleName): More work on simple name
24039 * cs-parser.jay (primary_expression/qualified_identifier): track
24040 the parameter index.
24042 * codegen.cs (CodeGen::Save): Catch save exception, report error.
24043 (EmitContext::EmitBoolExpression): Chain to expression generation
24044 instead of temporary hack.
24045 (::EmitStatementExpression): Put generic expression code generation.
24047 * assign.cs (Assign::Emit): Implement variable assignments to
24048 local variables, parameters and fields.
24050 2001-09-06 Miguel de Icaza <miguel@ximian.com>
24052 * statement.cs (Block::GetVariableInfo): New method, returns the
24053 VariableInfo for a variable name in a block.
24054 (Block::GetVariableType): Implement in terms of GetVariableInfo
24056 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24057 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24059 2001-09-06 Ravi Pratap <ravi@ximian.com>
24061 * cs-parser.jay (operator_declaration): Continue on my quest : update
24062 to take attributes argument.
24063 (event_declaration): Ditto.
24064 (enum_declaration): Ditto.
24065 (indexer_declaration): Ditto.
24067 * class.cs (Operator::Operator): Update constructor accordingly.
24068 (Event::Event): Ditto.
24070 * delegate.cs (Delegate::Delegate): Same here.
24072 * enum.cs (Enum::Enum): Same here.
24074 2001-09-05 Ravi Pratap <ravi@ximian.com>
24076 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24078 * ../tests/cs0658.cs : New file to demonstrate error 0658.
24080 * attribute.cs (Attributes): New class to encapsulate all attributes which were
24081 being passed around as an arraylist.
24082 (Attributes::AddAttribute): Method to add attribute sections.
24084 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24085 (struct_declaration): Update accordingly.
24086 (constant_declaration): Update.
24087 (field_declaration): Update.
24088 (method_header): Update.
24089 (fixed_parameter): Update.
24090 (parameter_array): Ditto.
24091 (property_declaration): Ditto.
24092 (destructor_declaration): Ditto.
24094 * class.cs (Struct::Struct): Update constructors accordingly.
24095 (Class::Class): Ditto.
24096 (Field::Field): Ditto.
24097 (Method::Method): Ditto.
24098 (Property::Property): Ditto.
24099 (TypeContainer::OptAttribute): update property's return type.
24101 * interface.cs (Interface.opt_attributes): New member.
24102 (Interface::Interface): Update to take the extra Attributes argument.
24104 * parameter.cs (Parameter::Parameter): Ditto.
24106 * constant.cs (Constant::Constant): Ditto.
24108 * interface.cs (InterfaceMemberBase): New OptAttributes field.
24109 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
24110 the attributes as a parameter.
24111 (InterfaceProperty): Update constructor call.
24112 (InterfaceEvent): Ditto.
24113 (InterfaceMethod): Ditto.
24114 (InterfaceIndexer): Ditto.
24116 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
24117 pass the attributes too.
24118 (interface_event_declaration): Ditto.
24119 (interface_property_declaration): Ditto.
24120 (interface_method_declaration): Ditto.
24121 (interface_declaration): Ditto.
24123 2001-09-05 Miguel de Icaza <miguel@ximian.com>
24125 * class.cs (Method::Define): Track the "static Main" definition to
24126 create an entry point.
24128 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24129 EntryPoint if we find it.
24131 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24132 (EmitContext::ig): Make this variable public.
24134 * driver.cs: Make the default output file be the first file name
24135 with the .exe extension.
24137 Detect empty compilations
24139 Handle various kinds of output targets. Handle --target and
24140 rename -t to --dumper.
24142 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24143 methods inherited from Expression return now an Expression. This
24144 will is used during the tree rewriting as we resolve them during
24147 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24148 the spec. Missing entirely is the information about
24149 accessability of elements of it.
24151 (Expression::ExprClassFromMemberInfo): New constructor for
24152 Expressions that creates a fully initialized Expression based on
24153 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24156 (Invocation::Resolve): Begin implementing resolution of invocations.
24158 * literal.cs (StringLiteral): Implement Emit.
24160 2001-09-05 Ravi Pratap <ravi@ximian.com>
24162 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24165 2001-09-04 Ravi Pratap <ravi@ximian.com>
24167 * cs-parser.jay (attribute_arguments): Implement actions.
24168 (attribute): Fix bug in production. Implement action.
24169 (attribute_list): Implement.
24170 (attribute_target): Implement.
24171 (attribute_target_specifier, opt_target_specifier): Implement
24172 (CheckAttributeTarget): New method to check if the attribute target
24174 (attribute_section): Implement.
24175 (opt_attributes): Implement.
24177 * attribute.cs : New file to handle attributes.
24178 (Attribute): Class to hold attribute info.
24180 * cs-parser.jay (opt_attribute_target_specifier): Remove production
24181 (attribute_section): Modify production to use 2 different rules to
24182 achieve the same thing. 1 s/r conflict down !
24183 Clean out commented, useless, non-reducing dimension_separator rules.
24185 * class.cs (TypeContainer.attributes): New member to hold list
24186 of attributes for a type.
24187 (Struct::Struct): Modify to take one more argument, the attribute list.
24188 (Class::Class): Ditto.
24189 (Field::Field): Ditto.
24190 (Method::Method): Ditto.
24191 (Property::Property): Ditto.
24193 * cs-parser.jay (struct_declaration): Update constructor call to
24194 pass in the attributes too.
24195 (class_declaration): Ditto.
24196 (constant_declaration): Ditto.
24197 (field_declaration): Ditto.
24198 (method_header): Ditto.
24199 (fixed_parameter): Ditto.
24200 (parameter_array): Ditto.
24201 (property_declaration): Ditto.
24203 * constant.cs (Constant::Constant): Update constructor similarly.
24204 Use System.Collections.
24206 * parameter.cs (Parameter::Parameter): Update as above.
24208 2001-09-02 Ravi Pratap <ravi@ximian.com>
24210 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24211 (TypeContainer.delegates): New member to hold list of delegates.
24213 * cs-parser.jay (delegate_declaration): Implement the action correctly
24214 this time as I seem to be on crack ;-)
24216 2001-09-02 Miguel de Icaza <miguel@ximian.com>
24218 * rootcontext.cs (RootContext::IsNamespace): new function, used to
24219 tell whether an identifier represents a namespace.
24221 * expression.cs (NamespaceExpr): A namespace expression, used only
24222 temporarly during expression resolution.
24223 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24224 utility functions to resolve names on expressions.
24226 2001-09-01 Miguel de Icaza <miguel@ximian.com>
24228 * codegen.cs: Add hook for StatementExpressions.
24230 * class.cs: Fix inverted test for static flag in methods.
24232 2001-09-02 Ravi Pratap <ravi@ximian.com>
24234 * class.cs (Operator::CheckUnaryOperator): Correct error number used
24235 to make it coincide with MS' number.
24236 (Operator::CheckBinaryOperator): Ditto.
24238 * ../errors/errors.txt : Remove error numbers added earlier.
24240 * ../errors/cs1019.cs : Test case for error # 1019
24242 * ../errros/cs1020.cs : Test case for error # 1020
24244 * cs-parser.jay : Clean out commented cruft.
24245 (dimension_separators, dimension_separator): Comment out. Ostensibly not
24246 used anywhere - non-reducing rule.
24247 (namespace_declarations): Non-reducing rule - comment out.
24249 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24250 with TypeContainer::AddEnum.
24252 * delegate.cs : New file for delegate handling classes.
24253 (Delegate): Class for declaring delegates.
24255 * makefile : Update.
24257 * cs-parser.jay (delegate_declaration): Implement.
24259 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
24261 * class.cs (Event::Define): Implement.
24262 (Event.EventBuilder): New member.
24264 * class.cs (TypeContainer::Populate): Update to define all enums and events
24266 (Events): New property for the events arraylist we hold. Shouldn't we move to using
24267 readonly fields for all these cases ?
24269 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24271 * class.cs (Property): Revamp to use the convention of making fields readonly.
24272 Accordingly modify code elsewhere.
24274 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24275 the Define method of the Property class.
24277 * class.cs : Clean up applied patch and update references to variables etc. Fix
24279 (TypeContainer::Populate): Update to define all the properties we have. Also
24280 define all enumerations.
24282 * enum.cs (Define): Implement.
24284 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24286 * cs-parser.jay (overloadable_operator): The semantic value is an
24287 enum of the Operator class.
24288 (operator_declarator): Implement actions.
24289 (operator_declaration): Implement.
24291 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24292 validity of definitions.
24293 (Operator::CheckBinaryOperator): Static method to check for binary operators
24294 (TypeContainer::AddOperator): New method to add an operator to a type.
24296 * cs-parser.jay (indexer_declaration): Added line to actually call the
24297 AddIndexer method so it gets added ;-)
24299 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
24300 already taken care of by the MS compiler ?
24302 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24304 * class.cs (Operator): New class for operator declarations.
24305 (Operator::OpType): Enum for the various operators.
24307 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24309 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24310 ostensibly handle this in semantic analysis.
24312 * cs-parser.jay (general_catch_clause): Comment out
24313 (specific_catch_clauses, specific_catch_clause): Ditto.
24314 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24315 (catch_args, opt_catch_args): New productions.
24316 (catch_clause): Rewrite to use the new productions above
24317 (catch_clauses): Modify accordingly.
24318 (opt_catch_clauses): New production to use in try_statement
24319 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24320 and re-write the code in the actions to extract the specific and
24321 general catch clauses by being a little smart ;-)
24323 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24324 Hooray, try and catch statements parse fine !
24326 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24328 * statement.cs (Block::GetVariableType): Fix logic to extract the type
24329 string from the hashtable of variables.
24331 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24332 I end up making that mistake ;-)
24333 (catch_clauses): Fixed gross error which made Key and Value of the
24334 DictionaryEntry the same : $1 !!
24336 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24338 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24340 * cs-parser.jay (event_declaration): Correct to remove the semicolon
24341 when the add and remove accessors are specified.
24343 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24345 * cs-parser.jay (IndexerDeclaration): New helper class to hold
24346 information about indexer_declarator.
24347 (indexer_declarator): Implement actions.
24348 (parsing_indexer): New local boolean used to keep track of whether
24349 we are parsing indexers or properties. This is necessary because
24350 implicit_parameters come into picture even for the get accessor in the
24351 case of an indexer.
24352 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24354 * class.cs (Indexer): New class for indexer declarations.
24355 (TypeContainer::AddIndexer): New method to add an indexer to a type.
24356 (TypeContainer::indexers): New member to hold list of indexers for the
24359 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24361 * cs-parser.jay (add_accessor_declaration): Implement action.
24362 (remove_accessor_declaration): Implement action.
24363 (event_accessors_declaration): Implement
24364 (variable_declarators): swap statements for first rule - trivial.
24366 * class.cs (Event): New class to hold information about event
24368 (TypeContainer::AddEvent): New method to add an event to a type
24369 (TypeContainer::events): New member to hold list of events.
24371 * cs-parser.jay (event_declaration): Implement actions.
24373 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24375 * cs-parser.jay (dim_separators): Implement. Make it a string
24376 concatenating all the commas together, just as they appear.
24377 (opt_dim_separators): Modify accordingly
24378 (rank_specifiers): Update accordingly. Basically do the same
24379 thing - instead, collect the brackets here.
24380 (opt_rank_sepcifiers): Modify accordingly.
24381 (array_type): Modify to actually return the complete type string
24382 instead of ignoring the rank_specifiers.
24383 (expression_list): Implement to collect the expressions
24384 (variable_initializer): Implement. We make it a list of expressions
24385 essentially so that we can handle the array_initializer case neatly too.
24386 (variable_initializer_list): Implement.
24387 (array_initializer): Make it a list of variable_initializers
24388 (opt_array_initializer): Modify accordingly.
24390 * expression.cs (New::NType): Add enumeration to help us
24391 keep track of whether we have an object/delegate creation
24392 or an array creation.
24393 (New:NewType, New::Rank, New::Indices, New::Initializers): New
24394 members to hold data about array creation.
24395 (New:New): Modify to update NewType
24396 (New:New): New Overloaded contructor for the array creation
24399 * cs-parser.jay (array_creation_expression): Implement to call
24400 the overloaded New constructor.
24402 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
24404 * class.cs (TypeContainer::Constructors): Return member
24405 constructors instead of returning null.
24407 2001-08-26 Miguel de Icaza <miguel@ximian.com>
24409 * typemanager.cs (InitCoreTypes): Initialize the various core
24410 types after we have populated the type manager with the user
24411 defined types (this distinction will be important later while
24412 compiling corlib.dll)
24414 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24415 on Expression Classification. Now all expressions have a method
24416 `Resolve' and a method `Emit'.
24418 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24419 generation from working. Also add some temporary debugging
24422 2001-08-24 Miguel de Icaza <miguel@ximian.com>
24424 * codegen.cs: Lots of code generation pieces. This is only the
24425 beginning, will continue tomorrow with more touches of polish. We
24426 handle the fundamentals of if, while, do, for, return. Others are
24427 trickier and I need to start working on invocations soon.
24429 * gen-treedump.cs: Bug fix, use s.Increment here instead of
24432 * codegen.cs (EmitContext): New struct, used during code
24433 emission to keep a context. Most of the code generation will be
24436 * cs-parser.jay: Add embedded blocks to the list of statements of
24437 this block. So code generation proceeds in a top down fashion.
24439 2001-08-23 Miguel de Icaza <miguel@ximian.com>
24441 * statement.cs: Add support for multiple child blocks.
24443 2001-08-22 Miguel de Icaza <miguel@ximian.com>
24445 * codegen.cs (EmitCode): New function, will emit the code for a
24446 Block of code given a TypeContainer and its ILGenerator.
24448 * statement.cs (Block): Standard public readonly optimization.
24449 (Block::Block constructors): Link children.
24450 (Block::Child): Child Linker.
24451 (Block::EmitVariables): Emits IL variable declarations.
24453 * class.cs: Drop support for MethodGroups here, delay until
24455 (Method::): Applied the same simplification that I did before, and
24456 move from Properties to public readonly fields.
24457 (Method::ParameterTypes): Returns the parameter types for the
24458 function, and implements a cache that will be useful later when I
24459 do error checking and the semantic analysis on the methods is
24461 (Constructor::GetCallingConvention): Renamed from CallingConvetion
24462 and made a method, optional argument tells whether this is a class
24463 or a structure to apply the `has-this' bit.
24464 (Method::GetCallingConvention): Implement, returns the calling
24466 (Method::Define): Defines the type, a second pass is performed
24467 later to populate the methods.
24469 (Constructor::ParameterTypes): implement a cache similar to the
24470 one on Method::ParameterTypes, useful later when we do semantic
24473 (TypeContainer::EmitMethod): New method. Emits methods.
24475 * expression.cs: Removed MethodGroup class from here.
24477 * parameter.cs (Parameters::GetCallingConvention): new method.
24479 2001-08-21 Miguel de Icaza <miguel@ximian.com>
24481 * class.cs (TypeContainer::Populate): Drop RootContext from the
24484 (Constructor::CallingConvention): Returns the calling convention.
24485 (Constructor::ParameterTypes): Returns the constructor parameter
24488 (TypeContainer::AddConstructor): Keep track of default constructor
24489 and the default static constructor.
24491 (Constructor::) Another class that starts using `public readonly'
24492 instead of properties.
24494 (Constructor::IsDefault): Whether this is a default constructor.
24496 (Field::) use readonly public fields instead of properties also.
24498 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24499 track of static constructors; If none is used, turn on
24500 BeforeFieldInit in the TypeAttributes.
24502 * cs-parser.jay (opt_argument_list): now the return can be null
24503 for the cases where there are no arguments.
24505 (constructor_declarator): If there is no implicit `base' or
24506 `this', then invoke the default parent constructor.
24508 * modifiers.cs (MethodAttr): New static function maps a set of
24509 modifiers flags into a MethodAttributes enum
24510 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
24511 MethodAttr, TypeAttr to represent the various mappings where the
24512 modifiers are used.
24513 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
24515 2001-08-19 Miguel de Icaza <miguel@ximian.com>
24517 * parameter.cs (GetParameterInfo): Fix bug where there would be no
24520 * interface.cs (PopulateIndexer): Implemented the code generator
24521 for interface indexers.
24523 2001-08-17 Miguel de Icaza <miguel@ximian.com>
24525 * interface.cs (InterfaceMemberBase): Now we track the new status
24528 (PopulateProperty): Implement property population. Woohoo! Got
24529 Methods and Properties going today.
24531 Removed all the properties for interfaces, and replaced them with
24532 `public readonly' fields.
24534 2001-08-16 Miguel de Icaza <miguel@ximian.com>
24536 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24537 initialize their hashtables/arraylists only when they are needed
24538 instead of doing this always.
24540 * parameter.cs: Handle refs and out parameters.
24542 * cs-parser.jay: Use an ArrayList to construct the arguments
24543 instead of the ParameterCollection, and then cast that to a
24546 * parameter.cs: Drop the use of ParameterCollection and use
24547 instead arrays of Parameters.
24549 (GetParameterInfo): Use the Type, not the Name when resolving
24552 2001-08-13 Miguel de Icaza <miguel@ximian.com>
24554 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24555 and instead use public readonly fields.
24557 * class.cs: Put back walking code for type containers.
24559 2001-08-11 Miguel de Icaza <miguel@ximian.com>
24561 * class.cs (MakeConstant): Code to define constants.
24563 * rootcontext.cs (LookupType): New function. Used to locate types
24566 2001-08-08 Miguel de Icaza <miguel@ximian.com>
24568 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
24569 this System.Reflection code is. Kudos to Microsoft
24571 * typemanager.cs: Implement a type cache and avoid loading all
24572 types at boot time. Wrap in LookupType the internals. This made
24573 the compiler so much faster. Wow. I rule!
24575 * driver.cs: Make sure we always load mscorlib first (for
24576 debugging purposes, nothing really important).
24578 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
24579 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
24581 * rootcontext.cs: Lookup types on their namespace; Lookup types
24582 on namespaces that have been imported using the `using' keyword.
24584 * class.cs (TypeContainer::TypeAttr): Virtualize.
24585 (Class::TypeAttr): Return attributes suitable for this bad boy.
24586 (Struct::TypeAttr): ditto.
24587 Handle nested classes.
24588 (TypeContainer::) Remove all the type visiting code, it is now
24589 replaced with the rootcontext.cs code
24591 * rootcontext.cs (GetClassBases): Added support for structs.
24593 2001-08-06 Miguel de Icaza <miguel@ximian.com>
24595 * interface.cs, statement.cs, class.cs, parameter.cs,
24596 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24597 Drop use of TypeRefs, and use strings instead.
24599 2001-08-04 Miguel de Icaza <miguel@ximian.com>
24603 * class.cs (Struct::Struct): set the SEALED flags after
24604 checking the modifiers.
24605 (TypeContainer::TypeAttr): new property, returns the
24606 TypeAttributes for a class.
24608 * cs-parser.jay (type_list): Oops, list production was creating a
24609 new list of base types.
24611 * rootcontext.cs (StdLib): New property.
24612 (GetInterfaceTypeByName): returns an interface by type name, and
24613 encapsulates error handling here.
24614 (GetInterfaces): simplified.
24615 (ResolveTree): Encapsulated all the tree resolution here.
24616 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24619 * driver.cs: Add support for --nostdlib, to avoid loading the
24620 default assemblies.
24621 (Main): Do not put tree resolution here.
24623 * rootcontext.cs: Beginning of the class resolution.
24625 2001-08-03 Miguel de Icaza <miguel@ximian.com>
24627 * rootcontext.cs: Provide better error reporting.
24629 * cs-parser.jay (interface_base): set our $$ to be interfaces.
24631 * rootcontext.cs (CreateInterface): Handle the case where there
24632 are no parent interfaces.
24634 (CloseTypes): Routine to flush types at the end.
24635 (CreateInterface): Track types.
24636 (GetInterfaces): Returns an array of Types from the list of
24637 defined interfaces.
24639 * typemanager.c (AddUserType): Mechanism to track user types (puts
24640 the type on the global type hash, and allows us to close it at the
24643 2001-08-02 Miguel de Icaza <miguel@ximian.com>
24645 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24646 RecordInterface instead.
24648 * cs-parser.jay: Updated to reflect changes above.
24650 * decl.cs (Definition): Keep track of the TypeBuilder type that
24651 represents this type here. Not sure we will use it in the long
24652 run, but wont hurt for now.
24654 * driver.cs: Smaller changes to accomodate the new code.
24656 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24659 * rootcontext.cs (CreateInterface): New method, used to create
24660 the System.TypeBuilder type for interfaces.
24661 (ResolveInterfaces): new entry point to resolve the interface
24663 (CodeGen): Property, used to keep track of the code generator.
24665 2001-07-26 Miguel de Icaza <miguel@ximian.com>
24667 * cs-parser.jay: Add a second production for delegate_declaration
24670 (enum_body): Put an opt_comma here instead of putting it on
24671 enum_body or enum_member_declarations so we can handle trailing
24672 commas on enumeration members. Gets rid of a shift/reduce.
24674 (type_list): Need a COMMA in the middle.
24676 (indexer_declaration): Tell tokenizer to recognize get/set
24678 * Remove old targets.
24680 * Re-add the parser target.
24682 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24684 * cs-parser.jay: Add precendence rules for a number of operators
24685 ot reduce the number of shift/reduce conflicts in the grammar.
24687 2001-07-17 Miguel de Icaza <miguel@ximian.com>
24689 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24692 Get rid of old crufty code.
24694 * rootcontext.cs: Use this to keep track of the parsed
24695 representation and the defined types available to the program.
24697 * gen-treedump.cs: adjust for new convention.
24699 * type.cs: Split out the type manager, and the assembly builder
24702 * typemanager.cs: the type manager will live here now.
24704 * cil-codegen.cs: And the code generator here.
24706 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
24708 * makefile: Fixed up for easy making.
24710 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24712 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24715 (unary_expression): Expand pre_increment_expression and
24716 post_decrement_expression to reduce a shift/reduce.
24718 2001-07-11 Simon Cozens
24720 * cs-tokenizer.cs: Hex numbers should begin with a 0.
24722 Improve allow_keyword_as_indent name.
24724 2001-06-19 Miguel de Icaza <miguel@ximian.com>
24726 * Adjustments for Beta2.
24728 2001-06-13 Miguel de Icaza <miguel@ximian.com>
24730 * decl.cs: Added `Define' abstract method.
24731 (InTransit): new property, used to catch recursive definitions.
24733 * interface.cs: Implement `Define'.
24735 * modifiers.cs: Map Modifiers.constants to
24736 System.Reflection.TypeAttribute flags.
24738 * class.cs: Keep track of types and user-defined types.
24739 (BuilderInit): New method for creating an assembly
24740 (ResolveType): New function to launch the resolution process, only
24741 used by interfaces for now.
24743 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24744 that are inserted into the name space.
24746 2001-06-08 Miguel de Icaza <miguel@ximian.com>
24748 * ARGH. I have screwed up my tree so many times due to the use of
24749 rsync rather than using CVS. Going to fix this at once.
24751 * driver.cs: Objetify driver. Load assemblies, use assemblies to
24754 2001-06-07 Miguel de Icaza <miguel@ximian.com>
24756 * Experiment successful: Use System.Type rather that our own
24759 2001-05-25 Miguel de Icaza <miguel@ximian.com>
24761 * cs-parser.jay: Removed nsAliases from here.
24763 Use new namespaces, handle `using XXX;'
24765 * namespace.cs: Reimplemented namespace handling, use a recursive
24766 definition of the class. Now we can keep track of using clauses
24767 and catch invalid using clauses.
24769 2001-05-24 Miguel de Icaza <miguel@ximian.com>
24771 * gen-treedump.cs: Adapted for all the renaming.
24773 * expression.cs (Expression): this class now has a Type property
24774 which returns an expression Type.
24776 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24777 `Type', as this has a different meaning now in the base
24779 2001-05-22 Miguel de Icaza <miguel@ximian.com>
24781 * interface.cs, class.cs: Removed from all the sources the
24782 references to signature computation, as we can not do method
24783 signature computation during the parsing time, as we are not
24784 trying to solve at that point distinguishing:
24788 void a (NS.Blah x) {}
24791 Which depending on the context might be valid or not, as we do not
24792 know if Blah is the same thing as NS.Blah at that point.
24794 * Redid everything so the code uses TypeRefs now instead of
24795 Types. TypeRefs are just temporary type placeholders, that need
24796 to be resolved. They initially have a pointer to a string and the
24797 current scope in which they are used. This is used later by the
24798 compiler to resolve the reference to an actual Type.
24800 * DeclSpace is no longer a CIR.Type, and neither are
24801 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
24802 are all DeclSpaces, but no Types.
24804 * type.cs (TypeRefManager): This implements the TypeRef manager,
24805 which keeps track of all the types that need to be resolved after
24806 the parsing has finished.
24808 2001-05-13 Miguel de Icaza <miguel@ximian.com>
24810 * ARGH. We are going to have to store `foreach' as a class rather
24811 than resolving it, as we need to verify error 1579 after name
24812 resolution. *OR* we could keep a flag that says `This request to
24813 IEnumerator comes from a foreach statement' which we can then use
24814 to generate the error.
24816 2001-05-10 Miguel de Icaza <miguel@ximian.com>
24818 * class.cs (TypeContainer.AddMethod): we now add methods to the
24819 MethodGroup instead of the method hashtable.
24821 * expression.cs: Add MethodGroup abstraction, which gets us one
24822 step closer to the specification in the way we handle method
24825 * cs-parser.jay (primary_expression): qualified_identifier now
24826 tried to match up an identifier to a local variable reference or
24827 to a parameter reference.
24829 current_local_parameters is now a parser global variable that
24830 points to the current parameters for the block, used during name
24833 (property_declaration): Now creates an implicit `value' argument to
24836 2001-05-09 Miguel de Icaza <miguel@ximian.com>
24838 * parameter.cs: Do not use `param' arguments as part of the
24839 signature, per the spec.
24841 2001-05-08 Miguel de Icaza <miguel@ximian.com>
24843 * decl.cs: Base class for classes, structs and interfaces. This
24844 is the "Declaration Space"
24846 * cs-parser.jay: Use CheckDef for checking declaration errors
24847 instead of having one on each function.
24849 * class.cs: Factor out some code for handling error handling in
24850 accordance to the "Declarations" section in the "Basic Concepts"
24851 chapter in the ECMA C# spec.
24853 * interface.cs: Make all interface member classes derive from
24854 InterfaceMemberBase.
24856 2001-05-07 Miguel de Icaza <miguel@ximian.com>
24858 * Many things: all interfaces are parsed and generated in
24859 gen-treedump. Support for member variables, constructors,
24860 destructors, properties, constants is there.
24862 Beginning of the IL backend, but very little done, just there for
24865 2001-04-29 Miguel de Icaza <miguel@ximian.com>
24867 * cs-parser.jay: Fix labeled statement.
24869 * cs-tokenizer.cs (escape): Escape " and ' always.
24870 ref_line, ref_name: keep track of the line/filename as instructed
24871 by #line by the compiler.
24874 2001-04-27 Miguel de Icaza <miguel@ximian.com>
24876 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24877 to match the values in System.CodeDOM.
24879 Divid renamed to Divide.
24881 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24883 (Statements.set): remove.
24885 * System.CodeDOM/CodeCatchClause.cs: always have a valid
24888 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24889 falseStatements always have valid values.
24891 * cs-parser.jay: Use System.CodeDOM now.