1 2006-03-09 Martin Baulig <martin@ximian.com>
3 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
4 `prepared' flag is set.
6 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
7 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
8 issues; see gtest-254.cs.
10 2006-03-07 Martin Baulig <martin@ximian.com>
12 * generic.cs (TypeManager.InferType): Allow infering
13 `IEnumerable<T>' with an array of T; see gtest-251.cs.
15 2006-03-06 Martin Baulig <martin@ximian.com>
18 (TypeManager.InferType): Fix gtest-250.cs.
21 (TypeManager.IsSubclassOf): Also check the base class.
24 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
27 2006-03-01 Raja R Harinath <rharinath@novell.com>
30 * expression.cs (ParameterReference.DoResolveBase): Change return
32 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
36 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
39 * typemanager.cs (GetFullNameSignature): Don't nullref on
42 2006-02-16 Martin Baulig <martin@ximian.com>
45 (TypeManager.GetGenericFieldDefinition): New public method; use it
46 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
48 2006-02-14 Martin Baulig <martin@ximian.com>
50 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
52 2006-02-14 Martin Baulig <martin@ximian.com>
55 (TypeManager.DropGenericMethodArguments): New public method; don't
56 use GetGenericMethodDefinition() on something which is not a
59 2006-02-14 Martin Baulig <martin@ximian.com>
62 (ConstraintChecker.CheckConstraints): If a type parameter has the
63 `struct' constraint, the type must be a non-nullable valuetype.
65 2006-02-10 Martin Baulig <martin@ximian.com>
68 (TypeManager.IsOverride): Make this work for instantiated methods
69 in a generic class; fixes #77509.
70 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
71 rather than calling it directly; fixes #77488.
73 2006-02-08 Martin Baulig <martin@ximian.com>
75 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
76 reporting into CheckConstraint() so we can use the correctly
79 2006-02-08 Martin Baulig <martin@ximian.com>
81 * expression.cs (BaseAccess): Add support for generic methods.
83 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
84 the new MethodGroupExpr.
86 2006-02-07 Martin Baulig <martin@ximian.com>
88 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
89 also reference types; fixes #77483.
91 2006-02-07 Martin Baulig <martin@ximian.com>
94 (TypeManager.IsGenericMethod): We now return whether something is
95 an instantiated generic method (and not a generic method def).
96 (TypeManager.IsGenericMethodDefinition): New public method.
99 (TypeManager.CSharpSignature): Only include type arguments for
100 "real" generic methods, not for any instantiated method.
101 (TypeManager.GetMethodName): Likewise, but also allow generic
102 method definitions here.
104 2006-02-06 Miguel de Icaza <miguel@novell.com>
106 * codegen.cs (EmitScopeInitFromBlock): check here the
107 capture_context, there is no need to make two calls to the
110 * anonymous.cs: Add some debugging messages that might help me
111 track other instances of this problem in the future (the
112 regression of test 467).
114 * cs-parser.jay: track the variable block, as we need to initalize
115 any captured variables declared in this block for the "catch"
116 portion of the "Try" statement.
118 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
119 scope initialization for captured variables.
121 Also, move the emit for the variables after the block location has
124 2006-02-06 Marek Safar <marek.safar@seznam.cz>
126 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
128 2006-02-06 Martin Baulig <martin@ximian.com>
130 * class.cs (TypeContainer.DefineType): If we're a struct, pass
131 `TypeManager.value_type' as parent type to
132 ModuleBuilder.DefineType(). Fixes #77358.
134 2006-02-02 Miguel de Icaza <miguel@novell.com>
136 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
137 commit yesterday, the initialization for the roots is necessary.
138 What is not necessary is the scope activation.
140 2006-02-02 Raja R Harinath <rharinath@novell.com>
142 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
143 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
145 (Argument.Resolve): Remove CS0206 checks.
147 2006-02-01 Miguel de Icaza <miguel@novell.com>
149 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
150 scopes for all the roots, the scopes will now be emitted when the
151 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
153 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
154 code. This reduces a lot of existing cruft.
156 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
157 that the ScopeInfo is generated as we enter the scope, not at the
158 time of use, which is what we used to do before.
160 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
161 every time a Block is about to be emitted if we have a
164 2006-02-01 Raja R Harinath <rharinath@novell.com>
166 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
167 attribute for mscorlib too.
169 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
171 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
173 * typemanager.cs (cons_param_array_attribute): Make private.
174 (Reset): Set it to null.
175 (InitCoreHelpers): Don't initialize it.
176 (ConsParamArrayAttribute): New. Initialize it as needed.
177 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
179 2006-01-31 Miguel de Icaza <miguel@novell.com>
181 * expression.cs: There might be errors reported during the
182 selection of applicable methods. If there are errors, do not
183 continue execution as it will lead the compiler to crash.
185 2006-01-30 Miguel de Icaza <miguel@novell.com>
187 * expression.cs: Member access is not allowed on anonymous
188 methods. Fixes #77402.
190 2006-01-30 Raja R Harinath <rharinath@novell.com>
193 * cs-parser.jay (VariableDeclaration): Don't set
194 current_array_type to null.
195 (field_declaration, event_declaration, declaration_statement):
198 2006-01-29 Raja R Harinath <harinath@gmail.com>
201 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
203 2006-01-28 Raja R Harinath <harinath@gmail.com>
205 * typemanager.cs (GenericParameterPosition): New.
208 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
210 * doc.cs : To process "include" elements, first we should create
211 another list than XmlNodeList, because it could result in node
212 removal, which could result in that the XmlNodeList gives up
215 2006-01-25 Miguel de Icaza <miguel@novell.com>
217 * expression.cs: Introduce an error report that we were not
218 catching before. Gonzalo ran into it.
220 2006-01-23 Miguel de Icaza <miguel@novell.com>
222 A fix for bug: #76957
224 * iterators.cs (MoveNextMethod.CreateMethodHost): call
225 ComputeMethodHost before creating the method, this is a new
228 * anonymous.cs (AnonymousContainer): Now we track all the scopes
229 that this method references (RegisterScope). The actual scope
230 where the method is hosted is computed with the ComputeMethodHost
231 before we create the method.
233 Moved the Deepest routine here.
235 (AnonymousContainer.ComputeMethodHost): New routine used to
236 compute the proper ScopeInfo that will host the anonymous method.
238 (ScopeInfo): Deal with multiple roots. The problem was that we
239 did not have a unique root where all ScopeInfos could be hanged
240 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
243 Remove AdjustMethodScope which is now computed at the end. Remove
244 LinkScope which did a partial link, instead link all ScopeInfos
245 before code generation from the new "LinkScopes" routine.
247 Simplify all the Add* routines as they no longer need to maintain
248 the tree, they just need to record that they are using variables
251 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
252 routines to produce the forest of ScopeInfo trees.
254 * class.cs (TypeContainer.AppendMethod): This is just like
255 AddMethod, but ensures that an interface implementation method
256 (IEnumerable.XXX) is not inserted at the beginning of the queue of
257 methods, but at the end.
259 We use this functionality to ensure that the generated MoveNext
260 method in the iterator class is resolved/emitted before the
261 enumerator methods created.
263 This is required because the MoveNext method computes the right
264 ScopeInfo for the method. And the other methods will eventually
265 need to resolve and fetch information computed from the anonymous
269 2006-01-23 Raja R Harinath <rharinath@novell.com>
271 Improve implementation of section 14.4.2.2 (Better function member).
272 * expression.cs (Invocation.MoreSpecific): Compare all type
273 arguments before deciding if one type is more specific than
274 another. Handle array types too. Return the more specific type.
275 (Invocation.BetterFunction): Add more tie-breaking rules from
276 section 14.4.2.2. Perform "more specific" check after
277 other tie-breaking rules. Compare all parameter types before
278 choosing the "more specific" method.
280 2006-01-21 Raja R Harinath <harinath@gmail.com>
281 Carlos Alberto Cortez <calberto.cortez@gmail.com>
284 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
286 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
287 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
289 2006-01-18 Martin Baulig <martin@ximian.com>
291 * class.cs (TypeContainer.AddToMemberContainer): Use
292 `symbol.MemberName.MethodName' instead of just `symbol.Name';
295 2006-01-18 Martin Baulig <martin@ximian.com>
297 Fix #76417: a generic class may now have methods which may unify
298 for some type parameter substitutions.
300 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
301 for methods which may unify anymore.
303 * expression.cs (Invocation.MoreSpecific): New private static
304 method; checks whether one method is more specific than another
305 according to 14.4.2.2 of the spec.
306 (Invocation.BetterFunction): Implement the tie-breaking rules from
307 14.4.2.2 of the spec: if two methods unify for some type parameter
308 substitution, we need to pick the more specific one.
310 2006-01-18 Raja R Harinath <rharinath@novell.com>
312 Fix #76656, cs0231-2.cs.
313 * cs-parser.jay (formal_parameter_list): Make error case catch
315 (parenthesized_expression_0): Add CS1026 check.
316 (invocation_expression): Remove unused { $$ = lexer.Location }.
318 2006-01-17 Raja R Harinath <rharinath@novell.com>
321 * cs-parser.jay (statement_expression): Don't list out the
322 individual statement-expressions. Convert syntax error into
325 2006-01-16 Raja R Harinath <rharinath@novell.com>
328 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
329 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
330 CheckIntermediateModification.
331 (FieldExpr.DoResolve): Add new two-argument version that
332 allows us to resolve the InstanceExpression as an lvalue.
333 The one-argument variant is now just a wrapper.
334 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
335 Resolve the lhs as an lvalue if the it has a value type.
336 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
337 from Assign.DoResolve.
338 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
339 resolved as an lvalue.
340 (PropertyExpr.DoResolve): Update.
341 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
342 has a value type. Move CS1612 check here from
343 CheckIntermediateModification.
344 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
345 * expression.cs (EmptyExpression.OutAccess): New. Used as the
346 'right_side' of a ResolveLValue on an 'out' argument.
347 (EmptyExpression.LValueMemberAccess): New. Used as the
348 'right_side' of a propagated ResolveLValue on a value type.
349 (LocalVariableReference.DoResolveBase): Recognize
350 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
352 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
353 EmptyExpression.Null.
355 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
357 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
358 Type.IsGenericParameter(). Fixed bug #77183.
359 * doc.cs : it is now identical to doc.cs in mcs.
361 2006-01-16 Martin Baulig <martin@ximian.com>
363 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
365 2006-01-16 Martin Baulig <martin@ximian.com>
367 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
370 2006-01-12 Miguel de Icaza <miguel@novell.com>
372 This fixes the problem where we used ldfld instead of ldflda to
373 load the "THIS" pointer on captured parameters, when THIS is a
374 value type. See bug #77205.
376 * iterators.cs (CapturedThisReference.Emit): Pass false to
377 EmitThis (we do not need the address).
379 * codegen.cs (EmitThis): it needs to know whether we need the
380 address of `this' or not. This is used by value types.
382 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
383 every other call passes false.
385 2006-01-12 Raja R Harinath <rharinath@novell.com>
388 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
390 * expression.cs (Invocation.OverloadResolve): Update.
391 (Invocation.DoResolve): Avoid double resolution of invocation.
393 2006-01-11 Raja R Harinath <rharinath@novell.com>
396 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
397 unary negation of floating point types as 0-expr; negation cannot
398 overflow in floating point types.
401 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
402 on operands of 'void' type.
405 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
406 and ExclusiveOr for boolean constants too.
408 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
410 * expression.cs: Fix Console.WriteLine ((this = x).foo);
412 2006-01-12 Miguel de Icaza <miguel@novell.com>
414 * cs-tokenizer.cs (Position): New class used to save and restore
415 the position state in the tokenizer. Before this patch the save
416 and restore was not complete enough so the line and columns would
417 start to drift and the debugger and stack traces will get the
420 2006-01-10 Martin Baulig <martin@ximian.com>
423 (TypeParameter.InflateConstraints): New public method.
425 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
426 constraints; fixes #77042.
428 2006-01-10 Martin Baulig <martin@ximian.com>
430 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
431 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
434 2006-01-09 Raja R Harinath <rharinath@novell.com>
437 * expression.cs (Invocation.OverloadResolve): Replace reflected
438 override methods with their base virtual methods, rather than
440 * typemanager.cs (TypeManager.GetOverride): New.
442 2005-12-21 Miguel de Icaza <miguel@novell.com>
444 * driver.cs: Report the case of no source files and no -out:
447 2005-12-20 Raja R Harinath <rharinath@novell.com>
450 * expression.cs (ComposedCast.GetSignatureForError): Define.
452 2006-01-05 Jb Evain <jbevain@gmail.com>
454 * class.cs (Property.Define, Indexer.Define): do not tag the
455 properties as SpecialName | RTSpecialName.
457 2006-01-04 Miguel de Icaza <miguel@novell.com>
459 * class.cs (MethodCore.IsDuplicateImplementation): This method was
460 doing a low-level comparission of parameter types. It was lacking
461 a check for __argslist.
463 2005-12-30 Miguel de Icaza <miguel@novell.com>
465 * expression.cs (ParameterReference.DoResolveBase): Allow
466 reference parameters if they are local to this block.
468 This allows the ref and out parameters of a delegate to be used in
469 an anonymous method, for example:
471 delegate void set (out int x);
473 set s = delegate (out int x){
477 This is used by functionality introduced late in the C# language.
479 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
480 method that take ref and out parameters.
482 Fixes #77119 which was a late change in the spec.
484 2005-12-23 Miguel de Icaza <miguel@novell.com>
486 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
487 parent if its the same scope. Fixes #77060.
489 2005-12-22 Marek Safar <marek.safar@seznam.cz>
491 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
493 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
495 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
496 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
497 that doesn't contain the full public key. This is a update of the
498 friend assemblies in .Net 2.0 release.
500 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
504 * namespace.cs (NamespaceEntry): Add extern_aliases as a
505 ListDictionary, to contain the ExternAliasEntry entries (in
506 addition to the NamespaceEntry.aliases hashtable). This field is
507 shared between the original entry and its doppelganger (bodyless
509 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
510 extern_aliases field.
511 (NamespaceEntry.Lookup): Move the IsImplicit check after the
512 lookup in extern_aliases.
514 2005-12-16 Raja R Harinath <rharinath@novell.com>
517 * class.cs (TypeContainer.Mark_HasEquals): New.
518 (TypeContainer.Mark_HasGetHashCode): New.
519 (ClassPart): Override them.
520 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
522 * generic.cs (GenericMethod.DefineMembers): Update to changes.
523 (TypeParameter.TypeParameter): Change type of 'parent' argument to
527 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
528 'parent' argument to the base constructor.
530 Remove all mention of TypeContainer from decl.cs.
531 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
532 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
533 (DeclSpace.DeclSpace): Likewise.
534 (DeclSpace.DefineMembers): Remove unused argument.
535 * cs-parser.jay (pop_current_class): Update to changes. Simplify
536 debugging check -- we don't care if the debug code throws an
537 InvalidCastException instead of an InternalErrorException.
538 * class.cs (TypeContainer.DefineMembers): Update to changes.
539 (TypeContainer.DoDefineMembers): Likewise.
540 (TypeContainer.GetMethods): Likewise.
541 (PropertyMember.Define): Likewise.
542 (MemberBase.Parent): New property that forwards to
543 MemberCore.Parent, but ensures that we get a TypeContainer.
544 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
545 (RootContext.PopulateTypes): Likewise. Remove special case code
546 for !RootContext.StdLib: DefineMembers is idempotent.
548 2005-12-13 Marek Safar <marek.safar@seznam.cz>
550 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
552 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
554 * doc.cs : The search for referenced namespace was insufficient to
555 get global one as it used to do. Fixed bug #76965.
557 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
559 * doc.cs : check name in cref in the last phase that whether it is
562 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
564 * cs-tokenizer.cs : reverted the latest change: it somehow broke
567 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
569 * doc.cs : so it turned out that we cannot skip override check for
570 interface members. Fixed bug #76954.
572 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
574 * cs-tokenizer.cs : fixed bug #75984:
575 - #warning and #error should not be handled when the source line
577 - #line is not checked strictly when the source line is disabled.
578 - #define and #undef is on the other hand checked strictly at any
581 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
583 * cs-tokenizer.cs : missing Location (actually, filename) in one of
586 2005-12-15 Raja R Harinath <rharinath@novell.com>
588 * generic.cs (TypeManager.IsGeneric): Remove unused method.
590 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
593 2005-12-14 Martin Baulig <martin@ximian.com>
595 * typemanager.cs (TypeManager.GetFullName): Make this public;
596 `Type.Fullname' now never returns null.
598 * class.cs (Method.Define): Use TypeManager.GetFullName() for
599 explicit interface implementations; we're now using the same
600 naming convention than csc does.
602 2005-12-14 Miguel de Icaza <miguel@novell.com>
604 * convert.cs (ExplicitConversionCore): Check the return value from
605 ExplicitConversionCore which can return null on failure. Fixes #76914
607 2005-12-09 Raja R Harinath <rharinath@novell.com>
609 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
610 instead of IsGenericInstance.
611 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
612 code that's now covered by the more general test.
613 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
615 * generic.cs (DropGenericTypeArguments): New. Captures the common
616 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
617 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
618 * generic.cs, report.cs, typemanager.cs: Likewise.
620 2005-12-08 Martin Baulig <martin@ximian.com>
622 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
624 * typemanager.cs (TypeManager.CSharpSignature): Include type
625 arguments in the signature of a generic method.
627 2005-12-07 Martin Baulig <martin@ximian.com>
629 Add support for custom attributes on type parameters.
631 * cs-parser.jay (type_arguments): Added `opt_attributes'.
633 * generic.cs (TypeParameterName): New public class; we use this
634 instead of a `string' to store the name of a type parameter, so we
635 can also have `Attributes'.
636 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
637 array instead of a `string[]' array.
638 (TypeParameter.ctor): We now also take an `Attributes' argument.
639 (TypeParameter.EmitAttributes): New public method; emit our
640 `OptAttributes' here.
641 (GenericMethod.EmitAttributes): New public method; emit the custom
642 attributes on all our type parameters.
644 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
646 (MethodData.Define): If we're a generic method, call
647 EmitAttributes() on it.
649 2005-12-07 Martin Baulig <martin@ximian.com>
652 (ConstraintChecker): New public abstract class; move the
653 constraint checking here from `ConstructedType' and also do
654 constraint checking for generic methods here.
656 * expression.cs (Invocation.OverloadResolve): Use
657 ConstraintChecker.CheckConstraints() if we resolved to a generic
660 2005-12-05 Marek Safar <marek.safar@seznam.cz>
662 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
664 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
666 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
667 (FieldBase.Initializer): Initializer is now optional.
668 (EventField.Define): Only event field can have initializer.
670 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
672 * const.cs (Const): Reuse initializer.
674 * cs-parser.jay: Updated after FieldBase changes.
675 Added current_array_type to simplify array initializers.
677 * ecore.cs (NullCast.IsDefaultValue): Implemented.
679 * expression.cs, iterators.cs: Updated.
681 * namespace.cs (NamespaceEntry): Made UsingFound private.
683 2005-12-05 Marek Safar <marek.safar@seznam.cz>
685 * parameterCollection.cs: Obsolete, removed.
686 * parser.cs: Obsolete, removed.
688 2005-12-05 Marek Safar <marek.safar@seznam.cz>
691 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
693 * enum.cs (Enum.Define): Set obsolete context here.
695 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
698 - FindDocumentedMember() now expects 1) paramList as null
699 when "we don't have to check the number of parameters" and
700 2) Type.EmptyTypes when "there is no arguments".
701 - Introduced FoundMember struct to hold the exact type which was
702 used to find the documented member (the above change broke
703 test-xml-044; it might be better just to use DeclaringType than
704 what MS does, like this change does, but it depends on usage.)
706 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
708 * doc.cs : documented member might be from DeclaringType for nested
709 types. Fixed bug #76782.
711 2005-12-03 Ben Maurer <bmaurer@ximian.com>
713 * anonymous.cs: Have the param code handle leaving copies on the
714 stack etc. Allows anonymous params to take part in the assignment
715 code (++, +=, etc). Fixes bug #76550
717 * expression.cs: Handle the prepare_for_load/leave_copy by passing
718 it down to the anon code.
720 * iterators.cs: Use dummy var here
722 * codegen.cs: Handle new vars
724 2005-12-01 Marek Safar <marek.safar@seznam.cz>
727 * class.cs (MethodData.Define): Set proper Obsolete context.
729 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
731 (FieldExpr.DoResolve): Ditto.
733 2005-12-01 Marek Safar <marek.safar@seznam.cz>
736 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
737 parent is not obsolete.
739 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
741 * doc.cs : (FindDocumentedMember) find parameterless members first
742 and get CS0419 in the early stage. Fixed first case of bug #76727.
744 2005-11-30 Marek Safar <marek.safar@seznam.cz>
747 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
748 no error was reported.
750 *expression.cs (Binary.DoResolve): left can be null.
752 2005-12-06 Raja R Harinath <rharinath@novell.com>
754 * class.cs (MethodCore.CheckGenericOverride): Delete unused
755 abstract method and all overrides.
756 * support.cs (ParameterData.GenericConstraints): Delete.
757 (ReflectionParameters.type_params): Delete.
758 (ReflectionParameters.ReflectionParameters): Make private.
759 (ReflectionParameters.GetConstaints): New factory method.
760 * generic.cs (TypeParameterDefineType): Use it.
761 (TypeManager.GetTypeParameterConstraints): Likewise.
763 2005-11-22 Marek Safar <marek.safar@seznam.cz>
766 * class.cs (MethodData.Emit): Parameters should be labeled first.
768 2005-11-21 Marek Safar <marek.safar@seznam.cz>
771 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
773 2005-11-18 Marek Safar <marek.safar@seznam.cz>
775 * attribute.cs (AreParametersCompliant): Moved to Parameter.
777 * class.cs (MethodCore): Parameter clean up.
778 (IMethodData): Added ParameterInfo.
779 (MethodData): Parameter clean up.
780 (Indexer.Define): Parameter clean up.
792 * typemanager.cs: Parameter clean up.
794 * delegate.cs (Define): Get rid of duplicated code.
796 * expression.cs (ParameterReference): Removed useless parameters
800 * parameter.cs (ParamsParameter): New class, params specialization.
801 (ArglistParameter): Attemp to separate arglist.
802 (Parameter): Refactored to be reusable and faster.
803 (Parameter.Modifier): Made understandable.
804 (Parameters): Changed to be used as a class for `this' assembly
805 parameters. Refactored to use new specialized classes.
807 * support.cs (ParameterData): Added Types property.
808 (InternalParameters): Deleted.
810 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
812 * doc.cs : the previous patch does not actually fix the bug.
813 PropertyInfo override check is now implemented and really fixed it.
814 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
816 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
818 * doc.cs : apply "override filter" also to properties.
821 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
823 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
824 no need to check overrides. For classes, omit those results from
825 interfaces since they must exist in the class. Fixed bug #76726.
827 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
829 * typemanager.cs : (GetFullNameSignature) differentiate indexers
830 with different parameters. Fixed the second problem in #76685.
832 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
834 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
835 get expected 'protected' access in CheckValidFamilyAccess()).
838 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
840 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
841 Fixed bug #76705. CS1569 was incorrectly commented out.
843 2005-11-23 Martin Baulig <martin@ximian.com>
845 * generic.cs (Constraints.Define): Removed.
846 (TypeParameter.DefineConstraints): Removed.
847 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
848 on the GenericTypeParameterBuilder here.
850 2005-11-23 Martin Baulig <martin@ximian.com>
852 * typemanager.cs (TypeManager.GetProperty): Make this public.
854 * generic.cs (Nullable.NullableInfo.ctor): Use
855 TypeManager.GetProperty() rather than using reflection directly.
857 2005-11-17 Martin Baulig <martin@ximian.com>
859 * expression.cs (Indexers.GetIndexersForType): Added support for
860 generic parameters; fixes #76587.
862 2005-11-17 Martin Baulig <martin@ximian.com>
865 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
866 inherit the scope from our parent. Fixes #76653.
868 2005-11-15 Martin Baulig <martin@ximian.com>
870 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
871 instead of `ScopeTypeBuilder' to refer to the "current" type.
872 (AnonymousMethod.CreateScopeType): Correctly create the helper
873 class if we're inside a generic type definition.
875 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
877 * doc.cs : use Invocation.IsOverride() to do real override check.
878 * expression.cs : made Invocation.IsOverride() internal.
880 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
882 * doc.cs : use TypeManager.FindMembers() instead of (possible)
883 TypeBuilder.FindMembers() and filter overriden base members out.
886 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
888 * doc.cs : ref/out parameters are represented as '@' (instead of
889 '&' in type FullName). Fixed bug #76630 (additionally crefs).
891 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
893 * doc.cs : when there was no '.' in cref to methods in doc comment,
894 then parameters were missing in the output. Fixed bug #76691.
896 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
898 * driver.cs : don't output docs when there is an error.
901 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
904 Now it should detect indexers. Fixed primary concern in bug #76685.
905 Fixed CS0419 message to not show the identical member signature in
908 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
910 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
911 instead of Type.FindMembers() since it does not handle events.
914 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
916 * codegen.cs: Fixed typo (speficied -> specified).
918 2005-11-11 Marek Safar <marek.safar@seznam.cz>
921 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
923 2005-11-11 Marek Safar <marek.safar@seznam.cz>
925 * attribute.cs: Changed error message.
927 * cs-tokenizer.cs: One more check.
929 2005-11-10 Marek Safar <marek.safar@seznam.cz>
931 * statement.cs (Block.Resolve): Ignore empty statement.
933 2005-11-10 Marek Safar <marek.safar@seznam.cz>
935 * report.cs: Made error/warning methods more strict to avoid
938 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
939 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
940 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
941 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
943 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
945 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
946 Use the more explicit AssemblyName.FullName instead of
947 AssemblyName.Name to report errors.
949 2005-11-11 Marek Safar <marek.safar@seznam.cz>
951 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
954 2005-11-10 Marek Safar <marek.safar@seznam.cz>
964 * report.cs: Fixed error reporting and typos.
966 * generic.cs (TypeParameter.GetSignatureForError): New method.
967 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
969 * typemanager.cs (GetFullName): Refactored.
971 2005-11-08 Marek Safar <marek.safar@seznam.cz>
973 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
974 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
976 * class.cs (TypeContainer.IsComImport): New property.
977 (Constructor.Define): Create proper ctor for ComImport types.
979 * expression.cs (New.CheckComImport): Fixed.
981 2005-11-07 Miguel de Icaza <miguel@novell.com>
983 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
984 that a parameter has been captured does not mean that we do not
985 have to do the rest of the processing. This fixes the second part
986 of #76592. If there was another anonymous method capturing
987 values in the past, the Scope would never be set for the second
988 method that captured the same parameter.
990 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
991 properly manipulate the stack. Second part of fix for #76592.
993 * expression.cs (New): Add support for invoking "new" on
994 interfaces that have been flagged with the ComImport attribute and
995 the CoClass. Fixes #76637
997 * statement.cs (Try.DoEmit): When a variable is captured, do not
998 try to emit the vi.LocalBuilder variable as it has been captured.
999 Create a temporary variable and store the results on the
1000 FieldBuilder. Fixes #76642
1002 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1004 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1006 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1008 * expression.cs (Binary.DoResolve): Added && optimalization.
1010 * typemanager.cs (AddUserType): Removed useless argument.
1012 2005-11-04 Marek Safar <marek.safar@seznam.cz>
1014 * statement.cs (Block.variables): Uses ListDictionary.
1016 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1019 * class.cs (PartialContainer.EmitType): Customized to emit
1020 security attributes.
1021 (ClassPart.ApplyAttributeBuilder): Transform security attribute
1022 for partial classes.
1024 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1027 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1028 access has to be fixed.
1030 * typemanager.cs (IsUnmanagedType): Wrong common field type.
1032 2005-11-01 Marek Safar <marek.safar@seznam.cz>
1035 * ecore.cs (NullCast.Reduce): Implemented.
1037 * expression.cs (ArrayCreation.CheckIndices): Correcly check
1040 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1042 (Foreach.Resolve): Catch null properly.
1044 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1046 * cs-tokenizer.cs: Warning text fix.
1048 * driver.cs: AllWarningNumbers exposed on public interface.
1050 * report.cs (): Reviewed warning numbers.
1051 (IsValidWarning): Use binary search.
1053 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1055 * driver.cs: Implemeted resource visibility.
1056 (Resources): New class for code sharing between /res: and
1059 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1061 decl.cs (CurrentTypeParameters): Fixed to be public.
1063 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1065 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1067 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1069 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1071 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
1073 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1075 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1077 Add friend assembly access support.
1078 * typemanager.cs: assembly_internals_vis_attrs
1079 cache for friend assembly access.
1080 (TypeManager.IsFriendAssembly): New method for
1081 checking friend assembly access.
1082 (TypeManager.Error_FriendAccessNameNotMatching): New
1084 (TypeManager.CompareKeyTokens): Likewise.
1085 (TypeManager.Filter): Handle friend accessible
1088 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1089 friend accessible types.
1091 * ecore.cs (Expression.IsAccessorAccessible): Handle
1092 friend accessible properties.
1094 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1097 2005-10-28 Marek Safar <marek.safar@seznam.cz>
1100 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1103 * convert (Convert.ImplicitReferenceConversion): NullCast holds
1106 * ecore.cs (NullCast): Child is contant only.
1108 * literal.cs (NullLiteral.Reduce): null can be converted to any
1111 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
1113 * driver.cs: Use Encoding.Default as default code page instead
1116 2005-10-27 Raja R Harinath <rharinath@novell.com>
1119 * expression.cs (Invocation.Error_InvalidArguments): Handle
1120 __arglist parameters.
1121 (Invocation.VerifyArgumentsCompat): Likewise.
1122 * support.cs (ReflectionParameters.GetSignatureForError): Print
1123 __arglist parameters.
1124 (InternalParamters.GetSignatureForError): Likewise.
1125 * parameter.cs (Parameters.GetSignatureForError): Likewise.
1127 2005-10-26 Marek Safar <marek.safar@seznam.cz>
1129 * attribute.cs (GetPropertyValue): Made public.
1131 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1133 Add new property WrapNonExceptionThrows to handle 2.0 assembly
1135 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1138 * driver.cs: Reflect method name change.
1140 * statement.cs (Try.Resolve): Warn when try has both general
1143 * typemanager.cs: runtime_compatibility_attr_type new predefined
1146 2005-10-26 Raja R Harinath <harinath@gmail.com>
1149 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1150 treat it as an empty parameter list.
1152 2005-10-26 Raja R Harinath <rharinath@novell.com>
1155 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
1156 ResolveAsTypeStep silent.
1157 * statement.cs (Block.AddConstant): Mark block as used.
1158 (Block.ResolveMeta): Avoid piling on error messages
1159 if a constant initializer resolution fails.
1161 2005-10-25 Raja R Harinath <rharinath@novell.com>
1163 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1165 (NamespaceEntry.VerifyAllUsing): New.
1166 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
1167 behaviour. Delegates actual resolution of alias to ...
1168 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
1169 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1171 * driver.cs (Driver.MainDriver): Update.
1173 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1174 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1176 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1178 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1179 RootNamespace.DefineNamespacesForAll.
1181 2005-10-24 Raja R Harinath <harinath@gmail.com>
1183 * typemanager.cs (assemblies, external_aliases, modules)
1184 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1185 (ComputeNamespaces, GetRootNamespace): Remove extra staging
1186 overhead. Move resposibility ...
1187 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
1188 * driver.cs, attribute.cs, codegen.cs: Update to changes.
1190 2005-10-23 Raja R Harinath <harinath@gmail.com>
1192 * namespace.cs (RootNamespace.all_namespaces): Renamed from
1193 cached_namespaces. Improve usage.
1194 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1195 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1196 Move from GlobalRootNamespace and simplify.
1197 (RootNamespace.Global): Make instance variable.
1198 (RootNamespace.RootNamespace): Add "alias name" parameter.
1199 (GlobalRootNamespace): Simplify drastically.
1200 (Namespace.Lookup): Don't use GetNamespace.
1201 * typemanager.cs (GetRootNamespace): Rename from
1202 ComputeNamespaceForAlias.
1203 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1205 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1207 * anonymous.cs (AnonymousContainer): Don't crash when container
1210 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1212 * expression.cs (Binary.DoResolve): Warn when comparing same
1215 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1218 * expression.cs (Binary.DoResolve): It looks like there are no
1219 convetsion rules in enum context.
1221 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1223 Add support for extern alias qualifiers.
1224 * typemanager.cs: Move some LookupTypeReflection code
1225 to namespace.cs, to have cleaner code. Added some methods
1226 to help us keep track of the extern aliased references.
1227 * driver.cs: Add suport for extern alias assemblies on command
1228 line and check for their warnings/errors. Also keep track of the
1229 extern aliased assemblies.
1230 * namespace.cs: Move the global functionality of Namespace
1231 to GlobalRootNamespace/RootNamespace. Now the global namespace
1232 is GlobalRootNamespace.Globa. Also the code moved from
1233 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
1234 Finally added LocalAliasEntry (AliasEntry before) and
1235 ExternAliasEntry, to handle alias statements.
1236 * cs-parser.jay: Add support in the grammar for extern alias
1238 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
1239 Update callings to Namespace (now in GlobalRootNamespace).
1241 2005-10-25 Martin Baulig <martin@ximian.com>
1243 * convert.cs (ImplicitTypeParameterConversion): Make base
1244 interfaces actually work; fixes #76557.
1246 2005-10-25 Martin Baulig <martin@ximian.com>
1249 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
1250 all the type parameters; fixes #76551.
1252 2005-10-25 Martin Baulig <martin@ximian.com>
1257 (GenericMethod.ctor): Added `Expression return_type' and
1258 `Parameters parameters' arguments.
1259 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
1260 parameter and return types to check their constraints if they're
1263 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
1266 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1267 constraints of a generic type if `ec.ResolvingGenericMethod'.
1269 * class.cs (MethodCore.DoDefineParameters): Set
1270 `ec.ResolvingGenericMethod' if we're a generic method.
1271 (MemberBase.MemberType): Likewise.
1273 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1275 * typemanager.cs (TypeManager): Added
1276 TypeManager.internals_visible_attr_type to cache
1277 S.R.CompilerServices.InternalsVisibleToAttribute.
1279 * codegen.cs (AssemblyClass): Added checks for
1280 InternalsVisibleToAttribute in new method
1281 CheckInternalsVisibleAttribute () and also cache the
1282 AssemblyName in AssemblyClass.Name.
1284 2005-10-24 Martin Baulig <martin@ximian.com>
1287 (TypeManager.ExpandInterfaces): Added overloaded version which
1288 just takes a `Type[]' array.
1291 (Constraints.Resolve): Don't expand the interfaces here; ie. we
1292 just use the interfaces which were explicitly specified and not
1293 the interfaces they inherit. Fixes #76482.
1294 (TypeParameter.FindMembers): Expand the interfaces here.
1296 2005-10-21 Martin Baulig <martin@ximian.com>
1299 (Constraints.Resolve): Also resolve the actual types here.
1300 (Constraints.ResolveTypes): Just check the constraints here.
1301 Fixes #76363; see gtest-218.cs.
1303 2005-10-21 Martin Baulig <martin@ximian.com>
1306 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
1307 instead of a `BoxedCast'; fixes gtest-217.cs.
1309 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
1311 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1312 1) "new()" is specified as generic parameter constraint and 2) the
1313 type is TypeBuilder and 3) the type is abstract even if it has a
1314 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
1316 2005-10-20 Martin Baulig <martin@ximian.com>
1319 (GenericConstraints.TypeParameter): New public property.
1320 (TypeParameter.ctor): Also take a `DeclSpace' argument.
1321 (TypeParameter.DeclSpace): New public property.
1322 (TypeParameter.DefineType): Inflate the constraints if our
1323 `DeclSpace' is an `Iterator'.
1325 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
1327 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
1328 GenericMethod argument to compare methods' generic type arguments.
1331 2005-10-19 Martin Baulig <martin@ximian.com>
1333 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
1334 not ResolveType() when resolving the base type, so we're not
1335 checking the constraints here.
1336 (TypeContainer.ResolveType): Call ResolveType() on our base_type
1339 2005-10-19 Martin Baulig <martin@ximian.com>
1341 * generic.cs (ConstructedType.CheckConstraints): Committing
1342 untested fix for #76441.
1344 2005-10-18 Raja R Harinath <rharinath@novell.com>
1347 * class.cs (TypeContainer.DefineType): Move updating of
1348 topological sort earlier in the code.
1349 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1351 2005-10-18 Marek Safar <marek.safar@seznam.cz>
1354 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1356 * constant.cs (Constant.TryReduce): Moved from Cast class.
1357 (Reduce): Made little bit more OO and fixed missing conversions.
1359 * ecore.cs (Reduce): Implemented.
1360 (Binary.EnumLiftUp): New method to upgrade values to enum values.
1362 * literal.cs (Reduce): Implemented.
1364 * class.cs: Reverted Miguel's wrong commit.
1366 2005-10-14 Miguel de Icaza <miguel@novell.com>
1368 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1370 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
1372 * cs-parser.jay, expression.cs : CS0214 was missing error location
1373 for constants. Fixed bug #76404.
1375 2005-10-10 Raja R Harinath <rharinath@novell.com>
1377 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1379 (PropertyExpr.EmitCall): Likewise.
1380 * expression.cs (Invocation.EmitArguments): Handle case where
1382 (Invocation.EmitCall): Avoid allocating temporary variable if
1383 there are no arguments.
1385 2005-10-11 Marek Safar <marek.safar@seznam.cz>
1388 * convert.cs (ExplicitConversionCore): Fixed object->enum
1391 2005-10-07 Raja R Harinath <rharinath@novell.com>
1394 * convert.cs (ImplicitConversionStandard): Move conversion of
1395 void* to arbitrary pointer types ...
1396 (ExplicitConversionStandard): .. here.
1397 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1398 error to always print typenames.
1400 2005-10-07 Raja R Harinath <rharinath@novell.com>
1402 * convert.cs (GetConversionOperator): Rename from
1403 GetConversionOperators. Move operator selection code from ...
1404 (UserDefinedConversion): ... here.
1406 2005-10-06 Marek Safar <marek.safar@seznam.cz>
1408 * convert.cs (ExplicitConversionCore): Removed duplicate enum
1411 2005-10-05 Marek Safar <marek.safar@seznam.cz>
1413 * assign.cs (Assign.DoResolve): Error method changed.
1415 * cfold.cs (DoConstantNumericPromotions): Error method changed.
1417 * const.cs (ResolveValue): Reset in_transit immediately.
1419 * constant.cs: Error method changed.
1421 * convert.cs: Removed useless location parameter.
1422 (ExplicitNumericConversion): Don't do double enum check.
1423 (ExplicitConversionCore): Renamed from ExplicitConversion.
1424 (ExplicitUnsafe): Extracted from ExplicitConversion.
1425 (ExplicitConversion): Uses for error reporting.
1427 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
1429 (ResolveBoolean): Uses common error method.
1430 (CastToDecimal): Get rid of ec.
1431 (CastFromDecimal): Optimized.
1432 (ConvCast): Get rid of ec.
1434 * enum.cs (ResolveValue): Reset in_transit immediately.
1435 (Emit): Return after first error.
1437 * expression.cs: Convert changes.
1439 * literal.cs: Error method changed.
1441 * statement.cs: Error method changed.
1443 2005-10-06 Raja R Harinath <rharinath@novell.com>
1445 Fix gtest-131.cs and gtest-211.cs.
1446 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
1447 Only emit code for a label if it is used. Unreachable code can
1448 violate ECMA evaluation stack invariants.
1450 2005-09-27 Marek Safar <marek.safar@seznam.cz>
1452 * anonymous.cs: Implemented ExprClassName.
1454 * assign.cs (Assign.DoResolve): Don't chrash when type is not
1457 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
1460 * class.cs (StaticClass.DefineContainerMembers): Report protected
1463 * codegen.cs: if(ed) PRODUCTION.
1465 * convert.cs (Error_CannotImplicitConversion): Better error
1468 * cs-parser.jay: More error checks.
1470 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
1472 * driver.cs (CSCParseOption): Enabled wrong option check.
1474 * ecore.cs (Expression.ExprClassName): Turned to property.
1475 (MemberExpr.CheckIntermediateModification): For checking boxed
1476 value types modification.
1478 * statement.cs (Fixed.Resolve): Expression type must be
1479 convertible to fixed type.
1480 (CollectionForeach.GetEnumeratorFilter,TryType):
1481 Small refactoring for easier error checking.
1483 2005-09-26 Marek Safar <marek.safar@seznam.cz>
1485 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
1488 * class.cs (GeneratedBaseInitializer): New class for customization
1489 compiler generated initializers.
1490 (MemberBase.DoDefine): Check Obsolete attribute here.
1491 (FieldMember.DoDefine): Ditto.
1493 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
1496 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
1497 (MemberCore.GetObsoleteAttribute): Removed argument.
1498 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
1499 (MemberCore.CheckObsoleteType): New helper.
1503 * statement.cs: Updates after MemberCore changes.
1505 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
1506 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
1508 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
1509 obsolete attribute for compiler construct.
1510 (As.DoResolve): Cache result.
1512 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
1514 2005-10-01 Miguel de Icaza <miguel@novell.com>
1516 * expression.cs (Probe): instead of having a "Type probe_type"
1517 keep the extra information as a TypeExpr probe_type_expr since the
1518 "As" operator needs to perform some type checks.
1520 * (As.DoResolve): If the type is a type parameter, ensure that it
1521 is constrained by a class.
1523 2005-09-22 Miguel de Icaza <miguel@novell.com>
1525 * statement.cs (Lock): Use the TemporaryVariable class instead of
1526 manually using local variables as those do not work when variables
1529 * ecore.cs: Moved the TemporaryVariable class from being a nested
1530 class inside Foreach to be a public class that can be employed in
1533 2005-09-19 Marek Safar <marek.safar@seznam.cz>
1535 * cs-parser.jay: interface_accessors replaced by
1536 accessor_declarations.
1538 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
1541 * statement.cs (GotoCase.Resolve): Convert null constant to
1543 (SwitchLabel.ResolveAndReduce): Ditto.
1544 (SwitchLabel.NullStringCase): Custom null stamp.
1545 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
1547 typemanager.cs (CSharpSignature): Don't skip first argument
1550 2005-09-16 Marek Safar <marek.safar@seznam.cz>
1552 * cfold.cs, constant.cs, convert.cs, ecore.cs,
1553 expression.cs, iterators.cs, literal.cs: Store constants and
1556 * class.cs (MemberBase.ShortName): Pass location.
1558 * cs-parser.jay: Some location fixes.
1560 * ecore.cs (Expression.Location): Made virtual.
1562 2005-09-27 Marek Safar <marek.safar@seznam.cz>
1565 * const.cs (Const.ResolveValue): Check for assigning non-null
1566 value to reference type.
1568 2005-09-26 Raja R Harinath <rharinath@novell.com>
1571 * expression.cs (This.VerifyFixed): In a value type T, the type of
1572 'this' is T&, iow, 'this' is either an out or ref parameter. In a
1573 value type R, 'this' is treated as a value parameter.
1575 2005-09-05 Miguel de Icaza <miguel@novell.com>
1577 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1578 if the underlying types are the same, otherwise we need to produce
1579 code that will do the proper cast.
1581 This was exposed by Marek's constant rewrite which produced
1582 invalid code for the call site:
1585 void Method (X v) {}
1589 This fixes test-49.cs
1591 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1593 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
1594 Type/Object should be allowed as well. Fixed bug #75968.
1596 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1598 * expression.cs : (Binary.DoResolve): when one is enum constant and
1599 another is constant 0, then return enum one *as enum type*.
1602 2005-10-04 Martin Baulig <martin@ximian.com>
1604 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
1605 `SetMemberIsUsed()' work for generics, too.
1607 2005-10-04 Martin Baulig <martin@ximian.com>
1609 * expression.cs (DelegateInvocation.EmitStatement): Make this work
1610 for corlib. Fixes #75691.
1612 2005-09-28 Marek Safar <marek.safar@seznam.cz>
1615 * driver.cs: Fix compilation files with full root path.
1617 2005-09-25 Miguel de Icaza <miguel@novell.com>
1619 * report.cs (SymbolRelatedToPreviousError): Format the output so
1620 it does not use an open parenthesis that is never closed.
1622 * driver.cs: Follow coding guidelines
1624 2005-09-18 Miguel de Icaza <miguel@novell.com>
1626 * driver.cs: Set InEmacs based on the environment variable EMACS.
1628 * location.cs (InEmacs): in this mode, do not report column
1629 location as it confuses Emacs.
1631 2005-10-03 Raja R Harinath <rharinath@novell.com>
1633 * support.cs (SeekableStreamReader.Position): Don't error out when
1634 the requested position is just beyond the end of the current
1637 2005-09-28 Raja R Harinath <rharinath@novell.com>
1639 * support.cs (SeekableStreamReader): Simplify drastically. Don't
1640 try to keep in sync with the byte count of the underlying Stream.
1641 However, this limits us to a window size of 2048 characters: i.e.,
1642 the maximum lookahead of our lexer/parser can be 2048 characters.
1644 2005-09-22 Martin Baulig <martin@ximian.com>
1646 * driver.cs: Removed a debugging FIXME.
1648 2005-09-21 Raja R Harinath <rharinath@novell.com>
1650 * cs-parser.jay (type_arguments): Add CS1644 check.
1651 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
1653 2005-09-15 Raja R Harinath <rharinath@novell.com>
1655 * Makefile (PROGRAM): Make profile specific.
1656 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
1657 the current directory.
1660 * expression.cs (Invocation.EmitCall): Remove optimization on
1661 this_call since it doesn't handle 'this' being a value type.
1663 2005-09-05 Geoff Norton <gnorton@customerdna.com>
1665 * driver.cs: Ensure file handles are closed after parsing
1667 2005-09-05 Miguel de Icaza <miguel@novell.com>
1669 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1670 if the underlying types are the same, otherwise we need to produce
1671 code that will do the proper cast.
1673 This was exposed by Marek's constant rewrite which produced
1674 invalid code for the call site:
1677 void Method (X v) {}
1681 This fixes test-49.cs
1683 2005-09-05 Martin Baulig <martin@ximian.com>
1685 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
1686 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
1688 * cs-parser.jay (delegate_declaration): Small fix for #75852.
1690 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1692 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
1693 to be a pointer type due to the spec 25.2, so check if declaring
1694 type is generic type definition. Fixed bug #75772.
1696 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1699 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
1700 both types are not defined by methods.
1701 * expression.cs : (Invocation.IsApplicable): it should work when
1702 the argument type is equal to the parameter type, not only when
1703 ImplicitConversionExists() returns true.
1705 2005-09-02 Raja R Harinath <rharinath@novell.com>
1707 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
1711 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
1712 flow-branching for LocalVariableReferences in case we were invoked
1713 from a MemberAccess.
1714 * expression.cs (LocalVariableReference.VerifyAssigned): New.
1716 (LocalVariableReference.DoResolveBase): ... this.
1717 (MemberAccess.Resolve): Do the check that was disabled during
1720 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
1723 (PartialContainer.Create): check abstract/sealed/static strictly
1724 but abstract/sealed can exist only at one side. Fixed bug #75883.
1726 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
1729 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
1730 specified, don't default to UnmanagedType.I4.
1732 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
1734 * expression.cs : conditional operator should check possibly
1735 incorrect assign expression. Fixed bug #75946.
1737 2005-08-30 Raja R Harinath <rharinath@novell.com>
1740 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
1741 (ScopeInfo.EmitScopeType): Use it to construct field names from
1742 names of captured locals.
1745 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
1746 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
1747 Pass 'target_type' to BoxedCast. Don't default to 'object'.
1748 (ExplicitConversion): Remove enum cases already handled by
1749 implicit conversion. Move implicit conversion check to the beginning.
1750 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
1751 * expression.cs (ArrayCreation.EmitDynamicInitializers):
1752 Don't treat System.Enum as a struct.
1754 2005-08-30 Jb Evain <jbevain@gmail.com>
1756 * attribute.cs: handles as expression in parameters.
1758 2005-08-30 Raja R Harinath <rharinath@novell.com>
1761 * class.cs (TypeContainer.VerifyClsName): Don't use a
1762 PartialContainer when verifying CLS compliance.
1763 (AbstractPropertyEventMethod): Set Parent here, ...
1764 (PropertyMethod): ... not here.
1766 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
1768 * attribute.cs : escaped attribute name should not be allowed to be
1769 resolved (e.g. @class as classAttribute). Fixed bug #75930.
1771 2005-08-29 Raja R Harinath <rharinath@novell.com>
1774 * convert.cs (ImplicitStandardConversionExists): Allow zero also
1775 when converting a long constant to unsigned long.
1776 * expression.cs (Invocation.OverloadResolve): Add sanity check to
1777 detect where IsApplicable and VerifyArgumentsCompat disagree.
1779 2005-08-29 Raja R Harinath <rharinath@novell.com>
1780 and Carlos Alberto Cortez <carlos@unixmexico.org>
1783 * class.cs (TypeContainer.CanElideInitializer): New helper.
1784 (TypeContainer.EmitFieldInitializers): Use it to determine if we
1785 can safely emitting the initializer of a field.
1787 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1789 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
1790 allowed inside a switch (without loop). Fixed bug #75433.
1792 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
1794 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
1795 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
1797 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1799 * driver.cs : kinda reverting the default encoding changes (not exact
1800 revert since I noticed that "codepage:reset" might not work fine).
1802 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1804 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
1805 Location. Now getter and setter store location correctly.
1806 (errors/cs0111-12.cs now reports the expected location.)
1808 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1810 * driver.cs : Use default encoding on the environment.
1811 Removed (now that) extra parameter for SeekableStreamReader.
1812 * support.cs : (SeekableStreamReader) third .ctor() argument for
1813 StreamReader is not required (always true). preamble size could
1814 be acquired in simpler and safe way.
1816 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
1818 * cs-parser.jay: report CS0642 at warning level 3
1819 and report CS0642 for an if else statement also
1820 fixes bug #74745. Patch by John Luke (and a bit
1822 Removed extra CS0642 warning check for "while",
1824 * statement.cs: In Block.Resolve(), CS0642 check
1825 is reimplemented to check a sequence of an empty
1826 statement and a block.
1828 Both fix bug #66777.
1830 2005-08-24 Marek Safar <marek.safar@seznam.cz>
1832 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
1833 detection until I fix it.
1835 * cs-tokenizer.cs: Changed error message.
1837 * cs-parser.jay: Fixed 2 error locations.
1839 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
1840 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
1843 * enum.cs (GetSignatureForError): Fixed.
1845 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
1849 * typemanager.cs (RegisterProperty): Removed.
1851 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
1853 2005-08-24 Raja R Harinath <rharinath@novell.com>
1856 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
1857 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
1859 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1861 * expression.cs : tiny fix is required for not warning positive ulong.
1864 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1866 * expression.cs : add CS0652 check for constant and integral
1867 expression. Fixed bug #53974.
1869 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1871 * expression.cs : in DoNumericPromotions(), check if there is implicit
1872 conversion overload for string (to check CS0034). Fixed bug #52492.
1874 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1876 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
1878 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1880 * ecore.cs : report location when it is *not* Null.
1882 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1888 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
1889 correctly. Fixed bug #75721.
1891 2005-08-23 Raja R Harinath <rharinath@novell.com>
1893 * support.cs (SeekableStreamReader.Position): Avoid an expensive
1894 loop that performs 'min (pos, char_count)'.
1897 * expression.cs (Unary.ResolveOperator): Don't discard implicit
1898 converted value in Operator.OnesComplement.
1900 2005-08-22 Ben Maurer <bmaurer@ximian.com>
1902 * anonymous.cs: If the anon method is pulled into a helper class,
1903 it needs to be `internal' not `private'. Fixes runtime behavior on
1906 2005-08-17 Marek Safar <marek.safar@seznam.cz>
1909 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
1912 2005-08-16 Marek Safar <marek.safar@seznam.cz>
1914 The big constants rewrite
1915 Fix #75746, #75685 and more
1916 As a side effect saved 1MB for MWF ;-)
1918 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
1919 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
1920 enum based for corlib compilation.
1922 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
1925 * class.cs (FixedField.Define): Use ResolveAsConstant.
1927 * const.cs (IConstant): Interface constants and enums.
1928 (Const.ResolveValue): New method for constant resolvning.
1929 (ExternalConstant): Constants from imported assemblies.
1931 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
1932 conversion; like enums.
1933 (Constant.ToType): Converts this constant to different type.
1934 (Constant.Increment): Adds 1.
1936 * convert.cs (ImplicitConversionRequired): Simplified.
1938 * cs-parser.jay: Create EnumMember directly.
1940 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
1942 * doc.cs (GenerateEnumDocComment): Removed.
1944 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
1945 (ConvertIntLiteral): Removed.
1946 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
1948 * enum.cs (EnumMember): Implement IConstant.
1949 (Enum.IsValidEnumConstant): Removed.
1950 (Enum.GetNextDefaultValue): Removed.
1951 (Enum.FindMembers): Updated.
1952 (Enum.GenerateDocComment): Iterate enum members.
1954 * expression.cs (Cast.TryReduce): Handle enums correctly.
1955 (New.Constantify): Made public.
1956 (MemberAccess.DoResolve): Removed contant specific if(s).
1958 * literal.cs (NullLiteral): Implement new abstract methods.
1960 * statement.cs (GotoCase.Resolve): Use new constant methods.
1961 (SwitchLabel.ResolveAndReduce): Use new constant methods.
1963 * typemanager.cs (LookupEnum): Removed.
1964 (IsEnumType): Fixed to work with corlib.
1965 (RegisterConstant): Removed.
1966 (LookupConstant): Removed.
1967 (GetConstant): Changed to work with IConstant.
1969 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
1971 * location.cs : Fixed overflown (>255) column number.
1973 2005-08-03 Raja R Harinath <rharinath@novell.com>
1975 First cut of the qualified-alias-member feature.
1976 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
1978 * cs-parser.jay (DOUBLE_COLON): New token.
1979 (namespace_or_type_name): Add rule for recognizing
1980 qualified-alias-members.
1981 (primary_expression): Likewise.
1982 (element_access): Allow QualifiedAliasMember as a possible
1983 type-bearing expression.
1984 (local_variable_type, local_variable_pointer_type): Likewise.
1985 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
1986 aliases in the current and enclosing namespace declarations.
1987 (NamespaceEntry.UsingAlias): Add CS0440 warning.
1988 * decl.cs (MemberName.is_double_colon): New.
1989 (MemberName.MemberName): Add new constructor for alias-member.
1990 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
1991 * expression.cs (QualifiedAliasMember): New expression type.
1993 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
1995 * location.cs : it borked when no argument was specified.
1997 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
1999 * location.cs : tiny ToString() format fix.
2001 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2003 * statement.cs : oops, it was missing.
2005 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2007 A set of fixes for precise line/column location.
2010 "token" field now holds a file/line "delta", a line number offset
2011 from the segment, and a column number. See also:
2012 http://lists.ximian.com/pipermail/mono-devel-list/2004-
2013 December/009508.html
2014 Removed static IsNull. Use instance IsNull property instead.
2016 For some tokens it stores Location. For Identifier it stores
2017 LocatedToken which is a pair of string name and location.
2018 Column numbers are adjusted only at getChar().
2020 Use Location.ToString() for reporting (it now contains column).
2022 Largely modified to use LocatedToken instead of
2023 string (IDENTIFIER), and to acquire Location from some tokens.
2024 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2025 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2027 Now MemberName holds Location. DeclSpace.ctor() receives Location
2028 as a parameter. Removed extra parameters to all derived classes.
2029 Replaced Location.IsNull() with instance property.
2030 * assign.cs, expression.cs :
2031 Added .ctor() overload that omits Location.
2033 Added "nameEscaped" flag that indicates the identifier was escaped
2034 in the source file. This fixes bug #57047.
2036 2005-09-02 Martin Baulig <martin@ximian.com>
2038 * class.cs: Make CS3005 a warning, not an error.
2040 2005-08-02 Marek Safar <marek.safar@seznam.cz>
2042 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2043 New method, looking for lo-case imported cls type.
2045 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2048 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2050 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2052 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2054 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2056 Optimized to save 3.5 MB for SWF compilation.
2058 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2060 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2061 (PartialContainer.Create): Moved logic AddToContainer.
2062 (PartialContainer.MarkForDuplicationCheck): Shares name.
2064 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2067 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2069 (Namespace.GetSignatureForError): New method.
2071 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2072 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2074 2005-08-01 Raja R Harinath <rharinath@novell.com>
2077 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2078 member lookup rather than qualifier_type, since qualifier_type can
2081 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2083 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2086 2005-07-31 Miguel de Icaza <miguel@novell.com>
2088 * statement.cs: Copy the local exception into the exception
2089 captured local. Fixes 75674
2091 2005-07-31 Raja R Harinath <harinath@gmail.com>
2094 * expression.cs (Invocation.OverloadResolve): Don't report error
2095 CS1501 if error CS1502 has been reported.
2096 (New.DoResolve): Delegate CS1501 reporting to
2097 Invocation.OverloadResolve.
2100 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2101 invariant-meaning-in-block property in an enclosing block if
2104 2005-07-29 Marek Safar <marek.safar@seznam.cz>
2106 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2107 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2108 (Switch.CheckSwitch): Just save 50kb for SWF.
2110 2005-07-27 Martin Baulig <martin@ximian.com>
2112 * anonymous.cs (CaptureContext.AddField): Added
2113 `AnonymousContainer am' argument; compute its toplevel scope if
2114 it's not already computed. Fixes #75649.
2116 2005-07-26 Raja R Harinath <rharinath@novell.com>
2119 * class.cs (Constructor.Emit): Reset block to null if the block
2122 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2124 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2126 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2128 * class.cs (MethodData.Define): Check whether accessor implementing
2129 interface is public.
2131 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2133 2005-07-22 Marek Safar <marek.safar@seznam.cz>
2136 * namespace.cs (LookupType): Moved same type check to...
2138 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2141 2005-07-21 Raja R Harinath <rharinath@novell.com>
2143 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2144 already found a typebuilder.
2145 * class.cs (MethodCore.IsDuplicateImplementation): Compare
2146 MemberNames, not strings.
2148 * const.cs (Error_ExpressionMustBeConst):
2149 Rename from Error_EpressionMustBeConst.
2150 * const.cs, class.cs, statement.cd: Update.
2152 2005-07-21 Marek Safar <marek.safar@seznam.cz>
2156 * const.cs (Const.LookupConstantValue): Report missing contant expression
2158 (Error_EpressionMustBeConstant): Only one error method.
2160 * class.cs, statement.c: Updated.
2162 2005-07-20 Raja R Harinath <rharinath@novell.com>
2164 * statement.cs (Block.Flags): Add back HasVarargs.
2165 (Block.flags): Make protected.
2166 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2168 * typemanager.cs (types, typecontainers, user_types): Remove.
2169 (UserTypes, TypeContainers): Likewise.
2170 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2171 (CleanUp, Reset): Update.
2172 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
2173 (GetNestedType): Use Type.GetNestedType.
2174 (CoreLookupType): Take two arguments, the namespace and the
2175 basename of the type. Update to use the Namespace.Lookup
2177 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2178 (RealMemberLookup): Use IsNestedChildOf instead of playing with
2179 string concatenation and substring matches.
2180 * class.cs, enum.cs, delegate.cs: Update to changes.
2182 2005-07-20 Marek Safar <marek.safar@seznam.cz>
2184 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2185 Expression and made virtual.
2187 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2188 (ImplicitStandardConversionExists): Fixed `byte' typo ?
2190 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2192 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2195 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2198 2005-07-18 Marek Safar <marek.safar@seznam.cz>
2201 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2202 AssemblyCultureAttribute is not used on executable.
2205 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2207 2005-07-16 Raja R Harinath <rharinath@novell.com>
2210 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2211 New. Reports CS0252/CS0253.
2212 Mostly taken from preliminary patch by Duncak Mak.
2213 (Binary.DoResolveOperator): Store results of operator lookup.
2214 Use them to detect if we need to warn about unintended reference
2217 2005-07-15 Raja R Harinath <rharinath@novell.com>
2220 * namespace.cs (Namespace.Lookup): Add back location parameter.
2221 (Namespace.LookupType): Add CS0436 report. Add location parameter.
2222 * delegate.cs, ecore.cs, expression.cs: Update to changes.
2224 * codegen.cs (EmitContext.DeclSpace): Make readonly.
2225 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2226 (Namespace.LookupType): ... this.
2227 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2229 * typemanager.cs (LookupTypeReflection): Remove buggy code that
2230 purported to handle pointers.
2231 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2234 2005-07-15 Marek Safar <marek.safar@seznam.cz>
2236 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2239 2005-07-15 Raja R Harinath <rharinath@novell.com>
2241 * namespace.cs (Namespace.Lookup): Drop location parameter.
2242 (NamespaceEntry.LookupAlias): Remove. Merge into ...
2243 (NamespaceEntry.Lookup): ... this.
2244 (NamespaceEntry.Error_AmbiguousTypeReference):
2245 Move here from DeclSpace.
2246 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2248 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2249 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2250 Move to NamespaceEntry.
2251 * delegate.cs, expression.cs: Update to changes.
2253 2005-08-31 Martin Baulig <martin@ximian.com>
2255 Committing a patch from Atsushi Enomoto for #75850.
2257 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
2258 Prefer a generic enumerator over a non-generic one.
2260 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2262 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2263 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2265 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2267 * driver.cs : reverting default encoding change as well as mcs.
2269 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2271 * driver.cs, support.cs : merged r48826.
2273 > could you integrate your mcs changes to gmcs otherwise
2274 > gmcs cannot compile some files.
2276 2005-08-20 Martin Baulig <martin@ximian.com>
2278 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2279 scope if we don't already have it.
2281 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2282 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2285 2005-07-31 Miguel de Icaza <miguel@novell.com>
2287 * statement.cs: Copy the local exception into the exception
2288 captured local. Fixes 75674
2290 2005-07-15 Marek Safar <marek.safar@seznam.cz>
2292 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2295 2005-08-12 Martin Baulig <martin@ximian.com>
2297 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
2298 for nested types here to avoid hitting the cache too early.
2300 2005-08-09 Miguel de Icaza <miguel@novell.com>
2302 * enum.cs: On the new compiler CLS error 3005 is now a warning not
2305 2005-08-03 Martin Baulig <martin@ximian.com>
2307 Make iterators in generic methods work; see gtest-191.cs.
2310 (Constraints.Resolve): Protect against being called twice.
2313 (TypeContainer.GetClassBases): Make this `protected virtual'.
2315 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
2316 (Iterator.GetClassBases): Override this and compute the base
2318 (Iterator.DefineNestedTypes): If we're a generic method, all our
2319 method type parameters become class type parameters on the proxy
2323 (ToplevelBlock.Parameters): Make this a property, not a field.
2324 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2326 2005-08-03 Martin Baulig <martin@ximian.com>
2328 * typemanager.cs (TypeManager.IsSubclassOf): Use
2329 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
2330 (TypeManager.GetFullName_recursed): Improved.
2332 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2335 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
2336 Private accessor case, using TypeManager.IsPrivateAccessible instead of
2337 invocation_type == mi.DeclaringType, since the first one also checks
2338 other condition used by generic instances.
2340 2005-07-27 Martin Baulig <martin@ximian.com>
2342 * anonymous.cs (CaptureContext.AddField): Added
2343 `AnonymousContainer am' argument; compute its toplevel scope if
2344 it's not already computed. Fixes #75649.
2346 2005-07-14 Marek Safar <marek.safar@seznam.cz>
2348 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2349 CheckAttributeType and refactored.
2350 (Attribute.ResolvePossibleAttributeType): Changed to reuse
2351 ResolveAsTypeTerminal error handling.
2352 (ResolveAsTypeTerminal): Introduced because of global attributes extra
2354 (GetSignatureForError): Print errors in same way.
2357 * codegen.cs: Reflect attribute GetSignatureForError change.
2360 * expression.cs: Add silent parameter to ResolveAsTypeStep.
2362 * namespace.cs (UsingEntry): Refactored to make fields private.
2365 statement.cs: Error_UnexpectedKind has extra parameter.
2367 2005-07-14 Raja R Harinath <rharinath@novell.com>
2369 * ecore.cs (IAlias): Remove.
2370 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
2371 that implement the interface.
2372 * namespace.cs (Namespace): Likewise.
2373 (Namespace.declspaces): Renamed from 'defined_names'.
2374 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
2375 DeclSpace instead of an IAlias.
2376 * tree.cs (Tree.AddDecl): Update.
2378 2005-07-12 Raja R Harinath <rharinath@novell.com>
2380 * statement.cs (Block.Flags); Remove HasVarargs.
2381 (Block.HasVarargs): Move to ToplevelBlock.
2382 (Block.ThisVariable, Block.AddThisVariable): Likewise.
2383 (Block.Variables): Make protected. Initialize variable hashtable
2385 (Block.AddVariable): Update.
2386 (Block.Resolve): Update to changes.
2387 (ToplevelBlock.HasVarargs): New boolean.
2388 (ToplevelBlock.ThisVariable): Move here from Block.
2389 (ToplevelBlock.AddThisVariable): Likewise.
2390 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
2391 * expression.cs (This.ResolveBase): Update to changes.
2392 (ArglistAccess.DoResolve): Likewise.
2394 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2397 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2399 * class.cs (TypeContainer.VerifyMembers): Distinguish between
2400 not used and not used & assigned.
2401 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2403 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2406 * expression.cs (Is.DoResolve): null is never provided type.
2408 2005-07-08 Marek Safar <marek.safar@seznam.cz>
2411 * cs-parser.jay: Less strict event error rule to catch more errors.
2413 2005-07-11 Martin Baulig <martin@ximian.com>
2415 * generic.cs (ConstructedType.CheckConstraints): Improve the check
2416 for the constructor constraint: we do not only have to check
2417 whether the class has a public constructor, but also ensure that
2418 it's parameterless. Fixes #75492.
2420 2005-07-11 Martin Baulig <martin@ximian.com>
2422 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
2423 between type parameters if they either have the reference type
2424 constraint or the class constraint.
2426 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
2428 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
2430 2005-07-07 Marek Safar <marek.safar@seznam.cz>
2433 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
2434 (ExtractSecurityPermissionSet): Cope with self referencing security
2435 attributes properly.
2437 * driver.cs (SetOutputFile): Made public property OutputFile.
2439 2005-07-07 Raja R Harinath <rharinath@novell.com>
2442 * class.cs (TypeContainer.first_nonstatic_field): Rename from
2443 has_nonstatic_fields. Make into a FieldBase pointer.
2444 (TypeContainer.AddField): Add CS0282 check.
2445 (TypeContainer.EmitType): Update.
2447 2005-07-06 Miguel de Icaza <miguel@novell.com>
2449 * cs-tokenizer.cs (consume_identifier): Do not create strings to
2450 compare if they start with __.
2452 2005-07-06 Raja R Harinath <rharinath@novell.com>
2454 * statement.cs (Switch.SwitchGoverningType): Only look at
2455 UserCasts that don't need implicit standard conversions to one of
2456 the allowed switch types (Fixes test-322.cs).
2457 (LocalInfo.Resolve): Re-enable sanity-test.
2459 2005-07-06 Marek Safar <marek.safar@seznam.cz>
2461 * cs-tokenizer.cs (consume_identifier): Detect double undescores
2463 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
2465 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
2467 2005-07-06 Raja R Harinath <rharinath@novell.com>
2470 * ecore.cs (SimpleName.GetSignatureForError): Add.
2471 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
2472 (MemberAccess.GetSignatureForError): Add.
2474 2005-07-05 Marek Safar <marek.safar@seznam.cz>
2476 The big error and warning messages review.
2506 * typemanager.cs: Updated.
2508 * class.cs: (MethodCore.SetYields): Moved here to share.
2509 (PropertyMethod.Define): Moved iterator setup here.
2511 * iterators.cs: Add orig_method to have full access to parent
2514 2005-07-05 Raja R Harinath <rharinath@novell.com>
2516 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
2517 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
2518 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
2519 variable of struct type.
2520 * expression.cs (Unary.ResolveOperator): Update to change.
2521 (Indirection.VerifyFixed): Likewise.
2522 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
2523 (ParameterReference.VerifyFixed): Value parameters are fixed.
2524 (This.VerifyFixed): Treat 'this' as a value parameter.
2525 * statement.cs (LocalInfo.IsFixed): Remove.
2527 2005-07-01 Martin Baulig <martin@ximian.com>
2529 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2530 `ec.EmitThis ()' to get the correct scope.
2532 2005-07-01 Martin Baulig <martin@ximian.com>
2534 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
2535 instance is a ParameterReference; fixes #75299.
2537 2005-06-30 Raja R Harinath <rharinath@novell.com>
2540 * expression.cs (Indexers.map): Remove.
2541 (Indexers.Append): Filter out inaccessible setters and getters.
2542 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
2545 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
2547 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
2548 (FieldExpr.Emit, PropertyExpr.Emit): Update.
2549 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
2550 * expression.cs (Invocation.EmitCall): Add CS0120 check.
2552 2005-06-30 Marek Safar <marek.safar@seznam.cz>
2555 * class.cs (FieldBase.GetInitializerExpression): One more field
2558 2005-06-28 Miguel de Icaza <miguel@novell.com>
2560 * pending.cs: Do not define a proxy if the base method is virtual,
2561 it will be picked up by the runtime (bug 75270).
2563 2005-07-08 Martin Baulig <martin@ximian.com>
2565 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
2566 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
2568 2005-07-07 Martin Baulig <martin@ximian.com>
2570 * generic.cs (ConstructedType.CheckConstraint): Use
2571 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
2572 called recursively; fixes #75329.
2574 2005-07-06 Martin Baulig <martin@ximian.com>
2576 * generic.cs (TypeManager.InferTypeArguments): Added support for
2577 anonymous methods; fixes #75461.
2579 2005-07-01 Martin Baulig <martin@ximian.com>
2581 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2582 `ec.EmitThis ()' to get the correct scope.
2584 2005-07-01 Martin Baulig <martin@ximian.com>
2586 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
2587 instance is `This'; fixes #75299.
2589 2005-06-30 Martin Baulig <martin@ximian.com>
2591 * class.cs (Indexer): Implement IIteratorContainer; added support
2592 for iterators in indexers.
2595 (EmitContext.CurrentIterator): Make this a property, not a field.
2597 * anonymous.cs (AnonymousContainer.Iterator): New public property.
2599 2005-06-28 Miguel de Icaza <miguel@novell.com>
2601 * pending.cs: Do not define a proxy if the base method is virtual,
2602 it will be picked up by the runtime (bug 75270).
2604 2005-06-28 Martin Baulig <martin@ximian.com>
2606 * cs-parser.jay (interface_method_declaration): Avoid a
2607 reduce/reduce conflict by moving some of the code into a separate
2608 `interface_method_declaration_body' rule; fixes #75368.
2610 2005-06-28 Martin Baulig <martin@ximian.com>
2612 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
2613 array check after the check for TypeBuilder's.
2615 2005-06-21 Raja R Harinath <rharinath@novell.com>
2617 * convert.cs (FindMostEncompassedType): Add two trivial special
2618 cases (number_of_types == 0 || number_of_types == 1).
2619 (FindMostEncompasingType): Likewise.
2621 2005-06-17 Raja R Harinath <rharinath@novell.com>
2623 Some cleanups preparing for the fix of #75283.
2624 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
2626 (EventExpr.InstanceResolve): Likewise.
2627 (EventExpr.DoResolve): Remove redundant checks.
2629 2005-06-08 Miguel de Icaza <miguel@novell.com>
2631 * class.cs: Small fix.
2633 2005-06-08 Raja R Harinath <rharinath@novell.com>
2636 * class.cs (GetPartialBases): Fix return value check of
2639 2005-06-07 Raja R Harinath <rharinath@novell.com>
2641 Ensure that partial classes are registered in their enclosing
2642 namespace. Initial part of fix of #75160.
2643 * tree.cs (Tree.RecordDecl): Add new namespace argument.
2644 Register declspace with namespace here, not in
2645 DeclSpace.RecordDecl.
2646 * cs-parser.jay: Pass namespace to RecordDecl.
2647 * class.cs (PartialContainer.Create): Likewise.
2648 (ClassPart.DefineType): New sanity-check. Throws an exception if
2650 * decl.cs (Declspace.RecordDecl): Remove.
2651 * namespace.cs (NamespaceEntry.DefineName): Remove.
2653 2005-06-06 Marek Safar <marek.safar@seznam.cz>
2655 * rootcontext.cs: Reset TargetExt as well.
2657 2005-06-03 Raja R Harinath <rharinath@novell.com>
2659 * ecore.cs (Expression.Resolve): Emit CS0654 error when
2662 2005-06-02 Raja R Harinath <rharinath@novell.com>
2664 Fix #75080, cs0119.cs.
2665 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
2667 (Expression.Resolve): ... this. Use it. Remove bogus code
2668 allowing ExprClass.Type and ExprClass.Namespace for
2669 ResolveFlags.VariableOrValue.
2670 (Expression.Resolve) [1-argument variant]: Change default resolve
2671 flags based on language version.
2672 (Expression.Error_UnexpectedKind): Use a simple string array
2673 rather than an ArrayList.
2674 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
2676 (TypeOfVoid.DoResolve): Likewise.
2677 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
2678 flags argument -- it always has the same value.
2680 2005-05-31 Raja R Harinath <rharinath@novell.com>
2683 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
2684 Use it in the error message.
2685 * assign.cs, expression.cs, statement.cs: Update.
2687 2005-05-30 Raja R Harinath <rharinath@novell.com>
2690 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
2691 the "almostMatchedMember" case too.
2692 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
2693 that failed the accessibility checks to 'almost_match'.
2695 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
2697 * attribute.cs: Use internal MethodBuilder methods to set
2698 ExactSpelling and SetLastError on PInvoke methods, instead
2699 of passing them via charset. Fixes #75060.
2701 2005-05-27 Raja R Harinath <rharinath@novell.com>
2703 * parameter.cs (Parameter): Remove TODO comment.
2704 (Parameter.DefineParameter): Remove Location parameter.
2705 (Parameters.LabelParameters): Likewise.
2706 * class.cs (Constructor.Emit): Update to change.
2707 (MethodData.Emit): Likewise.
2708 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
2709 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
2711 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
2714 Removed Parameters.Location and added Parameter.Location instead.
2715 Removed Location parameter from Emit() and GetSignature().
2722 Modified all related calls.
2724 2005-06-21 Martin Baulig <martin@ximian.com>
2726 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
2727 left-hand side is not a nullable type; fixes #75328.
2729 2005-06-21 Martin Baulig <martin@ximian.com>
2732 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
2733 (TypeManager.GetFullNameSignature): Likewise.
2735 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
2736 `source.FullName' and `target.FullName' to check whether there are
2737 two conflicting definitions.
2739 2005-06-21 Martin Baulig <martin@ximian.com>
2741 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
2742 a BoxedCast - also for reference types - to be compatible with csc.
2744 2005-06-21 Martin Baulig <martin@ximian.com>
2746 * expression.cs (MemberAccess.DoResolve): Add support for nested
2747 types in a generic instance; fixes #75320.
2749 2005-06-20 Martin Baulig <martin@ximian.com>
2751 * generic.cs (TypeManager.InferType): Also walk the class
2752 hierarchy for generic instances; fixes #75261.
2754 2005-06-17 Martin Baulig <martin@ximian.com>
2756 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
2757 to make things work for corlib.
2759 2005-06-15 Martin Baulig <martin@ximian.com>
2761 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
2762 obsolete `SecurityAction' values.
2764 2005-06-06 Marek Safar <marek.safar@seznam.cz>
2766 * rootcontext.cs: Reset TargetExt as well.
2768 2005-06-09 Martin Baulig <martin@ximian.com>
2770 * delegate.cs (Delegate.VerifyMethod): Added
2771 `MethodGroupExpr old_mg' argument; inherit its
2772 `HasTypeParameters'; fix #75085.
2774 2005-06-09 Martin Baulig <martin@ximian.com>
2776 * expression.cs (Invocation.OverloadResolve): Correctly handle
2777 generic methods for the SetMemberIsUsed(); fix #75064.
2779 2005-06-09 Martin Baulig <martin@ximian.com>
2781 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
2784 2005-06-08 Martin Baulig <martin@ximian.com>
2786 * cs-parser.jay (nullable_type_or_conditional): If we put the
2787 nullable back and our `type' is a `ComposedCast', remove the
2788 nullable from it. Fixes #75156.
2790 * expression.cs (ComposedCast.RemoveNullable): New public method.
2792 2005-06-08 Martin Baulig <martin@ximian.com>
2794 The big Iterators rewrite :-)
2796 * iterators.cs: Rewrite this to use the anonymous methods framework.
2798 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
2799 before the TypeContainers; see 2test-21.cs.
2802 (TypeContainer.DefineType): Don't create a new EmitContext if we
2803 already have one (this only happens if we're an Iterator).
2804 (TypeContainer.Define): Also call Define() on all our iterators.
2805 (Method.CreateEmitContext): Added support for iterators.
2808 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
2809 (AnonymousContainer.CreateMethodHost): Moved here from
2810 AnonymousMethod and made abstract.
2811 (AnonymousContainer.CreateScopeType): New abstract method.
2812 (AnonymousContainer.IsIterator): New public property.
2813 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
2814 get the ScopeTypeBuilder rather than manually defining it here.
2815 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
2818 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
2819 before RootContext.DefineTypes().
2821 * codegen.cs (EmitContext.RemapToProxy): Removed.
2822 (EmitContext.CurrentAnonymousMethod): Changed type from
2823 AnonymousMethod -> AnonymousContainer.
2824 (EmitContext.ResolveTopBlock): Protect from being called twice.
2825 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
2826 (EmitContext.EmitThis): Removed the iterators hacks; use the
2827 anonymous methods framework for that.
2830 (ToplevelBlock.Container): Make this a property, not a field.
2831 (ToplevelBlock.ReParent): New public method; move the
2832 ToplevelBlock into a new container.
2833 (Foreach.TemporaryVariable): Simplify.
2835 2005-06-05 Martin Baulig <martin@ximian.com>
2837 * statement.cs (LocalInfo.CompilerGenerated): New flag.
2838 (Block.AddTemporaryVariable): New public method; creates a new
2839 `LocalInfo' for a temporary variable.
2840 (Block.EmitMeta): Create the LocalBuilders for all the temporary
2842 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
2843 non-iterator variables.
2845 2005-06-05 Martin Baulig <martin@ximian.com>
2847 * statement.cs (Foreach.TemporaryVariable): Create the
2848 LocalBuilder in the Emit phase and not in Resolve since in some
2849 situations, we don't have an ILGenerator during Resolve; see
2850 2test-19.cs for an example.
2852 2005-06-04 Martin Baulig <martin@ximian.com>
2854 The big Foreach rewrite - Part II.
2856 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
2857 with `PropertyInfo ienumerator_getcurrent'.
2859 * codegen.cs (VariableStorage): Removed.
2862 (Foreach): Derive from Statement, not ExceptionStatement.
2863 (Foreach.CollectionForeach): New nested class. Moved all the code
2864 dealing with collection foreach here.
2865 (Foreach.ForeachHelperMethods): Removed.
2866 (Foreach.TemporaryVariable): Implement IMemoryLocation.
2868 2005-05-23 Martin Baulig <martin@ximian.com>
2870 * statement.cs (Try.DoResolve): Don't create a `finally' if we
2871 don't need to. Fix #75014.
2873 2005-05-26 Raja R Harinath <rharinath@novell.com>
2875 Improve user-defined conversion handling.
2876 * convert.cs (GetConversionOperators): Rewrite. Return only the
2877 applicable operators.
2878 (AddConversionOperators): New. Helper for GetConversionOperators.
2879 (FindMostEncompassedType, FindMostEncompassingType): Verify that
2880 there is only one most encompassed/encompassing type.
2881 (FindMostSpecificSource, FindMostSpecificTarget): Remove
2882 "applicable operator" handling.
2883 (UserConversion): Move cache here from GetConversionOperators.
2884 Directly cache the chosen operator, rather than the whole
2886 (ExplicitNumericConversion): Fix buggy implementation of Decimal
2887 case. Allow conversion of decimal to sbyte and byte too.
2888 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2889 New static methods. Used to avoid allocating EmptyExpressions in
2892 2005-05-24 Duncan Mak <duncan@novell.com>
2894 * ecore.cs (CastFromDecimal): New class for casting a decimal to
2895 another class, used in Convert.ExplicitNumericConversion.
2896 (CastToDecimal): New class, similar to above, but casts to
2897 System.Decimal, used in Convert.ImplicitNumericConversion and also
2898 in explicit convesion from double/float to decimal.
2900 * convert.cs (ImplicitNumericConversion): Handle implicit
2901 conversions to System.Decimal.
2902 (ExplicitNumericConversion): handle explicit conversions to
2907 2005-05-20 Miguel de Icaza <miguel@novell.com>
2909 * typemanager.cs: Do not throw an exception in the TypeBuilder
2910 case, we take care of it on the TypeCode.
2912 2005-05-17 Marek Safar <marek.safar@seznam.cz>
2914 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
2917 * cs-parser.jay: Catch more lexical errors.
2919 * report.cs: Add one more Error method.
2922 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
2924 2005-05-20 Martin Baulig <martin@ximian.com>
2926 * class.cs (TypeContainer.CircularDepException): Removed.
2927 (TypeContainer.DefineType): Removed the `InTransit' stuff.
2928 (TypeContainer.CheckRecursiveDefinition): Check for circular class
2929 (CS0146) and interface (CS0529) dependencies here.
2931 2005-05-20 Martin Baulig <martin@ximian.com>
2933 * expression.cs (New.DoResolve): Move the CS0712 check above the
2934 CS0144 check; otherwise it can never be reached.
2936 2005-05-20 Martin Baulig <martin@ximian.com>
2938 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
2940 2005-05-20 Martin Baulig <martin@ximian.com>
2942 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
2944 * typemanager.cs (TypeManager.IsAttributeType): New public method.
2946 2005-05-19 Martin Baulig <martin@ximian.com>
2949 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
2950 to disable error reporting.
2952 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
2953 here since we don't want to report an error; see the new test-336.cs.
2955 2005-05-19 Raja R Harinath <rharinath@novell.com>
2957 * statement.cs (ToplevelBlock.GetParameterReference)
2958 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
2959 Move here from class Block.
2960 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
2961 * expression.cs (ParameterReference.DoResolveBase): Likewise.
2963 2005-05-18 Martin Baulig <martin@ximian.com>
2968 (FlowBranching.Reachability): Add non-static public And() and Or()
2970 (FlowBranchingSwitch): New class; do the `break_origins' thing
2971 like in FlowBranchingLoop.
2972 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
2973 reachability, not just locals and parameters.
2974 (FlowBranching.MergeChild): Remove some of the hacks for loop and
2975 switch; MergeBreakOrigins() now takes care of that.
2977 2005-05-18 Martin Baulig <martin@ximian.com>
2979 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2980 a loop and may leave it, reset the barrier; fixes #74974.
2982 2005-05-16 Raja R Harinath <rharinath@novell.com>
2984 Fix test-382.cs. Emit values of decimal constants.
2985 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
2987 (TypeContainer.AddField): ... this.
2988 (TypeContainer.EmitFieldInitializers): Allow the list of fields
2989 with initializers to include 'Const's.
2990 (ClassPart.RegisterFieldForInitialization): Forward to
2992 * const.cs (Const.Const): Pass initializer to base class.
2993 (Const.Define): In case of decimal constants, register them for
2994 initialization in a static constructor.
2996 2005-05-14 Martin Baulig <martin@ximian.com>
2998 * statement.cs (Block.Resolve): Correctly handle unreachable code;
2999 do not call ResolveUnreachable() on unreachable statements in
3000 here, see the comment in the source code.
3002 2005-05-13 Raja R Harinath <rharinath@novell.com>
3005 * expression.cs (BinaryResolveOperator): If one of the operands of
3006 an equality comparison is 'null' and the other is a pointer type,
3007 convert the null to a NullPointer.
3008 * convert.cs (ImplicitReferenceConversion): If the expression is a
3009 NullLiteral and the target type is a pointer type, return a
3010 NullPointer instead.
3011 (ImplicitConversionStandard): Likewise.
3013 2005-05-13 Marek Safar <marek.safar@seznam.cz>
3015 * cs-parser.jay: Set readonly context based on special constructs.
3017 * expression.cs (LocalVariableReference.DoResolveBase): Improved
3018 readonly variable error handling.
3020 * rootcontext.cs (EmitCode): Don't verify members when error
3023 * statement.cs (LocalInfo): Add reaodnly context information.
3024 (SetReadOnlyContext, GetReadOnlyContext): New methods.
3026 2005-05-17 Martin Baulig <martin@ximian.com>
3028 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3031 2005-05-13 Martin Baulig <martin@ximian.com>
3033 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3034 handle unreachable blocks.
3036 2005-05-13 Martin Baulig <martin@ximian.com>
3039 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3040 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3043 2005-05-13 Martin Baulig <martin@ximian.com>
3045 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3046 instance variable, not a local. Fix #74873.
3047 (Block.ResolveUnreachable): Set it to true here.
3049 2005-05-12 Martin Baulig <martin@ximian.com>
3051 * cs-parser.jay (property_declaration): Pass the `current_class',
3052 not the `current_container' to Property's .ctor. Fixes #74912.
3054 2005-05-11 Martin Baulig <martin@ximian.com>
3056 * typemanager.cs (Closure): Copy this from MCS and merge all the
3057 GMCS-specific changes into it.
3059 2005-05-12 Raja R Harinath <harinath@gmail.com>
3062 * typemanager.cs (unmanaged_enclosing_types): New.
3063 (IsUnmanagedType): Avoid infloops by using
3064 'unmanaged_enclosing_types' to talk with recursive invocations.
3066 2005-05-11 Duncan Mak <duncan@novell.com>
3068 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3069 continuing to process for 'arg'.
3070 (handle_preprocessing_directive): Check the argument of the #endif
3071 directive and report error CS1025 if there are any trailing
3074 According to the C# spec, having even whitespace after the #endif
3075 directive is illegal; however, because we call arg.TrimEnd ()
3076 beforehand, we have the same behavior as csc, allowing whitespace
3077 after the directive.
3081 2005-05-11 Marek Safar <marek.safar@seznam.cz>
3085 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3086 (Constructor.GetObsoleteAttribute): Implemented correctly.
3088 2005-05-10 Martin Baulig <martin@ximian.com>
3090 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3091 resolve the type; fixes #74864.
3092 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3093 in DoResolve(); fixes #74862.
3095 2005-05-10 Martin Baulig <martin@ximian.com>
3097 * support.cs (ReflectionParameters.ParameterModifier): Use
3098 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3099 and `ParameterAttributes.In'. Fixes #74884.
3101 2005-05-10 Martin Baulig <martin@ximian.com>
3103 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3104 the cache if we're just looking for `MemberTypes.NestedType' in a
3107 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3108 constraints if we're still resolving the type tree.
3109 (Expression.MemberLookup): If we're resolving the type tree, only
3110 look for `MemberTypes.NestedType' since we're only interested in
3113 * class.cs (TypeContainer.DefineType): Don't resolve the type
3114 parameters here; do this later in ResolveType() after the type
3115 tree has been resolved.
3116 (TypeContainer.ResolveType): New public method; this is called
3117 after the type tree is resolved and before the types are being
3118 populated. We resolve the generic constraints here.
3119 (TypeContainer.DoDefineMember): Check the constraints on our base
3120 class and interfaces.
3122 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3123 set the `ResolvingTypeTree' flag on the EmitContext.
3125 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3127 2005-05-10 Marek Safar <marek.safar@seznam.cz>
3129 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3131 * expression.cs (Argument.GetParameterModifier): Turned to property.
3132 (Invocation.Error_InvalidArguments): Add more descriptive errors.
3134 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3137 2005-05-09 Raja R Harinath <rharinath@novell.com>
3140 * decl.cs (MemberCache.AddMethods): Register override methods,
3141 rather than non-override methods.
3142 * typemanager.cs (RegisterOverride): New.
3143 (IsOverride): Update.
3145 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3147 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3149 2005-05-06 Martin Baulig <martin@ximian.com>
3152 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3153 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3155 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3159 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3160 recursive declaration.
3162 * statement.cs (Block.ResolveMeta): Report any error in resolving.
3164 2005-05-06 Marek Safar <marek.safar@seznam.cz>
3166 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3168 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3170 2005-05-05 Raja R Harinath <rharinath@novell.com>
3173 * decl.cs (DeclSpace.FamilyAccessible):
3174 Use TypeManager.IsNestedFamilyAccessible.
3176 Fix reopened #64812.
3177 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3180 2005-05-04 Raja R Harinath <rharinath@novell.com>
3181 Abin Thomas <projectmonokochi@rediffmail.com>
3182 Anoob V E <projectmonokochi@rediffmail.com>
3183 Harilal P R <projectmonokochi@rediffmail.com>
3186 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3187 allow access to all static members.
3189 2005-05-04 Martin Baulig <martin@ximian.com>
3191 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3193 2005-05-04 Martin Baulig <martin@ximian.com>
3197 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3198 section at the end; make things work if `default' is not the last
3201 2005-05-04 Martin Baulig <martin@ximian.com>
3205 * statement.cs (Switch): Replaced the `got_default' field with a
3206 `default_section' one.
3207 (Switch.CheckSwitch): Set `default_section' here.
3208 (Switch.Resolve): If we're a constant switch and the constant is
3209 not found, use the default section.
3211 2005-05-03 Martin Baulig <martin@ximian.com>
3213 * expression.cs (ArrayAccess.EmitGetLength): New public method.
3215 * statement.cs (Foreach.ArrayForeach): New nested class.
3216 (Foreach.TemporaryVariable): New nested class.
3217 (Foreach.EmitArrayForeach): Removed; this is now in the new
3220 2005-05-03 Raja R Harinath <rharinath@novell.com>
3222 * pending.cs (BaseImplements): Move the #74773 fix here. This is
3224 (VerifyPendingMethods): Revert change below.
3226 * typemanager.cs (IsOverride, RegisterNonOverride): New.
3227 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3228 that used to trigger warning -28. Remove warning -28.
3229 * expression.cs (Invocation.OverloadResolve): Use
3230 TypeManager.IsOverride to distinguish override methods.
3233 * pending.cs (VerifyPendingMethods): If a base type implements the
3234 requested interface, don't bother checking individual methods of
3235 the base type. As a side-effect, this prevents the creation of
3236 unnecessary proxies.
3238 2005-05-02 Martin Baulig <martin@ximian.com>
3242 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3243 Also `And' the locals if the old vector is null.
3244 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3245 null; in this case we basically reset all the variables.
3247 2005-05-02 Martin Baulig <martin@ximian.com>
3251 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3252 Added `FlowBranching branching' argument; always `and' the
3253 variables instead of `or'ing them unless we're an infinite loop.
3255 * statement.cs (While.Resolve): Create a new sibling unless we're
3258 2005-05-02 Martin Baulig <martin@ximian.com>
3262 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3263 arguments; use it instead of creating a new TopLevelBlock.
3264 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3265 our ConstructorInitializer.
3268 (TopLevelBlock.TopLevelBranching): New public property.
3269 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3270 and create our `TopLevelBranching'.
3272 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3273 anonymous method host, use `block.TopLevelBranching' rather than
3274 creating a new branching.
3276 2005-04-20 Miguel de Icaza <miguel@novell.com>
3278 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3279 a ScopeInfo, if any of the current children is a child of the new
3280 entry, move those children there.
3282 2005-04-30 Martin Baulig <martin@ximian.com>
3284 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3285 at the beginning of a SwitchSection. Fix #73335.
3287 2005-04-27 Marek Safar <marek.safar@seznam.cz>
3290 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3292 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3293 (FieldExpr.DoResolve): Obsolete members are ignored for field
3296 2005-04-26 Marek Safar <marek.safar@seznam.cz>
3298 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3299 of arrays detection.
3301 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3303 (Field.VerifyClsCompliance): Volatile fields are not compliant.
3305 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3308 2005-04-25 Ben Maurer <bmaurer@ximian.com>
3310 * cs-parser.jay: Use the prefered version of -unsafe in error
3313 2005-04-22 Marek Safar <marek.safar@seznam.cz>
3315 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3318 2005-04-20 John Luke <john.luke@gmail.com>
3320 * driver.cs: fix typo in error message, --outout to --output
3322 2005-04-30 Martin Baulig <martin@ximian.com>
3324 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
3325 handle the .NET 2.x security attributes.
3327 2005-04-30 Martin Baulig <martin@ximian.com>
3330 (TypeManager.ExpandInterfaces): Don't add things twice.
3333 (TypeContainer.VerifyClsCompliance): Allow generic instances.
3335 2005-04-29 Martin Baulig <martin@ximian.com>
3337 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
3339 * anonymous.cs: Added support for anonymous generic methods.
3341 2005-04-29 Martin Baulig <martin@ximian.com>
3343 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
3346 2005-04-29 Martin Baulig <martin@ximian.com>
3348 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
3350 * expression.cs (New.DoResolve): Fix the CS0304 check.
3352 2005-04-29 Martin Baulig <martin@ximian.com>
3354 * typemanager.cs (TypeManager.GetFullName): Updated to the new
3357 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
3358 explicit interface implementation, compare the interface types.
3359 (MethodData.Define): Use the new naming scheme from the latest
3361 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
3363 * decl.cs (MemberName.GetMemberName): Removed.
3364 (MemberName.MethodName, FullName): New properties.
3366 2005-04-25 Raja R Harinath <rharinath@novell.com>
3368 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3370 2005-04-22 Martin Baulig <martin@ximian.com>
3372 * generic.cs (GenericMethod): Create the EmitContext in the
3373 `Define()'; in `Define(MethodBuilder)', create the type parameters
3374 before calling `Define()'. Fixes #73933.
3376 2005-04-22 Martin Baulig <martin@ximian.com>
3379 (Constraints.Resolve): Make things work wrt. the new type lookup system.
3380 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3382 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3383 ConstructedType, check its constraints.
3385 2005-04-20 Marek Safar <marek.safar@seznam.cz>
3387 * codegen.cs (InRefOutArgumentResolving): New field.
3389 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3390 fields outside contructor.
3392 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3394 2005-04-19 Miguel de Icaza <miguel@novell.com>
3396 * anonymous.cs (CaptureContext.EmitParameterInstance): The
3397 parameter code was not completed ever, so it was not as up-to-date
3398 as local variables. Must finish it.
3400 The bug fix was to compare the Toplevel of the block, not the
3401 current block. Thanks for Ben for pointing this out.
3403 2005-04-19 Raja R Harinath <rharinath@novell.com>
3405 * decl.cs (AddMethods): Use the declaring type of the problem
3406 method to determine if we want to squash a warning.
3408 2005-04-19 Marek Safar <marek.safar@seznam.cz>
3410 * attribute.cs: Removed debug output.
3412 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3414 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3417 2005-04-18 Raja R Harinath <rharinath@novell.com>
3420 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
3421 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
3422 all null comparisons against reference types.
3424 2005-04-18 Marek Safar <marek.safar@seznam.cz>
3427 * class.cs (TypeContainer.CircularDepException) New nested
3429 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
3430 (TypeContainer.DefineType): Removed error, reset InTransit before
3432 (Class.DefineType): Throw exception when is in Transit.
3433 Catch exception and report error.
3434 (Struct.DefineType): Throw exception when is in Transit.
3435 Catch exception and report error.
3436 (Interface.DefineType): Throw exception when is in Transit.
3437 Catch exception and report error.
3439 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
3440 handle nested exception handlers.
3442 * flowanalysis.cs (InTryWithCatch): New method, search for try with
3445 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
3446 InFinally and InCatch storage.
3448 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
3449 (Catch.Resolve): Set and Restore ec.InCatch.
3450 (Try.Resolve): Set and Restore ec.InFinally.
3451 (Try.HasCatch): True when try has catch.
3453 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
3455 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
3456 for the same event member, so exclude such cases from warning 419.
3459 2005-04-16 Miguel de Icaza <miguel@novell.com>
3461 * expression.cs (Binary.ResolveOperator): Apply patch from John
3462 Luke to fix bug 59864: operators &, | and ^ on enumerations
3463 require that the same enum type on both sides.
3465 * driver.cs: Add warnings to old flag usage, this is to assist
3466 people who produce Makefiles and hope that the Makefiles will be
3469 * class.cs (TypeContainer.EmitType): Moved the definition of the
3470 special $PRIVATE$ field from the resolve phase to the Emit phase.
3471 During resolve we do not know if we are a struct with
3472 HasExplicitLayout, we know this only after the attributes for the
3475 Set the FieldOffset to zero on the dummy field that we create for
3476 the class. Fixes 74590.
3478 2005-04-16 Raja R Harinath <rharinath@novell.com>
3481 * ecore.cs (PropertyExpr.resolved): New.
3482 (DoResolve): Use it to handle a case of double resolution here.
3483 Handle a case of identical-name-and-type-name.
3484 * expression.cs (ArrayCreation.CheckIndices): Avoid double
3485 resolution by storing the results of expression resolution back
3486 into the "probes" array.
3488 2005-04-15 Raja R Harinath <rharinath@novell.com>
3490 Fix cs0208-7.cs and cs0208-8.cs.
3491 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
3492 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
3493 error reporting to point out the reason a struct is not unmanaged.
3495 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3497 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
3498 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
3500 2005-04-13 Raja R Harinath <rharinath@novell.com>
3503 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
3504 IdenticalNameAndTypeName here.
3505 (EventExpr.InstanceResolve): Likewise.
3507 2005-04-13 Marek Safar <marek.safar@seznam.cz>
3509 C# 2.0 DefaultCharSetAttribute implementation
3511 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
3512 which allows us to set GlobalNamespace for every resolve.
3513 (Attribute.ResolveArguments): Cut from Resolve.
3514 (Attribute.GetCharSetValue): Returns CharSet named argument.
3515 (Attribute.DefinePInvokeMethod): Gets default charset from
3517 (GlobalAttribute.ResolveAsTypeStep): Override.
3518 (GlobalAttribute.ResolveArguments): Override.
3520 * class.cs (TypeAttr): Is protected.
3522 * codegen.cs (ModuleClass.DefaultCharSet): New member.
3523 (ModuleClass.DefaultCharSetType): New memeber.
3524 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
3526 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
3527 charset from module.
3529 * delegate.cs (TypeAttr): Override.
3530 (Delegate.DefineType): Use this TypeAttr.
3532 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
3533 at very early stage (before types are defined) to resolve model
3534 module attributes. It will probably not work with corlib but it
3537 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
3538 charset from module.
3540 * typemanager.cs (default_charset_type): New type.
3542 2005-04-13 Raja R Harinath <rharinath@novell.com>
3544 * decl.cs (MemberCache.AddMethods): Don't warn if
3545 System.Object.Finalize has buggy MethodAttributes.
3547 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
3550 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3552 * doc.cs : detect ambiguous reference to overloaded members.
3553 Fixed bug #71603. MS 1.1 csc does not detect it.
3555 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3557 * doc.cs : delegates must not be referenced with parameters.
3560 2005-04-12 Miguel de Icaza <miguel@novell.com>
3562 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
3564 2005-04-10 Miguel de Icaza <miguel@novell.com>
3566 * driver.cs (MainDriver): Stop processing if the CLS stage found
3569 (CompilerCallableEntryPoint.InvokeCompiler): Always
3570 reset after execution; Take a TextWriter argument for the
3573 * report.cs: Use the error stream instead of hardcoding stderr.
3575 2005-04-09 Miguel de Icaza <miguel@novell.com>
3577 * class.cs: Reduce code paths to test, too small of an
3578 optimization to make it worth the extra testing. Always perform
3581 2005-04-08 Raja R Harinath <rharinath@novell.com>
3584 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
3585 operators that had errors reported on them.
3587 2005-04-08 Marek Safar <marek.safar@seznam.cz>
3589 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
3591 (Attribute.Resolve): Add named argument type checking.
3593 * class.cs (FixedField.Define): Use IsPrimitiveType
3595 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
3597 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
3598 unsafe parameter types.
3600 * statement.cs (Using.ResolveExpression): Add better error description.
3602 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
3604 2005-04-08 Raja R Harinath <rharinath@novell.com>
3607 * attribute.cs (Attribute.GetAttributeUsage): Resolve
3608 AttributeUsageAttribute in the emitcontext of the attribute class,
3609 not in the emitcontext of the attributable entity it was attached to.
3610 * cs-parser.jay: Use 'current_class', not 'current_container',
3611 when creating a GlobalAttribute.
3613 2005-04-08 Alp Toker <alp@atoker.com>
3615 * pending.cs: The fix to #58413 failed to compile methods implementing
3616 interfaces with/without params modifiers and vice versa, even though
3617 params modifiers aren't part of the signature. Make the modifier check
3618 less strict as in csc.
3620 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
3621 Anoob V E <projectmonokochi@rediffmail.com>
3622 Harilal P R <projectmonokochi@rediffmail.com>
3625 * pending.cs (TypeAndMethods.mods): New. Store the parameter
3626 modifiers of pending methods.
3627 (PendingImplementation.PendingImplementation): Initialize it.
3628 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
3629 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
3630 with ParameterData. Add check for modifiers.
3631 * class.cs (MethodData.Define): Update to changes.
3633 2005-04-07 Raja R Harinath <rharinath@novell.com>
3635 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
3637 2005-04-07 Marek Safar <marek.safar@seznam.cz>
3639 * class.cs (PropertyMethod.Define): Check private accessor in abstract
3642 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
3645 * typemanager.cs: Registered RequiredAttributeAttribute.
3647 2005-04-06 Marek Safar <marek.safar@seznam.cz>
3649 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
3650 Warning CS0169 is back at level 3.
3651 (IMethodData.SetMemberIsUsed): New method.
3653 * decl.cs (IsUsed): New value; moved from FieldBase.Status
3654 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
3656 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
3658 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
3660 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
3663 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
3666 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
3667 to avoid the problems with nested types.
3669 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
3670 Anoob V.E <projectmonokochi@rediffmail.com>
3671 Harilal P.R <projectmonokochi@rediffmail.com>
3672 Raja R Harinath <rharinath@novell.com>
3675 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
3677 * typemanager (GetConstructor): Make public.
3679 2005-04-05 John Luke <john.luke@gmail.com>
3680 Raja R Harinath <rharinath@novell.com>
3683 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
3684 struct too. Return false quicker in a few cases.
3685 (VerifyUnManaged): Use it.
3687 2005-04-05 Raja R Harinath <rharinath@novell.com>
3690 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
3691 not 'unreachable_seen'.
3693 2005-04-04 Marek Safar <marek.safar@seznam.cz>
3695 * attribute.cs (Attribute.GetValue): Removed unused.
3697 * codegen.cs (CodeGen.TrimExt): Removed unused.
3699 * cs-parser.jay (output): Removed unused.
3701 * cs-tokenizer.cs (hex_digits): Removed unused.
3703 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
3705 * expression.cs (Indirection.LoadExprValue): Removed unused.
3706 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
3708 * iterators.cs (Iterator.param_types): Removed unused.
3710 * statement.cs (Goto.block): Removed unused.
3711 (ToplevelBlock.did): Removed unused.
3712 (Switch.ResolveConstantSwitch): Removed unused.
3714 2005-04-01 Ben Maurer <bmaurer@ximian.com>
3716 * rootcontext.cs: Allow mcs to bootstrap with the compilation
3719 2005-04-19 Martin Baulig <martin@ximian.com>
3721 Merged r42462 from MCS and made it work for GMCS.
3723 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
3725 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
3727 2005-04-01 Raja R Harinath <rharinath@novell.com>
3729 Fix #74232 and cs0208-3.cs.
3730 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
3731 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
3732 unmanaged type. Don't use FieldBuilders when 't' is a
3733 TypeBuilder. Use ModFlags and MemberType fields.
3734 * class.cs (MemberBase.member_type): Rename from MemberType.
3735 (MemberBase.MemberType): New property. Determines member_type on
3737 (MemberBase.DoDefine): Don't initialize MemberType here.
3738 (FieldMember.Define): Likewise.
3740 2005-04-01 Marek Safar <marek.safar@seznam.cz>
3743 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
3744 Attributes are emitted there.
3746 2005-04-01 Raja R Harinath <rharinath@novell.com>
3748 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
3749 keyword in 'partial enum' too.
3750 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
3752 Report from Kamil Skalski <nazgul@omega.pl>.
3755 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
3756 have partial containers too.
3758 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
3759 in block' checks to Block.CheckInvariantMeaningInBlock.
3760 * statement.cs (Block.GetKnownVariableInfo): Make private.
3761 (Block.IsVariableUsedInChildBlock): Remove.
3762 (Block.IsVariableUsedInBlock): Likewise.
3763 (Block.CheckInvariantMeaningInBlock): New. Show location of
3764 conflicting declaration.
3765 (Block.AddVariable): Make error messages less long-winded and more
3766 specific. Show location of conflicting declaration.
3767 * parameter.cs (Parameters.Location): New readonly property.
3769 2005-03-31 Raja R Harinath <rharinath@novell.com>
3771 Clean up semantics of invoking ResolveMemberAccess.
3772 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
3773 can have an instance, ensure that we pass in a non-TypeExpression
3774 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
3775 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
3776 argument. Update to changes and simplify.
3777 (FieldExpr.Emitinstance): Remove CS0120 check.
3778 (PropertyExpr.EmitInstance): Likewise.
3779 * expression.cs (Argument.Resolve): Likewise.
3780 (Invocation.DoResolve): Update to changes in semantics of
3783 2005-03-31 Marek Safar <marek.safar@seznam.cz>
3786 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
3789 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
3791 2005-03-31 Raja R Harinath <rharinath@novell.com>
3793 Fix difference in behaviour with commandline invocation.
3794 * driver.cs (Driver.Reset): New.
3795 (CompilerCallableEntryPoint): Call it.
3797 * statement.cs (If.Resolve): Avoid spurious "uninitialized
3798 variable" warnings if the boolean expression failed to resolve.
3800 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
3802 * attribute.cs: Fix the union of several permissions when some of them
3803 are unrestricted (so the result isn't an unrestricted permission set).
3806 2005-03-30 Raja R Harinath <rharinath@novell.com>
3808 * ecore.cs (MemberExpr): New class. Convert from interface
3810 (MemberExpr.ResolveMemberAccess): Refactor and move here from
3811 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
3813 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
3814 (MethodGroupExpr.IsExplicitImpl): Remove.
3815 (Expression.GetFieldFromEvent): Remove.
3816 (SimpleName.MemberStaticCheck): Remove.
3817 (SimpleName.DoSimpleNameResolve): Update to changes.
3818 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
3819 (MemberAccess.IdenticalNameAndTypeName): Remove.
3820 (MemberAccess.error176): Move to MemberExpr.
3821 (MemberAccess.DoResolve): Update to changes.
3822 (BaseAccess.DoResolve): Likewise.
3824 2005-03-30 Marek Safar <marek.safar@seznam.cz>
3826 C# 2.0 Conditional attribute class implementation
3828 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
3829 Analyzes class whether it has attribute which has ConditionalAttribute
3830 and its condition is not defined.
3832 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
3833 (Class.IsExcluded): New method. Search for at least one defined
3834 condition in ConditionalAttribute of attribute class.
3836 2005-03-30 Raja R Harinath <rharinath@novell.com>
3838 * ecore.cs (PropertyExpr): Derive from Expression, not
3839 ExpressionStatement.
3840 (PropertyExpr.EmitStatement): Remove.
3842 2005-03-29 Raja R Harinath <rharinath@novell.com>
3845 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
3846 internal field "value__" of an enum be private. The examples for
3847 "value__" that I found on MSDN all used FieldAttributes.Private.
3849 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
3850 Don't mention IL method attribute names.
3852 Fix #47991. Remove a TODO.
3853 * statement.cs (Block.Toplevel): Make into a field.
3854 (Block.Parameters): Move into ToplevelBlock.
3855 (Block.known_variables): Rename from child_variable_names.
3856 (Block.Block): Remove variants that take Parameters. Initialize
3857 'Toplevel' with the immediately surrounding toplevel block.
3858 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
3859 LocalInfo parameter.
3860 (Block.GetKnownVariableInfo): New.
3861 (Block.IsVariableNameUsedInChildBlock): Update.
3862 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
3863 the block, even though it may not be in scope.
3864 (Block.AddVariable): Remove Parameters parameter. Use
3865 Toplevel.Parameters instead.
3866 (Block.AddConstant): Remove Parameters parameter.
3867 (Block.GetParameterReference): Update to use Toplevel.Parameters.
3868 (Block.IsParamaterReference): Likewise.
3869 (Block.IsLocalParameter): Likewise. Simplify a lot.
3870 (ToplevelBlock.Parameters): New. Moved from Block.
3871 (ToplevelBlock.ToplevelBlock): Update to changes. Always
3872 initialize Parameters to a non-null value.
3873 * cs-parser.jay: Update to changes.
3874 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
3875 simple names that mean different things in the same block. Use
3876 Block.IsVariableNameUsedInBlock.
3878 2005-03-28 Raja R Harinath <rharinath@novell.com>
3880 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
3882 2005-03-26 Raja R Harinath <harinath@acm.org>
3885 * assign.cs (Assign.DoResolve): When the RHS of an assignment
3886 fails to resolve, ensure that the LHS is still resolved as an
3889 2005-03-25 Raja R Harinath <harinath@acm.org>
3891 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
3893 (Enum.current_ec): Remove.
3894 (Enum.LookupEnumValue): Remove EmitContext argument.
3895 Just uses the one created during DefineType.
3896 (Enum.FindMembers): Update.
3897 * expression.cs (MemberAccess.DoResolve): Update.
3899 2005-03-22 Marek Safar <marek.safar@seznam.cz>
3901 * assign.cs (Assign.DoResolve): Check for CS1717 when
3902 source and target are same (uses Equals).
3904 * expression.cs (LocalVariableReference, ParameterReference,
3905 This): Implemented Equals, GetHashCode.
3907 * statement.cs (Block.GetParameterReference): Removed useless
3910 2005-03-22 Raja R Harinath <rharinath@novell.com>
3913 * statement.cs (Block.AddVariable): Ensure that we skip implicit
3914 blocks before deciding whether the error is cs0136 or cs0128.
3916 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
3917 (using_alias_directive, using_namespace_directive): Pass
3918 MemberName, not an expression to Namespace.UsingAlias and
3920 (MakeName): Use the MemberName of the namespace.
3921 * namespace.cs (Namespace.MemberName): New.
3922 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
3923 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
3925 * decl.cs (MemberName.Name): Make readonly.
3926 (MemberName.FromDotted): New "constructor".
3927 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
3928 (MemberCore.Name): Compute from MemberName on demand.
3929 (MemberCore.SetMemberName): Provide a way to change the
3931 (MemberCore.AddToContainer): Don't take a fullname parameter.
3932 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
3933 fully qualified name of the container to the member name.
3934 (TypeContainer.AddToTypeContainer): Use a fully qualified name
3935 only if the type is a member of the root container.
3936 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
3937 MemberName.Left rather than searching for an embedded ".".
3938 (PartialContainer.CreatePart): Update to changes in RootContext.
3939 (MemberBase.ShortName): Turn into a property. Use
3940 MemberCore.SetMemberName.
3941 (MemberBase.ExplicitInterfaceName): Remove.
3942 (MemberBase.UpdateMemberName): Remove.
3943 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
3944 (PropertyBase.SetMemberName): New override.
3945 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
3946 (Tree.GetDecl): New.
3947 (Tree.AllDecls): Rename from Decls.
3948 * attribute.cs, enum.cs, report.cs: Update to changes.
3949 * driver.cs (MainDriver): Use MemberName.FromDotted on
3950 RootContext.MainClass.
3952 2005-03-21 Marek Safar <marek.safar@seznam.cz>
3954 * class.cs (FixedField.Define): Check for CS1664 and more sanity
3957 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
3959 2005-03-18 Marek Safar <marek.safar@seznam.cz>
3961 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
3962 property accessor modifiers.
3964 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
3965 fixed buffer attribute (CS1716).
3966 (PropertyMethod.HasCustomAccessModifier): When property accessor
3967 has custom modifier.
3969 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
3971 (PropertyExpr.DoResolveLValue): Add CS0272.
3973 2005-03-17 Miguel de Icaza <miguel@novell.com>
3975 * convert.cs: When converting to a pointer, use the proper Conv.U
3976 or Conv.I depending on the source data type.
3978 * cs-tokenizer.cs: Make the size for large decimal constants,
3981 2005-03-17 Martin Baulig <martin@ximian.com>
3983 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3984 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
3986 2005-03-17 Martin Baulig <martin@ximian.com>
3988 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3989 to bool so we can return an error condition.
3990 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3993 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
3995 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
3998 2005-03-16 Raja R Harinath <rharinath@novell.com>
4000 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4001 Refactor to avoid traversing the list of assemblies, and to avoid
4002 string concatenation.
4003 * typemanager.cs (guid_attr_type): Remove.
4004 (negative_hits, pointers, references): Remove hashes.
4006 (GetConstructedType): New. Uses type_hash to handle constructed
4007 types (arrays, references, pointers).
4008 (GetReferenceType, GetPointerType): Use it.
4009 (GetNestedType): New. Uses type_hash to handle nested types of
4011 (LookupType, LookupTypeDirect): Remove.
4012 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
4013 'types' hash and LookupTypeReflection directly.
4014 (params_string, params_object): Use GetConstructedType.
4015 * namespace.cs (Namespace.cached_types): New. Cache of reflected
4017 (Namespace.Lookup): Use cached_types.
4018 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4019 provided by old TypeManager.LookupType.
4020 * rootcontext.cs (MakeFQN): Remove.
4021 * decl.cs (DeclSpace.MakeFQN): Likewise.
4022 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4023 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4024 TypeManager.GetConstructedType.
4025 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4027 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
4029 * cs-parser.jay: Fix build.
4031 2005-03-15 Marek Safar <marek.safar@seznam.cz>
4033 * class.cs (TypeContainer.CircularDepException) New nested
4034 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4036 * cs-parser.jay: Reports CS1527 for any namespace element.
4038 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4041 * expression.cs (ParameterReference.IsAssigned): Changed error to
4043 (Error_WrongNumArguments): Moved CS0245 detection here.
4045 * statement.cs (Return.Resolve): Add CS1622 report.
4047 2005-03-11 Marek Safar <marek.safar@seznam.cz>
4049 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4051 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
4053 * attribute.cs expression.cs: Get rid of some allocations.
4055 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
4057 * doc.cs : just eliminate the latest change.
4059 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4061 * doc.cs : commented out the latest change. It breaks xml-030.cs
4063 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4065 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4066 fail. So invoke CreateType() in FindDocumentedType().
4068 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4070 * cs-tokenizer.cs : added IsKeyword().
4071 * doc.cs : Detect keyword incorrectly used as identifier.
4072 Allow identifiers prefixed by @.
4074 2005-03-10 Marek Safar <marek.safar@seznam.cz>
4076 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4077 It caused exception in namespace resolving (again!).
4079 * class.cs (Class.ctor): Removed exit.
4080 (PropertyMethod.ctor): ditto.
4082 * codegen.cs (Codegen.Reset): Reset static data.
4083 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4085 * cs-tokenizer.cs (Cleanup): Removed.
4087 * driver.cs (GetSystemDir): Rewrote to one line command.
4088 It caused problem with unloaded dynamic modules.
4089 (UnixParseOption): Removed Exit.
4090 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4091 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4092 Now can be mcs used as library.
4094 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4097 * location.cs (Reset): Reset static data.
4099 * namespace.cs (Reset): Reset static data.
4101 * report.cs (Report.Reset): Reset static data.
4103 * rootcontext.cs (RootContext.Reset): Reset static data.
4105 * tree.cs (RootTypes.ctor): Use Location.Null
4107 * typemanager.cs (TypeManager.Reset): Reset static data.
4108 (CoreLookupType): Removed Exit.
4109 (TypeHandle.Reset): Reset static data.
4111 2005-03-10 Raja R Harinath <rharinath@novell.com>
4114 * typemanager.cs (ComputeNamespaces): Import namespaces from
4115 referenced modules too.
4117 2005-03-09 Raja R Harinath <rharinath@novell.com>
4119 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4122 2005-03-09 Raja R Harinath <rharinath@novell.com>
4124 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4125 enclosing DeclSpace. This ensures that a name-lookup populates
4126 more caches and there are fewer 'TypeExpression's. Carve out
4127 nested type lookup into ...
4128 (LookupNestedTypeInHierarchy): ... this.
4130 2005-04-15 Martin Baulig <martin@ximian.com>
4132 Merged r41590 from MCS and make it work in the generics land.
4134 * generic.cs (TypeParameter.UpdateConstraints): Removed the
4137 * class.cs (PartialContainer.UpdateConstraints): Removed.
4138 (PartialContainer.CheckConstraints): Removed.
4139 (PartialContainer.SetParameterInfo): Store the constraints here.
4140 (PartialContainer.DefineTypeParameters): New public method;
4141 resolve the type parameter's constraints here. Note that the
4142 PartialContainer doesn't have an EmitContext anymore, so we must
4143 do this in the ClassPart.
4145 2005-03-09 Raja R Harinath <rharinath@novell.com>
4147 Clean up a few partial-class semantics.
4148 Fixes test-357.cs and cs1618-2.cs.
4149 * cs-parser.jay (struct_declaration): Use 'current_class' as
4150 parent of newly-created struct. Remove call to Register ().
4151 Use 'pop_current_class' to complete handing the current struct.
4152 (interface_declaration): Likewise.
4153 (class_declaration): Likewise.
4154 (enum_declaration): Use 'current_class' as parent of newly created
4156 (delegate_declaration): Likewise.
4157 (pop_current_class): New function. This is used to handle closing
4158 up the 'current_class' and 'current_container', and pointing them
4159 to the enclosing class/container.
4160 (CSharpParser): Initialize 'current_class' too.
4161 * decl.cs (MemberCore): Add check for invariant: a partial
4162 container is not a parsed entity, and thus does not enclose any
4164 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4165 (DeclSpace.BaseTypeExpr): Use it.
4166 (DeclSpace.LookupType): Add check for invariant.
4167 * class.cs (TypeContainer): Add check for invariant: a nested
4168 class should have the same NamespaceEntry as its enclosing class.
4169 (TypeContainer.EmitFieldInitializers): Make virtual.
4170 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4172 (TypeContainer.Register): Remove.
4173 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4174 null. Use TypeResolveEmitContext for resolving base types and
4175 interfaces. Move initialization of Parts.TypeBuilder here from
4177 (TypeContainer.DefineNestedTypes): ... here.
4178 (PartialContainer): Take a Namespace not a NamespaceEntry.
4179 (PartialContainer.Create): Don't use Register. Call the
4180 appropriate Add... function directly.
4181 (ClassPart): Take both the PartialContainer and the enclosing
4182 class as constructor arguments.
4183 (ClassPart.EmitFieldInitializers): Override.
4184 (ClassPart.PartFindNestedTypes): Remove.
4185 (FieldBase.GetInitializerExpression): Resolve the initializer
4186 expression in the emit context of the enclosing class.
4187 * tree.cs (RootTypes): Remove Register ().
4189 2005-03-08 Marek Safar <marek.safar@seznam.cz>
4191 * cs-parser.jay: Removed CS0134.
4193 * driver.cs: Removed CS1901.
4195 * expression.cs (SizeOf.DoResolve): Don't report CS0233
4196 for predefined types.
4198 2005-03-07 Duncan Mak <duncan@novell.com>
4200 * codegen.cs (Save): Catch UnauthorizedAccessException as
4201 well. Fixes bug #73454.
4203 2005-03-07 Marek Safar <marek.safar@seznam.cz>
4205 * cs-tokenizer.cs (xtoken): Add CS1035.
4207 * class.cs (MethodData.Define): Add CS0683.
4208 (FieldMember.ctor): Add CS0681.
4210 2005-03-07 Raja R Harinath <rharinath@novell.com>
4212 * ecore.cs (SimpleName.DoResolve): Rename from
4213 SimpleName.DoResolveAllowStatic.
4214 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4215 Pass 'intermediate' flag to MemberStaticCheck.
4216 (SimpleName.MemberStaticCheck): Skip "static check" only in case
4217 of "intermediate" lookups via MemberAccess.
4218 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
4219 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4221 2005-03-07 Raja R Harinath <rharinath@novell.com>
4224 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4225 slipped in because of variable names that are identical to a
4226 builtin type's BCL equivalent ('string String;', 'int Int32;').
4227 (PropertyExpr.EmitInstance): Likewise.
4229 2005-03-04 Marek Safar <marek.safar@seznam.cz>
4231 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4233 * report.cs (warning_ignore_table): Made public.
4235 2005-03-04 Raja R Harinath <rharinath@novell.com>
4238 * class.cs (MethodData.Emit): Pass 'container' to
4239 container.GetObsoleteAttribute instead of 'container.Parent'.
4241 2005-03-03 Marek Safar <marek.safar@seznam.cz>
4243 * cs-parser.jay: Add 1534 error test.
4245 * iterators.cs (Yield.CheckContext): Add error 1629.
4246 (Iterator.ctor): Save unsafe modifier.
4247 (MoveNextMethod.DoEmit): Restore unsafe context.
4249 * namespace.cs (UsingAlias): Better error message.
4251 2005-03-03 Dan Winship <danw@novell.com>
4253 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4254 the warning message [#73219]
4256 2005-03-03 Raja R Harinath <rharinath@novell.com>
4258 Fix compile with MCS 1.0.0.0.
4259 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4260 w_restore to not depend on string constant folding.
4262 2005-03-03 Raja R Harinath <rharinath@novell.com>
4264 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
4265 CS0246 check to users who passed 'silent = false'.
4266 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4268 (SimpleName.SimpleNameResolve): Update.
4269 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4270 (MemberAccess.IdenticalNameAndTypeName): Update.
4271 * doc.cs (FindDocumentedTypeNonArray): Update.
4273 2005-03-03 Raja R Harinath <rharinath@novell.com>
4275 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4276 * parameters.cs (ComputeAndDefineParameters): Remove.
4277 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4278 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4279 Use GetParameterInfo.
4281 2005-03-02 Marek Safar <marek.safar@seznam.cz>
4283 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4285 2005-03-02 Raja R Harinath <rharinath@novell.com>
4287 Unify DeclSpace.LookupType and DeclSpace.FindType.
4288 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
4289 is in charge of defining nested types on demand.
4290 (DeclSpace.LookupType): Use it when the current_type is a
4291 TypeBuilder. Use LookupTypeDirect for reflected types.
4292 (DeclSpace.FindType): Remove.
4293 (DeclSpace.LookupInterfaceOrClass): Likewise.
4294 (DeclSpace.DefineTypeAndParents): Likewise.
4295 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4296 DeclSpace.LookupType.
4297 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4298 * typemanager.cs (LookupType): Simplify.
4299 (AddUserType): Remove type from negative_hits.
4300 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4301 * class.cs (TypeContainer.FindMembers): Move handling of nested
4303 (TypeContainer.FindMembers_NestedTypes): ... here.
4304 (TypeContainer.FindNestedType): Implement override.
4305 (ClassPart.FindNestedType): Delegate to PartialContainer.
4306 (ClassPart.PartFindNestedType): Looks up the nested types of the
4309 2005-04-14 Martin Baulig <martin@ximian.com>
4311 * generic.cs (ConstructedType): Moved all the type lookup and
4312 nested class logic into SimpleName.
4313 (ConstructedType.ResolveConstructedType): Our underlying type is
4314 already fully resolved; all the type lookup stuff is in
4317 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
4318 constructed types here instead of in ConstructedType.
4320 * decl.cs (MemberName.GetTypeExpression): Always create a
4321 SimpleName, not a ConstructedType.
4322 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
4324 2005-03-02 Martin Baulig <martin@ximian.com>
4326 * class.cs (TypeContainer.DoDefineMembers): We also need a default
4327 static constructor in static classes.
4329 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
4331 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4332 sizeParamIndex is not specified.
4334 2005-03-01 Marek Safar <marek.safar@seznam.cz>
4337 * report.cs (WarningMessage.IsEnabled): Missing null check.
4339 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4341 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4342 in the fields and not in the properties.
4344 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
4346 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
4349 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4351 * attribute.cs: Small refactoring (improved robustness).
4352 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4353 (ValidateGuid): Removed.
4354 (Resolve): Removed referenced to above mentioned.
4355 (GetAttributeUsage): Made private and changed to work without
4357 (GetIndexerAttributeValue): Don't crash.
4358 (GetConditionalAttributeValue): Ditto.
4359 (GetClsCompliantAttributeValue): Ditto.
4360 (ExtractSecurityPermissionSet): All attributes exceptions are
4362 (GetPropertyValue): New helper.
4363 (GetMethodImplOptions): New method.
4364 (DefinePInvokeMethod): Reuse common code. Implemented handling of
4365 some missing properties.
4367 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4368 (Method.ApplyAttributeBuilder): Updated.
4370 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4373 2005-02-28 Raja R Harinath <rharinath@novell.com>
4376 * report.cs (Report.SymbolRelatedToPreviousError): Handle
4377 non-simple types (array, pointer, reference).
4379 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4381 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4383 * class.cs (MethodCore.IsDuplicateImplementation): Special error
4385 (Method.CheckBase): Catch wrong destructor here.
4386 (MethodData.Define): Add errors 550, 668.
4388 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4390 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4392 * pending.cs (VerifyPendingMethods): Add error 551.
4394 * typemanager.cs (CSharpName): Next error report helper.
4396 2005-02-25 Marek Safar <marek.safar@seznam.cz>
4398 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4399 attributes. Removed useless attribute double check.
4400 It saves almost 2MBs for corlib.
4402 2005-02-25 Raja R Harinath <rharinath@novell.com>
4405 * statement.cs (ExpressionStatement.Resolve): Make robust to being
4406 called twice in case of error.
4408 2005-02-23 Chris Toshok <toshok@ximian.com>
4410 Fix compiler portions of #72827.
4411 * statement.cs (Block.Emit): call Begin/EndScope on the
4412 EmitContext instead of the ILGenerator.
4414 * codegen.cs (EmitContext.BeginScope): new method, call
4415 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4417 (EmitContext.BeginScope): same, but EndScope and CloseScope
4419 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
4420 offset and call the superclass's OpenScope(int) with it.
4421 (SymbolWriter.CloseScope): get the current il
4422 offset and call superclass's CloseScope(int) with it.
4424 2005-02-23 Marek Safar <marek.safar@seznam.cz>
4426 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
4427 CS1677 for out and ref as well.
4429 * class.cs (Method.Define): Add error CS1599 detection.
4431 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
4433 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
4435 * delegate.cs (Delegate.Define): Add error CS1599 detection.
4437 * support.cs.cs (ModifierDesc): New helper method.
4439 2005-02-23 Raja R Harinath <rharinath@novell.com>
4440 Abin Thomas <projectmonokochi@rediffmail.com>
4441 Anoob V E <projectmonokochi@rediffmail.com>
4442 Harilal P R <projectmonokochi@rediffmail.com>
4445 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
4446 MemberLookup (used for error reporting) actually returns a result.
4447 Fix error report number (122, not 112).
4449 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
4450 Anoob V E <projectmonokochi@rediffmail.com>
4451 Harilal P R <projectmonokochi@rediffmail.com>
4454 * pending.cs (PendingImplementation.GetAbstractMethods):
4455 Find NonPublic members too.
4457 2005-02-22 Marek Safar <marek.safar@seznam.cz>
4459 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
4462 * class.cs (MethodCore.CheckMethodAgainstBase):
4463 Add error 239 report.
4465 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4467 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4469 * class.cs (Operator.Define): Add error 217 report.
4471 2005-02-21 Raja R Harinath <rharinath@novell.com>
4474 * expression.cs (Invocation.IsApplicable): Make public.
4475 (Invocation.IsParamsMethodApplicable): Likewise.
4476 * delegate.cs (Delegate.VerifyApplicability): Don't use
4477 Invocation.VerifyArgumentCompat for parameter applicability
4478 testing. Use Invocation.IsApplicable and
4479 Invocation.IsParamsMethodApplicable.
4481 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4483 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4485 * class.cs (Operator.Define): Add error 217 report.
4487 2005-02-21 Raja R Harinath <rharinath@novell.com>
4489 * namespace.cs (UsingEntry.Resolve): Undo change below.
4491 2005-02-21 Raja R Harinath <rharinath@novell.com>
4494 * ecore.cs (Expression.MemberLookupFailed): Add argument to
4495 disable the error message when the extended MemberLookup also
4497 (Expression.MemberLookupFinal): Update.
4498 (SimpleName.DoSimpleNameResolve): Update.
4499 * expression.cs (MemberAccess.ResolveNamespaceOrType):
4500 Don't use MemberLookupFinal.
4501 (New.DoResolve): Update.
4502 (BaseAccess.CommonResolve): Update.
4504 2005-02-21 Raja R Harinath <rharinath@novell.com>
4507 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
4508 occured previously, don't resolve again.
4510 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4513 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
4514 argument. Call ResolveAttributeUsage for unresolved.
4515 when types doesn't match ctor arguments.
4517 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
4518 for nested attribute classes.
4519 (Class.attribute_usage): Removed.
4520 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
4521 for attribute class.
4523 * ecore.cs (IsAttribute): Removed.
4525 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
4527 * rootcontext.cs (RegisterAttribute): Removed, attributes are
4529 (attribute_types): Removed.
4530 (EmitCode): Global attributes are emited as the latest.
4532 2005-02-18 Marek Safar <marek.safar@seznam.cz>
4534 * class.cs (EmitFieldInitializers): Don't emit field initializer
4535 for default values when optimilization is on.
4537 * constant.cs (Constant.IsDefaultValue): New property.
4539 * driver.cs: Add /optimize handling.
4543 * literal.cs: Implement new IsDefaultValue property.
4545 * rootcontext.cs (Optimize): New field, holds /optimize option.
4547 2005-02-18 Raja R Harinath <rharinath@novell.com>
4549 Fix crasher in re-opened #72347.
4550 * namespace.cs (Namespace.Lookup): Return null if
4551 DeclSpace.DefineType returns null.
4554 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
4556 2005-02-18 Raja R Harinath <rharinath@novell.com>
4558 Fix remainder of #63202. Change semantics of DoResolveLValue: it
4559 now returns null if it cannot resolve to an lvalue.
4560 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
4561 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
4562 returned null. Remove check for SimpleName.
4563 (EventExpr.DoResolveLValue): New.
4564 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
4565 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
4567 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
4569 (Unary.ResolveOperator): Move CS0211 check ...
4570 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
4572 (Unary.DoResolveLValue): Simplify.
4573 (AddressOf.DoResolveLValue): New.
4574 (ArrayAccess.DoResolveLValue): New.
4576 2005-02-16 Marek Safar <marek.safar@seznam.cz>
4578 * attribute.cs (Attribute.Resolve): Add arguments casting for
4579 when types doesn't match ctor arguments.
4581 2005-02-16 Raja R Harinath <rharinath@novell.com>
4583 Fix parts of #63202.
4584 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
4585 lookup of operator in base type. Ensure that all checks happen
4586 when the operator resolves to an "op_..." method.
4588 2005-02-15 Raja R Harinath <rharinath@novell.com>
4591 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
4592 'ignore_cs0104' parameter. Pass it to ...
4593 (NamespaceEntry.Lookup): ... this.
4594 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
4595 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
4596 (TypeLookupExpression.DoResolveAsTypeStep): Update.
4597 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
4598 Update. Request that cs0104 errors be ignored.
4599 (ComposedCast.ResolveAsTypeStep): Update.
4601 2005-02-14 Raja R Harinath <rharinath@novell.com>
4604 * expression.cs (Invocation.BetterFunction): Remove support for
4605 comparing virtual functions and their overrides.
4606 (Invocation.IsOverride): New.
4607 (Invocation.OverloadResolve): Don't consider 'override' functions
4608 during candidate selection. Store them in a lookaside list.
4609 If the selected method is a 'virtual' function, use the list to
4610 find any overrides that are closer to the LHS type.
4612 2005-02-14 Marek Safar <marek.safar@seznam.cz>
4614 * expression.cs (New.DoResolve): Add complex core type reduction.
4615 (New.Constantify): Converts complex core type syntax like 'new int ()'
4618 2005-02-14 Raja R Harinath <rharinath@novell.com>
4620 * decl.cs (EntryType.EntryType): New constructor to create an
4621 updated copy of a cache entry.
4622 (MemberCache.AddMethods): Use it.
4623 (MemberCache.ClearDeclaredOnly): Remove.
4624 (MemberCache.MemberCache): Update.
4626 2005-02-11 Miguel de Icaza <miguel@novell.com>
4628 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
4629 variable. This one is represents the actual low-level declaration
4630 of the method, as opposed to the semantic level `IsStatic'.
4632 An anonymous method which is hosted into a static method might be
4633 actually an instance method. IsStatic would reflect the
4634 container, while MethodIsStatic represents the actual code
4637 * expression.cs (ParameterReference): Use the new MethodIsStatic
4638 instead of IsStatic.
4640 * anonymous.cs (AnonymousMethod.Compatible): Pass the
4641 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
4642 set on the current EmitContext.
4644 * expression.cs (Cast): Overload DoResolveLValue so we can pass
4645 resolve our casted expression as an LValue. This triggers the
4646 proper LValue processing that is later required by Assign.
4650 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
4652 2005-02-11 Marek Safar <marek.safar@seznam.cz>
4654 C# 2.0 Fixed buffer implementation
4656 * anonymous.cs: Update after RegisterHelperClass renaming.
4658 * attribute.cs (AttributeTester.fixed_buffer_cache):
4659 Cache of external fixed buffers.
4660 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
4661 implementation if field is fixed buffer else null.
4664 (TypeContainer.AddField): Accept FieldMember instead of Field.
4665 (FieldBase.IsFieldClsCompliant): Extracted code from
4666 VerifyClsCompliance descendant customization.
4667 (FixedField): New class handles fixed buffer fields.
4668 (FixedFieldExternal): Keeps information about imported fixed
4670 (IFixedField): Make access to internal or external fixed buffer
4673 * cs-parser.jay: Add fixed buffer parsing.
4675 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
4678 * expression.cs (Indirection): Extended implementation to accept
4680 (PointerArithmetic.Emit): Get element from fixed buffer as well.
4681 (ElementAccess.MakePointerAccess): Get type as parameter.
4682 (DoResolve): Add fixed buffer field expression conversion.
4683 (DoResolveLValue): Ditto.
4684 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
4685 (ArrayPtr): Derives from FixedBufferPtr.
4686 (ArrayPtr.Emit): Add extra emit for array elements.
4688 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
4690 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
4691 for compiler generated types.
4692 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
4694 * statement.cs (Fixed): Refactored to be easier add fixed buffer
4695 and consume less memory.
4696 (Fixed.Resolve): Add fixed buffer case.
4698 * typemanager.cs (compiler_generated_attr_ctor,
4699 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
4700 (HasElementType): Add our own implementation to work on every
4703 2005-02-11 Miguel de Icaza <miguel@novell.com>
4705 * anonymous.cs (CaptureContext): Track whether `this' has been
4708 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
4709 only captured `this' if it was implicitly done (instance
4710 methods/variables were used).
4712 * codegen.cs (EmitContext.CaptureThis): New method to flag that
4713 `this' must be captured.
4715 2005-01-30 Miguel de Icaza <miguel@novell.com>
4717 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
4718 is null it means that there has been no need to capture anything,
4719 so we just create a sibling.
4721 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
4723 Just a partial fix. The other half is fairly elusive.
4725 2005-02-10 Raja R Harinath <rharinath@novell.com>
4727 Fix #52586, cs0121-4.cs.
4728 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
4729 and return a hashtable.
4730 (MemberCache.ClearDeclaredOnly): New.
4731 (MemberCache.MemberCache): Update to change. Make a deep copy of
4732 the method_hash of a base type too.
4733 (MemberCache.AddMethods): Adapt to having a deep copy of the base
4734 type methods. Overwrite entries with the same MethodHandle so
4735 that the ReflectedType is correct. The process leaves in base
4736 virtual functions and their overrides as distinct entries.
4737 (CacheEntry): Now a class instead of a struct. It shouldn't alter
4738 matters since it was boxed in a ArrayList before.
4739 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
4741 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
4742 case of a virtual function and its override (choose the overload
4744 (Invocation.OverloadResolve): Avoid 'override' members during
4745 'applicable_type' calculation.
4747 2005-03-28 Raja R Harinath <rharinath@novell.com>
4749 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4750 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4751 GetTypeHandle. It is possible for a reflected type to derive from
4752 a TypeBuilder (e.g., int[] derives from the TypeBuilder
4753 System.Array during mscorlib compilation).
4754 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4755 contain a method_hash, don't create one either. Don't create a
4756 deep copy of the base cache's method_hash.
4757 (MemberCache.SetupCache): Rename back from DeepCopy.
4758 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4759 already initialized. If we see an override function, add its
4760 underlying base virtual function to the member_hash too.
4762 2005-02-09 Raja R Harinath <rharinath@novell.com>
4764 Combine two near-redundant caches.
4765 * typemanager.cs (method_params): Rename from method_internal_params.
4766 (TypeManager.GetParameterData): New. Replace
4767 Invocation.GetParameterData.
4768 (TypeManager.LookupParametersByBuilder): Remove.
4769 * expression.cs (Invocation.method_parameter_cache): Remove.
4770 (Invocation.GetParameterData): Remove.
4772 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
4775 2005-02-08 Raja R Harinath <rharinath@novell.com>
4778 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
4779 TypeManager.multicast_delegate_type is null, resolve it by looking
4780 up "System.MulticastDelegate".
4781 * rootcontext.cs (RootContext.ResolveCore): Simplify.
4783 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
4784 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
4785 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
4788 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
4789 (LabeledStatement.AddReference): New. Set 'referenced'.
4790 (Goto.Resolve): Use it.
4792 2005-02-05 John Luke <john.luke@gmail.com>
4794 * driver.cs: remove duplicate -doc line in Usage ()
4796 2005-02-04 Raja R Harinath <rharinath@novell.com>
4798 * location.cs (Location.AddFile): Fix CS2002 error report.
4800 2005-02-02 Martin Baulig <martin@ximian.com>
4802 * delegate.cs (Delegate.DefineType): Report an internal error if
4803 TypeManager.multicast_delegate_type is null. See bug #72015 for
4806 2005-02-02 Raja R Harinath <rharinath@novell.com>
4808 Fix a crasher in a variant of #31984.
4809 * const.cs (Constant.CheckBase): New override that defers the
4810 new-or-override check in case the base type hasn't been populated
4812 (Constant.Define): Ensure the new-or-override check is performed.
4814 2005-02-01 Duncan Mak <duncan@ximian.com>
4816 * const.cs (LookupConstantValue): Check that `ce' is not null
4817 before calling GetValue ().
4819 2005-02-01 Raja R Harinath <rharinath@novell.com>
4821 Fix test-334.cs (#69519).
4822 * cs-parser.jay (using_alias_directive): Pass in an expression to
4823 NamespaceEntry.UsingAlias.
4824 (using_namespace_directive): Pass in an expression to
4825 NamespaceEntry.Using.
4826 (namespace_name): Don't flatten to a string.
4827 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
4828 (NamespaceEntry.AliasEntry.Resolve): Lookup using
4830 (NamespaceEntry.UsingEntry): Likewise.
4831 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
4833 (NamespaceEntry.LookupForUsing): Remove.
4834 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
4836 (NamespaceEntry.Lookup): Remove support for dotted names.
4838 2005-02-01 Raja R Harinath <rharinath@novell.com>
4840 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
4842 (NamespaceEntry.ImplicitParent): Compute on demand.
4843 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
4844 parallels the current.
4845 (NamespaceEntry.LookupForUsing): Use it.
4846 (NamespaceEntry.Lookup): If the current namespace-entry is
4847 implicit, don't search aliases and using tables.
4849 2005-02-01 Raja R Harinath <rharinath@novell.com>
4852 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
4854 (TypeContainer.BaseCache): Compute on demand.
4855 (TypeContainer.FindMembers): Define constants and types if they're
4856 not already created.
4857 (FieldMember.Define): Move resetting of ec.InUnsafe before error
4859 * const.cs (Constant.Define): Make idempotent.
4861 2005-01-29 Miguel de Icaza <miguel@novell.com>
4863 * pending.cs: Produce better code (no nops produced by using Ldarg
4866 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
4867 i - 1' it should be arg + 1.
4871 2005-01-28 Raja R Harinath <rharinath@novell.com>
4873 * attribute.cs (Attribute.CheckAttributeType): Make private
4875 (Attribute.ResolveType): Make virtual.
4876 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
4877 handling of RootContext.Tree.Types.
4879 2005-01-27 Raja R Harinath <rharinath@novell.com>
4881 Update attribute-handling to use the SimpleName/MemberAccess
4883 * cs-parser.jay (attribute): Pass in an expression to the
4884 constructors of Attribute and GlobalAttribute.
4885 * attribute.cs (Attribute): Take an expression for the name.
4886 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
4887 passed in attribute name expression.
4888 (Attribute.CheckAttributeType): Use it.
4889 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
4890 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
4891 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
4892 argument to prevent error messages if the lookup fails.
4894 2005-01-27 Marek Safar <marek.safar@seznam.cz>
4896 * expression.cs (Indirection): Implemented IVariable interface
4897 to support indirection in AddressOf operator.
4898 (PointerArithmetic.Emit): Add optimalization for case where
4899 result can be precomputed.
4901 2005-01-26 Martin Baulig <martin@ximian.com>
4903 * class.cs (TypeContainer.AttributeTargets): Return the correct
4904 AttributeTargets depending on our `Kind' instead of throwing an
4905 exception; fixes #71632.
4907 2005-01-26 Marek Safar <marek.safar@seznam.cz>
4910 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
4913 2005-03-17 Martin Baulig <martin@ximian.com>
4915 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4916 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
4918 2005-03-17 Martin Baulig <martin@ximian.com>
4920 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4921 to bool so we can return an error condition.
4922 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4925 2005-03-17 Martin Baulig <martin@ximian.com>
4927 * generic.cs (TypeMananager.IsIEnumerable): New public method.
4929 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
4930 converting from an array-type of T to `IEnumerable<T>'.
4932 2005-03-16 Martin Baulig <martin@ximian.com>
4934 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
4935 (Nullable.LiftedUnaryMutator): New public class.
4937 * expression.cs (UnaryMutator.DoResolve): Added support for
4940 2005-03-14 Martin Baulig <martin@ximian.com>
4942 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
4944 2005-03-14 Martin Baulig <martin@ximian.com>
4946 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
4947 the comparision operators `<', `>', `<=' and `>='.
4949 2005-03-13 Martin Baulig <martin@ximian.com>
4952 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
4953 avoid confusion with the `NullLiteral'.
4954 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
4956 2005-03-13 Martin Baulig <martin@ximian.com>
4958 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
4959 comparing arbitrary types with the null literal.
4961 2005-03-13 Martin Baulig <martin@ximian.com>
4963 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
4964 boolean operators '&&', '||', '&' and '|'.
4965 (Nullable.OperatorTrueOrFalse): New public class.
4967 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
4968 instead of a `StaticCallExpr'; added support for nullables.
4970 2005-03-10 Martin Baulig <martin@ximian.com>
4973 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
4974 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
4976 2005-03-07 Martin Baulig <martin@ximian.com>
4978 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
4979 it work if `expr' is not an IMemoryLocation.
4980 (Nullable.Lifted): Implement IMemoryLocation.
4981 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
4984 2005-03-05 Martin Baulig <martin@ximian.com>
4986 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
4987 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
4988 (Nullable): Added support for lifted unary and binary operators.
4990 * expression.cs (Unary.DoResolve): Added support for nullable types.
4991 (Binary.DoResolve): Likewise.
4992 (Conditional.DoResolve): Likewise.
4994 2005-03-02 Martin Baulig <martin@ximian.com>
4996 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
4998 * class.cs (ClassPart.SetParameterInfo): Override this.
4999 (PartialContainer.SetParameterInfo): Override this.
5000 (TypeContainer.CheckConstraints): New protected method.
5001 (PartialContainer.CheckConstraints): Override this and check
5002 whether the same contraints were specified in all parts of a
5003 partial generic type definition.
5004 (PartialContainer.UpdateConstraints): New public method.
5006 * generic.cs (TypeParameter.UpdateConstraints): New public method.
5008 2005-03-02 Martin Baulig <martin@ximian.com>
5010 Committing a patch from Carlos Alberto Cortez to fix #72887.
5012 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5013 casts from `T []' to `int []'.
5015 2005-03-02 Martin Baulig <martin@ximian.com>
5017 * generic.cs (TypeManager.IsEqual): Make this symmetric.
5019 * expression.cs (Binary.ResolveOperator): When resolving a
5020 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5021 `=='. Fixes #71866. See gen-127.cs.
5023 2005-03-02 Martin Baulig <martin@ximian.com>
5025 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5026 static constructor in static classes.
5028 2005-03-02 Martin Baulig <martin@ximian.com>
5031 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5032 (Nullable.LiftedConversion): Added support for user-defined
5035 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5037 * cs-parser.jay: Use ComposedCast everywhere instead of
5038 NullableType, so we don't need to check for NullableType
5040 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5041 case where we'll be resolved into a `parenthesized_expression_0'
5045 (Convert.UserDefinedConversion): Added nullable conversions.
5047 2005-02-28 Martin Baulig <martin@ximian.com>
5049 * generic.cs (TypeManager.IsNullableType): New static method.
5050 (Nullable): New abstract class.
5051 (Nullable.NullLiteral): New public class.
5052 (Nullable.LiftedConversion): New public class.
5054 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5055 `builtin_types opt_nullable'.
5058 (Convert.ImplicitConversionStandard): Added nullable conversions.
5059 (Convert.ExplicitConversionStandard): Likewise.
5060 (Convert.ExplicitConversion): Likewise.
5062 2005-02-26 Martin Baulig <martin@ximian.com>
5064 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5065 begin with a "?", for instance "?[]". Don't do a type lookup if
5068 2005-02-25 Martin Baulig <martin@ximian.com>
5070 The first part of Nullable Types :-)
5072 * generic.cs (NullableType): New public class.
5073 (NullCoalescingOperator): New public class.
5074 (TypeArguments.Resolve): Add a CS0306 check.
5076 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5077 (opt_nullable): New rule.
5078 (type): Added `opt_nullable' to `namespace_or_type_name',
5079 `builtin_types' and `pointer_type'.
5080 (array_type): Added `opt_nullable'.
5081 (opt_rank_specifier_or_nullable): New rule; this is the
5082 combination of `opt_rank_specifier' and `opt_nullable'.
5083 (opt_error): New rule; catch errors here.
5084 (nullable_type_or_conditional): New rule; we use this to check for
5085 nullable and still detect the conditional operator.
5086 (local_variable_type): Use `opt_rank_specifier_or_nullable'
5087 instead `opt_rank_specifier'.
5089 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5092 2005-02-24 Martin Baulig <martin@ximian.com>
5094 * README, README.Changes: Removed; they're old and obsolete.
5096 2005-02-22 Martin Baulig <martin@ximian.com>
5098 * generic.cs (TypeParameter.Resolve): If resolving the constraints
5099 returned an error, set `constraints' to null to avoid a crash
5101 (TypeParameter.ResolveType): Likewise.
5103 2005-02-22 Martin Baulig <martin@ximian.com>
5106 (Constraints.ResolveTypes): Protect against being called twice.
5107 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5108 (TypeParameter.ResolveType): New public method; calls
5109 constraints.ResolveTypes().
5110 (TypeParameter.DefineType): Moved constraints.ResolveType() out
5111 into the new ResolveType().
5112 (GenericMethod.Define): Call ResolveType() on all our
5115 2005-02-21 Martin Baulig <martin@ximian.com>
5118 (TypeManager.generic_nullable_type): New static public field.
5119 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5122 (RootContext.ResolveCore): Resolve "System.Nullable`1".
5124 2005-02-15 Martin Baulig <martin@ximian.com>
5126 * generic.cs (ConstructedType.Constraints): Correctly check
5127 constraints if the argument type is a type parameter; fixes
5130 2005-02-02 Martin Baulig <martin@ximian.com>
5132 * delegate.cs (Delegate.DefineType): Report an internal error if
5133 TypeManager.multicast_delegate_type is null. See bug #72015 for
5136 2005-01-29 Miguel de Icaza <miguel@novell.com>
5138 * pending.cs: Produce better code (no nops produced by using Ldarg
5141 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5142 i - 1' it should be arg + 1.
5146 2005-01-26 Martin Baulig <martin@ximian.com>
5148 * cs-parser.jay (indexer_declarator): Don't report an error if we
5149 have type parameters since we can be an explicit interface
5150 implementation; fixes #71449.
5152 2005-01-26 Martin Baulig <martin@ximian.com>
5154 * class.cs (TypeContainer.AttributeTargets): Return the correct
5155 AttributeTargets depending on our `Kind' instead of throwing an
5156 exception; fixes #71632.
5158 2005-01-26 Martin Baulig <martin@ximian.com>
5160 * delegate.cs (Delegate.DefineType): Correctly define our type
5161 parameters. Fixes #71483.
5163 2005-01-25 Raja R Harinath <rharinath@novell.com>
5166 * expression.cs (MemberAccess.DoResolve): Don't complain with
5167 cs0572 when the LHS of a member access has identical name and type
5170 2005-01-25 Marek Safar <marek.safar@seznam.cz>
5173 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5175 Create custom PermissionSet only for PermissionSetAttribute.
5177 2005-01-24 Marek Safar <marek.safar@seznam.cz>
5180 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5181 delegates in static class.
5183 2005-01-24 Martin Baulig <martin@ximian.com>
5185 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5186 merging an implicit block, just use its reachability.
5188 * statement.cs (Block.Resolve): Make the unreachable code check
5189 work wrt. implicit blocks; see test-337 from #63842.
5191 2005-01-21 Alp Toker <alp@atoker.com>
5193 * cs-parser.jay: destructor_declaration's container is PartialContainer
5194 not Class when partial types are used, so use Kind prop instead of
5197 2005-01-22 Miguel de Icaza <miguel@ximian.com>
5199 * cs-parser.jay: Improve error reporting when an interface
5202 2005-01-20 Dick Porter <dick@ximian.com>
5204 * support.cs: SeekableStreamReader fix from Sandor Dobos
5205 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5206 chars are read. Fixes bug 70369.
5208 2005-01-20 Raja R Harinath <rharinath@novell.com>
5210 * cs-parser.jay (catch_clause): Simplify current_block handling
5213 2005-01-17 Miguel de Icaza <miguel@ximian.com>
5215 * convert.cs (ImplicitStandardConversionExists): Synchronize the
5216 code with ImplicitStandardConversion to handle the implicit
5217 conversion of method groups into valid delegate invocations.
5219 The problem is that in parameter handling we were using this code
5220 path. Fixes bug #64698
5222 2005-01-19 Raja R Harinath <rharinath@novell.com>
5224 * cs-parser.jay: Fix several infelicities.
5225 - Avoid assigning to the parser value stack. Code like
5226 '$3 = null' is unclean. Synthesize a value for the code block
5228 - Avoid using oob_stack for storing location information. Use ...
5229 (_mark_): ... this. New (empty) rule. Saves the current location
5231 (foreach_statement): Avoid using oob_stack for current_block
5232 handling. Use technique used in for_statement and
5233 using_statement. Synthesize a value for the code block to store
5234 additional intermediate information.
5236 2005-01-13 Miguel de Icaza <miguel@ximian.com>
5238 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5239 of a different type is only allowed to private fields of a
5240 containing type, not on fields of a base class.
5242 See test-174.cs and error cs0122-9.cs
5244 2005-01-13 Raja R Harinath <rharinath@novell.com>
5246 Fix test-335.cs (bug #58126).
5247 * cs-parser.jay (argument): Split out non-expression parts of the
5248 rule into 'non_simple_argument'.
5249 (invocation_expression): Support parenthesized invocations with
5250 multiple arguments, and with single non-simple arguments.
5252 2005-01-13 Raja R Harinath <rharinath@novell.com>
5254 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5257 2005-01-12 Raja R Harinath <rharinath@novell.com>
5259 Fix cs0038-1.cs, cs1640-6.cs.
5260 * ecore.cs (Expression.Resolve): Remove special-case for
5261 SimpleName in error-handling.
5262 (Expression.almostMatchedMembers): Relax access permission to
5264 (Expression.MemberLookupFailed): Handle duplicates in
5265 almostMatchedMembers list.
5266 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5267 * expression.cs (New.DoResolve): Report CS1540 for more cases.
5268 * typemanager.cs (GetFullNameSignature): Use the MethodBase
5269 overload if the passed in MemberInfo is a MethodBase.
5271 2005-01-25 Martin Baulig <martin@ximian.com>
5274 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
5276 2005-01-12 Marek Safar <marek.safar@seznam.cz>
5279 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5280 for non-CAS & merge permission sets properly.
5282 2005-01-11 Raja R Harinath <rharinath@novell.com>
5284 Improve standard-compliance of simple name and member access
5285 resolution. Fixes bugs #52697, #57200, #67520, #69519.
5286 * ecore.cs (FullNamedExpression): New abstract base class
5287 for Namespaces and TypeExpressions.
5288 (ResolveFlags.SimpleName): Remove.
5289 (SimpleName): Remove support for dotted names.
5290 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
5291 DeclSpace.FindType and DeclSpace.LookupType.
5292 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5293 (Expression.ExprClassName): Make member function.
5294 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5295 a namespace. Remove creation of dotted "SimpleName"s.
5296 (MemberAccess.DoResolve): Likewise.
5297 * decl.cs (DeclSpace.Cache): Make private.
5298 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5299 (DeclSpace.FindType): Update.
5300 (DeclSpace.LookupType): Move here from RootContext. Return a
5301 FullNamedExpression.
5302 * namespace.cs (Namespace): Derive from FullNamedExpression
5303 so that it can be part of expression resolution.
5304 (Namespace.Lookup): Return an FullNamedExpression.
5305 (NamespaceEntry.LookupAlias): Lookup aliases only in current
5307 * rootcontext.cs (NamespaceLookup): Remove.
5308 (LookupType): Move to DeclSpace.
5309 * attribute.cs (CheckAttributeType): Update.
5310 * doc.cs (FindDocumentedType): Remove allowAlias argument.
5311 (FindDocumentedTypeNonArray): Likewise.
5313 2005-01-11 Raja R Harinath <rharinath@novell.com>
5315 Fix cs0509.cs, cs1632.cs.
5316 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5317 is the same as IsInterface.
5318 (TypeContainer.GetClassBases): Likewise.
5319 * statement.cs (LabeledStatement.ig): New field.
5320 (LabeledStatement.LabelTarget): Save ILGenerator which created the
5322 (LabeledStatement.DoEmit): Check that the label was created with
5323 the same ILGenerator.
5325 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5328 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5329 accessors to its properties.
5331 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5332 from accessors to property.
5334 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5337 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5340 2005-01-08 Miguel de Icaza <miguel@ximian.com>
5342 * attribute.cs: Check for null and empty strings.
5344 I have lost another battle to Paolo.
5346 2005-01-07 Marek Safar <marek.safar@seznam.cz>
5349 * class.cs (PropertyMethod): Set Parent field in ctors.
5350 (SetMethod.InternalParameters): Add unsafe switch hack.
5351 Override MarkForDuplicationCheck where it is appropriate.
5353 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5354 It says whether container allows members with the same name.
5356 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5357 Removed is_method parameter.
5359 2005-01-06 Duncan Mak <duncan@ximian.com>
5361 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5362 because the previous change led to incorrect reporting of CS1032
5363 ("Cannot define/undefine preprocessor symbols after first token in
5364 file"). Instead of using `tokens_seen' as the only flag that
5365 triggers CS1040, introduce `comments_seen'. This new flag is used
5366 to signify having seen comments on the current line, so it is
5367 unset after a newline.
5369 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5371 * doc.cs : When searching for a type, find nested type too.
5372 This fixes bug #71040.
5374 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5377 - Warn missing member comment on those classes which also does not
5378 have doc comments. Fixed bug #71041.
5379 - Don't warn missing doc comment on default constructor.
5382 2005-01-06 Duncan Mak <duncan@ximian.com>
5384 * cs-tokenizer.cs (xtoken): After handling traditional C-style
5385 comments, set `tokens_seen' to true. This allows us to detect
5386 misplaced preprocessor directives (i.e. not at the beginning of
5387 the a line, nor after whitespaces). In that case, report error
5388 CS1040. This fixes bug #56460.
5390 * cs-parser.jay (interface_member_declaration): Add checks for
5391 IsExplicitImpl, and report CS0541 error if an interface member is
5392 defined as an explicit interface declaration.
5394 2005-01-06 Marek Safar <marek.safar@seznam.cz>
5397 * class.cs (PropertyMethod): Set Parent field in ctors.
5398 (SetMethod.InternalParameters): Add unsafe switch hack.
5400 * decl.cs (MemberCore.Parent): Cannot be readonly.
5402 2005-01-06 Raja R Harinath <rharinath@novell.com>
5404 * decl.cs (DeclSpace.ResolveType): Remove.
5405 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5406 Merge in code from ...
5407 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
5408 * class.cs, enum.cs: Update to changes.
5410 2005-01-06 Miguel de Icaza <miguel@ximian.com>
5412 * anonymous.cs: Ensure that we init the scope of our parent if it
5413 has not been initialized yet.
5415 2004-12-30 Duncan Mak <duncan@ximian.com>
5417 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5418 if field.FieldBuilder is null. Fixes #70758.
5420 * convert.cs: Fixed some typos and updated some of the comments.
5421 (ImplicitStandardConversionExists):
5422 (TryImplicitIntConversion): If `target_type' is an interface and
5423 the type of `ic' implements this interface, return true or a new
5424 BoxedCast instead of null. This fixes #70468.
5426 2004-12-29 Duncan Mak <duncan@ximian.com>
5428 * expression.cs (Argument.Emit): Check that Expr is
5429 IMemoryLocation before casting to it, and report CS1510 otherwise.
5433 2004-12-21 Ben Maurer <bmaurer@ximian.com>
5435 * statement.cs (Block.ThisVariable): remove the recursion here, to
5436 make the --profile more sane.
5438 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
5440 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5441 assembly, by JB Evain.
5443 2004-12-17 Raja R Harinath <rharinath@novell.com>
5445 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
5446 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5447 "parent" refers to enclosing type/class. "base" refers to superclass.
5449 2004-12-17 Raja R Harinath <rharinath@novell.com>
5451 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5452 Ensure that we only have GlobalAttributes.
5453 * attribute.cs (Attribute.Emit): Make non-virtual.
5454 (GlobalAttribute.Emit): Remove.
5455 (Attribute.Resolve): Make virtual.
5456 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
5457 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5458 the argument. Don't create one.
5459 (Attribute.GetObsoleteAttribute): Likewise.
5460 (Attribute.GetClsCompliantAttributeValue): Likewise.
5461 * class.cs, decl.cs: Update to changes.
5463 2004-12-17 Marek Safar <marek.safar@seznam.cz>
5465 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5467 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5469 * statement.cs (Foreach.Resolve): Add error 186 report.
5471 2004-12-16 Marek Safar <marek.safar@seznam.cz>
5473 * expression.cs (Conditional.DoResolve): Add warning 429.
5475 * statement.cs (If.Resolve): Add warning 665.
5477 2004-12-16 Raja R Harinath <rharinath@novell.com>
5479 New invariant: RootContext.Tree.Types.NamespaceEntry == null
5480 except when in the parser, and in GlobalAttribute.
5481 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5482 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5483 RootContext.Tree.Types.NamespaceEntry once work is done.
5484 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
5485 and resets RootContext.Tree.Types.NamespaceEntry.
5487 2004-12-15 Marek Safar <marek.safar@seznam.cz>
5489 * cs-parser.jay: Don't create a block for every variable.
5491 2004-12-14 Miguel de Icaza <miguel@ximian.com>
5493 * location.cs: Provide extra information.
5495 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5496 variables from the captured environment, it is the ldarg_0.
5498 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5500 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5503 * class.cs: Changed warning level for 169 to avoid developer
5504 displeasure from warning flooding. It will be changed back when they
5505 fix most of current BCL warnings.
5507 * RootContext.cs: Pushed default WarningLevel to 3.
5509 * statement.cs: Removed unused variable.
5511 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5513 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5514 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5515 Add error 502 report.
5516 (StaticClass.DefineType): Add error 441 report.
5517 (Class.AllowedModifiersProp): New virtual property as temporary
5518 extension to AllowedModifiers.
5519 (Class.DefineType): Add error 418 report. Moved ModFlags check here
5520 to share implementation with StaticClass and don't call virtual
5523 * driver.cs (MainDriver): Add error 1558 test.
5525 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5526 report. Moved error 36 test here.
5528 * statement.cs (Throw.Resolve): Add error 724 report.
5530 * typemanager.cs: Add out_attribute_type core type.
5532 2004-12-13 Marek Safar <marek.safar@seznam.cz>
5534 * class.cs (TypeContainer.VerifyClsCompliance): Add error
5536 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5538 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5541 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5543 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
5544 Add error 3023 report.
5545 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5547 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5550 2004-12-12 John Luke <john.luke@gmail.com>
5552 * driver.cs (AddArgs): take -- into account when
5553 adding arguments, fixes bug 65710
5555 2004-12-12 Martin Baulig <martin@ximian.com>
5557 * expression.cs (Unary.TryReduceNegative): Added support for
5558 SByteConstant and ByteConstant.
5559 (Unary.Reduce): Check error values from TryReduceNegative().
5561 2004-12-10 Marek Safar <marek.safar@seznam.cz>
5563 * attributes.cs (Attribute.Resolve): Avoid multiple error report
5564 and report exception as error 182.
5566 2004-12-10 Raja R Harinath <rharinath@novell.com>
5568 * driver.cs (Main): Fix message when there are warnings.
5570 2004-12-09 Miguel de Icaza <miguel@ximian.com>
5572 * delegate.cs: Fixed my fix from yesterday, sorry about that.
5574 2004-12-09 Marek Safar <marek.safar@seznam.cz>
5576 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
5577 Reduced number of warnings.
5579 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5581 2004-12-08 Miguel de Icaza <miguel@ximian.com>
5583 * driver.cs: Removed message.
5585 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5587 2004-12-08 <vargaz@freemail.hu>
5589 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5591 2004-12-08 Martin Baulig <martin@ximian.com>
5593 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5594 instead of a CS3002 for properties and indexer.
5596 2004-12-08 Martin Baulig <martin@ximian.com>
5598 * decl.cs (MemberName.ToString): Make this work again.
5600 2004-12-08 Marek Safar <marek.safar@seznam.cz>
5602 * attribute.cs (Resolve): Add error 591 detection.
5604 * class.cs (FieldMember.Define): Add error 1547 detection.
5605 (Indexer.Define): Add error 620 detection.
5606 (Operator.Define): Add error 590 detection.
5608 * ecore.cs: Missing argument for error 79.
5610 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5613 2004-12-07 Marek Safar <marek.safar@seznam.cz>
5616 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5619 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
5621 * cs-parser.jay : handle doc comments on implicit/explicit operators.
5622 Some operator comments were suppressed.
5623 * doc.cs : Implicit/explicit operator name in doc comments are like
5624 "op_Explicit(type)~returnType", so added suffix handling.
5626 2005-01-21 Alp Toker <alp@atoker.com>
5628 * cs-parser.jay: destructor_declaration's container is PartialContainer
5629 not Class when partial types are used, so use Kind prop instead of 'is'.
5631 2004-12-12 Martin Baulig <martin@ximian.com>
5633 * expression.cs (Unary.TryReduceNegative): Added support for
5634 SByteConstant and ByteConstant.
5635 (Unary.Reduce): Check error values from TryReduceNegative().
5637 2004-12-11 Martin Baulig <martin@ximian.com>
5639 * support.cs (ReflectionParameters.ParameterName): If we have a
5640 `gpd', call `ParameterName' on it.
5642 * parameter.cs (Parameter.GetParameterAttributes): New static method.
5644 * pending.cs (PendingImplementation.DefineProxy): Call
5645 DefineParameter() for all of the MethodBuilder's arguments.
5647 2004-12-09 Martin Baulig <martin@ximian.com>
5649 * doc.cs (DocUtil): Make this a static class.
5651 2004-12-09 Martin Baulig <martin@ximian.com>
5653 * expression.cs (Invocation.InferType): Moved the type inference
5654 implementation into TypeManager.
5656 * generics.cs (TypeManager): Moved the type inference
5657 implementation here.
5659 2004-12-09 Martin Baulig <martin@ximian.com>
5661 * typemanager.cs (TypeManager): Make this a partial class.
5664 (TypeManager): Move the generics part of `TypeManager' here.
5666 2004-12-08 Martin Baulig <martin@ximian.com>
5668 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5669 instead of a CS3002 for properties and indexer. Added CS3024
5670 check for generic interfaces.
5672 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
5673 instances are not CLS-compliant.
5675 2004-12-08 Martin Baulig <martin@ximian.com>
5678 (void_pointer_expression): New rule for `void*', `void**' etc.
5679 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
5681 2004-12-08 Martin Baulig <martin@ximian.com>
5683 * expression.cs (Invocation.InferType): Removed the hack for
5684 MethodCore.MayUnify().
5686 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
5689 * class.cs (MethodCore.MayUnify): Use
5690 TypeManager.MayBecomeEqualGenericTypes().
5692 2004-12-08 Martin Baulig <martin@ximian.com>
5694 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
5695 parameter, box it. Fixes #69233.
5697 2004-12-08 Martin Baulig <martin@ximian.com>
5699 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
5700 have the ctor constraint. Fixes #68326.
5702 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
5704 * cs-parser.jay : interface comment was not consumed because of
5705 extra opt_semicolon before doc handling.
5707 2004-12-03 Raja R Harinath <rharinath@novell.com>
5709 Fix test-327.cs, test-328.cs, and put in early infrastructure
5710 for eventually fixing #52697.
5711 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
5712 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
5714 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
5715 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
5716 (VerifyUsing, error246): Update.
5717 * rootcontext.cs (RootContext.NamespaceLookup): Just use
5718 'NamespaceEntry.LookupNamespaceOrType'.
5720 2004-12-07 Martin Baulig <martin@ximian.com>
5722 * driver.cs: Call it "BETA SOFTWARE" :-)
5724 2004-12-06 Raja R Harinath <rharinath@novell.com>
5726 Fix crash on cs0657-17.cs.
5727 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5728 Use RootContext.Tree.Types, not 'new RootTypes ()'.
5729 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5730 the case where the NamespaceEntry gets overwritten.
5732 2004-12-06 Marek Safar <marek.safar@seznam.cz>
5734 Fixed #69195, #56821
5735 * ecore.cs (ResolveBoolean): Tiny refactoring.
5737 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
5738 of right expression resolving when left is false constant and
5739 operator is LogicalAnd OR true constant and operator is LogicalOr.
5741 * statement.cs (ResolveUnreachable): Always reports warning.
5743 2004-12-05 Miguel de Icaza <miguel@ximian.com>
5745 * class.cs: Distinguish between 1721 and 1722 (just a little help
5746 for the programmer).
5748 2004-12-03 Miguel de Icaza <miguel@ximian.com>
5750 * delegate.cs: Only allow this on new versions of the language.
5752 2004-12-02 Duncan Mak <duncan@ximian.com>
5754 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
5756 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
5757 here as a static method. Take an additional bool out parameter
5758 `must_do_cs1540_check' for signaling to InstanceResolve.
5759 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
5760 member field from PropertyExpr class and made it an argument of
5762 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
5763 check for MarshalByRefObject, and report CS0122 instead of CS1540.
5764 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
5765 and `remove_accessor' as well as InstanceResolve: report CS0122
5770 2004-12-07 Martin Baulig <martin@ximian.com>
5772 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
5773 and CS0692 where appropriate.
5775 2004-12-06 Martin Baulig <martin@ximian.com>
5777 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
5778 IsDuplicateImplementation() and improved it.
5780 * expression.cs (Invocation.InferTypeArguments): Added
5781 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
5782 and removed the "ref" modifier from `infered_types'.
5784 * decl.cs (MemberName.ToString): Removed the exception.
5786 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
5788 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
5789 comments are allowed.
5791 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
5793 * delegate.cs: Add checks for subtypes in paramaters and return values
5794 in VerifyMethod () to add support for Covariance/Contravariance
5797 2004-12-02 Miguel de Icaza <miguel@ximian.com>
5799 * report.cs: Remove extra closing parenthesis.
5801 * convert.cs (Error_CannotImplicitConversion): If the name of the
5802 types are the same, provide some extra information.
5804 2004-12-02 Marek Safar <marek.safar@seznam.cz>
5807 * attribute.cs (Resolve): Improved implementation of params
5808 attribute arguments.
5810 * support.cs (ParameterData): Add HasParams to be faster.
5812 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
5814 all things are for /doc support:
5816 * doc.cs: new file that supports XML documentation generation.
5817 * mcs.exe.sources: added doc.cs.
5819 Handle /doc command line option.
5820 Report error 2006 instead of 5 for missing file name for /doc.
5821 Generate XML documentation when required, after type resolution.
5823 Added support for picking up documentation (/// and /** ... */),
5824 including a new XmlCommentState enumeration.
5826 Added lines to fill Documentation element for field, constant,
5827 property, indexer, method, constructor, destructor, operator, event
5828 and class, struct, interface, delegate, enum.
5829 Added lines to warn incorrect comment.
5831 Added Documentation field (passed only when /doc was specified).
5833 Added DocComment, DocCommentHeader, GenerateDocComment() and
5834 OnGenerateDocComment() and some supporting private members for
5835 /doc feature to MemberCore.
5837 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
5839 Added overriden DocCommentHeader.
5841 Added overriden DocCommentHeader and GenerateDocComment().
5843 2004-12-01 Miguel de Icaza <miguel@ximian.com>
5845 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
5846 unwrapping the enumeration values, chain to
5847 DoConstantNumericPromotions again, so we can promote things to the
5848 fundamental types (takes care of enums that are bytes, sbytes).
5852 2004-12-01 Raja R Harinath <rharinath@novell.com>
5854 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
5855 Fix long-standing bug in type-lookup. Use FindType instead of
5856 LookupType when ec.ResolvingTypeTree.
5857 (Attribute.ResolveType, Attribute.Resolve)
5858 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
5860 (Attributes.Search): Remove internal version. Update.
5861 (Attributes.SearchMulti): Update.
5862 (Attributes.GetClsCompliantAttribute): Remove.
5863 (Attributes.GetIndexerNameAttribute): Remove.
5864 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
5865 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
5866 * class.cs (Indexer.Define): Likewise.
5868 2004-12-01 Marek Safar <marek.safar@seznam.cz>
5871 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
5872 MarshallByReference members access.
5874 * expression.cs: Use CheckMarshallByRefAccess;
5875 Better error CS0197 message.
5877 * report.cs: Print whole related error message.
5879 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5881 * class (GetClassBases): Better error 60 report.
5882 (EventProperty): Disabled warning 67 detection.
5884 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5887 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
5889 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
5892 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5895 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
5897 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
5899 2004-11-26 Miguel de Icaza <miguel@ximian.com>
5901 * attribute.cs (Attribute.Resolve): Refine error reporting and
5902 report a cs0117 if the identifier does not exist, to distinguish
5903 from 0617 which is a miss-use of the actual identifier.
5905 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
5906 between cs0070 and cs0079.
5908 * class.cs (MemberBase.DoDefine): When reporting a wrong
5909 accessibility level, we use MethodCore to compare instead of
5910 Method (this was a regression in some refactoring effort).
5912 So now we correctly report cs0056 again.
5914 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
5915 testing the target_type (which was known to be object_type) and
5916 not the source type (which is anonymous_method).
5918 Fixed reporting of error cs1660.
5920 * expression.cs (UserCast.Source): Expose the underlying cast.
5922 * statement.cs (Switch.SwitchGoverningType): Sort the list of
5923 allowed types to find a match to int32 first (most common).
5925 In addition, it ignores any ImplicitUserConversions that did an
5926 internal implicit conversion (as the switch statement allows only
5927 one integral conversion to exist).
5929 * class.cs (PartialContainer.Create): rename `name' to
5930 `member_name' for clarity. Then replace the string calls with a
5931 call to MemberName.GetPartialName, as now using
5932 MemberName.ToString is an error (this is due to the side effects
5933 it had, that were fixed in the past).
5935 This will restore the error reporting on a number of partial class
5936 errors that were missusing this (and getting an exception as a
5937 results, which is now just a plain textual warning, because
5938 yyparse debug output would crash otherwise).
5940 2004-11-26 Raja R Harinath <rharinath@novell.com>
5942 * Makefile (PROGRAM_INSTALL_DIR): Remove.
5944 2004-11-25 Ben Maurer <bmaurer@ximian.com>
5946 * rootcontext.cs (LookupType): Make sure to cache lookups that
5947 don't give us a negative result. This saves about 5% of corlib
5950 2004-11-25 Miguel de Icaza <miguel@ximian.com>
5952 * report.cs (AbstractMessage.Print): messages are sent to stderr
5954 * class.cs (TypeContainer.GetClassBases): It is an error to have a
5955 non-interface in the list of interfaces (at this point, either
5956 parent was properly set, or a base class is being listed in the
5957 interfaces section).
5959 This flags error 1722, and resolves the crash from bug 69259.
5961 2004-11-25 Ben Maurer <bmaurer@ximian.com>
5963 * statement.cs (Using.EmitExpressionFinally): make this work right
5964 for valuetypes. Fixes 69926.
5966 2004-11-25 Miguel de Icaza <miguel@ximian.com>
5968 * const.cs (Const.ChangeType): Cope with the "0 literal can be
5969 converted to an enum" here, before we try to change the underlying
5970 type. This code exists, but it is a different code path than the
5971 one used while encoding constants.
5973 (ImplicitReferenceConversionExists): In addition, resynchronized
5974 the code here, so it matches the same code in
5975 ImplicitReferenceConversionExists for the `from any class-type S
5976 to any interface-type T'.
5978 2004-11-25 Marek Safar <marek.safar@seznam.cz>
5980 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
5982 2004-11-24 Miguel de Icaza <miguel@ximian.com>
5984 * cs-parser.jay: Use verbosity accordingly.
5986 2004-11-24 Marek Safar <marek.safar@seznam.cz>
5988 * expression.cs (Unary.ResolveOperator): Do not report warning;
5989 AddressOf reads from variable.
5991 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
5993 2004-11-24 Marek Safar <marek.safar@seznam.cz>
5997 * attribute.cs (Attributable): Removed CheckTargets.
5998 (Attributes.Emit): Explicit attribute targets are tested here.
6000 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6001 not enabled for interfaces.
6003 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6004 (GetAssemblyName): Ouch next bug there.
6006 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6008 * expression.cs: Error 275 added.
6010 2004-11-23 Marek Safar <marek.safar@seznam.cz>
6012 Fix bug #69177 (Implemented decimal constant support)
6014 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6015 (BinaryFold): Add DecimalConstant.
6017 * const.cs (Define): Decimal constant
6019 (ChangeType): Add decimal type handling.
6020 (LookupConstantValue): Don't set value for decimal type but
6021 emit DecimalConstantAttribute. Needed for constant optimization.
6023 * constant.cs (ToDecimal): New method.
6024 (ConvertToDecimal): New method.
6025 (IntConstant): Implemented ConvertToDecimal.
6026 (DecimalConstant.Emit): Emit optimized version for decimals in
6029 * expression.cs (ResolveOperator): Changed order of constant
6030 reduction to work correctly with native types which have
6031 overloaded operators.
6032 (ResolveMemberAccess): Extract constant value from attribute
6035 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6037 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6038 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6039 (ChangeType): Decimal is special.
6040 (TypeToCoreType): Add decimal type.
6042 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6044 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6047 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6049 * class.cs (EventField.ApplyAttributeBuilder): Fix error
6052 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6054 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6056 * pending.cs (PendingImplementation): Grab only interfaces.
6058 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6060 * statement.cs (ForeachHelperMethods): Add location member and
6061 error 202 detection.
6063 2004-11-18 Marek Safar <marek.safar@seznam.cz>
6065 * expression.cs (DoResolveBase): Fixed wrong warning for out
6068 2004-12-04 Martin Baulig <martin@ximian.com>
6070 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6071 to check whether the conversion is ok.
6073 * typemanager.cs (TypeManager.GetTypeArguments): Just return
6074 `Type.EmptyTypes' if we're not a generic TypeContainer.
6076 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6078 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6079 old bug: when converting from the null literal to a pointer,
6080 return an EmptyCast, not the NullLiteral.
6082 This fixes #69921, the recent null_type changes probably made this
6085 2004-12-03 Martin Baulig <martin@ximian.com>
6087 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6088 method as our child, call AnonymousMethod.Compatible() on it.
6090 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6092 * class.cs (FieldBase): Use an unused bit field from the field to
6093 encode the `has_offset' property from the FieldMember. This saves
6094 a couple of Ks on bootstrap compilation.
6096 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6097 method as our child, return the AnonymousMethod resolved
6100 * expression.cs (New.DoResolve): Allow return values from
6101 NewDelegate to also include AnonymousMethods.
6105 2004-11-29 Raja R Harinath <rharinath@novell.com>
6107 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6109 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6110 System.Runtime.InteropServices._Exception, since it's a base
6111 interface of the core type System.Exception in the net_2_0 profile.
6113 2004-11-27 Martin Baulig <martin@ximian.com>
6115 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6117 2004-11-26 Raja R Harinath <rharinath@novell.com>
6119 * Makefile: Convert to use executable.make.
6120 * gmcs.exe.sources: New.
6122 2004-11-25 Martin Baulig <martin@ximian.com>
6124 * expression.cs (Invocation.InferType): Added support for byref types.
6126 2004-11-25 Martin Baulig <martin@ximian.com>
6128 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6129 in TypeManager.TypeToCoreType().
6131 2004-11-25 Martin Baulig <martin@ximian.com>
6133 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6134 "Dispose" method from the `current_type'.
6135 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6136 DoDefineMembers() instead of using the MethodBuilder; this is
6137 required for generic iterators.
6139 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6141 2004-11-24 Martin Baulig <martin@ximian.com>
6143 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6145 2004-11-20 Martin Baulig <martin@ximian.com>
6147 * expression.cs (Invocation.InferType): Correctly infer generic
6148 instances; see gen-103.cs.
6149 (Invocation.InferTypeArguments): If a generic method doesn't have
6150 any unbound type parameters, we don't need to infer anything.
6152 2004-11-19 Raja R Harinath <rharinath@novell.com>
6154 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6156 2004-11-17 Raja R Harinath <rharinath@novell.com>
6158 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6159 (TypeHandle.GetMemberCache): New.
6160 (TypeHandle.TypeHandle): Update.
6161 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6162 (TypeManager.LookupParentInterfacesCache):
6163 Rename from LookupInterfaceCache. Optimize slightly.
6164 (TypeManager.MemberLookup_FindMembers): Update.
6165 * decl.cs (MemberCache.MemberCache): Set Container to null in the
6167 (AddCacheContents): Rename from AddHashtable.
6168 * class.cs (TypeContainer.parent_container): Remove.
6169 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6170 (TypeContainer.DoDefineMembers): Don't initialize it.
6171 Update to name changes.
6173 2004-11-17 Miguel de Icaza <miguel@ximian.com>
6175 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6176 that factors the code to check access modifiers on override.
6178 (PropertyBase): Use the code here.
6180 Patch from Lluis S'anchez, fixes bug #69361.
6182 2004-11-15 Miguel de Icaza <miguel@ximian.com>
6184 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6185 routine that is used to report the use of a captured variable
6186 whose address has been taken.
6188 There are two checks: one when variables are being captured and
6189 the other check is when the address of a variable is taken.
6191 (because an anonymous methods might be resolved before *or* after
6192 the address has been taken) and
6194 * expression.cs (Conditional.DoResolve): Remove the special
6195 casing that Martin added to trueExpr and falseExpr being both
6196 NullLiteral. We get the right behavior now just by introducing
6197 the null_type into the compiler.
6199 * convert.cs (ExplicitConversion): Change the code to use
6200 null_type instead of testing `expr is NullLiteral'.
6201 (ImplicitConversionStandard): use null_type too.
6202 (ImplicitReferenceConversionExists): use null_type too.
6203 (ImplicitReferenceConversion): use null_type too.
6205 * literal.cs: The type of `NullLiteral' is now null_type instead
6207 (Resolve): Set the type here.
6209 * typemanager.cs: Introduce null_type.
6211 2004-11-18 Martin Baulig <martin@ximian.com>
6214 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6216 2004-11-18 Martin Baulig <martin@ximian.com>
6218 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
6220 2004-11-18 Martin Baulig <martin@ximian.com>
6222 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
6223 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
6224 call ResolveConstructedType() on it to resolve it without checking
6226 (Constraints.ResolveTypes): Check them here.
6227 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
6228 but don't check constraints.
6229 (ConstructedType.ResolveAsTypeTerminal): Override this and also
6230 check constraints here.
6231 (ConstructedType.ResolveConstructedType): New public method. This
6232 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
6233 resolve ourselves without checking constraints.
6235 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
6237 2004-11-18 Martin Baulig <martin@ximian.com>
6240 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
6242 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
6244 2004-11-18 Martin Baulig <martin@ximian.com>
6246 * ecore.cs (TypeExpr.ResolveType): Removed.
6247 (Expression.ResolveAsTypeTerminal): We always return a fully
6248 resolved `TypeExpr', so we can just access its `Type'.
6250 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
6252 2004-11-17 Martin Baulig <martin@ximian.com>
6254 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
6255 sure we don't return any unresolved TypeExpr's.
6256 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
6258 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
6260 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
6261 unresolved `ConstructedType's.
6263 2004-11-17 Martin Baulig <martin@ximian.com>
6265 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
6267 2004-11-17 Martin Baulig <martin@ximian.com>
6270 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
6272 * decl.cs (DeclSpace.ResolveType): Removed.
6273 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
6275 2004-11-17 Martin Baulig <martin@ximian.com>
6277 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6278 direction, like FindMembers() does. Fixes #69546, testcase is in
6281 2004-11-16 Martin Baulig <martin@ximian.com>
6283 This is based on a patch from Marek Safar, see bug #69082.
6284 Fixes bugs #63705 and #67130.
6286 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6287 method; create a MemberCache for an interface type and cache the
6290 * decl.cs (IMemberContainer.ParentContainer): Removed.
6291 (IMemberContainer.ParentCache): New property.
6292 (MemberCache.SetupCacheForInterface): Removed.
6293 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6294 to create a cache for an interface's "parent".
6296 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6299 2004-11-14 Ben Maurer <bmaurer@ximian.com>
6301 * statement.cs: Avoid adding bools to a hashtable.
6303 2004-11-15 Martin Baulig <martin@ximian.com>
6305 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
6307 2004-11-11 Martin Baulig <martin@ximian.com>
6309 * typemanager.cs (TypeManager.GetMethodName): New method.
6311 * class.cs (MethodData.Define): Include the generic arity in the
6312 name of an explicit interface; also add it to the method name.
6314 * pending.cs (PendingImplementation.InterfaceMethod): The method
6315 name now includes the generic arity.
6317 2004-11-07 Miguel de Icaza <miguel@ximian.com>
6319 * expression.cs (Invocation.OverloadResolve): Flag error if we are
6320 calling an unsafe method from a safe location.
6322 2004-11-06 Marek Safar <marek.safar@seznam.cz>
6325 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6327 2004-11-06 Miguel de Icaza <miguel@ximian.com>
6329 * namespace.cs (VerifyUsing): use GetPartialName instead of
6332 2004-11-05 Miguel de Icaza <miguel@ximian.com>
6334 * statement.cs (Return.Resolve): Fix regression in typo: if
6335 `in_exc', we have to request a NeedReturnLabel, this was a typo
6336 introduced in the anonymous method check-in. Fixes #69131.
6338 * Indexers were using the ShortName when defining themselves,
6339 causing a regression in the compiler bootstrap when applying the
6340 patch from 2004-11-02 (first part), now they use their full name
6341 and the bug is gone.
6343 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
6345 * driver.cs: Strip the path from the names of embedded resources. Fixes
6348 2004-11-04 Raja R Harinath <rharinath@novell.com>
6350 Fix error message regression: cs0104-2.cs.
6351 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6352 (AliasEntry.Resolve): Update.
6353 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
6355 (RootContext.LookupType): Update.
6357 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
6359 * cs-parser.jay: Add support for handling accessor modifiers
6360 * class: Add support port accessor modifiers and error checking,
6361 define PropertyMethod.Define as virtual (not abstract anymore)
6362 * ecore.cs: Add checking for proeprties access with access modifiers
6363 * iterators.cs: Modify Accessor constructor call based in the modified
6365 2004-11-02 Ben Maurer <bmaurer@ximian.com>
6367 * expression.cs (StringConcat): Handle being called twice,
6368 as when we have a concat in a field init with more than two
6371 2004-11-02 Miguel de Icaza <miguel@ximian.com>
6373 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6374 special case explicit implementations, we should always produce
6375 the .property or .event declaration.
6377 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6378 since it will not return correct data if people use this
6379 unresolved in the presence of using statements (see test-313).
6381 * class.cs (MethodData.Define): If we are an explicit interface
6382 implementation, set the method name to the full name of the
6383 interface plus the name of the method.
6385 Notice that using the method.MethodName.GetFullName() does not
6386 work, as it will only contain the name as declared on the source
6387 file (it can be a shorthand in the presence of using statements)
6388 and not the fully qualifed type name, for example:
6392 class D : ICloneable {
6393 object ICloneable.Clone () {
6397 Would produce a method called `ICloneable.Clone' instead of
6398 `System.ICloneable.Clone'.
6400 * namespace.cs (Alias.Resolve): Use GetPartialName.
6402 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6404 * cs-parser.jay: Add error 1055 report.
6406 2004-11-01 Miguel de Icaza <miguel@ximian.com>
6408 * assign.cs (Assign.DoResolve): Only do the transform of
6409 assignment into a New if the types are compatible, if not, fall
6410 through and let the implicit code deal with the errors and with
6411 the necessary conversions.
6413 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6415 * cs-parser.jay: Add error 1031 report.
6417 * cs-tokenizer.cs: Add location for error 1038.
6419 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6421 * cs-parser.jay: Add error 1016 report.
6423 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6425 * cs-parser.jay: Add errors 1575,1611 report.
6427 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6429 * cs-parser.jay: Add error 1001 report.
6431 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6434 * attribute.cs (GetMarshal): Add method argument for
6435 caller identification.
6437 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6438 agument for GetMarshal and RuntimeMissingSupport.
6440 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6442 * attribute.cs (ExtractSecurityPermissionSet): Removed
6443 TypeManager.code_access_permission_type.
6445 * typemanager.cs: Removed TypeManager.code_access_permission_type.
6447 2004-10-27 Miguel de Icaza <miguel@ximian.com>
6449 * expression.cs (LocalVariableReference.DoResolveLValue): Check
6450 for obsolete use of a variable here. Fixes regression on errors
6451 cs0619-25 and cs0619-26.
6453 2004-10-27 Marek Safar <marek.safar@seznam.cz>
6455 Fix #62358, implemented security attribute encoding.
6457 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6458 Tests permitted SecurityAction for assembly or other types.
6459 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6460 data from SecurityPermissionAttribute to PermisionSet class.
6462 * class.cs (ApplyAttributeBuilder): Added special handling
6463 for System.Security.Permissions.SecurityAttribute based types.
6465 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6466 special handling for System.Security.Permissions.SecurityAttribute
6469 * enum.cs (ApplyAttributeBuilder): Added special handling
6470 for System.Security.Permissions.SecurityAttribute based types.
6472 * parameter.cs (ApplyAttributeBuilder): Added special handling
6473 for System.Security.Permissions.SecurityAttribute based types.
6475 * rootcontext.cs: Next 2 core types.
6477 * typemanager.cs (TypeManager.security_permission_attr_type):
6478 Built in type for the SecurityPermission Attribute.
6479 (code_access_permission_type): Build in type.
6481 2004-10-17 Miguel de Icaza <miguel@ximian.com>
6483 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6484 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6485 all of this information into
6486 EmitContext.EmitCapturedVariableInstance.
6488 * codegen.cs (EmitCapturedVariableInstance): move here the
6489 funcionality of emitting an ldarg.0 in the presence of a
6490 remapping. This centralizes the instance emit code.
6492 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6493 then emit a load of this: it means that we have reached the
6494 topmost ScopeInfo: the one that contains the pointer to the
6495 instance of the class hosting the anonymous method.
6497 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6498 captures to the topmost CaptureContext.
6500 2004-10-12 Miguel de Icaza <miguel@ximian.com>
6502 * expression.cs (LocalVariableReference): Move the knowledge about
6503 the iterators into codegen's EmitCapturedVariableInstance.
6505 2004-10-11 Miguel de Icaza <miguel@ximian.com>
6507 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6508 all code paths return a value from an anonymous method (it is the
6509 same as the 161 error, but for anonymous methods).
6511 2004-10-08 Miguel de Icaza <miguel@ximian.com>
6513 The introduction of anonymous methods in the compiler changed
6514 various ways of doing things in the compiler. The most
6515 significant one is the hard split between the resolution phase
6516 and the emission phases of the compiler.
6518 For instance, routines that referenced local variables no
6519 longer can safely create temporary variables during the
6520 resolution phase: they must do so from the emission phase,
6521 since the variable might have been "captured", hence access to
6522 it can not be done with the local-variable operations from the runtime.
6526 (Block.Flags): New flag `IsTopLevel' to indicate that this block
6527 is a toplevel block.
6529 (ToplevelBlock): A new kind of Block, these are the blocks that
6530 are created by the parser for all toplevel method bodies. These
6531 include methods, accessors and anonymous methods.
6533 These contain some extra information not found in regular blocks:
6534 A pointer to an optional CaptureContext (for tracking captured
6535 local variables and parameters). A pointer to the parent
6538 (Return.Resolve): Catch missmatches when returning a value from an
6539 anonymous method (error 1662).
6540 Invoke NeedReturnLabel from the Resolve phase instead of the emit
6543 (Break.Resolve): ditto.
6545 (SwitchLabel): instead of defining the labels during the
6546 resolution phase, we now turned the public ILLabel and ILLabelCode
6547 labels into methods called GetILLabelCode() and GetILLabel() that
6548 only define the label during the Emit phase.
6550 (GotoCase): Track the SwitchLabel instead of the computed label
6551 (its contained therein). Emit the code by using
6552 SwitchLabel.GetILLabelCode ().
6554 (LocalInfo.Flags.Captured): A new flag has been introduce to track
6555 whether the Local has been captured or not.
6557 (LocalInfo.IsCaptured): New property, used to tell whether the
6558 local has been captured.
6560 * anonymous.cs: Vastly updated to contain the anonymous method
6563 The main classes here are: CaptureContext which tracks any
6564 captured information for a toplevel block and ScopeInfo used to
6565 track the activation frames for various local variables.
6567 Each toplevel block has an optional capture context associated
6568 with it. When a method contains an anonymous method both the
6569 toplevel method and the anonymous method will create a capture
6570 context. When variables or parameters are captured, they are
6571 recorded on the CaptureContext that owns them, for example:
6575 MyDelegate d = delegate {
6580 Here `a' will be recorded as captured on the toplevel
6581 CapturedContext, the inner captured context will not have anything
6582 (it will only have data if local variables or parameters from it
6583 are captured in a nested anonymous method.
6585 The ScopeInfo is used to track the activation frames for local
6586 variables, for example:
6588 for (int i = 0; i < 10; i++)
6589 for (int j = 0; j < 10; j++){
6590 MyDelegate d = delegate {
6595 At runtime this captures a single captured variable `i', but it
6596 captures 10 different versions of the variable `j'. The variable
6597 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6598 recorded on a child.
6600 The toplevel ScopeInfo will also track information like the `this'
6601 pointer if instance variables were referenced (this is necessary
6602 as the anonymous method lives inside a nested class in the host
6603 type of the method).
6605 (AnonymousMethod): Expanded to track the Toplevel, implement
6606 `AnonymousMethod.Compatible' to tell whether an anonymous method
6607 can be converted to a target delegate type.
6609 The routine now also produces the anonymous method content
6611 (AnonymousDelegate): A helper class that derives from
6612 DelegateCreation, this is used to generate the code necessary to
6613 produce the delegate for the anonymous method that was created.
6615 * assign.cs: API adjustments for new changes in
6616 Convert.ImplicitStandardConversionExists.
6618 * class.cs: Adjustments to cope with the fact that now toplevel
6619 blocks are of type `ToplevelBlock'.
6621 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6622 insteda of standard blocks.
6624 Flag errors if params arguments are passed to anonymous methods.
6626 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6627 `CurrentAnonymousMethod' which points to the current Anonymous
6628 Method. The variable points to the AnonymousMethod class that
6629 holds the code being compiled. It is set in the new EmitContext
6630 created for the anonymous method.
6632 (EmitContext.Phase): Introduce a variable and an enumeration to
6633 assist in enforcing some rules about when and where we are allowed
6634 to invoke certain methods (EmitContext.NeedsReturnLabel is the
6635 only one that enfonces this right now).
6637 (EmitContext.HaveCaptureInfo): new helper method that returns
6638 whether we have a CapturedContext initialized.
6640 (EmitContext.CaptureVariable): New method used to register that a
6641 LocalInfo must be flagged for capturing.
6643 (EmitContext.CapturedParameter): New method used to register that a
6644 parameters must be flagged for capturing.
6646 (EmitContext.CapturedField): New method used to register that a
6647 field must be flagged for capturing.
6649 (EmitContext.HaveCapturedVariables,
6650 EmitContext.HaveCapturedFields): Return whether there are captured
6651 variables or fields.
6653 (EmitContext.EmitMethodHostInstance): This is used to emit the
6654 instance for the anonymous method. The instance might be null
6655 (static methods), this (for anonymous methods that capture nothing
6656 and happen to live side-by-side with the current method body) or a
6657 more complicated expression if the method has a CaptureContext.
6659 (EmitContext.EmitTopBlock): Routine that drives the emission of
6660 code: it will first resolve the top block, then emit any metadata
6661 and then emit the code. The split is done so that we can extract
6662 any anonymous methods and flag any captured variables/parameters.
6664 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6665 during this phase, the ILGenerator should not be used as labels
6666 and local variables declared here might not be accessible to any
6667 code that is part of an anonymous method.
6669 Exceptions to this include the temporary variables that are
6670 created by some statements internally for holding temporary
6673 (EmitContext.EmitMeta): New routine, in charge of emitting all the
6676 (EmitContext.TemporaryReturn): This method is typically called
6677 from the Emit phase, and its the only place where we allow the
6678 ReturnLabel to be defined other than the EmitMeta. The reason is
6679 that otherwise we would have to duplicate a lot of logic in the
6680 Resolve phases of various methods that today is on the Emit
6683 (EmitContext.NeedReturnLabel): This no longer creates the label,
6684 as the ILGenerator is not valid during the resolve phase.
6686 (EmitContext.EmitThis): Extended the knowledge in this class to
6687 work in anonymous methods in addition to iterators.
6689 (EmitContext.EmitCapturedVariableInstance): This emits whatever
6690 code is necessary on the stack to access the instance to a local
6691 variable (the variable will be accessed as a field).
6693 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6694 EmitContext.EmitAddressOfParameter): Routines to support
6695 parameters (not completed at this point).
6697 Removals: Removed RemapLocal and RemapLocalLValue. We probably
6698 will also remove the parameters.
6700 * convert.cs (Convert): Define a `ConstantEC' which points to a
6701 null. This is just to prefity some code that uses
6702 ImplicitStandardConversion code and do not have an EmitContext
6705 The idea is to flag explicitly that at that point in time, it is
6706 known that the conversion will not trigger the delegate checking
6707 code in implicit conversions (which requires a valid
6710 Everywhere: pass new EmitContext parameter since
6711 ImplicitStandardConversionExists now requires it to check for
6712 anonymous method conversions.
6714 (Convert.ImplicitStandardConversionExists): If the type of an
6715 expression is the anonymous_method_type, and the type is a
6716 delegate, we invoke the AnonymousMethod.Compatible method to check
6717 whether an implicit conversion is possible.
6719 (Convert.ImplicitConversionStandard): Only do implicit method
6720 group conversions if the language level is not ISO_1.
6722 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6723 MethodInfo for the Invoke method. used by Delegate and
6726 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6727 method conversions if the target type is a delegate.
6729 Removed extra debugging nops.
6731 (LocalVariableReference): Turn the `local_info' into a public
6734 Add `prepared' field, the same hack used for FieldExprs to cope
6735 with composed assignments, as Local variables do not necessarily
6736 operate purely on the stack as they used to: they can be captured
6739 Add `temp' for a temporary result, like fields.
6741 Refactor DoResolve and DoResolveLValue into DoResolveBase.
6743 It now copes with Local variables that are captured and emits the
6744 proper instance variable to load it from a field in the captured
6747 (ParameterReference.DoResolveBase): During the resolve phase,
6748 capture parameters if we are in an anonymous method.
6750 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
6751 anonymous method, use the EmitContext helper routines to emit the
6752 parameter reference.
6754 * iterators.cs: Set RemapToProxy to true/false during the
6757 * parameters.cs (GetParameterByName): New helper method.
6759 * typemanager.cs (anonymous_method_type) a new type that
6760 represents an anonyous method. This is always an internal type,
6761 used as a fencepost to test against the anonymous-methodness of an
6764 2004-10-20 Marek Safar <marek.safar@seznam.cz>
6766 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
6768 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
6770 2004-11-10 Martin Baulig <martin@ximian.com>
6772 * expression.cs (Invocation.BetterFunction): If two methods have
6773 equal parameter types, but only one of them is generic, the
6774 non-generic one wins.
6775 (New.DoResolve): Don't set `is_struct' to false if we're a generic
6776 instance; just use `Type.IsValueType' to determine whether
6777 something is a struct or not.
6778 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
6779 so we can be called multiple times.
6781 2004-11-10 Martin Baulig <martin@ximian.com>
6783 * generic.cs (TypeParameter.DefineConstraints): New public method.
6784 (TypeParameter.CheckAccessLevel): Override this and return true.
6785 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
6786 override ResolveType() anymore.
6787 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
6789 2004-11-10 Martin Baulig <martin@ximian.com>
6791 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
6792 call DeclSpace.ResolveNestedType() on it.
6794 2004-11-10 Martin Baulig <martin@ximian.com>
6796 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
6797 non-null, call ParameterModifier() on it.
6799 2004-11-10 Martin Baulig <martin@ximian.com>
6802 (Iterators): Added `current_type' and `this_type' fields.
6803 (Iterators.DefineIterator): Create a new EmitContext and store it
6804 in `ec'; compute `this_type'.
6806 2004-11-10 Martin Baulig <martin@ximian.com>
6809 (TypeManager.IsPrivateAccessible): New public method.
6810 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
6812 2004-11-10 Martin Baulig <martin@ximian.com>
6814 * class.cs (TypeContainer.DefineType): Call
6815 TypeBuilder.DefineGenericParameters() before resolving the type
6817 (MethodData.parent_method): New protected field.
6818 (MethodData..ctor): Added `MethodInfo parent_method' argument.
6819 (MethodData.Define): Compute `parent_method'.
6822 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6823 (MemberCore.GetClsCompliantAttributeValue): Likewise.
6824 (DeclSpace.ec): New protected field; store the EmitContext here.
6825 (DeclSpace.EmitContext): New public property.
6826 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
6827 (DeclSpace.ResolveNestedType): New public method.
6828 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
6829 (DeclSpace.NestedAccessible): Added `Type tb' argument.
6830 (DeclSpace.FamilyAccessible): Likewise.
6831 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
6832 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6835 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
6838 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6839 (Enum.Emit): Don't create a new EmitContext.
6841 2004-10-18 Martin Baulig <martin@ximian.com>
6843 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
6844 `Type' directly, but call ResolveType() on it.
6845 (Catch.Resolve): Likewise.
6846 (Foreach.Resolve): Likewise.
6848 2004-10-18 Martin Baulig <martin@ximian.com>
6850 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
6851 `Type' directly, but call ResolveType() on it.
6852 (Probe.DoResolve): Likewise.
6853 (ArrayCreation.LookupType): Likewise.
6854 (TypeOf.DoResolve): Likewise.
6855 (SizeOf.DoResolve): Likewise.
6857 2004-10-18 Raja R Harinath <rharinath@novell.com>
6859 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6862 2004-10-17 John Luke <john.luke@gmail.com>
6864 * class.cs (Operator.GetSignatureForError): use CSharpName
6866 * parameter.cs (Parameter.GetSignatureForError): Returns
6867 correct name even if was not defined.
6869 2004-10-13 Raja R Harinath <rharinath@novell.com>
6872 * class.cs (TypeContainer.EmitContext): New property.
6873 (DefineNestedTypes): Create an emitcontext for each part.
6874 (MethodCore.DoDefineParameters): Use container's emitcontext.
6875 Pass type array to InternalParameters.
6876 (MemberBase.DoDefine): Use container's emitcontext.
6877 (FieldMember.Define): Likewise.
6878 (Event.Define): Likewise.
6879 (SetMethod.GetParameterInfo): Change argument to EmitContext.
6880 Pass type array to InternalParameters.
6881 (SetIndexerMethod.GetParameterInfo): Likewise.
6882 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6883 * delegate.cs (Define): Pass emitcontext to
6884 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
6885 array to InternalParameters.
6886 * expression.cs (ParameterReference.DoResolveBase): Pass
6887 emitcontext to GetParameterInfo.
6888 (ComposedCast.DoResolveAsTypeStep): Remove check on
6889 ec.ResolvingTypeTree.
6890 * parameter.cs (Parameter.Resolve): Change argument to
6891 EmitContext. Use ResolveAsTypeTerminal.
6892 (Parameter.GetSignature): Change argument to EmitContext.
6893 (Parameters.ComputeSignature): Likewise.
6894 (Parameters.ComputeParameterTypes): Likewise.
6895 (Parameters.GetParameterInfo): Likewise.
6896 (Parameters.ComputeAndDefineParameterTypes): Likewise.
6897 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
6898 * support.cs (InternalParameters..ctor): Remove variant that takes
6900 * typemanager.cs (system_intptr_expr): New.
6901 (InitExpressionTypes): Initialize it.
6903 2004-10-12 Chris Toshok <toshok@ximian.com>
6905 * cs-parser.jay: fix location for try_statement and catch_clause.
6907 2004-10-18 Martin Baulig <martin@ximian.com>
6909 * class.cs (FieldMember.Define): Don't access the TypeExpr's
6910 `Type' directly, but call ResolveType() on it.
6911 (MemberBase.DoDefine): Likewise.
6913 * expression.cs (New.DoResolve): Don't access the TypeExpr's
6914 `Type' directly, but call ResolveType() on it.
6915 (ComposedCast.DoResolveAsTypeStep): Likewise.
6917 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6918 `Type' directly, but call ResolveType() on it.
6920 2004-10-17 John Luke <john.luke@gmail.com>
6922 * class.cs (Operator.GetSignatureForError): use CSharpName
6924 * parameter.cs (Parameter.GetSignatureForError): Returns
6925 correct name even if was not defined.
6927 2004-10-13 Raja R Harinath <rharinath@novell.com>
6930 * class.cs (TypeContainer.EmitContext): New property.
6931 (DefineNestedTypes): Create an emitcontext for each part.
6932 (MethodCore.DoDefineParameters): Use container's emitcontext.
6933 Pass type array to InternalParameters.
6934 (MemberBase.DoDefine): Use container's emitcontext.
6935 (FieldMember.Define): Likewise.
6936 (Event.Define): Likewise.
6937 (SetMethod.GetParameterInfo): Change argument to EmitContext.
6938 Pass type array to InternalParameters.
6939 (SetIndexerMethod.GetParameterInfo): Likewise.
6940 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6941 * delegate.cs (Define): Pass emitcontext to
6942 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
6943 array to InternalParameters.
6944 * expression.cs (ParameterReference.DoResolveBase): Pass
6945 emitcontext to GetParameterInfo.
6946 (ComposedCast.DoResolveAsTypeStep): Remove check on
6947 ec.ResolvingTypeTree.
6948 * parameter.cs (Parameter.Resolve): Change argument to
6949 EmitContext. Use ResolveAsTypeTerminal.
6950 (Parameter.GetSignature): Change argument to EmitContext.
6951 (Parameters.ComputeSignature): Likewise.
6952 (Parameters.ComputeParameterTypes): Likewise.
6953 (Parameters.GetParameterInfo): Likewise.
6954 (Parameters.ComputeAndDefineParameterTypes): Likewise.
6955 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
6956 * support.cs (InternalParameters..ctor): Remove variant that takes
6958 * typemanager.cs (system_intptr_expr): New.
6959 (InitExpressionTypes): Initialize it.
6961 2004-10-12 Chris Toshok <toshok@ximian.com>
6963 * cs-parser.jay: fix location for try_statement and catch_clause.
6965 2004-10-07 Raja R Harinath <rharinath@novell.com>
6967 More DeclSpace.ResolveType avoidance.
6968 * decl.cs (MemberCore.InUnsafe): New property.
6969 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
6970 with newly created EmitContext.
6971 (FieldMember.Define): Likewise.
6972 * delegate.cs (Delegate.Define): Likewise.
6973 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
6974 only if normal name-lookup fails.
6975 (TypeExpr.DoResolve): Enable error-checking.
6976 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
6977 (SizeOf.DoResolve): Likewise.
6978 (ComposedCast.DoResolveAsTypeStep): Likewise.
6979 (StackAlloc.DoResolve): Likewise.
6980 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
6981 (Block.Unsafe): New property.
6982 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
6983 (Unsafe): Set 'unsafe' flag of contained block.
6984 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
6985 (Fixed.Resolve): Likewise.
6986 (Catch.Resolve): Likewise.
6987 (Using.ResolveLocalVariableDecls): Likewise.
6988 (Foreach.Resolve): Likewise.
6990 2004-10-05 John Luke <john.luke@gmail.com>
6992 * cs-parser.jay: add location to error CS0175
6994 2004-10-04 Miguel de Icaza <miguel@ximian.com>
6996 * ecore.cs (Expression.Constantity): Add support for turning null
6999 * const.cs (Const.Define): Allow constants to be reference types
7000 as long as the value is Null.
7002 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
7004 * namespace.cs (NamespaceEntry.Using): No matter which warning
7005 level is set, check if this namespace name has already been added.
7007 2004-10-03 Ben Maurer <bmaurer@ximian.com>
7009 * expression.cs: reftype [!=]= null should always use br[true,false].
7012 2004-10-03 Marek Safar <marek.safar@seznam.cz>
7015 * attribute.cs: Enum conversion moved to
7016 GetAttributeArgumentExpression to be applied to the all
7019 2004-10-01 Raja R Harinath <rharinath@novell.com>
7021 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7022 * class.c (TypeContainer.DefineType): Flag error if
7023 base types aren't accessible due to access permissions.
7024 * decl.cs (DeclSpace.ResolveType): Move logic to
7025 Expression.ResolveAsTypeTerminal.
7026 (DeclSpace.ResolveTypeExpr): Thin layer over
7027 Expression.ResolveAsTypeTerminal.
7028 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7029 Refactor code into NestedAccess. Use it.
7030 (DeclSpace.NestedAccess): New.
7031 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7032 argument to silence errors. Check access permissions.
7033 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7034 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7035 (Cast.DoResolve): Likewise.
7036 (New.DoResolve): Likewise.
7037 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7038 (TypeOf.DoResolve): Likewise.
7040 * expression.cs (Invocation.BetterConversion): Return the Type of
7041 the better conversion. Implement section 14.4.2.3 more faithfully.
7042 (Invocation.BetterFunction): Make boolean. Make correspondence to
7043 section 14.4.2.2 explicit.
7044 (Invocation.OverloadResolve): Update.
7045 (Invocation): Remove is_base field.
7046 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
7047 (Invocation.Emit): Likewise.
7049 2004-09-24 Marek Safar <marek.safar@seznam.cz>
7051 * cs-parser.jay: Reverted 642 warning fix.
7053 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7056 * decl.cs (FindMemberWithSameName): Indexer can have more than
7059 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7061 * expression.cs (LocalVariableReference.DoResolveLValue):
7062 Do not report warning 219 for out values.
7063 (EmptyExpression.Null): New member to avoid extra allocations.
7065 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7067 * cs-parser.jay: Fix wrong warning 642 report.
7069 * cs-tokenizer.cs (CheckNextToken): New helper;
7070 Inspect next character if is same as expected.
7072 2004-09-23 Martin Baulig <martin@ximian.com>
7074 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7075 (Convert.ImplicitReferenceConversionExists): Likewise.
7077 2004-11-09 Raja R Harinath <rharinath@novell.com>
7079 * Makefile (DISTFILES): Comment out a few missing files.
7081 2004-10-29 Raja R Harinath <rharinath@novell.com>
7083 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7084 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
7085 (gmcs.exe): Invoke bootstrap-libs.
7086 (clean-local): Clean the net_2_0_bootstrap profile too.
7087 (PROGRAM_INSTALL_DIR): New.
7088 (install-local): Use it.
7090 2004-10-13 Martin Baulig <martin@ximian.com>
7092 * generic.cs (TypeManager.InflatedConstraints): New nested class.
7093 (TypeParameter.DefineType): If we're a method type parameter and
7094 that method is overriding something, "inflate" its constraints.
7096 2004-10-12 Martin Baulig <martin@ximian.com>
7098 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7099 and have type arguments, create and resolve a ConstructedType.
7101 2004-10-12 Martin Baulig <martin@ximian.com>
7103 * decl.cs (MemberCache.FindMemberToOverride): Use
7104 TypeManager.IsEqual() to compare the parameters and Type.Equals()
7105 to compare the invocationType.
7107 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7108 When comparing two type parameters, only do the signature-only
7109 comparision for method type parameters.
7111 2004-10-11 Martin Baulig <martin@ximian.com>
7113 * report.cs: Don't make --fatal abort on warnings, we have
7114 -warnaserror for that.
7116 2004-10-11 Martin Baulig <martin@ximian.com>
7119 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7120 (TypeManager.IsEqual): Call ourself recursively instead of using
7123 2004-10-11 Martin Baulig <martin@ximian.com>
7125 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7126 on our own type parameters, not on the ones we inherit from a containing
7129 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7132 * generic.cs (TypeParameter.Define): We may only be called once.
7134 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7135 instead of TypeManager.IsEqual().
7137 2004-09-28 Martin Baulig <martin@ximian.com>
7140 (GenericConstraints.EffectiveBaseClass): New public property.
7141 (TypeParameter.GenericConstraints): New public property.
7142 (ConstructedType.CheckConstraints): Improved.
7144 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7145 (Convert.TypeParameterConversion): New private method; use this in
7146 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7147 for all conversions related to type parameters.
7149 2004-09-24 Martin Baulig <martin@ximian.com>
7151 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7152 type parameter conversions for type parameters which are known to
7155 2004-09-24 Martin Baulig <martin@ximian.com>
7157 * generic.cs (GenericConstraints): Added `IsReferenceType' and
7158 `IsValueType' properties.
7160 * support.cs (ReflectionConstraints): Use
7161 Type.GetGenericParameterConstraints() instead of the old hack.
7163 2004-09-24 Martin Baulig <martin@ximian.com>
7165 * generic.cs (GenericConstraints): Moved here and made it an
7168 * support.cs (GenericConstraints): Moved to generic.cs.
7170 2004-09-24 Martin Baulig <martin@ximian.com>
7173 (ReflectionConstraints): Un-nested this class and made it public.
7176 (TypeManager.GetTypeParameterConstraints): New public method.
7177 (TypeManager.HasConstructorConstraint): Use the attributes.
7179 2004-09-24 Martin Baulig <martin@ximian.com>
7181 * support.cs (GenericConstraints): Replaced `HasConstructor',
7182 `IsReferenceType' and `IsValueType' with `Attributes'.
7183 (ReflectionParameters.ReflectionConstraints): Removed the Create()
7184 method and made the .ctor public.
7186 * generic.cs (Constraints.Attributes): New public property.
7187 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7188 `IsReferenceType' -> `HasReferenceTypeConstraint' and
7189 `IsValueType' -> `HasValueTypeConstraint'.
7191 2004-09-23 Martin Baulig <martin@ximian.com>
7193 * generic.cs (Constraints): Reflect latest runtime changes.
7195 2004-09-23 Martin Baulig <martin@ximian.com>
7197 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7198 (Convert.ImplicitReferenceConversionExists): Likewise.
7200 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7202 * class.cs (Operator.Define): Add error 448 and 559 report.
7204 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7206 * class.cs (MemberBase.IsTypePermitted): New protected
7207 method for checking error CS0610.
7209 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7211 * class.cs (TypeContainer.HasExplicitLayout): New property
7212 Returns whether container has StructLayout attribute set Explicit.
7213 (FieldMember): New abstract class for consts and fields.
7214 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7215 (Field): Reuse FieldMember.
7217 * const.cs (Const): Reuse FieldMember.
7219 * rootcontext.cs: EmitConstants call moved to class.
7221 2004-09-22 Martin Baulig <martin@ximian.com>
7223 Marek and me just fixed one of our oldest bugs: #28562 :-)
7225 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7227 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7228 we're an EnumConstant, just return that.
7229 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7230 an EnumConstant. In this case, we need to use GetValueAsEnumType()
7231 to get the value which'll actually be written into the attribute.
7232 However, we have to use GetValue() to access the attribute's value
7235 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7237 * constant.cs (Constant.IsNegative): New abstract property
7240 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7241 (StackAlloc.DoResolve): Reused IsNegative.
7243 2004-09-22 Martin Baulig <martin@ximian.com>
7245 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
7246 public method; like LookupTypeContainer, but also works for
7249 * report.cs (Report.SymbolRelatedToPreviousError): Use
7250 TypeManager.LookupGenericTypeContainer().
7252 2004-09-22 Martin Baulig <martin@ximian.com>
7254 Thanks to Peter Sestoft for this bug report.
7256 * expression.cs (Conditional): If both the `trueExpr' and the
7257 `falseExpr' is a NullLiteral, return a NullLiteral.
7259 2004-09-22 Martin Baulig <martin@ximian.com>
7261 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7262 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7263 for the "get_Current" call.
7265 2004-09-21 Martin Baulig <martin@ximian.com>
7267 * convert.cs (Convert.ImplicitReferenceConversion): When
7268 converting to an interface type, first check whether we're
7269 converting from a reference type.
7271 2004-09-14 Martin Baulig <martin@ximian.com>
7273 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7275 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7278 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7279 called and is obsolete then this member suppress message
7280 when call is inside next [Obsolete] method or type.
7282 * expression.cs: Use TestObsoleteMethodUsage member.
7284 2004-09-14 Martin Baulig <martin@ximian.com>
7286 * genericparser.cs: Removed.
7288 2004-09-13 Marek Safar <marek.safar@seznam.cz>
7290 * class.cs (MethodCore.CheckBase): Fix bug #65757.
7292 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7294 * attribute.cs (Attribute.Resolve): Add error 653 report.
7296 * class.cs (Class.ApplyAttributeBuilder): Add error 641
7298 (Method.ApplyAttributeBuilder): Add error 685 report.
7299 (Operator.Define): Add error 564 report.
7301 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7303 * expression.cs (Invocation.DoResolve): Add error
7306 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7309 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7311 * class.cs (ConstructorInitializer.Resolve):
7312 Wrong error number (515->516).
7314 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7316 * class.cs (Indexer.Define): Add error 631 report.
7318 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7320 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7322 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7324 * expression.cs (Probe.DoResolve): Add error CS0241 report.
7326 2004-09-10 Marek Safar <marek.safar@seznam.cz>
7328 * cs-parser.jay: Added error CS0241 report.
7330 2004-09-10 Raja R Harinath <rharinath@novell.com>
7332 * cs-parser.jay (fixed_statement): Introduce a scope for the
7333 declaration in the 'fixed' statement.
7335 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7337 * cs-parser.jay: Added CS0230 error report.
7339 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7341 * cs-parser.jay: Added errors CS0231 and CS0257 report.
7343 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7345 * expression.cs (Argument.Resolve): Added error CS0192 and
7348 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7350 C# 2.0 #pragma warning feature
7352 * cs-tokenizer.cs (PreProcessPragma): New method;
7353 Handles #pragma directive.
7355 * report.cs (WarningRegions): New class; Support
7356 class for #pragma warning directive. It tests whether
7357 warning is enabled for a given line.
7359 2004-09-08 Miguel de Icaza <miguel@ximian.com>
7361 * const.cs: Add more descriptive error report, tahnks to
7364 2004-09-08 Marek Safar <marek.safar@seznam.cz>
7366 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7368 2004-09-07 Miguel de Icaza <miguel@ximian.com>
7370 * expression.cs: Apply patch from Ben: Remove dead code from
7371 ArrayCreation, and remove the TurnintoConstant call in const.cs,
7372 as that code just threw an exception anwyays.
7374 * const.cs: Remove the call to the turnintoconstant, for details
7377 * literal.cs: The type of the null-literal is the null type; So
7378 we use a placeholder type (literal.cs:System.Null, defined here)
7381 * expression.cs (Conditional.DoResolve): Remove some old code that
7382 is no longer needed, conversions have been fixed.
7384 (ArrayCreationExpression.DoResolve): Return false if we fail to
7385 resolve the inner expression.
7387 2004-09-07 Raja R Harinath <rharinath@novell.com>
7390 * cs-parser.jay (delegate_declaration): Record a delegate
7391 declaration as a type declaration.
7392 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7394 2004-09-06 Miguel de Icaza <miguel@ximian.com>
7396 * parameter.cs: Do not crash if the type can not be resolved.
7398 * expression.cs: Report errors with unsafe pointers, fixes #64896
7400 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
7402 * expression.cs: Pointer arith always needs to do a conv.i
7403 if the operand is a long. fix 65320
7405 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7407 Fixed cs0619-37.cs, cs0619-38.cs
7409 * enum.cs (GetObsoleteAttribute): Removed.
7411 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7412 on Enum member is double staged. The first is tested member
7415 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7417 Fixed #56986, #63631, #65231
7419 * class.cs: (TypeContainer.AddToMemberContainer): New method,
7420 adds member to name container.
7421 (TypeContainer.AddToTypeContainer): New method, adds type to
7423 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7424 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7425 AddOperator): Simplified by reusing AddToMemberContainer.
7426 (TypeContainer.UserDefinedStaticConstructor): Changed to property
7428 (Method.CheckForDuplications): Fixed implementation to test all
7430 (MemberBase): Detection whether member is explicit interface
7431 implementation is now in constructor.
7432 (MemberBase.UpdateMemberName): Handles IndexerName.
7433 (Accessor): Changed to keep also location information.
7434 (AbstractPropertyEventMethod): Is derived from MemberCore.
7435 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7436 will be emited or not.
7437 (PropertyBase.AreAccessorsDuplicateImplementation):
7438 Tests whether accessors are not in collision with some method.
7439 (Operator): Is derived from MethodCore to simplify common
7442 * decl.cs (Flags.TestMethodDuplication): Test for duplication
7444 (DeclSpace.AddToContainer): Adds the member to defined_names
7445 table. It tests for duplications and enclosing name conflicts.
7447 * enum.cs (EnumMember): Clean up to reuse the base structures
7449 2004-09-03 Martin Baulig <martin@ximian.com>
7451 Merged latest changes into gmcs. Please keep this comment in
7452 here, it makes it easier for me to see what changed in MCS since
7453 the last time I merged.
7455 2004-09-03 Martin Baulig <martin@ximian.com>
7457 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7458 into TypeContainer, to make partial classes work again.
7460 2004-09-03 Martin Baulig <martin@ximian.com>
7462 * rootcontext.cs (RootContext.V2): Removed.
7464 2004-03-23 Martin Baulig <martin@ximian.com>
7466 * expression.cs (Invocation.OverloadResolve): Added `bool
7467 may_fail' argument and use it instead of the Location.IsNull() hack.
7469 2004-09-09 Martin Baulig <martin@ximian.com>
7471 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
7473 2004-09-09 Martin Baulig <martin@ximian.com>
7475 * generic.cs (TypeParameter.DefineType): Added support for
7476 explicit interface methods.
7478 2004-09-09 Martin Baulig <martin@ximian.com>
7480 * README.Changes: New document. Started to list important changes
7481 between MCS and GMCS here.
7483 2004-09-08 Martin Baulig <martin@ximian.com>
7486 (TypeContainer.CheckRecursiveDefinition): New protected method.
7487 (TypeContainer.DefineType): Move the CS0146 check into
7488 CheckRecursiveDefinition().
7490 2004-09-06 Martin Baulig <martin@ximian.com>
7492 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
7493 types for the constructor constraint.
7495 2004-09-03 Martin Baulig <martin@ximian.com>
7497 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7498 into TypeContainer, to make partial classes work again.
7500 2004-09-03 Martin Baulig <martin@ximian.com>
7502 * rootcontext.cs (RootContext.V2): Removed.
7504 2004-03-23 Martin Baulig <martin@ximian.com>
7506 * expression.cs (Invocation.OverloadResolve): Added `bool
7507 may_fail' argument and use it instead of the Location.IsNull() hack.
7509 2004-09-03 Martin Baulig <martin@ximian.com>
7511 Merged latest changes into gmcs. Please keep this comment in
7512 here, it makes it easier for me to see what changed in MCS since
7513 the last time I merged.
7515 2004-09-03 Raja R Harinath <rharinath@novell.com>
7518 * expression.cs (BetterConversion): Don't allow either conversion
7519 to be null. Remove redundant implicit conversion test when 'q ==
7520 null' -- when this function is invoked, we already know that the
7521 implicit conversion exists.
7522 (BetterFunction): Assume that 'best' is non-null. Remove
7523 redundant reimplementation of IsApplicable when 'best' is null.
7524 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7525 number of arguments.
7526 (IsAncestralType): Extract from OverloadResolve.
7527 (OverloadResolve): Make robust to the MethodGroupExpr being
7528 unsorted. Implement all the logic of Section 14.5.5.1, and
7529 support overloading of methods from multiple applicable types.
7530 Clean up logic somewhat. Don't pass null methods to BetterFunction.
7532 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7533 (RealError, Warning): Append type of report to related symbol.
7535 2004-09-03 Marek Safar <marek.safar@seznam.cz>
7537 * enum.cs: Fixed CLS-Compliance checks for enum members.
7538 Error tests cs3008-8.cs, cs3014-8.cs
7540 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7542 Fixed bug #62342, #63102
7543 * class.cs: ImplementIndexer uses member.IsExplicitImpl
7544 like ImplementMethod.
7546 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7548 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7551 2004-09-02 Martin Baulig <martin@ximian.com>
7553 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7554 TypeManager.GetArgumentTypes() rather than calling GetParameters()
7557 2004-09-01 Marek Safar <marek.safar@seznam.cz>
7559 C# 2.0 Static classes implemented
7561 * class.cs (TypeContainer): instance_constructors,
7562 initialized_fields, initialized_static_fields,
7563 default_constructor, base_inteface_types are protected to be
7564 accessible from StaticClass.
7565 (TypeContainer.DefineDefaultConstructor): New virtual method
7566 for custom default constructor generating
7567 (StaticClass): New class to handle "Static classes" feature.
7569 * cs-parser.jay: Handle static keyword on class like instance
7572 * driver.cs: Added "/langversion" command line switch with two
7573 options (iso-1, default).
7575 2004-08-31 Marek Safar <marek.safar@seznam.cz>
7577 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7579 2004-08-31 Miguel de Icaza <miguel@ximian.com>
7581 * delegate.cs: Style.
7583 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
7585 * delegate.cs: Add seperate instance expr field for miguel.
7587 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7589 * PointerArithmetic (Resolve): make sure we are not doing
7590 pointer arith on void*. Also, make sure we are resolved
7591 by not setting eclass until resolve.
7593 All callers: Make sure that PointerArithmetic gets resolved.
7595 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7597 * ArrayCreation (LookupType): If the type does not resolve
7598 to an array, give an error.
7600 2004-08-27 Marek Safar <marek.safar@seznam.cz>
7602 * statement.cs (Try.Resolve): Fixed bug #64222
7604 2004-08-27 Martin Baulig <martin@ximian.com>
7607 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7610 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7612 * ecore.cs (Constantify): Get underlying type via
7613 System.Enum.GetUnderlyingType to avoid StackOverflow on the
7614 Windows in special cases.
7616 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7618 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7619 for obtaining also private methods.
7620 (GetRemoveMethod): Used GetRemoveMethod (true)
7621 for obtaining also private methods.
7623 2004-09-02 Martin Baulig <martin@ximian.com>
7625 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7626 TypeManager.GetArgumentTypes() rather than calling GetParameters()
7629 2004-08-27 Martin Baulig <martin@ximian.com>
7632 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7635 2004-08-25 Martin Baulig <martin@ximian.com>
7637 * support.cs (ReflectionParameters..ctor): If this is a generic
7638 method, retrieve and store its type parameters.
7639 (InternalParameters..ctor): Added `TypeParameter[]' argument.
7640 (ReflectionParameters.GenericConstraints): The argument specifies
7641 the type parameter, not the method parameter.
7642 (InternalParameters.GenericConstraints): Likewise.
7644 * generic.cs (TypeParameter.DefineType): Correctly handle
7645 constraints wrt. generic methods in interfaces and their
7648 2004-08-24 Martin Baulig <martin@ximian.com>
7650 * generic.cs (TypeParameter.IsSubclassOf): New public method.
7651 (Constraints.IsSubclassOf): New internal method.
7653 * typemanager.cs (TypeManager.FindMembers): Added special support
7654 for GenericTypeParameterBuilder's.
7655 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
7658 2004-08-24 Martin Baulig <martin@ximian.com>
7661 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7662 this for accessibility checks.
7663 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7664 IsNestedFamilyAccessible.
7665 (TypeManager.IsSubclassOf): New method, do what the name actually
7668 2004-08-24 Martin Baulig <martin@ximian.com>
7670 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
7671 as a SimpleName, include the generic arity.
7673 2004-08-24 Martin Baulig <martin@ximian.com>
7675 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7676 MethodAttributes.HideBySig for operators.
7678 2004-08-23 Martin Baulig <martin@ximian.com>
7680 Back to the old error reporting system :-)
7682 * report.cs (Message): Removed.
7683 (Report.MessageData, ErrorData, WarningData): Removed.
7684 (Report.Error, Warning): Back to the old system.
7686 2004-08-23 Martin Baulig <martin@ximian.com>
7688 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7690 * class.cs (TypeContainer.ParentContainer): New public virtual
7691 method; replaces the explicit interface implementation.
7692 (ClassPart.ParentContainer): Override.
7694 2004-08-23 Martin Baulig <martin@ximian.com>
7696 * statement.cs (Switch): Added support for constant switches; see
7697 #59428 or test-285.cs.
7699 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7702 * statement.cs (GetEnumeratorFilter): Removed useless
7703 logic because C# specs is strict. GetEnumerator must be
7706 2004-08-22 Martin Baulig <martin@ximian.com>
7708 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7709 a switch and may break, reset the barrier. Fixes #59867.
7711 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7713 CLS-Compliance speed up (~5% for corlib)
7715 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7716 New method. Tests container for CLS-Compliant names
7718 * class.cs (TypeContainer.VerifyClsName): New method.
7719 Checks whether container name is CLS Compliant.
7720 (Constructor): Implements IMethodData.
7722 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7723 low-case table for CLS Compliance test.
7724 (MemberCache.VerifyClsParameterConflict): New method.
7725 Checks method parameters for CS3006 error.
7727 * enum.cs (EnumMember): Is derived from MemberCore.
7728 (Enum.VerifyClsName): Optimized for better performance.
7730 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7732 * report.cs: Renamed Error_T to Error and changed all
7735 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7737 * class.cs (TypeContainer.IndexerArrayList): New inner class
7738 container for indexers.
7739 (TypeContainer.DefaultIndexerName): New constant for default
7740 indexer name. Replaced all "Item" with this constant.
7741 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7743 * typemanager.cs (TypeManager.default_member_ctor): Cache here
7744 DefaultMemberAttribute constructor.
7746 2004-08-05 Martin Baulig <martin@ximian.com>
7748 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7751 2004-08-05 Marek Safar <marek.safar@seznam.cz>
7753 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7754 multi platforms problem.
7756 * compiler.csproj: Included shared files.
7758 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7760 Fix bug 60333, 55971 in the more general way
7761 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7762 Added arg_type argument for constant conversion.
7763 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7765 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7768 * class.cs (TypeContainer ): New inner classes MethodArrayList,
7769 OperatorArrayList, MethodCoreArrayList for typecontainer
7770 containers. Changed class member types to these new types.
7771 (MethodArrayList.DefineMembers): Added test for CS0659.
7773 2004-08-04 Miguel de Icaza <miguel@ximian.com>
7775 * cfold.cs: Synchronize the folding with the code in expression.cs
7776 Binary.DoNumericPromotions for uint operands.
7778 * attribute.cs: Revert patch from Raja, it introduced a regression
7779 while building Blam-1.2.1 (hard to isolate a test case).
7781 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7785 (TypeContainer.Define): Renamed to DefineContainerMembers because of
7787 (MethodCore.parent_method): New member. The method we're overriding
7788 if this is an override method.
7789 (MethodCore.CheckBase): Moved from Method class and made common.
7790 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7792 (MethodCore.CheckForDuplications): New abstract method. For custom
7793 member duplication search in a container
7794 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7795 method and its return type.
7796 (Event.conflict_symbol): New member. Symbol with same name in the
7800 (MemberCache.FindMemberWithSameName): New method. The method
7801 is looking for conflict with inherited symbols.
7803 2004-08-04 Martin Baulig <martin@ximian.com>
7805 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7807 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7809 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7811 * report.cs (Message): New enum for better error, warning reference in
7813 (MessageData): New inner abstract class. It generally handles printing of
7814 error and warning messages.
7815 Removed unused Error, Warning, Message methods.
7817 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7819 Fix for cs0592-8.cs test
7821 (Attributable.ValidAttributeTargets): Made public.
7822 (Attribute.ExplicitTarget): New member for explicit target value.
7823 (Attribute.CheckTargets): Now we translate explicit attribute
7824 target to Target here.
7826 2004-08-03 Ben Maurer <bmaurer@ximian.com>
7828 * ecore.cs (MethodGroupExpr): new IsBase property.
7830 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7832 * delegate.cs (DelegateCreation): store a MethodGroupExpr
7833 rather than an instance expr.
7835 (DelegateCreation.Emit): Use the method group rather than
7836 the instance expression. Also, if you have base.Foo as the
7837 method for a delegate, make sure to emit ldftn, not ldftnvirt.
7839 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
7841 (NewDelegate.DoResolve): Only check for the existance of Invoke
7842 if the method is going to be needed. Use MethodGroupExpr.
7844 (NewDelegate.Emit): Remove, DelegateCreation implements this.
7846 * expression.cs: For pointer arith., make sure to use
7847 the size of the type, not the size of the pointer to
7850 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7853 * class.cs (Class): Added error CS0502 test.
7855 2004-08-03 John Luke <jluke@cfl.rr.com>
7856 Raja R Harinath <rharinath@novell.com>
7859 * attribute.cs (Attribute.complained_before): New flag.
7860 (Attribute.ResolveType, Attribute.Resolve),
7861 (Attribute.DefinePInvokeMethod): Set it.
7862 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7864 2004-08-03 Martin Baulig <martin@ximian.com>
7866 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7867 use a user-defined operator; we still need to do numeric
7868 promotions in case one argument is a builtin type and the other
7869 one has an implicit conversion to that type. Fixes #62322.
7871 2004-08-18 Martin Baulig <martin@ximian.com>
7873 * class.cs (Method.Define): Use the correct method name when
7874 creating the MethodBuilder for a generic method.
7876 2004-08-17 Martin Baulig <martin@ximian.com>
7878 * generic.cs (Constraints): Support type parameter constraints.
7880 2004-08-16 Martin Baulig <martin@ximian.com>
7882 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
7883 (Token.GENERIC_DIMENSION): New token; this is returned if we
7884 encounter an unbound generic type in a typeof() expression.
7886 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
7887 this token is only generated while parsing a typeof() expression.
7888 (typeof_expression): Removed the old unbound_type hack.
7890 * generic.cs (TypeArguments.IsUnbound): New public property.
7892 * decl.cs (MemberName): Added support for unbound types.
7894 2004-08-14 Martin Baulig <martin@ximian.com>
7897 (TypeManager.IsEqualGenericInstance): New static method.
7898 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
7899 just used to check accessibility, so follow the rules of 26.1.6.
7901 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
7902 ConstructedType instead of a TypeExpression if we have type arguments.
7904 * cs-parser.jay (typeof_expression): Support unbound generic types.
7906 * ecore.cs (UnboundTypeExpression): New public class.
7908 2004-08-12 Martin Baulig <martin@ximian.com>
7910 * typemanager.cs (TypeManager.IsNestedChildOf): Use
7911 TypeManager.IsEqual() rather than `=='.
7913 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
7914 generic instances as well.
7916 2004-08-12 Martin Baulig <martin@ximian.com>
7918 * expression.cs (Invocation.InferType): We can only infer method
7919 type parameters. Fixes #62647.
7921 2004-08-11 Martin Baulig <martin@ximian.com>
7923 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
7924 before resolving the base classes.
7926 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7928 * Makefile: install .mdb file too.
7930 2004-08-05 Martin Baulig <martin@ximian.com>
7932 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
7933 initializer, the current type is just the TypeBuilder, not the
7934 instantiated generic type.
7935 (FieldExpr.IsFieldInitializer): New public property.
7937 2004-08-04 Martin Baulig <martin@ximian.com>
7939 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7941 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7943 2004-08-03 Martin Baulig <martin@ximian.com>
7945 * class.cs (MethodData.Define): If we're an explicit
7946 implementation, remove the generic arity from the type name.
7948 2004-08-03 Martin Baulig <martin@ximian.com>
7950 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7951 use a user-defined operator; we still need to do numeric
7952 promotions in case one argument is a builtin type and the other
7953 one has an implicit conversion to that type. Fixes #62322.
7955 2004-08-02 Martin Baulig <martin@ximian.com>
7957 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
7959 (TypeContainer.GetClassBases): Return the unexpanded list of
7960 interfaces; we expand them later.
7961 (TypeContainer.DefineType): After creating the TypeBuilder, call
7962 TypeManager.ExpandInterfaces() to get an expanded and resolved
7965 * ecore.cs (TypeExpr.GetInterfaces): Removed
7967 * generics.cs (Constraints.InterfaceConstraints): Remove.
7968 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
7969 register the interface constraints.
7972 (TypeManager.AddUserType): Removed the `ifaces' argument.
7973 (TypeManager.AddTypeParameter): Likewise.
7974 (TypeManager.AddUserInterface): Removed, was unused.
7975 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
7976 `TypeExpr[]' array for the interfaces.
7977 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
7978 has been defined, returns a list of the resolved interfaces types.
7979 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
7980 (TypeManager.GetExplicitInterfaces): Likewise.
7982 2004-08-02 Martin Baulig <martin@ximian.com>
7984 * expression.cs (Invocation.EmitCall): If we're invoking a method
7985 on a type parameter, use the new `Constrained' prefix opcode.
7987 2004-08-02 Martin Baulig <martin@ximian.com>
7989 * statement.cs (LocalInfo.Flags): Added `IsThis'.
7990 (LocalInfo.IsThis): New public property.
7991 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
7993 2004-08-01 Martin Baulig <martin@ximian.com>
7995 * class.cs (TypeContainer.GetClassBases): Don't set the default
7996 here since we may get called from GetPartialBases().
7997 (TypeContainer.DefineType): If GetClassBases() didn't return a
7998 parent, use the default one.
8000 2004-07-30 Martin Baulig <martin@ximian.com>
8002 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8004 * class.cs (SourceMethod): New public class, derive from the
8005 symbol writer's ISourceMethod.
8006 (Method): Use the new symbol writer API.
8008 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8009 as argument and use the new symbol writer.
8012 (SourceFile): Implement the symbol writer's ISourceFile.
8013 (Location.SymbolDocument): Removed.
8014 (Location.SourceFile): New public property.
8016 * symbolwriter.cs: Use the new symbol writer API.
8018 2004-07-30 Raja R Harinath <rharinath@novell.com>
8020 * Makefile (install-local): Remove. Functionality moved to
8023 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
8025 * Makefile: Install mcs.exe.config file together with mcs.exe.
8026 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8027 correct runtime version.
8029 2004-07-25 Martin Baulig <martin@ximian.com>
8032 (TypeContainer.RegisterOrder): Removed, this was unused.
8033 (TypeContainer, interface_order): Removed.
8034 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8035 TypeContainer as argument since we can also be called with a
8036 `PartialContainer' for a partial class/struct/interface.
8037 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8038 of checking whether we're an `Interface' - we could be a
8040 (PartialContainer.Register): Override; call
8041 AddClass()/AddStruct()/AddInterface() on our parent.
8043 * cs-parser.jay (interface_member_declaration): Add things to the
8044 `current_container', not the `current_class'.
8046 * rootcontext.cs (RegisterOrder): The overloaded version which
8047 takes an `Interface' was unused, removed.
8049 * typemanager.cs (TypeManager.LookupInterface): Return a
8050 `TypeContainer', not an `Interface'.
8051 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8052 contain a `PartialContainer' for an interface, so check it's
8053 `Kind' to figure out what it is.
8055 2004-07-25 Martin Baulig <martin@ximian.com>
8057 * class.cs (Class.DefaultTypeAttributes): New public constant.
8058 (Struct.DefaultTypeAttributes): Likewise.
8059 (Interface.DefaultTypeAttributes): Likewise.
8060 (PartialContainer.TypeAttr): Override this and add the
8061 DefaultTypeAttributes.
8063 2004-07-25 Martin Baulig <martin@ximian.com>
8065 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8066 we can just use the `Parent' field instead.
8068 2004-07-25 Martin Baulig <martin@ximian.com>
8070 * class.cs (TypeContainer.Emit): Renamed to EmitType().
8072 2004-07-25 Martin Baulig <martin@ximian.com>
8074 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8075 our parts before defining any methods.
8076 (TypeContainer.VerifyImplements): Make this virtual.
8077 (ClassPart.VerifyImplements): Override and call VerifyImplements()
8078 on our PartialContainer.
8080 2004-07-25 Martin Baulig <martin@ximian.com>
8082 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8084 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8085 argument, we can just use the `Parent' field instead.
8088 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
8089 (MemberBase.DoDefine): Likewise.
8091 2004-07-24 Martin Baulig <martin@ximian.com>
8093 * decl.cs (MemberCore.Parent): New public field.
8094 (DeclSpace.Parent): Moved to MemberCore.
8096 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8097 (MemberBase.ctor): Added TypeContainer argument, pass it to our
8099 (FieldBase, Field, Operator): Likewise.
8100 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8101 (EventField, Event): Likewise.
8103 2004-07-23 Martin Baulig <martin@ximian.com>
8105 * class.cs (PartialContainer): New public class.
8106 (ClassPart): New public class.
8107 (TypeContainer): Added support for partial classes.
8108 (TypeContainer.GetClassBases): Splitted some of the functionality
8109 out into GetNormalBases() and GetPartialBases().
8111 * cs-tokenizer.cs (Token.PARTIAL): New token.
8112 (Tokenizer.consume_identifier): Added some hacks to recognize
8113 `partial', but only if it's immediately followed by `class',
8114 `struct' or `interface'.
8116 * cs-parser.jay: Added support for partial clases.
8118 2004-07-23 Martin Baulig <martin@ximian.com>
8120 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8121 a `DeclSpace' and also made it readonly.
8122 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8123 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8124 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8126 * cs-parser.jay: Pass the `current_class', not the
8127 `current_container' (at the moment, this is still the same thing)
8128 to a new Method, Property, Event, Indexer or Constructor.
8130 2004-07-23 Martin Baulig <martin@ximian.com>
8132 * cs-parser.jay (CSharpParser): Added a new `current_class' field
8133 and removed the `current_interface' one.
8134 (struct_declaration, class_declaration, interface_declaration):
8135 Set `current_class' to the newly created class/struct/interface;
8136 set their `Bases' and call Register() before parsing their body.
8138 2004-07-23 Martin Baulig <martin@ximian.com>
8140 * class.cs (Kind): New public enum.
8141 (TypeContainer): Made this class abstract.
8142 (TypeContainer.Kind): New public readonly field.
8143 (TypeContainer.CheckDef): New public method; moved here from
8145 (TypeContainer.Register): New public abstract method.
8146 (TypeContainer.GetPendingImplementations): New public abstract
8148 (TypeContainer.GetClassBases): Removed the `is_class' and
8149 `is_iface' parameters.
8150 (TypeContainer.DefineNestedTypes): Formerly known as
8152 (ClassOrStruct): Made this class abstract.
8154 * tree.cs (RootTypes): New public type.
8156 2004-07-20 Martin Baulig <martin@ximian.com>
8158 * tree.cs (Tree.RecordNamespace): Removed.
8159 (Tree.Namespaces): Removed.
8161 * rootcontext.cs (RootContext.IsNamespace): Removed.
8163 * cs-parser.jay (namespace_declaration): Just create a new
8164 NamespaceEntry here.
8166 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
8168 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8169 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8170 entry to make sure it runs in the correct runtime version.
8172 2004-07-18 Martin Baulig <martin@ximian.com>
8174 * generic.cs (ConstructedType.CheckConstraints): Improved
8175 constraints checking.
8177 2004-07-18 Martin Baulig <martin@ximian.com>
8179 * expression.cs (Invocation.BetterMethod): Call
8180 TypeManager.TypeToCoreType() on all types and removed my previous
8181 hack; we're already doig the right thing here.
8183 2004-07-17 Martin Baulig <martin@ximian.com>
8185 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8187 2004-07-16 Martin Baulig <martin@ximian.com>
8189 * iterators.cs: Added generics support.
8191 2004-07-16 Martin Baulig <martin@ximian.com>
8193 * iterators.cs: Rewrote this. We're now using one single Proxy
8194 class for both the IEnumerable and the IEnumerator interface and
8195 `Iterator' derives from Class so we can use the high-level API.
8197 * class.cs (TypeContainer.AddIterator): New method.
8198 (TypeContainer.DoDefineType): New protected virtual method, which
8199 is called from DefineType().
8200 (TypeContainer.DoDefineMembers): Call DefineType() and
8201 DefineMembers() on all our iterators.
8202 (TypeContainer.Emit): Call Emit() on all our iterators.
8203 (TypeContainer.CloseType): Call CloseType() on all our iterators.
8205 * codegen.cs (EmitContext.CurrentIterator): New public field.
8207 2004-07-15 Martin Baulig <martin@ximian.com>
8210 (TypeManager.not_supported_exception_type): New type.
8212 2004-07-14 Martin Baulig <martin@ximian.com>
8215 (TypeManager.generic_ienumerable_type): New type.
8216 (TypeManager.generic_ienumerator_type): New type.
8219 (RootContext.interfaces_first_stage): Added
8220 "System.Collections.Generic.IEnumerator`1" and
8221 "System.Collections.Generic.IEnumerable`1".
8223 2004-07-14 Martin Baulig <martin@ximian.com>
8225 * iterators.cs: Use real error numbers.
8227 2004-07-14 Martin Baulig <martin@ximian.com>
8229 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8230 requires this to be a System.Collection.IEnumerable and not a
8231 class implementing that interface.
8232 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
8234 2004-07-13 Marek Safar <marek.safar@seznam.cz>
8236 * class.cs: Fixed previous fix, it broke some error tests.
8238 2004-07-12 Martin Baulig <martin@ximian.com>
8240 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8243 2004-07-14 Martin Baulig <martin@ximian.com>
8245 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
8246 an exclamation mark (!) for the generic arity to reflect the
8247 latest spec changes; ie. use "System.Collections.Generic.IList`1".
8249 2004-07-13 Martin Baulig <martin@ximian.com>
8251 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
8252 specifiers being part of a type argument.
8254 2004-07-13 Martin Baulig <martin@ximian.com>
8256 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
8257 name for generic types.
8259 2004-07-13 Martin Baulig <martin@ximian.com>
8261 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
8264 2004-07-09 Miguel de Icaza <miguel@ximian.com>
8266 * assign.cs (LocalTemporary): Add new argument: is_address,If
8267 `is_address' is true, then the value that we store is the address
8268 to the real value, and not the value itself.
8270 * ecore.cs (PropertyExpr): use the new local temporary
8271 stuff to allow us to handle X.Y += z (where X is a struct)
8273 2004-07-08 Martin Baulig <martin@ximian.com>
8275 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8276 not always return, just like we're doing in Using.Resolve().
8278 2004-07-07 Miguel de Icaza <miguel@ximian.com>
8280 * cs-parser.jay (fixed_statement): flag this as Pinned.
8282 2004-07-06 Miguel de Icaza <miguel@ximian.com>
8284 * typemanager.cs (TypeManager): Removed MakePinned method, this
8285 mechanism is replaced with the .NET 2.x compatible mechanism of
8286 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8288 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
8289 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8290 `IsFixed' property which has a different meaning.
8292 2004-07-02 Raja R Harinath <rharinath@novell.com>
8294 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8295 visible from inside a nested class, not just the names of the
8296 immediately enclosing class.
8299 2004-06-24 Raja R Harinath <rharinath@novell.com>
8301 * expression.cs (BetterConversion): Remove buggy special-case
8302 handling of "implicit constant expression conversions". At this
8303 point, we already know that the conversion is possible -- we're
8304 only checking to see which is better.
8306 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8308 * cs-parser.jay: Added error CS0210 test.
8310 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8312 * cs-parser.jay: Added error CS0134 test.
8314 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8317 * cs-parser.jay: Added error CS0145 test.
8319 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8321 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8323 2004-06-23 Ben Maurer <bmaurer@ximian.com>
8325 * expression.cs (StackAlloc.Resolve): The argument may not
8326 be a constant; deal with this case.
8328 2004-06-23 Marek Safar <marek.safar@seznam.cz>
8330 * attribute.cs (IndexerName_GetIndexerName): Renamed to
8331 GetIndexerAttributeValue.
8332 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8334 * class.cs (Indexer.Define): Added error tests for CS0415,
8337 2004-06-23 Miguel de Icaza <miguel@ximian.com>
8339 * attribute.cs (Attribute.Resolve): Keep field code in sync with
8342 2004-06-23 Martin Baulig <martin@ximian.com>
8344 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8345 neither return nor throw, reset the barrier as well. Fixes #60457.
8347 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
8349 * class.cs : EventAttributes is now set to None by default.
8350 This fixes bug #60459.
8352 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8355 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8356 Don't throw exception but return null (it's sufficient now).
8358 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8360 * typemanager.cs (GetArgumentTypes): Faster implementation.
8362 2004-06-18 Martin Baulig <martin@ximian.com>
8364 * attribute.cs (Attribute.Resolve): Check whether we're an
8365 EmptyCast which a Constant child. Fixes #60333.
8367 2004-06-17 Ben Maurer <bmaurer@ximian.com>
8369 * statement.cs (EmitCollectionForeach): Account for the fact that
8370 not all valuetypes are in areas which we can take the address of.
8371 For these variables, we store to a temporary variable. Also, make
8372 sure that we dont emit a `callvirt' on a valuetype method.
8374 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8376 * expression.cs (StackAlloc.DoReSolve): Added test for
8377 negative parameter (CS0247).
8379 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8382 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8384 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8387 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8390 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8392 Fix bug #58254 & cs1555.cs, cs1556.cs
8393 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8395 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8397 * cs-parser.jay: Added error CS1669 test for indexers.
8399 2004-06-18 Martin Baulig <martin@ximian.com>
8401 * generics.cs (GenericMethod.ctor): Don't take an Attributes
8402 argument. Fixes #60441.
8404 2004-06-16 Ben Maurer <bmaurer@ximian.com>
8405 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
8406 The name needs to have the actual name of the method in order
8407 for other tests (such as the one in OverloadResolve for Invoke
8408 on a delegate) to work. As well, it does not really help
8409 error reporting because the method group had multiple methods.
8410 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
8411 Make profiling work.
8413 2004-06-13 Martin Baulig <martin@ximian.com>
8415 * cs-parser.jay: Don't allow generic attributes.
8417 2004-06-13 Martin Baulig <martin@ximian.com>
8419 * class.cs (MemberBase.DoDefineBase): New protected method.
8420 (MemberBase.DoDefine): Compute the `flags' in the new
8421 DoDefineBase() which must be called first.
8422 (Method.Define): Call DoDefineBase() first so we have the flags
8423 when defining the generic method.
8425 * cs-parser.jay (interface_method_declaration): Support generic methods.
8427 2004-06-13 Martin Baulig <martin@ximian.com>
8429 * decl.cs (TypeName): Removed.
8430 (MemberName): Removed TypeName and MemberNow; now we just have
8433 * cs-parser.jay: Don't distinguish between type arguments and type
8434 parameters in the grammar and simplified the rules a bit. The
8435 reduce/reduce conflicts are now gone (except the one we inherited
8438 2004-06-11 Martin Baulig <martin@ximian.com>
8440 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8441 call this twice: for params and varargs methods.
8443 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8446 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8448 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8450 * attribute.cs (Attribute.GetValidTargets): Made public.
8453 (AbstractPropertyEventMethod): New class for better code sharing.
8454 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8456 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8458 2004-06-09 Martin Baulig <martin@ximian.com>
8460 * cs-parser.jay: Removed a reduce/reduce conflict.
8462 2004-06-03 Martin Baulig <martin@ximian.com>
8464 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
8465 GetSimpleName() and return a SimpleName.
8467 * ecore.cs (SimpleName.Arguments): New public field.
8468 (SimpleName): Added overloaded ctor which takes an additional
8469 TypeArguments argument.
8470 (SimpleName.SimpleNameResolve): Added support for generic methods.
8471 (MethodGroupExpr.ResolveGeneric): New public method. The code was
8472 formerly in MemberAccess.DoResolve(), but we also need it in
8473 SimpleNameResolve().
8475 * expression.cs (MemberAccess.DoResolve): Use the new
8476 MethodGroupExpr.ResolveGeneric().
8478 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8480 * decl.cs: If possible, use lookuptypedirect here. We can only do
8481 this if there is no `.' after the namespace. Avoids using
8482 LookupType, which does lots of slow processing.
8483 (FindNestedType) New method, does what it says :-).
8484 * namespace.cs: use LookupTypeDirect.
8485 * rootcontext.cs: use membercache, if possible.
8486 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8488 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8491 According to the spec,
8493 In a member access of the form E.I, if E is a single identifier,
8494 and if the meaning of E as a simple-name (§7.5.2) is a constant,
8495 field, property, localvariable, or parameter with the same type as
8496 the meaning of E as a type-name (§3.8), then both possible
8497 meanings of E are permitted.
8499 We did not check that E as a simple-name had the same type as E as
8502 This trivial check gives us 5-7% on bootstrap time.
8504 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8506 * expression.cs (Invocation.OverloadResolve): Avoid the
8507 use of hashtables and boxing here by allocating on demand.
8509 2004-05-30 Martin Baulig <martin@ximian.com>
8511 * rootcontext.cs (RootContext.LookupType): Don't cache things if
8512 we're doing a silent lookup. Don't try to lookup nested types in
8513 TypeManager.object_type (thanks to Ben Maurer).
8515 2004-05-30 Martin Baulig <martin@ximian.com>
8517 Committing a patch from Ben Maurer.
8519 * rootcontext.cs (RootContext.LookupType): Cache negative results.
8521 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8523 * convert.cs: add a trivial cache for overload operator resolution.
8525 2004-05-31 Marek Safar <marek.safar@seznam.cz>
8528 (AttributeTester.GetObsoleteAttribute): Returns instance of
8529 ObsoleteAttribute when type is obsolete.
8532 (TypeContainer.VerifyObsoleteAttribute): Override.
8533 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8534 (MethodCode.VerifyObsoleteAttribute): Override.
8535 (MemberBase.VerifyObsoleteAttribute): Override.
8538 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8539 and report proper error.
8542 (Delegate.VerifyObsoleteAttribute): Override.
8545 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8546 and report proper error.
8547 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8550 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8554 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8555 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8556 Added test for ObsoleteAttribute.
8559 (Catch): Derived from Statement.
8561 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8563 * decl.cs: If possible, use lookuptypedirect here. We can only do
8564 this if there is no `.' after the namespace. Avoids using
8565 LookupType, which does lots of slow processing.
8566 (FindNestedType) New method, does what it says :-).
8567 * namespace.cs: use LookupTypeDirect.
8568 * rootcontext.cs: use membercache, if possible.
8569 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8571 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8574 According to the spec,
8576 In a member access of the form E.I, if E is a single identifier,
8577 and if the meaning of E as a simple-name (§7.5.2) is a constant,
8578 field, property, localvariable, or parameter with the same type as
8579 the meaning of E as a type-name (§3.8), then both possible
8580 meanings of E are permitted.
8582 We did not check that E as a simple-name had the same type as E as
8585 This trivial check gives us 5-7% on bootstrap time.
8587 2004-05-30 Marek Safar <marek.safar@seznam.cz>
8589 Fixed bug #59071 & cs0160.cs
8590 * statement.cs (Try.Resolve): Check here whether order of catch
8591 clauses matches their dependencies.
8593 2004-05-30 Marek Safar <marek.safar@seznam.cz>
8596 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
8599 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8601 * expression.cs (Invocation.OverloadResolve): Avoid the
8602 use of hashtables and boxing here by allocating on demand.
8604 2004-05-30 Martin Baulig <martin@ximian.com>
8606 * rootcontext.cs (RootContext.LookupType): Don't cache things if
8607 we're doing a silent lookup. Don't try to lookup nested types in
8608 TypeManager.object_type (thanks to Ben Maurer).
8610 2004-05-30 Martin Baulig <martin@ximian.com>
8612 Committing a patch from Ben Maurer.
8614 * rootcontext.cs (RootContext.LookupType): Cache negative results.
8616 2004-05-29 Martin Baulig <martin@ximian.com>
8618 * class.cs (IMethodData.ShouldIgnore): New method.
8620 * typemanager.cs (TypeManager.MethodFlags): Don't take a
8621 `Location' argument, we don't need it anywhere. Use
8622 `IMethodData.ShouldIgnore ()' instead of
8623 `MethodData.GetMethodFlags ()'.
8624 (TypeManager.AddMethod): Removed.
8625 (TypeManager.AddMethod2): Renamed to AddMethod.
8627 2004-05-29 Martin Baulig <martin@ximian.com>
8629 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8631 * convert.cs (Convert.ImplicitReferenceConversion): If we're
8632 converting from a class type S to an interface type and we already
8633 have an object on the stack, don't box it again. Fixes #52578.
8635 2004-05-29 Martin Baulig <martin@ximian.com>
8637 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8638 Added support for `params' parameters. Fixes #59267.
8640 2004-05-29 Martin Baulig <martin@ximian.com>
8642 * literal.cs (NullPointer): Provide a private .ctor which sets
8643 `type' to TypeManager.object_type. Fixes #59048.
8645 2004-05-29 Martin Baulig <martin@ximian.com>
8647 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8648 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
8650 * ecore.cs (EventExpr.instance_expr): Make the field private.
8652 2004-05-26 Marek Safar <marek.safar@seznam.cz>
8654 Fixed bug #50080 & cs0214-2.cs
8655 * expression.cs (Cast.DoResolve): Check unsafe context here.
8657 * statement.cs (Resolve.DoResolve): Likewise.
8659 2004-05-26 Martin Baulig <martin@ximian.com>
8661 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8663 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8664 (RootContext.LookupType): Pass down the `silent' flag.
8666 2004-05-25 Martin Baulig <martin@ximian.com>
8669 (MethodGroupExpr.IdenticalTypeName): New public property.
8670 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8671 expression actually refers to a type.
8673 2004-05-25 Martin Baulig <martin@ximian.com>
8675 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8676 for #56176 and made it actually work.
8678 2004-05-25 Martin Baulig <martin@ximian.com>
8680 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8681 (FieldExpr, PropertyExpr): Override and implement
8682 CacheTemporaries. Fixes #52279.
8684 2004-05-25 Miguel de Icaza <miguel@ximian.com>
8686 * location.cs: In the new compiler listing a file twice is a
8687 warning, not an error.
8689 2004-05-24 Martin Baulig <martin@ximian.com>
8691 * enum.cs (Enum.DefineType): For the `BaseType' to be a
8692 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
8694 2004-05-24 Martin Baulig <martin@ximian.com>
8696 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8697 walking the `using' list. Fixes #53921.
8699 2004-05-24 Martin Baulig <martin@ximian.com>
8701 * const.cs (Const.LookupConstantValue): Added support for
8702 EmptyCast's; fixes #55251.
8704 2004-05-24 Martin Baulig <martin@ximian.com>
8706 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8707 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8708 which does the CS0135 check. The reason is that we first need to
8709 check whether the variable actually exists.
8711 2004-05-24 Martin Baulig <martin@ximian.com>
8713 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8714 than RootContext.LookupType() to find the explicit interface
8717 2004-05-24 Raja R Harinath <rharinath@novell.com>
8719 * Makefile: Simplify. Use executable.make.
8720 * mcs.exe.sources: New file. List of sources of mcs.exe.
8722 2004-05-24 Anders Carlsson <andersca@gnome.org>
8726 Use the invariant culture when doing String.Compare for CLS case
8729 2004-05-23 Martin Baulig <martin@ximian.com>
8731 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8732 don't have any dots. Fixes #52622, added cs0246-8.cs.
8734 * namespace.cs (NamespaceEntry.Lookup): Likewise.
8736 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8738 * class.cs (MemberBase.Define): Reuse MemberType member for
8739 resolved type. Other methods can use it too.
8741 2004-05-23 Martin Baulig <martin@ximian.com>
8743 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8744 the variable also exists in the current block (otherwise, we need
8745 to report a CS0103). Fixes #58670.
8747 2004-05-23 Martin Baulig <martin@ximian.com>
8749 * flowanalysis.cs (Reachability.Reachable): Compute this
8750 on-the-fly rather than storing it as a field.
8752 2004-05-23 Martin Baulig <martin@ximian.com>
8754 * flowanalysis.cs (Reachability.And): Manually compute the
8755 resulting `barrier' from the reachability.
8757 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8760 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8761 instance of ObsoleteAttribute when symbol is obsolete.
8764 (IMethodData): Extended interface for ObsoleteAttribute support.
8766 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8768 * attribute.cs: Fix bug #55970
8770 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8774 (GetObsoleteAttribute): New method. Creates the instance of
8776 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8777 ObsoleteAttribute when member is obsolete.
8778 (AttributeTester.Report_ObsoleteMessage): Common method for
8779 Obsolete error/warning reporting.
8782 (TypeContainer.base_classs_type): New member for storing parent type.
8785 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8786 for this MemberCore.
8788 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8790 * attribute.cs, const.cs: Fix bug #58590
8792 2004-05-21 Martin Baulig <martin@ximian.com>
8794 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8795 out parameters if the end of the method is unreachable. Fixes
8798 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8800 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8801 Hari was right, why extra method.
8803 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8805 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8807 2004-05-20 Martin Baulig <martin@ximian.com>
8809 * delegate.cs: Convert this file to Unix mode - like the original
8812 2004-05-20 Martin Baulig <martin@ximian.com>
8814 * attribute.cs: Convert this file to Unix mode - like the original
8817 2004-05-19 Marek Safar <marek.safar@seznam.cz>
8819 Fix bug #58688 (MCS does not report error when the same attribute
8822 * attribute.cs (Attribute.Emit): Distinction between null and default.
8824 2004-05-19 Raja R Harinath <rharinath@novell.com>
8826 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8827 of a top-level attribute without an attribute target.
8828 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
8830 (Attribute.Conditional_GetConditionName),
8831 (Attribute.Obsolete_GetObsoleteMessage): Update.
8832 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
8833 part of ScanForIndexerName.
8834 (Attribute.CanIgnoreInvalidAttribute): New function.
8835 (Attribute.ScanForIndexerName): Move to ...
8836 (Attributes.ScanForIndexerName): ... here.
8837 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8838 (Attributes.Search): New internal variant that can choose not to
8839 complain if types aren't resolved. The original signature now
8841 (Attributes.GetClsCompliantAttribute): Use internal variant, with
8842 complaints suppressed.
8843 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8844 only if it not useful.
8845 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8846 top-level for attributes that are shared between the assembly
8847 and a top-level class.
8848 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8849 * class.cs: Update to reflect changes.
8850 (DefineIndexers): Fuse loops.
8851 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
8852 a couple more variants of attribute names.
8854 2004-05-18 Marek Safar <marek.safar@seznam.cz>
8856 Fix bug #52585 (Implemented explicit attribute declaration)
8859 (Attributable.ValidAttributeTargets): New abstract method. It gets
8860 list of valid attribute targets for explicit target declaration.
8861 (Attribute.Target): It holds target itself.
8862 (AttributeSection): Removed.
8863 (Attribute.CheckTargets): New method. It checks whether attribute
8864 target is valid for the current element.
8867 (EventProperty): New class. For events that are declared like
8868 property (with add and remove accessors).
8869 (EventField): New class. For events that are declared like field.
8872 * cs-parser.jay: Implemented explicit attribute target declaration.
8874 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
8875 Override ValidAttributeTargets.
8878 (ReturnParameter): Class for applying custom attributes on
8880 (ParameterAtribute): New class. Class for applying custom
8881 attributes on the parameter type.
8883 2004-05-17 Miguel de Icaza <miguel@ximian.com>
8885 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8888 (Method): Allow UNSAFE here.
8890 * modifiers.cs: Support unsafe reporting.
8892 2004-05-17 Marek Safar <marek.safar@seznam.cz>
8894 * decl.cs: Fix bug #58478.
8896 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8898 * statement.cs: When checking for unreachable code on an EmptyStatement,
8899 set the location. Fixes bug #58488.
8901 2004-05-13 Miguel de Icaza <miguel@ximian.com>
8903 * driver.cs: Add -pkg handling.
8905 From Gonzalo: UseShelLExecute=false
8907 2004-05-12 Marek Safar <marek.safar@seznam.cz>
8910 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8912 (Attribute.IsClsCompliaceRequired): Moved to base for better
8914 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8915 when attribute is AttributeUsageAttribute.
8916 (Attribute.GetValidTargets): Simplified.
8917 (Attribute.GetAttributeUsage): New method returns AttributeUsage
8918 attribute for this type.
8919 (Attribute.ApplyAttributes): Method renamed to Emit and make
8921 (GlobalAttributeSection): New class for special handling of global
8922 attributes (assembly, module).
8923 (AttributeSection.Emit): New method.
8925 * class.cs: Implemented Attributable abstract methods.
8926 (MethodCore.LabelParameters): Moved to Parameter class.
8927 (Accessor): Is back simple class.
8928 (PropertyMethod): Implemented Attributable abstract class.
8929 (DelegateMethod): Implemented Attributable abstract class.
8930 (Event): New constructor for disctintion between normal Event
8931 and Event with accessors.
8933 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8935 * codegen.cs, const.cs, decl.cs, delegate.cs:
8936 (CommonAssemblyModulClass): Implemented Attributable abstract class
8939 * enum.cs: Implement IAttributeSupport interface.
8940 (EnumMember): New class for emum members. Implemented Attributable
8944 (ParameterBase): Is abstract.
8945 (ReturnParameter): New class for easier [return:] attribute handling.
8947 * typemanager.cs: Removed builder_to_attr.
8949 2004-05-11 Raja R Harinath <rharinath@novell.com>
8952 * attribute.cs (Attribute.GetPositionalValue): New function.
8953 * class.cs (TypeContainer.VerifyMembers): New function.
8954 (TypeContainer.Emit): Use it.
8955 (ClassOrStruct): New base class for Class and Struct.
8956 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
8957 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8959 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8960 then each non-static field should have a FieldOffset attribute.
8961 Otherwise, none of the fields should have a FieldOffset attribute.
8962 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
8963 and FieldOffset attributes.
8964 * typemanager.cs (TypeManager.struct_layout_attribute_type)
8965 (TypeManager.field_offset_attribute_type): New core types.
8966 (TypeManager.InitCoreTypes): Initialize them.
8968 2004-05-11 Michal Moskal <malekith@pld-linux.org>
8970 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8971 Return correct type.
8974 2004-05-09 Miguel de Icaza <miguel@ximian.com>
8976 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8977 be implicitly converted to ulong.
8979 * expression.cs: The logic for allowing operator &, | and ^ worked
8980 was wrong, it worked before because we did not report an error in
8981 an else branch. Fixes 57895.
8983 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8984 allow volatile fields to be reference types.
8986 2004-05-07 Miguel de Icaza <miguel@ximian.com>
8988 * driver.cs: Add support for /debug-
8990 2004-05-07 Raja R Harinath <rharinath@novell.com>
8992 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
8993 Add a 'complain' parameter to silence errors.
8994 (Attribute.Resolve): Update to changes. Put in sanity check to catch
8995 silently overlooked type-resolutions.
8996 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
8998 (Attributes.Search): New function.
8999 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9000 (Attributes.GetAttributeFullName): Remove hack.
9001 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
9002 Update to reflect changes.
9003 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9004 Use Attributes.Search instead of nested loops.
9006 2004-05-07 Marek Safar <marek.safar@seznam.cz>
9009 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9010 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9011 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9013 * report.cs: (Report.Warning): Renamed to Warning_T because of
9014 parameter collision.
9016 2004-05-05 Raja R Harinath <rharinath@novell.com>
9018 * expression.cs (MemberAccess.ResolveMemberAccess):
9019 Exit with non-zero status after Report.Error.
9020 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9022 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9024 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9026 * support.cs: Don't hang when the file is empty.
9028 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9030 * support.cs: In SeekableStreamReader, compute the preamble size of the
9031 underlying stream. Position changes should take into account that initial
9034 2004-05-03 Todd Berman <tberman@sevenl.net>
9036 * driver.cs: remove unused GetSysVersion function.
9038 2004-05-03 Todd Berman <tberman@sevenl.net>
9040 * driver.cs: Remove the hack from saturday, as well as the hack
9041 from jackson (LoadAssemblyFromGac), also adds the CWD to the
9042 link_paths to get that bit proper.
9044 2004-05-01 Todd Berman <tberman@sevenl.net>
9046 * driver.cs: Try a LoadFrom before a Load, this checks the current
9047 path. This is currently a bug in mono that is be fixed, however, this
9048 provides a workaround for now. This will be removed when the bug
9051 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
9053 * CryptoConvert.cs: Updated to latest version. Fix issue with
9054 incomplete key pairs (#57941).
9056 2004-05-01 Todd Berman <tberman@sevenl.net>
9058 * driver.cs: Remove '.' from path_chars, now System.* loads properly
9061 2004-04-30 Jackson Harper <jackson@ximian.com>
9063 * codegen.cs: Open keys readonly.
9065 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9067 * typemanager.cs: don't report cyclic struct layout when a struct
9068 contains 2 or more fields of the same type. Failed for Pango.AttrShape
9069 which has 2 Pango.Rectangle fields.
9071 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
9073 * expression.cs: Handle IntPtr comparisons with IL code
9074 rather than a method call.
9076 2004-04-29 Martin Baulig <martin@ximian.com>
9078 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
9079 the list of PropertyInfo's in class hierarchy and find the
9080 accessor. Fixes #56013.
9082 2004-04-29 Martin Baulig <martin@ximian.com>
9084 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9086 2004-04-29 Martin Baulig <martin@ximian.com>
9088 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9090 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9092 2004-04-29 Martin Baulig <martin@ximian.com>
9094 * class.cs (ConstructorInitializer.Resolve): Check whether the
9095 parent .ctor is accessible. Fixes #52146.
9097 2004-04-29 Martin Baulig <martin@ximian.com>
9099 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9101 * statement.cs (Using.EmitLocalVariableDecls): Use
9102 TypeManager.idisposable_type, not typeof (IDisposable).
9103 (Foreach.EmitCollectionForeach): Added support for valuetypes.
9105 2004-04-29 Martin Baulig <martin@ximian.com>
9107 * class.cs (Event.Define): Don't emit the field and don't set
9108 RTSpecialName and SpecialName for events on interfaces. Fixes
9111 2004-04-29 Raja R Harinath <rharinath@novell.com>
9113 Refactor Attribute.ApplyAttributes.
9114 * attribute.cs (Attributable): New base class for objects that can
9115 have Attributes applied on them.
9116 (Attribute): Make AttributeUsage fields public.
9117 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9118 (Attribute.IsInternalCall): New property.
9119 (Attribute.UsageAttr): Convert to a public read-only property.
9120 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9121 (Attribute.ResolveType, Attribute.Resolve)
9122 (Attribute.ScanForIndexerName): Update to reflect changes.
9123 (Attribute.CheckAttributeTarget): Re-format.
9124 (Attribute.ApplyAttributes): Refactor, to various
9125 Attributable.ApplyAttributeBuilder methods.
9126 * decl.cs (MemberCore): Make Attributable.
9127 * class.cs (Accessor): Make Attributable.
9128 (MethodData.ApplyAttributes): Use proper attribute types, not
9130 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9131 (TypeContainer.ApplyAttributeBuilder)
9132 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9133 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
9134 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9135 (Operator.ApplyAttributeBuilder): New factored-out methods.
9136 * const.cs (Const.ApplyAttributeBuilder): Likewise.
9137 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9138 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9139 * parameter.cs (ParameterBase): New Attributable base class
9140 that can also represent Return types.
9141 (Parameter): Update to the changes.
9143 2004-04-29 Jackson Harper <jackson@ximian.com>
9145 * driver.cs: Prefer the corlib system version when looking for
9146 assemblies in the GAC. This is still a hack, but its a better hack
9149 2004-04-29 Marek Safar <marek.safar@seznam.cz>
9151 * decl.cs, enum.cs: Improved error 3005 reporting.
9153 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9154 (related_symbols): New private member for list of symbols
9155 related to reported error/warning.
9157 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9159 2004-04-29 Martin Baulig <martin@ximian.com>
9161 * ecore.cs (Expression.Constantify): If we're an enum and
9162 TypeManager.TypeToCoreType() doesn't give us another type, use
9163 t.UnderlyingSystemType. Fixes #56178.
9165 2004-04-29 Martin Baulig <martin@ximian.com>
9167 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9168 interfaces and for each interface, only add members directly
9169 declared in that interface. Fixes #53255.
9171 2004-04-28 Martin Baulig <martin@ximian.com>
9173 * expression.cs (ConditionalLogicalOperator): Use a temporary
9174 variable for `left' to avoid that we evaluate it more than once;
9177 2004-04-28 Martin Baulig <martin@ximian.com>
9179 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9182 2004-04-28 Martin Baulig <martin@ximian.com>
9184 * statement.cs (LocalInfo.Resolve): Check whether the type is not
9187 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9188 whether the type is not void (CS1547).
9190 2004-04-28 Martin Baulig <martin@ximian.com>
9192 * expression.cs (Unary.DoResolveLValue): Override this and report
9193 CS0131 for anything but Operator.Indirection.
9195 2004-04-28 Martin Baulig <martin@ximian.com>
9197 Committing a patch from Ben Maurer; see bug #50820.
9199 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9202 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9205 2004-04-28 Martin Baulig <martin@ximian.com>
9207 Committing a patch from Ben Maurer; see bug #50820.
9209 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9212 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9215 2004-04-28 Martin Baulig <martin@ximian.com>
9217 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9218 (Block.AddLabel): Call DoLookupLabel() to only search in the
9221 2004-04-28 Martin Baulig <martin@ximian.com>
9223 * cfold.cs (ConstantFold.BinaryFold): Added special support for
9224 comparing StringConstants and NullLiterals in Equality and Inequality.
9226 2004-04-28 Jackson Harper <jackson@ximian.com>
9228 * driver.cs: Attempt to load referenced assemblies from the
9229 GAC. This is the quick and dirty version of this method that
9230 doesnt take into account versions and just takes the first
9231 canidate found. Will be good enough for now as we will not have more
9232 then one version installed into the GAC until I update this method.
9234 2004-04-28 Martin Baulig <martin@ximian.com>
9236 * typemanager.cs (TypeManager.CheckStructCycles): New public
9237 static method to check for cycles in the struct layout.
9239 * rootcontext.cs (RootContext.PopulateTypes): Call
9240 TypeManager.CheckStructCycles() for each TypeContainer.
9241 [Note: We only need to visit each type once.]
9243 2004-04-28 Martin Baulig <martin@ximian.com>
9245 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9247 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9248 success and added `out object value'. Use a `bool resolved' field
9249 to check whether we've already been called rather than
9250 `ConstantValue != null' since this breaks for NullLiterals.
9252 2004-04-28 Raja R Harinath <rharinath@novell.com>
9254 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9255 setting of this flag, since the 'set' method may be non-public.
9257 2004-04-28 Raja R Harinath <rharinath@novell.com>
9259 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9260 check on current_vector.Block.
9262 2004-04-27 Martin Baulig <martin@ximian.com>
9264 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9265 a field initializer. Fixes #56459.
9267 2004-04-27 Martin Baulig <martin@ximian.com>
9269 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9270 we're not attempting to use an indexer. Fixes #52154.
9272 2004-04-27 Martin Baulig <martin@ximian.com>
9274 * statement.cs (Return): Don't create a return label if we don't
9275 need it; reverts my change from January 20th. Thanks to Ben
9278 2004-04-27 Martin Baulig <martin@ximian.com>
9280 According to the spec, `goto' can only leave a nested scope, but
9283 * statement.cs (Block.LookupLabel): Only lookup in the current
9284 block, don't recurse into parent or child blocks.
9285 (Block.AddLabel): Check in parent and child blocks, report
9286 CS0140/CS0158 if we find a duplicate.
9287 (Block): Removed this indexer for label lookups.
9288 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9289 this already does the error reporting for us.
9292 (FlowBranching.UsageVector.Block): New public variable; may be null.
9293 (FlowBranching.CreateSibling): Added `Block' argument.
9294 (FlowBranching.LookupLabel): New public virtual method. Lookup a
9295 label for the target of a `goto' and check whether we're not
9296 leaving a `finally'.
9298 2004-04-27 Martin Baulig <martin@ximian.com>
9300 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9301 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9304 2004-04-27 Martin Baulig <martin@ximian.com>
9306 * statement.cs (Block.AddLabel): Also check for implicit blocks
9307 and added a CS0158 check.
9309 2004-04-27 Martin Baulig <martin@ximian.com>
9311 * flowanalysis.cs (FlowBranchingLoop): New class.
9312 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9313 UsageVector's instead of an ArrayList.
9314 (FlowBranching.Label): Likewise.
9315 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9316 (FlowBranching.AddBreakVector): New method.
9318 2004-04-27 Miguel de Icaza <miguel@ximian.com>
9320 * attribute.cs: Small regression fix: only convert the type if we
9321 the type is different, fixes System.Drawing build.
9323 2004-04-27 Martin Baulig <martin@ximian.com>
9325 * attribute.cs (Attribute.Resolve): If we have a constant value
9326 for a named field or property, implicity convert it to the correct
9329 2004-04-27 Raja R Harinath <rharinath@novell.com>
9331 * statement.cs (Block.Block): Implicit blocks share
9332 'child_variable_names' fields with parent blocks.
9333 (Block.AddChildVariableNames): Remove.
9334 (Block.AddVariable): Mark variable as "used by a child block" in
9335 every surrounding block.
9336 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9337 been used in a child block, complain about violation of "Invariant
9338 meaning in blocks" rule.
9339 * cs-parser.jay (declare_local_variables): Don't use
9340 AddChildVariableNames.
9341 (foreach_statement): Don't create an implicit block: 'foreach'
9344 2004-04-23 Miguel de Icaza <miguel@ximian.com>
9346 * convert.cs (ImplicitNumericConversion): 0 is also positive when
9347 converting from 0L to ulong. Fixes 57522.
9349 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9351 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9352 derived class hides via 'new' keyword field from base class (test-242.cs).
9353 TODO: Handle this in the more general way.
9355 * class.cs (CheckBase): Ditto.
9357 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9359 * decl.cs (caching_flags): New member for storing cached values
9361 (MemberCore.Flags): New enum where bit flags for caching_flags
9363 (MemberCore.cls_compliance): Moved to caching_flags.
9364 (DeclSpace.Created): Moved to caching_flags.
9366 * class.cs: Use caching_flags instead of DeclSpace.Created
9368 2004-04-21 Miguel de Icaza <miguel@ximian.com>
9370 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9371 if we are only a derived class, not a nested class.
9373 * typemanager.cs: Same as above, but do this at the MemberLookup
9374 level (used by field and methods, properties are handled in
9375 PropertyExpr). Allow for the qualified access if we are a nested
9378 2004-04-21 Marek Safar <marek.safar@seznam.cz>
9380 * class.cs: Refactoring.
9381 (IMethodData): New inteface; Holds links to parent members
9382 to avoid member duplication (reduced memory allocation).
9383 (Method): Implemented IMethodData interface.
9384 (PropertyBase): New inner classes for get/set methods.
9385 (PropertyBase.PropertyMethod): Implemented IMethodData interface
9386 (Event): New inner classes for add/remove methods.
9387 (Event.DelegateMethod): Implemented IMethodData interface.
9389 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9390 EmitContext (related to class.cs refactoring).
9392 2004-04-21 Raja R Harinath <rharinath@novell.com>
9394 * delegate.cs (Delegate.VerifyApplicability): If the number of
9395 arguments are the same as the number of parameters, first try to
9396 verify applicability ignoring any 'params' modifier on the last
9400 2004-04-08 Martin Baulig <martin@ximian.com>
9402 Merged latest changes into gmcs. Please keep this comment in
9403 here, it makes it easier for me to see what changed in MCS since
9404 the last time I merged.
9406 2004-04-16 Raja R Harinath <rharinath@novell.com>
9408 * class.cs (TypeContainer.AddIndexer): Use
9409 'ExplicitInterfaceName' to determine if interface name was
9410 explicitly specified. 'InterfaceType' is not initialized at this time.
9411 (TypeContainer.DefineIndexers): Remove use of temporary list. The
9412 Indexers array is already in the required order. Initialize
9413 'IndexerName' only if there are normal indexers.
9414 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9415 (TypeContainer.Emit): Emit DefaultMember attribute only if
9416 IndexerName is initialized.
9419 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
9421 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9424 2004-04-15 Raja R Harinath <rharinath@novell.com>
9426 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9430 * attribute.cs (Attribute.Resolve): Check for duplicate named
9434 2004-04-15 Miguel de Icaza <miguel@ximian.com>
9436 * iterators.cs (MarkYield): track whether we are in an exception,
9437 and generate code accordingly. Use a temporary value to store the
9438 result for our state.
9440 I had ignored a bit the interaction of try/catch with iterators
9441 since their behavior was not entirely obvious, but now it is
9442 possible to verify that our behavior is the same as MS .NET 2.0
9446 2004-04-14 Miguel de Icaza <miguel@ximian.com>
9448 * iterators.cs: Avoid creating temporaries if there is no work to
9451 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9452 Enumerations, use TypeManager.EnumToUnderlying and call
9455 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9458 (This.Emit): Use EmitContext.EmitThis to emit our
9461 (This.EmitAssign): Ditto.
9463 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9464 codepaths, we will move all the functionality into
9467 (FieldExpr.EmitAssign): Ditto.
9469 This fixes several hidden bugs that I uncovered while doing a code
9470 review of this today.
9472 * codegen.cs (EmitThis): reworked so the semantics are more clear
9473 and also support value types "this" instances.
9475 * iterators.cs: Changed so that for iterators in value types, we
9476 do not pass the value type as a parameter.
9478 Initialization of the enumerator helpers is now done in the caller
9479 instead of passing the parameters to the constructors and having
9480 the constructor set the fields.
9482 The fields have now `assembly' visibility instead of private.
9484 2004-04-11 Miguel de Icaza <miguel@ximian.com>
9486 * expression.cs (Argument.Resolve): Check if fields passed as ref
9487 or out are contained in a MarshalByRefObject.
9489 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9490 another compiler type.
9492 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
9494 * class.cs (Indexer.Define): use the new name checking method.
9495 Also, return false on an error.
9496 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9497 (is_identifier_[start/part]_character): make static.
9499 2004-04-10 Miguel de Icaza <miguel@ximian.com>
9501 * expression.cs (Binary.ResolveOperator): Do no append strings
9502 twice: since we can be invoked more than once (array evaluation)
9503 on the same concatenation, take care of this here. Based on a fix
9504 from Ben (bug #56454)
9506 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
9508 * codegen.cs: Fix another case where CS1548 must be reported (when
9509 delay-sign isn't specified and no private is available #56564). Fix
9510 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
9511 error when MCS is used on the MS runtime and we need to delay-sign
9512 (which seems unsupported by AssemblyBuilder - see #56621).
9514 2004-04-08 Marek Safar <marek.safar@seznam.cz>
9516 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9517 (TypeManager.ComputeNamespaces): Faster implementation for
9520 * compiler.csproj: Updated AssemblyName to mcs.
9522 2004-05-11 Jackson Harper <jackson@ximian.com>
9524 * Makefile: Preserve MONO_PATH
9526 2004-05-11 Jackson Harper <jackson@ximian.com>
9528 * Makefile: Use mono and mcs to build gmcs
9530 2004-05-03 Miguel de Icaza <miguel@ximian.com>
9532 * codegen.cs: Add patch from Robert Shade
9533 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
9536 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
9538 * CryptoConvert.cs: Updated to latest version. Fix issue with
9539 incomplete key pairs (#57941).
9541 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
9543 * codegen.cs: Fix another case where CS1548 must be reported (when
9544 delay-sign isn't specified and no private is available #56564). Fix
9545 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
9546 error when MCS is used on the MS runtime and we need to delay-sign
9547 (which seems unsupported by AssemblyBuilder - see #56621).
9549 2004-04-29 Jackson Harper <jackson@ximian.com>
9551 * Makefile: Set MONO_PATH to use the bootstrap corlib
9552 * driver.cs: Check the GAC for referenced assemblies.
9554 2004-04-29 Martin Baulig <martin@ximian.com>
9556 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
9558 2004-04-07 Martin Baulig <martin@ximian.com>
9560 * expression.cs (Binary.ResolveOperator): Added special case for
9561 Equality/Inequality between a type parameter and a null literal.
9563 2004-04-07 Martin Baulig <martin@ximian.com>
9565 * convert.cs: Check null literal -> type parameter conversions.
9567 2004-04-07 Martin Baulig <martin@ximian.com>
9569 * generic.cs (ConstructedType.CheckConstraints): Enforce the
9570 `class' and `struct' constraints.
9572 2004-04-07 Martin Baulig <martin@ximian.com>
9574 * generic.cs (SpecialConstraint): New public enum.
9575 (Constraints.Resolve): Added support for the `class' and `struct'
9578 * cs-parser.jay (type_parameter_constraint): Added support for the
9579 `class' and `struct' constraints.
9581 2004-04-07 Martin Baulig <martin@ximian.com>
9583 * support.cs (GenericConstraints): Replaced `Types' by
9584 `ClassConstraint' and `InterfaceConstraints'; added
9585 `HasClassConstraint'.
9587 2004-04-07 Martin Baulig <martin@ximian.com>
9590 (Constraints.InterfaceConstraints): New public property.
9591 (Constraints.Types): Make this property public
9592 (TypeParameter): Implement IMemberContainer.
9593 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
9594 instead of a TypeBuilder/MethodBuilder; pass the interface
9595 constraints to TypeManager.AddTypeParameter().
9596 (TypeParameter.DefineType): Just take an EmitContext and no
9597 TypeBuilder/MethodBuilder. Use the new public API.
9599 * typemanager.cs (TypeManager.AddTypeParameter): Added
9600 `TypeExpr[]' argument; add the interfaces to the
9601 `builder_to_ifaces' hash.
9602 (TypeManager.LookupMemberContainer): For
9603 GenericTypeParameterBuilders, get the TypeParameter from the
9604 `builder_to_type_param'.
9605 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
9606 the TypeParameter and call FindMembers on it.
9608 2004-04-07 Martin Baulig <martin@ximian.com>
9611 (MethodCore.GenericMethod): Moved this field here from Method.
9612 (MethodCore.IsDuplicateImplementation): Take the number of type
9613 parameters into account if we're a generic method.
9615 * expression.cs (Invocation.InferTypeArguments): Don't return true
9616 if `arguments' is null; we still need to check whether we actually
9617 don't need to infer anything in this case.
9618 (MemberAccess): Merged the functionality from GenericMemberAccess
9621 * generic.cs (GenericMemberAccess): Removed.
9623 2004-04-05 Martin Baulig <martin@ximian.com>
9625 * decl.cs (MemberCore): For generic classes, interfaces and
9626 structs, `Name' now includes the number of type parameters
9628 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
9629 encode the number of type arguments in the type name.
9631 * expression.cs (Expression.MemberLookup): Removed the
9632 `num_type_args' argument; we now encode the number of type
9633 arguments in the type name.
9635 * ecore.cs (SimpleName): Encode the number of type arguments in
9636 the type name itself.
9638 * generic.cs (ConstructedType): Likewise.
9640 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
9641 `MemberName'; we now include the number of type parameters in the
9644 * typemanager.cs (TypeManager.CheckGeneric): Removed.
9645 (TypeManager.MemberLookup): Removed the
9646 `num_type_args' argument; we now encode the number of type
9647 arguments in the type name.
9649 2004-04-03 Martin Baulig <martin@ximian.com>
9651 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
9652 (MemberCore.MemberName): Moved here from MemberBase.
9653 (DeclSpace.SetParameterInfo): Just take the constraints as an
9654 ArrayList; we already have the type parameters in our
9655 `MemberName'; also do the CS0080 reporting here.
9657 * cs-parser.jay (struct_declaration): Use `member_name' instead of
9658 `IDENTIFIER opt_type_parameter_list'; when constructing our
9659 `MemberName', it'll already include our type parameters.
9660 (class_declaration, interface_declaration): Likewise.
9661 (delegate_declaration): Likewise.
9662 (MakeName): Take a MemberName and return a MemberName.
9663 The following two changes are required to avoid shift/reduce conflicts:
9664 (member_name): Don't include a TypeName anymore; ie. this is now
9665 just 'IDENTIFIER opt_type_parameter_list'.
9666 (property_declaration, event_declaration): Use a
9667 `namespace_or_type_name' instead of a `member_name'.
9669 2004-04-03 Martin Baulig <martin@ximian.com>
9671 * decl.cs (MemberName): Renamed to `TypeName' and created a new
9673 (TypeName): Formerly known as MemberName.
9675 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
9676 instead of a `MemberName'.
9678 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
9679 (member_name): New rule; create a MemberName.
9681 2004-04-02 Martin Baulig <martin@ximian.com>
9683 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
9684 (CS0305 and CS0308).
9686 2004-04-02 Martin Baulig <martin@ximian.com>
9688 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
9689 support for nested types.
9691 2004-04-02 Martin Baulig <martin@ximian.com>
9693 * ecore.cs (IAlias): New public interface.
9694 (TypeExpr, TypeExpression): Implement IAlias.
9695 (TypeAliasExpression): New public class.
9697 * namespace.cs (Namespace): Implement IAlias.
9698 (Namespace.Lookup): Return an IAlias instead on an object.
9699 (Namespace.DefineName): Take an IAlias instead of an object.
9700 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
9702 (NamespaceEntry.UsingAlias): Take a Membername instead of an
9704 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
9706 (NamespaceEntry.Lookup): Likewise.
9708 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
9711 * decl.cs (DeclSpace): Implement IAlias.
9712 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
9714 * generic.cs (ConstructedType): Improved error checking.
9716 2004-04-02 Martin Baulig <martin@ximian.com>
9718 * convert.cs: Added type parameter conversions.
9721 (UnboxCast.Emit): Emit an `unbox.any' for type params.
9722 (ClassCast.Emit): If the source type is a type parameter, box it.
9723 If the target type is a type parameter, emit an `unbox.any'
9724 instead of a `classcast'.1
9726 2004-04-01 Martin Baulig <martin@ximian.com>
9728 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
9730 2004-04-01 Martin Baulig <martin@ximian.com>
9732 * generic.cs (ConstructedType.CheckConstraints): Use
9733 Convert.ImplicitStandardConversionExists(); user-defined implicit
9734 conversions are not allowed according to the spec.
9736 2004-03-30 Martin Baulig <martin@ximian.com>
9738 * expression.cs (New): Added support for type parameters.
9741 (TypeManager.activator_type): New public static field.
9742 (TypeManager.activator_create_instance): Likewise.
9744 2004-03-30 Martin Baulig <martin@ximian.com>
9746 * typemanager.cs (TypeManager.HasConstructorConstraint): New
9749 2004-03-30 Martin Baulig <martin@ximian.com>
9751 * generic.cs (ConstructedType.CheckConstraints): Actually follow
9752 the spec here: the argument type must be convertible to the
9755 2004-03-30 Martin Baulig <martin@ximian.com>
9758 (TypeParameter.Define, TypeParameter.DefineMethod): Call
9759 TypeManager.AddTypeParameter().
9760 (ConstructedType.CheckConstraints): Re-enable this and actually
9761 check whether we have a constructor constraint.
9764 (TypeManager.builder_to_type_param): New static field.
9765 (TypeManager.AddTypeParameter): New static method.
9766 (TypeManager.LookupTypeParameter): New public method.
9768 2004-03-30 Martin Baulig <martin@ximian.com>
9770 * generic.cs (TypeParameter.DefineType): Return a boolean and use
9771 the new API to actually define the constructor constraint.
9774 (TypeManager.new_constraint_attr_type): New static field.
9775 (TypeManager.InitCoreTypes): Initialize it.
9777 2004-03-30 Martin Baulig <martin@ximian.com>
9779 * generic.cs (Constraints): Completed error checking, use correct
9782 2004-03-29 Martin Baulig <martin@ximian.com>
9784 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
9786 * expression.cs (Invocation.InferTypeArguments): Added overloaded
9787 public version which takes a `ParameterData pd' instead of an
9790 2004-03-29 Martin Baulig <martin@ximian.com>
9792 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
9795 2004-03-29 Martin Baulig <martin@ximian.com>
9797 * expression.cs (Argument.ResolveMethodGroup): If we're a
9798 ConstructedType, call GetMemberAccess() on it.
9800 2004-03-29 Martin Baulig <martin@ximian.com>
9802 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
9803 (MethodCore.CheckGenericOverride): When overriding a generic
9804 method, check whether the constraints match.
9806 * support.cs (GenericConstraints): New public interface.
9807 (ParameterData.GenericConstraints): New public method.
9809 * parameter.cs (Parameter.Resolve): Check whether we're a generic
9810 method parameter and compute our constraints if appropriate.
9811 (Parameter.GenericConstraints): New public property.
9813 * generic.cs (Constraints): Implement GenericConstraints.
9815 2004-03-29 Martin Baulig <martin@ximian.com>
9817 * decl.cs (MemberCache.FindMemberToOverride): Use
9818 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
9820 2004-03-29 Martin Baulig <martin@ximian.com>
9822 * generic.cs (GenericMethod.Define): Resolve our type parameters.
9824 2004-03-29 Martin Baulig <martin@ximian.com>
9826 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
9827 not allowed on non-generic declarations").
9829 2004-03-29 Martin Baulig <martin@ximian.com>
9831 * expression.cs (Invocation.InferTypeArguments): Added overloaded
9832 public version of this method.
9834 * class.cs (MethodCore.IsDuplicateImplementation): Use
9835 Invocation.InferTypeArguments() to check this.
9837 2004-03-29 Martin Baulig <martin@ximian.com>
9839 * convert.cs: Use TypeManager.IsDelegateType() instead of
9840 comparing types correctly.
9842 2004-03-29 Martin Baulig <martin@ximian.com>
9844 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
9845 types directly to make it work for generic instances.
9847 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
9849 2004-03-29 Martin Baulig <martin@ximian.com>
9851 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
9854 2004-03-24 Martin Baulig <martin@ximian.com>
9856 * decl.cs (DeclSpace.FindType): Also use
9857 TypeManager.CheckGeneric() for types from the using clauses.
9859 2004-03-23 Martin Baulig <martin@ximian.com>
9861 * expression.cs (Invocation.OverloadResolve): Added `bool
9862 may_fail' argument and use it instead of the Location.IsNull() hack.
9864 2004-03-23 Martin Baulig <martin@ximian.com>
9866 * expression.cs (Invocation.InferType): Use correct type inference
9869 2004-03-23 Martin Baulig <martin@ximian.com>
9871 * ecore.cs (MethodGroupExpr.Name): Use
9872 TypeManager.CSharpSignature() instead of just the name.
9874 * expression.cs (Invocation.OverloadResolve): Provide better error
9876 (Invocation.DoResolve): OverloadResolve() never returns null
9877 without reporting an error, so removed the error -6 reporting here.
9879 2004-03-23 Martin Baulig <martin@ximian.com>
9881 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
9884 * cs-parser.jay (delegate_declaration): Support generic delegates.
9886 * delegate.cs: Support generic delegates.
9888 2004-03-22 Martin Baulig <martin@ximian.com>
9890 * expression.cs (Invocation.InferParamsTypeArguments): New static
9891 method; does type inference for params arguments.
9893 2004-03-21 Martin Baulig <martin@ximian.com>
9895 * typemanager.cs (TypeManager.IsGenericMethod): New public static
9896 method; checks whether a method is a generic method.
9898 * expression.cs (Invocation.InferTypeArguments): New static method;
9899 infer type arguments for generic method invocation.
9901 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
9902 property; we set this to true if we're resolving a generic method
9903 invocation and the user specified type arguments, ie. we're not
9904 doing type inference.
9906 2004-03-20 Martin Baulig <martin@ximian.com>
9908 * class.cs (MethodData.DeclaringType): New public property.
9909 (MethodData.Define): Set DeclaringType here.
9910 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
9911 instead of OperatorMethodBuilder.DeclaringType.
9913 2004-03-20 Martin Baulig <martin@ximian.com>
9915 * cs-tokenizer.cs (xtoken): Return a special
9916 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
9918 * cs-parser.jay (default_value_expression): Switch to the new
9921 2004-03-19 Martin Baulig <martin@ximian.com>
9923 * decl.cs (MemberName): New class. We use this to "construct"
9924 namespace_or_type_name's.
9926 * generics.cs (TypeArguments.GetDeclarations): New public method;
9927 returns the type arguments as a string[] and reports a CS0081 if
9928 one of them is not an identifier.
9930 * class.cs (MemberBase): The .ctor now takes the name as a
9931 MemberName instead of a string.
9932 (MemberBase.ExplicitInterfaceName): Changed type from string to
9934 (MemberBase.DoDefine): If we're an explicit implementation, the
9935 InterfaceType may be a generic instance.
9937 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
9938 (namespace_name): Call MemberName.GetName () to transform the
9939 MemberName into a string and ensure we don't have any type
9941 (type_name): Call MemberName.GetTypeExpression() to transfrom the
9942 MemberName into an expression.
9943 (method_header): Use namespace_or_type_name instead of member_name.
9945 2004-04-07 Miguel de Icaza <miguel@ximian.com>
9947 * rootcontext.cs: Add new types to the boot resolution.
9949 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9950 MulticastDelegate is not allowed.
9952 * typemanager.cs: Add new types to lookup: System.TypedReference
9955 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9956 check for TypedReference or ArgIterator, they are not allowed.
9958 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9959 makes us properly catch 1510 in some conditions (see bug 56016 for
9962 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
9964 * CryptoConvert.cs: update from corlib version
9967 2004-04-05 Miguel de Icaza <miguel@ximian.com>
9969 * class.cs (Indexer.Define): Check indexername declaration
9971 2004-04-05 Marek Safar <marek.safar@seznam.cz>
9973 * attribute.cs (IsClsCompliant): Fixed problem with handling
9974 all three states (compliant, not-compliant, undetected).
9976 2004-03-30 Marek Safar <marek.safar@seznam.cz>
9978 * attribute.cs (Attribute): Location is now public.
9979 (Resolve): Store resolved arguments (pos_values) in attribute class.
9980 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9981 (GetClsCompliantAttributeValue): New method that gets
9982 CLSCompliantAttribute value.
9983 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9984 if exists else null.
9985 (AttributeTester): New class for CLS-Compliant verification routines.
9987 * class.cs (Emit): Add CLS-Compliant verification.
9988 (Method.GetSignatureForError): Implemented.
9989 (Constructor.GetSignatureForError): Implemented
9990 (Constructor.HasCompliantArgs): Returns if constructor has
9991 CLS-Compliant arguments.
9992 (Constructor.Emit): Override.
9993 (Construcor.IsIdentifierClsCompliant): New method; For constructors
9994 is needed to test only parameters.
9995 (FieldBase.GetSignatureForError): Implemented.
9996 (TypeContainer): New member for storing base interfaces.
9997 (TypeContainer.FindMembers): Search in base interfaces too.
9999 * codegen.cs (GetClsComplianceAttribute): New method that gets
10000 assembly or module CLSCompliantAttribute value.
10001 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10003 (ModuleClass.Emit): Add error 3012 test.
10005 * const.cs (Emit): Override and call base for CLS-Compliant tests.
10007 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10008 state for all decl types.
10009 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10010 if CLS-Compliant tests are required.
10011 (IsClsCompliaceRequired): New method. Analyze whether code
10012 must be CLS-Compliant.
10013 (IsExposedFromAssembly): New method. Returns true when MemberCore
10014 is exposed from assembly.
10015 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10016 value or gets cached value.
10017 (HasClsCompliantAttribute): New method. Returns true if MemberCore
10018 is explicitly marked with CLSCompliantAttribute.
10019 (IsIdentifierClsCompliant): New abstract method. This method is
10020 used to testing error 3005.
10021 (IsIdentifierAndParamClsCompliant): New method. Common helper method
10022 for identifier and parameters CLS-Compliant testing.
10023 (VerifyClsCompliance): New method. The main virtual method for
10024 CLS-Compliant verifications.
10025 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10026 null. I don't know why is null (too many public members !).
10027 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10028 and get value of first CLSCompliantAttribute that found.
10030 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10031 (VerifyClsCompliance): Override and add extra tests.
10033 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10034 clscheck- disable CLS-Compliant verification event if assembly is has
10035 CLSCompliantAttribute(true).
10037 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10038 ApllyAttribute is now called in emit section as in the other cases.
10039 Possible future Emit integration.
10040 (IsIdentifierClsCompliant): New override.
10041 (VerifyClsCompliance): New override.
10042 (GetEnumeratorName): Returns full enum name.
10044 * parameter.cs (GetSignatureForError): Implemented.
10046 * report.cs (WarningData): New struct for Warning message information.
10047 (LocationOfPreviousError): New method.
10048 (Warning): New method. Reports warning based on the warning table.
10049 (Error_T): New method. Reports error based on the error table.
10051 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10052 verifications are done here.
10054 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10056 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10057 CLSCompliantAttribute.
10058 (all_imported_types): New member holds all imported types from other
10060 (LoadAllImportedTypes): New method fills static table with exported types
10061 from all referenced assemblies.
10062 (Modules): New property returns all assembly modules.
10064 2004-03-30 Miguel de Icaza <miguel@ximian.com>
10066 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10067 throwing a parser error.
10069 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10070 which removes the hardcoded get_/set_ prefixes for properties, as
10071 IL allows for the properties to be named something else.
10075 * expression.cs: Do not override operand before we know if it is
10076 non-null. Fix 56207
10078 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10080 * typemanager.cs: support for pinned variables.
10082 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10084 * decl.cs, typemanager.cs: Avoid using an arraylist
10085 as a buffer if there is only one result set.
10087 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10089 * expression.cs: Make sure you cant call a static method
10090 with an instance expression, bug #56174.
10092 2004-03-29 Miguel de Icaza <miguel@ximian.com>
10094 * class.cs (IsDuplicateImplementation): Improve error reporting to
10095 flag 663 (method only differs in parameter modifier).
10097 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10098 in preprocessor directives.
10100 * location.cs (LookupFile): Allow for the empty path.
10102 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
10103 better approach for some of that patch, but its failing with the
10104 CharSet enumeration. For now try/catch will do.
10106 * typemanager.cs: Do not crash if a struct does not have fields.
10109 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10111 * expression.cs: cs0213, cant fix a fixed expression.
10114 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10116 * cs-parser.jay: detect invalid embeded statements gracefully.
10119 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10121 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10124 the invocation type may not be a subclass of the tye of the item/
10125 The type of the item must be a subclass of the invocation item.
10130 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
10132 * attribute.cs: Added methods to get a string and a bool from an
10133 attribute. Required to information from AssemblyKeyFileAttribute,
10134 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10135 * codegen.cs: Modified AssemblyName creation to include support for
10136 strongnames. Catch additional exceptions to report them as CS1548.
10137 * compiler.csproj: Updated include CryptoConvert.cs.
10138 * compiler.csproj.user: Removed file - user specific configuration.
10139 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
10140 Mono.Security assembly. The original class is maintained and tested in
10141 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10142 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10143 like CSC 8.0 (C# v2) supports.
10144 * Makefile: Added CryptoConvert.cs to mcs sources.
10145 * rootcontext.cs: Added new options for strongnames.
10147 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
10149 * driver.cs: For --expect-error, report error code `2'
10150 if the program compiled with no errors, error code `1' if
10151 it compiled with an error other than the one expected.
10153 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
10155 * compiler.csproj: Updated for Visual Studio .NET 2003.
10156 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10157 * compiler.sln: Updated for Visual Studio .NET 2003.
10159 2004-03-24 Ravi Pratap M <ravi@ximian.com>
10161 * expression.cs: Fix bug #47234. We basically need to apply the
10162 rule that we prefer the conversion of null to a reference type
10163 when faced with a conversion to 'object' (csc behaviour).
10165 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10167 * statement.cs: Shorter form for foreach, eliminates
10168 a local variable. r=Martin.
10170 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10172 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10173 checks if we can use brtrue/brfalse to test for 0.
10174 * expression.cs: use the above in the test for using brtrue/brfalse.
10175 cleanup code a bit.
10177 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10179 * expression.cs: Rewrite string concat stuff. Benefits:
10181 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10182 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10183 rather than a concat chain.
10185 * typemanager.cs: Add lookups for more concat overloads.
10187 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10189 * expression.cs: Emit shorter il code for array init.
10206 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
10208 * statement.cs: Before, two switch blocks would be merged if the
10209 total size of the blocks (end_item - begin_item + 1) was less than
10210 two times the combined sizes of the blocks.
10212 Now, it will only merge if after the merge at least half of the
10217 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
10219 * class.cs : csc build fix for GetMethods(). See bug #52503.
10221 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
10223 * expression.cs: Make sure fp comparisons work with NaN.
10224 This fixes bug #54303. Mig approved this patch a long
10225 time ago, but we were not able to test b/c the runtime
10228 2004-03-19 Miguel de Icaza <miguel@ximian.com>
10230 * ecore.cs (TypExpr.GetHashCode): implement this overload.
10232 2004-03-19 Martin Baulig <martin@ximian.com>
10234 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
10235 two overloads may unify for some type parameter substitutions and
10236 report a CS0408 if appropriate.
10238 2004-03-19 Martin Baulig <martin@ximian.com>
10240 * class.cs (MemberCore.IsDuplicateImplementation): Report the
10241 error here and not in our caller.
10243 2004-03-19 Martin Baulig <martin@ximian.com>
10245 * interface.cs: Completely killed this file.
10246 (Interface): We're now a TypeContainer and live in class.cs.
10248 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10249 argument; we're now also called for interfaces.
10250 (TypeContainer.DefineMembers): Allow this method being called
10252 (TypeContainer.GetMethods): New public method; formerly known as
10253 Interface.GetMethod(). This is used by PendingImplementation.
10254 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10255 it's now private and non-static.
10256 (Interface): Moved this here; it's now implemented similar to
10258 (Method, Property, Event, Indexer): Added `bool is_interface'
10259 argument to their .ctor's.
10260 (MemberBase.IsInterface): New public field.
10262 * cs-parser.jay: Create normal Method, Property, Event, Indexer
10263 instances instead of InterfaceMethod, InterfaceProperty, etc.
10264 (opt_interface_base): Removed; we now use `opt_class_base' instead.
10265 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10267 2004-03-19 Martin Baulig <martin@ximian.com>
10269 * class.cs (MethodCore.IsDuplicateImplementation): New private
10270 method which does the CS0111 checking.
10271 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10272 Use IsDuplicateImplementation().
10274 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
10276 * decl.cs (FindMemberToOverride): New method to find the correct
10277 method or property to override in the base class.
10279 - Make Method/Property use the above method to find the
10280 version in the base class.
10281 - Remove the InheritableMemberSignatureCompare as it is now
10284 This patch makes large code bases much faster to compile, as it is
10285 O(n) rather than O(n^2) to do this validation.
10287 Also, it fixes bug 52458 which is that nested classes are not
10288 taken into account when finding the base class member.
10290 Reviewed/Approved by Martin.
10292 2004-03-17 Martin Baulig <martin@ximian.com>
10294 * expression.cs (MemberAccess.DoResolve): Take the parent's number
10295 of type arguments into account; use the `real_num_type_args'
10296 approach like in DoResolveAsTypeStep().
10298 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
10301 2004-03-17 Marek Safar <marek.safar@seznam.cz>
10303 * interface.cs: In all interface classes removed redundant
10304 member initialization.
10306 2004-03-16 Martin Baulig <martin@ximian.com>
10308 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10310 2004-03-15 Miguel de Icaza <miguel@ximian.com>
10312 * decl.cs (DefineTypeAndParents): New helper method to define a
10313 type's containers before the type itself is defined; This is a
10314 bug exposed by the recent changes to Windows.Forms when an
10315 implemented interface was defined inside a class that had not been
10318 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10320 (Check): Loop correctly to report errors modifiers
10321 (UNSAFE was not in the loop, since it was the same as TOP).
10323 * interface.cs: Every interface member now takes a ModFlags,
10324 instead of a "is_new" bool, which we set on the base MemberCore.
10326 Every place where we called "UnsafeOk" in the interface, now we
10327 call the proper member (InterfaceMethod.UnsafeOK) instead to get
10328 the unsafe settings from the member declaration instead of the
10329 container interface.
10331 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
10333 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10334 `set_indexer_name' to the pending bits (one per type).
10336 We fixed a bug today that was picking the wrong method to
10337 override, since for properties the existing InterfaceMethod code
10338 basically ignored the method name. Now we make sure that the
10339 method name is one of the valid indexer names.
10341 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
10343 * support.cs (SeekableStreamReader): Keep track of stream byte
10344 positions and don't mix them with character offsets to the buffer.
10346 Patch from Gustavo Giráldez
10348 2004-03-15 Marek Safar <marek.safar@seznam.cz>
10350 * interface.cs (InterfaceSetGetBase): Removed double member
10351 initialization, base class does it as well.
10353 2004-03-13 Martin Baulig <martin@ximian.com>
10355 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10356 when compiling corlib.
10358 2004-03-13 Miguel de Icaza <miguel@ximian.com>
10360 * convert.cs (ExplicitConversion): We were reporting an error on
10361 certain conversions (object_type source to a value type, when the
10362 expression was `null') before we had a chance to pass it through
10363 the user defined conversions.
10365 * driver.cs: Replace / and \ in resource specifications to dots.
10368 * class.cs: Add check for duplicate operators. Fixes 52477
10370 2004-03-11 Miguel de Icaza <miguel@ximian.com>
10372 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10373 that are in the middle of the statements, not only at the end.
10376 * class.cs (TypeContainer.AddField): No longer set the
10377 `HaveStaticConstructor' flag, now we call it
10378 `UserDefineStaticConstructor' to diferentiate the slightly
10379 semantic difference.
10381 The situation is that we were not adding BeforeFieldInit (from
10382 Modifiers.TypeAttr) to classes that could have it.
10383 BeforeFieldInit should be set to classes that have no static
10388 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10390 And most importantly Zoltan's comment:
10392 http://bugzilla.ximian.com/show_bug.cgi?id=44229
10394 "I think beforefieldinit means 'it's ok to initialize the type sometime
10395 before its static fields are used', i.e. initialization does not need
10396 to be triggered by the first access to the type. Setting this flag
10397 helps the JIT to compile better code, since it can run the static
10398 constructor at JIT time, and does not need to generate code to call it
10399 (possibly lots of times) at runtime. Unfortunately, mcs does not set
10400 this flag for lots of classes like String.
10402 csc sets this flag if the type does not have an explicit static
10403 constructor. The reasoning seems to be that if there are only static
10404 initalizers for a type, and no static constructor, then the programmer
10405 does not care when this initialization happens, so beforefieldinit
10408 This bug prevents the AOT compiler from being usable, since it
10409 generates so many calls to mono_runtime_class_init that the AOT code
10410 is much slower than the JITted code. The JITted code is faster,
10411 because it does not generate these calls if the vtable is type is
10412 already initialized, which is true in the majority of cases. But the
10413 AOT compiler can't do this."
10415 2004-03-10 Miguel de Icaza <miguel@ximian.com>
10417 * class.cs (MethodData.Emit): Refactor the code so symbolic
10418 information is generated for destructors; For some reasons we
10419 were taking a code path that did not generate symbolic information
10422 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
10424 * class.cs: Create a Constructor.CheckBase method that
10425 takes care of all validation type code. The method
10426 contains some code that was moved from Define.
10428 It also includes new code that checks for duplicate ctors.
10429 This fixes bug #55148.
10431 2004-03-09 Joshua Tauberer <tauberer@for.net>
10433 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10434 a { ... }-style array creation invokes EmitStaticInitializers
10435 which is not good for reference-type arrays. String, decimal
10436 and now null constants (NullCast) are not counted toward
10437 static initializers.
10439 2004-03-05 Martin Baulig <martin@ximian.com>
10441 * location.cs (SourceFile.HasLineDirective): New public field;
10442 specifies whether the file contains or is referenced by a "#line"
10444 (Location.DefineSymbolDocuments): Ignore source files which
10445 either contain or are referenced by a "#line" directive.
10447 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
10449 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10450 direct access to our parent, so check the method inline there.
10452 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
10454 * expression.cs (Invocation.EmitCall): Miguel's last commit
10455 caused a regression. If you had:
10460 In Foo the implict this would be null.
10462 2004-02-27 Miguel de Icaza <miguel@ximian.com>
10464 * expression.cs (Invocation.EmitCall): If the method is not
10465 virtual, do not emit a CallVirt to it, use Call.
10467 * typemanager.cs (GetFullNameSignature): Improve the method to
10468 cope with ".ctor" and replace it with the type name.
10470 * class.cs (ConstructorInitializer.Resolve): Now the method takes
10471 as an argument the ConstructorBuilder where it is being defined,
10472 to catch the recursive constructor invocations.
10474 2004-03-16 Martin Baulig <martin@ximian.com>
10476 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
10477 ConstructedType, call ResolveType() on it to get the type rather
10478 than just using `expr.Type'.
10480 2004-03-16 Martin Baulig <martin@ximian.com>
10482 * generics.cs (ConstructedType.GetMemberAccess): Take the
10483 EmitContext instead on the TypeExpr and use
10484 ec.TypeContainer.CurrentType/ec.ContainerType.
10486 2004-03-16 Martin Baulig <martin@ximian.com>
10488 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
10489 parameters before aliases.
10491 2004-03-16 Martin Baulig <martin@ximian.com>
10493 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
10494 New oublic function; checks whether two generic instances may become
10495 equal under some instantiations (26.3.1).
10497 * class.cs (TypeContainer.Define): Call
10498 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
10501 2004-03-16 Martin Baulig <martin@ximian.com>
10503 * class.cs (TypeContainer.GetClassBases): Moved
10504 Error_TypeParameterAsBase() here and also check whether the base
10505 class is not an attribute.
10507 2004-03-16 Martin Baulig <martin@ximian.com>
10509 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10511 2004-03-16 Martin Baulig <martin@ximian.com>
10513 * class.cs (Error_TypeParameterAsBase): Use correct error number
10516 2004-03-16 Martin Baulig <martin@ximian.com>
10518 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
10521 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
10524 2004-03-15 Martin Baulig <martin@ximian.com>
10526 * typemanager.cs (TypeManager.GetFullName): New public method.
10527 (TypeManager.MemberLookup): Added `int_num_type_arguments'
10528 argument; only return members with the correct number of type
10530 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
10531 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
10532 whether the number of type arguments matches.
10534 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
10535 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
10537 * expression.cs (MemberAccess): Added public `NumTypeArguments'
10538 field; it's set by the protected .ctor when we're actually a
10539 GenericMemberAccess.
10540 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
10541 arguments and pass it to MemberLookupFinal ().
10543 * ecore.cs (Expression.MemberLookup): Added `int
10544 num_type_arguments' argument; only return members with the correct
10545 number of type arguments.
10546 (Expression.MemberLookupFailed): Check whether the MemberLookup
10547 failed because we did not have the correct number of type
10548 arguments; report CS0305 in this case.
10550 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
10551 `e.ResolveAsTypeTerminal()' already did so.
10553 2004-03-15 Martin Baulig <martin@ximian.com>
10555 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
10556 we're a ConstructedType; in this case, the caller must report an
10557 error (for instance CS0131).
10559 * generic.cs (TypeArguments): Added Location argument to the .ctor.
10560 (TypeArguments.Resolve): Actually report errors here.
10562 2004-03-15 Miguel de Icaza <miguel@ximian.com>
10564 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10565 `set_indexer_name' to the pending bits (one per type).
10567 We fixed a bug today that was picking the wrong method to
10568 override, since for properties the existing InterfaceMethod code
10569 basically ignored the method name. Now we make sure that the
10570 method name is one of the valid indexer names.
10572 2004-03-15 Martin Baulig <martin@ximian.com>
10574 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
10575 for generic instances.
10577 2004-03-13 Martin Baulig <martin@ximian.com>
10579 * class.cs (TypeContainer.DefineType): Call
10580 TypeManager.AddUserType() immediately after creating the
10581 TypeBuilder; pass all type parameters when creating the
10584 * decl.cs (DeclSpace.FindNestedType): New public method.
10585 (DeclSpace.FindType): Added `int num_type_args' argument; only
10586 return types with the correct number of type parameters.
10587 (DeclSpace.CountTypeParams): New public property.
10589 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
10590 the number of type parameters; defaults to zero.
10592 * generic.cs (TypeArguments.Count): New public property.
10593 (ConstructedType.DoResolveAsTypeStep): First call
10594 ds.FindNestedType() to find out whether we're nested in the
10595 current generic type; in this case, we inherit all type parameters
10596 from the current class.
10598 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
10599 num_type_args' argument.
10600 (RootContext.LookupType): Added overloaded version which takes the
10601 number of type arguments; only return types with the correct
10602 number of type arguments.
10604 * typemanager.cs (TypeManager.CheckGeneric): New public function;
10605 checks whether `Type t' has `int num_type_args'.
10607 2004-03-13 Martin Baulig <martin@ximian.com>
10609 * generic.cs (GenericMethod.DefineType): New method; calls
10610 DefineType() on all the type parameters.
10612 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
10613 (MethodData.Define): If we're a generic method, call
10614 GenericMethod.DefineType() to define the type parameters.
10616 2004-03-10 Martin Baulig <martin@ximian.com>
10618 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
10619 instead of IsAssignableFrom.
10621 2004-03-10 Martin Baulig <martin@ximian.com>
10623 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
10625 * support.cs (ParameterData.HasArrayParameter): New property.
10626 (ReflectionParameters.ctor): Take a MethodBase instead of a
10627 ParameterInfo[]. If we have any type parameters, get the generic
10628 method definition and ask it whether we have variable arguments.
10630 2004-02-26 Miguel de Icaza <miguel@ximian.com>
10632 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10633 routines to check if a type is an enumerable/enumerator allow
10634 classes that implement the IEnumerable or IEnumerator interfaces.
10636 * class.cs (Property, Operator): Implement IIteratorContainer, and
10637 implement SetYields.
10639 (Property.Define): Do the block swapping for get_methods in the
10640 context of iterators. We need to check if Properties also
10641 include indexers or not.
10643 (Operator): Assign the Block before invoking the
10644 OperatorMethod.Define, so we can trigger the Iterator code
10647 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
10648 Property and Operator classes are not created when we parse the
10649 declarator but until we have the block completed, so we use a
10650 singleton SimpleIteratorContainer.Simple to flag whether the
10651 SetYields has been invoked.
10653 We propagate this setting then to the Property or the Operator to
10654 allow the `yield' to function.
10656 2004-02-25 Marek Safar <marek.safar@seznam.cz>
10658 * codegen.cs: Implemented attribute support for modules.
10659 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10660 Assembly/Module functionality.
10662 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10663 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10664 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10666 2004-02-16 Marek Safar <marek.safar@seznam.cz>
10668 * interface.cs (FindMembers): The operation is performed on all base
10669 interfaces and not only on the first. It is required for future CLS Compliance patch.
10671 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
10673 * statement.cs, codegen.cs:
10674 This patch deals with patterns such as:
10676 public class List : IEnumerable {
10678 public MyEnumerator GetEnumerator () {
10679 return new MyEnumerator(this);
10682 IEnumerator IEnumerable.GetEnumerator () {
10686 public struct MyEnumerator : IEnumerator {
10691 Before, there were a few things we did wrong:
10692 1) we would emit callvirt on a struct, which is illegal
10693 2) we emited ldarg when we needed to emit ldarga
10694 3) we would mistakenly call the interface methods on an enumerator
10695 type that derived from IEnumerator and was in another assembly. For example:
10697 public class MyEnumerator : IEnumerator
10699 Would have the interface methods called, even if there were public impls of the
10700 method. In a struct, this lead to invalid IL code.
10702 2004-02-11 Marek Safar <marek.safar@seznam.cz>
10704 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10707 * delegate.cs (Define): Fixed crash when delegate type is undefined.
10709 2004-02-11 Miguel de Icaza <miguel@ximian.com>
10711 * cs-parser.jay: Fix small regression: we were not testing V2
10712 compiler features correctly.
10714 * interface.cs: If the emit context is null, then create one
10716 2004-02-09 Marek Safar <marek.safar@seznam.cz>
10718 * decl.cs (GetSignatureForError): New virtual method to get full name
10719 for error messages.
10721 * attribute.cs (IAttributeSupport): New interface for attribute setting.
10722 Now it is possible to rewrite ApplyAttributes method to be less if/else.
10724 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10725 Duplicated members and code in these classes has been removed.
10726 Better encapsulation in these classes.
10728 2004-02-07 Miguel de Icaza <miguel@ximian.com>
10730 * assign.cs (Assign.DoResolve): When dealing with compound
10731 assignments, there is a new rule in ECMA C# 2.4 (might have been
10732 there before, but it is documented here) that states that in:
10736 If b is of type int, and the `op' is a shift-operator, then the
10737 above is evaluated as:
10741 * expression.cs (Binary.ResolveOperator): Instead of testing for
10742 int/uint/long/ulong, try to implicitly convert to any of those
10743 types and use that in pointer arithmetic.
10745 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10746 method to print information for from the type, not from the
10747 null-method we were given.
10749 2004-02-01 Duncan Mak <duncan@ximian.com>
10751 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10752 parsing for cmd, fixes bug #53694.
10754 2004-02-04 Marek Safar <marek.safar@seznam.cz>
10756 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10757 in the member name duplication tests. Property and operator name duplication
10758 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10760 2004-02-03 Marek Safar <marek.safar@seznam.cz>
10762 * interface.cs (PopulateMethod): Fixed crash when interface method
10763 returns not existing type (error test cs0246-3.cs).
10765 2004-02-02 Ravi Pratap M <ravi@ximian.com>
10767 * cs-parser.jay (interface_accessors): Re-write actions to also
10768 store attributes attached to get and set methods. Fix spelling
10771 (inteface_property_declaration): Modify accordingly.
10773 (InterfaceAccessorInfo): New helper class to store information to pass
10774 around between rules that use interface_accessors.
10776 * interface.cs (Emit): Apply attributes on the get and set
10777 accessors of properties and indexers too.
10779 * attribute.cs (ApplyAttributes): Modify accordingly to use the
10780 right MethodBuilder when applying attributes to the get and set accessors.
10782 2004-01-31 Miguel de Icaza <miguel@ximian.com>
10784 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10786 2004-01-26 Miguel de Icaza <miguel@ximian.com>
10788 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10790 2004-01-25 Miguel de Icaza <miguel@ximian.com>
10792 * cs-parser.jay: Remove YIELD token, instead use the new grammar
10793 changes that treat `yield' specially when present before `break'
10794 or `return' tokens.
10796 * cs-tokenizer.cs: yield is no longer a keyword.
10798 2004-01-23 Marek Safar <marek.safar@seznam.cz>
10800 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10801 setting for default constructors.
10802 For default constructors are almost every time set wrong Modifier. The
10803 generated IL code has been alright. But inside mcs this values was
10804 wrong and this was reason why several of my CLS Compliance tests
10807 2004-02-27 Martin Baulig <martin@ximian.com>
10809 * generics.cs (ConstructedType.ResolveType): Make the nested type
10810 stuff actually work.
10812 2004-02-25 Martin Baulig <martin@ximian.com>
10814 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
10815 property; returns the type parameters just from the current type,
10816 ie. with the ones from outer classes.
10817 (DeclSpace.LookupGeneric): First search in the current class, then
10819 (DeclSpace.initialize_type_params): When hiding a type parameter
10820 from an outer class, put it into the `type_param_list' anyways.
10822 * expression.cs (MemberAccess.expr): Made this field protected.
10824 * class.cs (TypeContainer.Define): The `CurrentType' just contains
10825 the type parameters from the current class.
10827 * generic.cs (ConstructedType.ResolveType): Support nested generic
10828 types by taking the type parameters which we inherit from outer
10829 classes into account.
10830 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
10831 support for nested generic types.
10833 2004-02-23 Martin Baulig <martin@ximian.com>
10835 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
10836 field and check whether we're nested inside a generic type.
10837 (DeclSpace.ResolveType): If we're resolving to a generic type
10838 definition, create a ConstructedType and return its resolved type.
10839 (DeclSpace.initialize_type_params): New private method;
10840 initializes the `type_param_list' field from the type parameters
10841 from this and all enclosing classes.
10842 (DeclSpace.TypeParameters): Call initialize_type_params() unless
10843 we're already initialized.
10845 2004-02-23 Martin Baulig <martin@ximian.com>
10847 * class.cs (Method.Define): Create the generic method before
10848 calling DoDefine().
10849 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
10850 the TypeContainer one); we use this for generic methods.
10852 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
10853 parent's TypeBuilder.
10855 2004-02-18 Martin Baulig <martin@ximian.com>
10857 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
10858 to check for equality.
10860 2004-02-05 Martin Baulig <martin@ximian.com>
10862 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
10863 `ec.TypeContainer.CurrentType', use it instead of
10864 `ec.ContainerType' to check whether we're in the type's ctor.
10866 2004-01-29 Martin Baulig <martin@ximian.com>
10868 * expression.cs (Invocation.DoResolve): If we're a
10869 `ConstructedType', then we're actually a generic method, so
10870 rewrite the expr as a GenericMemberAccess.
10872 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
10873 here; manually parse it into a string.
10875 2004-01-28 Martin Baulig <martin@ximian.com>
10877 * typemanager.cs (TypeManager.IsEqual): New static method.
10878 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
10879 check for equality instead of using `=='.
10881 2004-01-26 Martin Baulig <martin@ximian.com>
10883 * decl.cs (DeclSpace.CurrentType): New public field.
10885 * expression.cs (This.ResolveBase): If we have an
10886 `ec.TypeContainer.CurrentType', use it instead of
10887 `ec.ContainerType'.
10889 * class.cs (TypeContainer.DefineType): If we're a generic type,
10890 create the `CurrentType' (unresolved).
10891 (TypeContainer.GenericType): New private field.
10892 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
10893 it and store it in `GenericType' before creating the MemberCache.
10894 (TypeContainer.GetMembers): If we have a `GenericType', call
10895 TypeManager.FindMembers() on it.
10897 * interface.cs (Interface.GenericType): New private field.
10898 (Interface.DefineType): If we're a generic type, create the
10899 `CurrentType' (unresolved).
10900 (Interface.DefineMembers): If we have a `CurrentType', resolve it
10901 and store it in `GenericType' before creating the MemberCache.
10902 (Interface.GetMembers): If we have a `GenericType', call
10903 TypeManager.FindMembers() on it.
10905 2004-01-22 Martin Baulig <martin@ximian.com>
10907 * cs-parser.jay (namespace_or_type_name): Return an Expression,
10908 not a QualifiedIdentifier. This is what `type_name_expression'
10909 was previously doing.
10910 (type_name_expression): Removed; the code is now in
10911 `namespace_or_type_name'.
10912 (qualified_identifier): Removed, use `namespace_or_type_name'
10914 (QualifiedIdentifier): Removed this class.
10916 2004-01-22 Martin Baulig <martin@ximian.com>
10918 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10919 not a string as alias name.
10921 2004-01-21 Miguel de Icaza <miguel@ximian.com>
10923 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10924 #52730 bug, and instead compute correctly the need to use a
10925 temporary variable when requesting an address based on the
10926 static/instace modified of the field and the constructor.
10928 2004-01-21 Martin Baulig <martin@ximian.com>
10930 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10931 class and namespace before looking up aliases. Fixes #52517.
10933 2004-01-21 Martin Baulig <martin@ximian.com>
10935 * flowanalysis.cs (UsageVector.Merge): Allow variables being
10936 assinged in a 'try'; fixes exception4.cs.
10938 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10939 * class.cs : Implemented parameter-less constructor for TypeContainer
10941 * decl.cs: Attributes are now stored here. New property OptAttributes
10943 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10945 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10947 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10949 * typemanager.cs (CSharpSignature): Now reports also inner class name.
10950 (CSharpSignature): New method for indexer and property signature.
10952 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10954 * pending.cs (IsVirtualFilter): Faster implementation.
10956 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10958 * typemanager.cs: Avoid inclusion of same assembly more than once.
10960 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10962 * cs-parser.jay: Fixed problem where the last assembly attribute
10963 has been applied also to following declaration (class, struct, etc.)
10965 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10967 * class.cs: Added error CS0538, CS0539 reporting.
10968 Fixed crash on Microsoft runtime when field type is void.
10970 * cs-parser.jay: Added error CS0537 reporting.
10972 * pending.cs: Added error CS0535 reporting.
10973 Improved error report for errors CS0536, CS0534.
10975 2004-01-20 Miguel de Icaza <miguel@ximian.com>
10977 Merge a few bits from the Anonymous Method MCS tree.
10979 * statement.cs (ToplevelBlock): New class for toplevel methods,
10980 will hold anonymous methods, lifted variables.
10982 * cs-parser.jay: Create toplevel blocks for delegates and for
10983 regular blocks of code.
10985 2004-01-20 Martin Baulig <martin@ximian.com>
10987 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10988 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10989 and `NeedExplicitReturn'; added `IsLastStatement'.
10990 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10991 have a `ReturnLabel' or we're not unreachable.
10993 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10994 child's reachability; don't just override ours with it. Fixes
10995 #58058 (lluis's example).
10996 (FlowBranching): Added public InTryOrCatch(), InCatch(),
10997 InFinally(), InLoop(), InSwitch() and
10998 BreakCrossesTryCatchBoundary() methods.
11000 * statement.cs (Return): Do all error checking in Resolve().
11001 Unless we are the last statement in a top-level block, always
11002 create a return label and jump to it.
11003 (Break, Continue): Do all error checking in Resolve(); also make
11004 sure we aren't leaving a `finally'.
11005 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11006 statement in a top-level block.
11007 (Block.Flags): Added `IsDestructor'.
11008 (Block.IsDestructor): New public property.
11010 2004-01-20 Martin Baulig <martin@ximian.com>
11012 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11014 2004-01-20 Martin Baulig <martin@ximian.com>
11016 * statement.cs (Statement.ResolveUnreachable): New public method.
11017 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11018 (Block.Resolve): Resolve unreachable statements.
11020 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11022 * expression.cs: We need to fix the case where we do
11023 not have a temp variable here.
11025 * assign.cs: Only expression compound assignments need
11026 temporary variables.
11028 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11030 * flowanalysis.cs: Reduce memory allocation in a few ways:
11031 - A block with no variables should not allocate a bit
11033 - A method with no out parameters does not need any tracking
11034 for assignment of the parameters, so we need not allocate
11037 public readonly Type[] VariableTypes;
11038 public readonly string[] VariableNames;
11039 Are redundant. The data is already stored in the variable
11040 map, so we need not allocate another array for it.
11041 - We need to add alot of checks for if (params | locals) == null
11042 due to the first two changes.
11044 2004-01-18 Miguel de Icaza <miguel@ximian.com>
11046 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11047 implement IMemoryLocation, we store a copy on a local variable and
11048 take the address of it. Patch from Benjamin Jemlich
11050 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11051 to use a special "type_name_expression" rule which reduces the
11052 number of "QualifiedIdentifier" classes created, and instead
11053 directly creates MemberAccess expressions.
11055 2004-01-17 Miguel de Icaza <miguel@ximian.com>
11057 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11058 that fixes #52853. Null literal assignment to ValueType
11060 * class.cs (MethodData.Emit): Instead of checking the name of the
11061 method to determine if its a destructor, create a new derived
11062 class from Method called Destructor, and test for that.
11064 * cs-parser.jay: Create a Destructor object instead of a Method.
11066 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11070 2004-01-16 Miguel de Icaza <miguel@ximian.com>
11072 * expression.cs (Binary.ResolveOperator): Perform an implicit
11073 conversion from MethodGroups to their delegate types on the
11074 Addition operation.
11076 * delegate.cs: Introduce a new class DelegateCreation that is the
11077 base class for `NewDelegate' and `ImplicitDelegateCreation',
11078 factor some code in here.
11080 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11081 conversion from MethodGroups to compatible delegate types.
11083 * ecore.cs (Expression.Resolve): Do not flag error 654
11084 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11085 we allow conversions from MethodGroups to delegate types now.
11087 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11088 assignments in v2 either.
11090 2004-01-10 Miguel de Icaza <miguel@ximian.com>
11092 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11093 static read-only fields in ctors.
11095 Applied patch from Benjamin Jemlich
11097 * expression.cs (UnaryMutator): Avoid leaking local variables.
11099 2004-01-09 Miguel de Icaza <miguel@ximian.com>
11101 * cs-tokenizer.cs (IsCastToken): Allow the various native types
11102 here to return true, as they can be used like this:
11104 (XXX) int.MEMBER ()
11106 Fixed 49836 and all the other dups
11108 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
11110 * driver.cs: Implement /win32res and /win32icon.
11112 2004-01-08 Miguel de Icaza <miguel@ximian.com>
11114 * cs-parser.jay: Add a rule to improve error handling for the
11115 common mistake of placing modifiers after the type.
11117 2004-01-07 Miguel de Icaza <miguel@ximian.com>
11119 * cs-parser.jay (interface_event_declaration): Catch
11120 initialization of events on interfaces, and report cs0068
11122 * cs-parser.jay (interface_event_declaration): Catch
11123 initialization of events.
11125 * ecore.cs: Better report missing constructors.
11127 * expression.cs (Binary.ResolveOperator): My previous bug fix had
11128 the error reporting done in the wrong place. Fix.
11130 * expression.cs (Binary.ResolveOperator): Catch the
11131 operator + (E x, E y) error earlier, and later allow for implicit
11132 conversions in operator +/- (E e, U x) from U to the underlying
11135 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11136 52596, if the container class is abstract, the default constructor
11137 is protected otherwise its public (before, we were always public).
11139 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11142 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11143 Jemlich that fixes bug #52597, MCS was generating invalid code for
11144 idisposable structs. Thanks to Ben for following up with this
11147 2004-01-06 Miguel de Icaza <miguel@ximian.com>
11149 * driver.cs: Allow assemblies without code to be generated, fixes
11152 2004-01-07 Nick Drochak <ndrochak@gol.com>
11154 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11156 2004-01-05 Miguel de Icaza <miguel@ximian.com>
11158 * cs-parser.jay: Add rules to improve error reporting if fields or
11159 methods are declared at the namespace level (error 116)
11161 * Add rules to catch event add/remove
11163 2004-01-04 David Sheldon <dave-mono@earth.li>
11165 * expression.cs: Added matching ")" to error message for
11168 2004-01-03 Todd Berman <tberman@gentoo.org>
11170 * ecore.cs, attribute.cs:
11171 Applying fix from #52429.
11173 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11175 * ecore.cs, expression.cs, statement.cs:
11176 Total rewrite of how we handle branching. We
11177 now handle complex boolean expressions with fewer
11178 jumps. As well if (x == 0) no longer emits a ceq.
11180 if (x is Foo) is much faster now, because we generate
11183 Overall, we get a pretty big improvement on our benchmark
11184 tests. The code we generate is smaller and more readable.
11186 I did a full two-stage bootstrap. The patch was reviewed
11187 by Martin and Miguel.
11189 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11191 * cs-parser.jay: Make primary_expression not take a QI.
11192 we dont need this because the member_access rule covers
11193 us here. So we replace the rule with just IDENTIFIER.
11195 This has two good effects. First, we remove a s/r conflict.
11196 Second, we allocate many fewer QualifiedIdentifier objects.
11198 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11200 * attribute.cs: Handle MarshalAs attributes as pseudo, and
11201 set the correct information via SRE. This prevents
11202 hanging on the MS runtime. Fixes #29374.
11204 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11206 * convert.cs: correctly handle conversions to value types
11207 from Enum and ValueType as unboxing conversions.
11209 Fixes bug #52569. Patch by Benjamin Jemlich.
11211 2004-01-02 Ravi Pratap <ravi@ximian.com>
11213 * expression.cs (BetterConversion): Prefer int -> uint
11214 over int -> ulong (csc's behaviour). This fixed bug #52046.
11216 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
11218 * decl.cs (MemberCache.FindMembers): now returns a
11221 * typemanager.cs: In general, go with with ^^.
11222 (CopyNewMethods): take an IList.
11223 (RealMemberLookup): Only allocate an arraylist
11224 if we copy from two sets of methods.
11226 This change basically does two things:
11227 1) Fewer array lists allocated due to CopyNewMethods.
11228 2) the explicit cast in MemberList costed ALOT.
11230 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
11232 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11233 a hashtable to avoid needless string allocations when an identifier is
11234 used more than once (the common case).
11236 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11238 * pending.cs: MS's TypeBuilder.GetInterfaces ()
11239 is broken, it will not return anything. So, we
11240 have to use the information we have in mcs to
11243 * typemanager.cs: Add a cache for GetInterfaces,
11244 since this will now be used more often (due to ^^)
11246 (GetExplicitInterfaces) New method that gets the
11247 declared, not effective, interfaces on a type
11248 builder (eg, if you have interface IFoo, interface
11249 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11252 This patch makes MCS able to bootstrap itself on
11255 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11257 * expression.cs: Remove the Nop's that Miguel put
11260 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11262 * report.cs, codegen.cs: Give the real stack trace to
11263 the error when an exception is thrown.
11265 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11267 * decl.cs: only allocate hashtables for ifaces if
11270 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11272 * expression.cs: fix the error from cs0121-2.cs
11273 (a parent interface has two child interfaces that
11274 have a function with the same name and 0 params
11275 and the function is called through the parent).
11277 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
11279 * class.cs, rootcontext.cs, typmanager.cs: do not
11282 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
11284 * codegen.cs: remove stack for the ec flow branching.
11285 It is already a linked list, so no need.
11287 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
11289 * Makefile: Allow custom profiler here.
11291 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11293 * typemanager.cs (LookupType):
11294 - Use a static char [], because split takes
11295 a param array for args, so it was allocating
11297 - Do not store true in a hashtable, it boxes.
11299 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11301 * flowanalysis.cs: bytify common enums.
11303 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11305 * modifiers.cs: Add a new set of flags for the
11306 flags allowed on explicit interface impls.
11307 * cs-parser.jay: catch the use of modifiers in
11308 interfaces correctly.
11309 * class.cs: catch private void IFoo.Blah ().
11311 All related to bug #50572.
11313 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11315 * decl.cs: Rewrite the consistant accessability checking.
11316 Accessability is not linear, it must be implemented in
11317 a tableish way. Fixes #49704.
11319 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11321 * expression.cs: Handle negation in a checked context.
11322 We must use subtraction from zero. Fixes #38674.
11324 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11326 * class.cs: Ignore static void main in DLLs.
11327 * rootcontext.cs: Handle the target type here,
11328 since we are have to access it from class.cs
11329 * driver.cs: account for the above.
11331 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11333 * report.cs: Give line numbers and files if available.
11335 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
11337 * driver.cs: Implement /addmodule.
11339 * typemanager.cs: Change 'modules' field so it now contains Modules not
11342 2003-12-20 Martin Baulig <martin@ximian.com>
11344 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11345 (FieldBase.IsAssigned): Removed this field.
11346 (FieldBase.SetAssigned): New public method.
11347 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11349 2003-12-20 Martin Baulig <martin@ximian.com>
11351 * expression.cs (LocalVariableReference.DoResolve): Don't set
11352 `vi.Used' if we're called from DoResolveLValue().
11354 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11355 returns the usage vector it just merged into the current one -
11356 pass this one to UsageWarning().
11357 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11358 of the `EmitContext', don't call this recursively on our children.
11360 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
11362 * driver.cs: Implement /target:module.
11364 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
11366 * support.cs (CharArrayHashtable): New helper class.
11368 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
11369 char arrays, not strings, so we can avoid creating a string in
11370 consume_identifier if the identifier is a keyword.
11372 2003-12-16 Martin Baulig <martin@ximian.com>
11374 * statement.cs (LocalInfo.Assigned): Removed this property.
11375 (LocalInfo.Flags): Removed `Assigned'.
11376 (LocalInfo.IsAssigned): New public method; takes the EmitContext
11377 and uses flow analysis.
11378 (Block.UsageWarning): Made this method private.
11379 (Block.Resolve): Call UsageWarning() if appropriate.
11381 * expression.cs (LocalVariableReference.DoResolve): Always set
11382 LocalInfo.Used here.
11384 2003-12-13 Martin Baulig <martin@ximian.com>
11386 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11387 any value here; we're now using flow analysis to figure out
11388 whether a statement/block returns a value.
11390 2003-12-13 Martin Baulig <martin@ximian.com>
11392 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11394 (FlowBranching.MergeFinally): Don't call
11395 `branching.CheckOutParameters()' here, this is called in
11397 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11398 when adding the `finally' vector.
11400 2003-12-13 Martin Baulig <martin@ximian.com>
11403 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11404 actually work and also fix #48962.
11406 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
11408 * decl.cs: Do not check System.Object for nested types,
11409 since we know it does not have any. Big bang for buck:
11412 Run 1: 8.35 seconds
11413 Run 2: 8.32 seconds
11414 corlib: 17.99 seconds
11416 Run 1: 8.17 seconds
11417 Run 2: 8.17 seconds
11418 corlib: 17.39 seconds
11420 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
11422 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11423 time we are returning 0 members, so we save alot here.
11425 2003-12-11 Martin Baulig <martin@ximian.com>
11427 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11428 `MergeChild()', also just take the `FlowBranching' as argument;
11429 call Merge() on it and return the result.
11430 (FlowBranching.Merge): We don't need to do anything if we just
11433 2003-12-11 Martin Baulig <martin@ximian.com>
11435 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11436 them in an `ArrayList' to reduce memory usage. Thanks to Ben
11437 Maurer for this idea.
11439 2003-12-11 Martin Baulig <martin@ximian.com>
11441 * flowanalysis.cs (MergeResult): This class is now gone; we now
11442 use the `UsageVector' for this. The reason for this is that if a
11443 branching just has one sibling, we don't need to "merge" them at
11444 all - that's the next step to do.
11445 (FlowBranching.Merge): We now return a `UsageVector' instead of a
11448 2003-12-11 Martin Baulig <martin@ximian.com>
11450 Reworked flow analyis and made it more precise and bug-free. The
11451 most important change is that we're now using a special `Reachability'
11452 class instead of having "magic" meanings of `FlowReturns'. I'll
11453 do some more cleanups and optimizations and also add some more
11454 documentation this week.
11456 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11457 largely reworked this class.
11458 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11459 the new `Reachability' class instead of having "magic" values here.
11460 (FlowBranching): We're now using an instance of `Reachability'
11461 instead of having separate `Returns', `Breaks' etc. fields.
11463 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11464 based on flow analysis; ignore the return value of block.Emit ().
11466 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
11468 * driver.cs typemanager.cs: Find the mono extensions to corlib even
11469 if they are private.
11471 2003-12-09 Martin Baulig <martin@ximian.com>
11473 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11474 call them directly on the UsageVector.
11476 2003-12-09 Martin Baulig <martin@ximian.com>
11478 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11479 Changed return type from `FlowReturns' to `Reachability'.
11481 2003-12-09 Martin Baulig <martin@ximian.com>
11483 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11484 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11485 `Reachable' fields with a single `Reachability' one.
11487 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11489 * class.cs (FindMembers): Remove foreach's.
11494 Run 1: 8.74 seconds
11495 Run 2: 8.71 seconds
11498 Run 1: 8.64 seconds
11499 Run 2: 8.58 seconds
11502 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11507 This patch does a few things:
11508 1. EmptyStatement is now a singleton, so it is never reallocated.
11509 2. All blah is EmptyStatement constructs have been changed to
11510 blah == EmptyStatement.Value, which is much faster and valid
11511 now that EmptyStatement is a singleton.
11512 3. When resolving a block, rather than allocating a new array for
11513 the non-empty statements, empty statements are replaced with
11514 EmptyStatement.Value
11515 4. Some recursive functions have been made non-recursive.
11516 Mainly the performance impact is from (3), however (1) and (2) are needed for
11517 this to work. (4) does not make a big difference in normal situations, however
11518 it makes the profile look saner.
11523 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11524 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11525 Total memory allocated: 56397 KB
11528 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11529 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11530 Total memory allocated: 55666 KB
11532 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11534 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11535 than the hashtable in a hashtable version
11537 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11538 we always end up concating a string. This results in a huge perf
11539 loss, because many strings have to be tracked by the GC. In this
11540 patch, we first use a hashtable that works with two keys, so that
11541 the strings do not need to be concat'ed.
11545 Run 1: 8.74 seconds
11546 Run 2: 8.71 seconds
11549 Run 1: 8.65 seconds
11550 Run 2: 8.56 seconds
11552 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11554 * Makefile: Add a new target `do-time' that does a quick and simple
11555 profile, leaving easy to parse output.
11557 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
11559 * codegen.cs (Init): Create the dynamic assembly with
11560 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11562 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
11564 * support.cs: Make the PtrHashtable use only one
11565 instance of its comparer.
11567 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
11569 * typemanager.cs: Fix lookup of GetNamespaces.
11571 2003-11-29 Miguel de Icaza <miguel@ximian.com>
11573 * expression.cs: Removed redundant line.
11575 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11576 ArrayLists, use for loops with bounds.
11578 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11581 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11582 arraylists, use for loop with bounds.
11584 The above three changes give us a 0.071 second performance
11585 improvement out of 3.294 seconds down to 3.223. On my machine
11586 the above changes reduced the memory usage by 1,387 KB during
11587 compiler bootstrap.
11589 * cs-parser.jay (QualifiedIdentifier): New class used to represent
11590 QualifiedIdentifiers. Before we created a new string through
11591 concatenation, and mostly later on, the result would be
11592 manipulated by DecomposeQI through string manipulation.
11594 This reduced the compiler memory usage for bootstrapping from
11595 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11596 compile times in 0.05 seconds.
11598 2003-11-28 Dick Porter <dick@ximian.com>
11600 * support.cs: Do string compares with the Invariant culture.
11608 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11609 the comparison is done with the Invariant culture.
11611 2003-11-27 Miguel de Icaza <miguel@ximian.com>
11613 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11614 GetEnumerator method.
11616 (ProbeCollectionType): Iterate starting at the most specific type
11617 upwards looking for a GetEnumerator
11619 * expression.cs: Shift count can be up to 31 for int/uint and 63
11622 2003-11-26 Miguel de Icaza <miguel@ximian.com>
11624 * statement.cs (Block.LookupLabel): Also look for the label on the
11625 children blocks. Use a hash table to keep track of visited
11628 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11629 we actually did transform the other operand, otherwise fall back
11630 to the common codepath that casts to long.
11632 * cs-tokenizer.cs: Use the same code pattern as the int case.
11633 Maybe I should do the parsing myself, and avoid depending on the
11634 Parse routines to get this done.
11636 2003-11-25 Miguel de Icaza <miguel@ximian.com>
11638 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11639 which fixes bug 51347. This time test it.
11641 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11642 attributes for example can not tell the difference between these.
11643 The difference was only a syntax feature of the language.
11645 * attribute.cs: Apply attributes to delegates.
11647 * delegate.cs: Call the apply attributes method.
11649 2003-11-24 Miguel de Icaza <miguel@ximian.com>
11651 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11652 comparing 0 vs Byte.MinValue, not the value
11654 (ImplicitConversionRequired): When reporting a conversion error,
11655 use error 31 to print out the constant error instead of the
11658 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11659 which fixes bug 51347.
11661 2003-11-22 Miguel de Icaza <miguel@ximian.com>
11663 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
11664 which fixes the -warnaserror command line option.
11666 2003-11-21 Miguel de Icaza <miguel@ximian.com>
11668 * cfold.cs (DoNumericPromotions): During constant folding of
11669 additions on UIntConstant, special case intconstants with
11670 IntConstants like we do on the expression binary operator.
11672 2003-11-12 Miguel de Icaza <miguel@ximian.com>
11674 * convert.cs (ImplicitReferenceConversion): We were missing a case
11675 (System.Enum are not value types or class types, so we need to
11676 classify them separatedly).
11678 * driver.cs: We do not support error 2007.
11680 2003-11-12 Jackson Harper <jackson@ximian.com>
11682 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11683 system directory. Also use the full file name so users can
11684 libraries names mscorlib-o-tron.dll in a non system dir.
11686 2004-01-04 David Sheldon <dave-mono@earth.li>
11688 * expression.cs: Added matching ")" to error message for CS0077.
11690 2003-12-19 Martin Baulig <martin@ximian.com>
11692 * typemanager.cs (TypeManager.IsEqualGenericType): New public
11693 static method; see documentation in the method.
11694 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
11696 * convert.cs (Convert.ImplicitReferenceConversion,
11697 Convert.ImplicitReferenceConversionExists): Add support for
11698 generic type declarations; see gen-36.cs.
11700 2003-12-19 Martin Baulig <martin@ximian.com>
11702 * pending.cs (Pending.InterfaceMethod): Use
11703 `Type.IsAssignableFrom()' instead of `=='.
11705 2003-12-18 Martin Baulig <martin@ximian.com>
11707 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
11710 * convert.cs (Convert.ImplicitStandardConversionExists): Use
11711 `expr_type.Equals (target_type)' instead of `=='.
11713 2003-12-08 Martin Baulig <martin@ximian.com>
11715 * generics.cs (Constraints.Types): Removed.
11716 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
11718 (Constraints.ResolveTypes): New public method; resolves the
11719 TypeExpr's to Type's.
11720 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
11721 longer takes the constraints.
11722 (TypeParameter.DefineMethod): Likewise.
11723 (TypeParameter.DefineType): New public method. Calls
11724 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
11727 2003-12-08 Martin Baulig <martin@ximian.com>
11729 * convert.cs (Convert.ImplicitConversionStandard): Use
11730 `expr_type.Equals (target_type)' instead of `=='.
11732 2003-12-08 Martin Baulig <martin@ximian.com>
11734 * typemanager.cs (TypeManager.GetReferenceType): Call
11735 `Type.MakeByRefType ()'.
11737 2003-12-08 Martin Baulig <martin@ximian.com>
11739 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
11740 just has some special meaning in some situations. For instance,
11741 it is allowed to use `where' as the name of a variable etc.
11743 2003-12-04 Martin Baulig <martin@ximian.com>
11745 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
11746 `Type.MakeArrayType()' for array types.
11748 2003-11-18 Miguel de Icaza <miguel@ximian.com>
11750 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
11753 (SizeOf.DoResolve): assign the `type_queried' field. This gets
11756 2003-11-16 Martin Baulig <martin@ximian.com>
11758 * codegen.cs (EmitContext.IsGeneric): Removed.
11760 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
11761 ResolveGeneric() on the DeclSpace.
11763 2003-11-16 Martin Baulig <martin@ximian.com>
11765 * generic.cs (TypeArguments.Resolve):
11766 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
11767 `ResolveType()' on it to get the Type.
11769 2003-11-15 Martin Baulig <martin@ximian.com>
11771 * generic.cs (ConstructedType.GetInterfaces): Override this.
11773 2003-11-14 Martin Baulig <martin@ximian.com>
11775 * interface.cs (Interface.DefineType): Define all type parameters
11776 before adding the interfaces we inherit.
11778 2003-11-11 Martin Baulig <martin@ximian.com>
11780 * generic.cs (ConstructedType.ResolveType): Always call
11781 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
11783 2003-11-10 Martin Baulig <martin@ximian.com>
11785 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11786 (TypeManager.InitCoreTypes): Initialize them here, but instead of
11787 calling `ResolveType()' on them, directly assign their `Type'.
11789 2003-11-08 Martin Baulig <martin@ximian.com>
11791 * generic.cs (ConstructedType): Override `IsClass' etc.
11793 2003-11-08 Martin Baulig <martin@ximian.com>
11795 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11796 return value and the `out parent' parameter.
11797 (TypeContainer.DefineType): Moved the CS0644 check into
11798 GetClassBases(). Don't pass the interface types to the
11799 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11800 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11802 * ecore.cs (TypeExpr.IsAttribute): New property.
11803 (TypeExpr.GetInterfaces): New method.
11805 * interface.cs (Interface.GetInterfaceTypeByName): Return a
11806 TypeExpr instead of a Type.
11807 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11808 (Interface.DefineType): Don't pass the interface types to the
11809 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11810 them later and then call `TypeBulider.AddInterfaceImplementation()'.
11812 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11813 instead of a `Type[]'.
11814 (TypeManager.RegisterBuilder): Likewise.
11815 (TypeManager.AddUserInterface): Likewise.
11816 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11817 `Type[]' and also return a `TypeExpr[]'.
11818 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11820 2003-11-08 Martin Baulig <martin@ximian.com>
11822 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11825 2003-11-08 Martin Baulig <martin@ximian.com>
11827 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11828 TypeManager.ResolveExpressionTypes().
11830 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11831 instead of an Expression.
11832 (TypeExpr): This is now an abstract base class for `TypeExpression'.
11833 (TypeExpression): New public class; formerly known as `TypeExpr'.
11835 * expression.cs (ComposedCast): Derive from TypeExpr.
11837 * typemanager.cs (TypeManager.system_*_expr): These are now
11838 TypExpr's instead of Expression's.
11839 (TypeManager.ResolveExpressionTypes): New public static function;
11840 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11843 2003-11-06 Miguel de Icaza <miguel@ximian.com>
11845 * expression.cs (New.DoResolve): Do not dereference value that
11846 might be a null return.
11848 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11849 sure that the constant value has the right type. Fixes an
11850 unreported bug, similar to 50425.
11852 * const.cs (Const.LookupConstantValue): Call
11853 ImplicitStandardConversionExists before doing a conversion to
11854 avoid havng the TypeManager.ChangeType do conversions.
11856 Reduced the number of casts used
11858 (Const.ChangeType): New routine to enable reuse of the constant
11859 type changing code from statement.
11861 * typemanager.cs (ChangeType): Move common initialization to
11862 static global variables.
11866 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11867 every value type to go through, even if it was void. Fix that.
11869 * cs-tokenizer.cs: Use is_identifier_start_character on the start
11870 character of the define, and the is_identifier_part_character for
11871 the rest of the string.
11873 2003-11-05 Miguel de Icaza <miguel@ximian.com>
11875 * expression.cs (UnaryMutator.EmitCode): When I updated
11876 LocalVariableReference.DoResolve, I overdid it, and dropped an
11877 optimization done on local variable references.
11879 2003-11-04 Miguel de Icaza <miguel@ximian.com>
11881 * ecore.cs: Convert the return from Ldlen into an int.
11883 2003-10-20 Miguel de Icaza <miguel@ximian.com>
11885 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11886 the accessibility, this is a special case for toplevel non-public
11887 classes (internal for instance).
11889 2003-10-20 Nick Drochak <ndrochak@gol.com>
11891 * ecore.cs: Fix typo and build. Needed another right paren.
11893 2003-10-19 Miguel de Icaza <miguel@ximian.com>
11895 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
11896 `internal' case regular and protected, but not allowing protected
11897 to be evaluated later. Bug 49840
11899 2003-10-15 Miguel de Icaza <miguel@ximian.com>
11901 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11902 to kb.Nlast, and not the kb.nFirst to isolate the switch
11905 Extract the underlying type, so enumerations of long/ulong are
11906 treated like long/ulong.
11908 2003-10-14 Miguel de Icaza <miguel@ximian.com>
11910 * expression.cs (New): Overload the meaning of RequestedType to
11911 track the possible creation of the NewDelegate type, since
11912 DoResolve is invoked more than once for new constructors on field
11915 See bugs: #48800 and #37014
11917 * cs-parser.jay (declare_local_constants): Take an arraylist
11918 instead of a single constant.
11920 (local_constant_declaration): It should take a
11921 constant_declarators, not a constant_declarator. Fixes 49487
11923 * convert.cs: Fix error report.
11925 2003-10-13 Jackson Harper <jackson@ximian.com>
11927 * typemanager.cs (TypeToCoreType): Add float and double this fixes
11930 2003-11-03 Martin Baulig <martin@ximian.com>
11932 * expression.cs (ArrayAccess.GetStoreOpcode): Added
11933 `out bool has_type_arg'; if set, we need to pass the type to
11935 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
11936 Stelem_Any/Ldelem_Any for generic parameters.
11938 2003-11-02 Martin Baulig <martin@ximian.com>
11940 * expression.cs (Invocation.EmitCall): Use
11941 `TypeManager.IsValueType()' to check whether it's a value type.
11942 Don't set `struct_call' when calling a method on a type parameter.
11944 2003-11-02 Martin Baulig <martin@ximian.com>
11946 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
11947 and removed the TypeBuilder argument.
11949 * typemanager.cs (TypeManager.IsValueType): Return
11950 `t.IsGenericParameter || t.IsValueType'.
11952 2003-10-25 Martin Baulig <martin@ximian.com>
11954 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
11955 call ConstructedType.Resolve() on it.
11957 * generic.cs (ConstructedType.Resolve): Set `type' on success.
11959 2003-10-25 Martin Baulig <martin@ximian.com>
11961 * class.cs (TypeContainer.GetClassBases): Changed
11962 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
11963 CS8214 reporting here.
11964 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
11965 instead of a `Type' for our parent. In case of a recursive
11966 declaration (see tests/gen-23.cs for an example), our parent is a
11967 ConstructedType and it doesn't have its type set. So, first
11968 create our own TypeBuilder, then call constructed.Resolve() to get
11969 the parent's type and finally TypeBuilder.SetParent() it.
11971 * ecore.cs (TypeExpr.Name): New public virtual property.
11974 (ConstructedType): We're now a TypeExpr and not just an Expression.
11975 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
11976 arguments here; this is done later.
11977 (ConstructedType.Resolve): New public method to resolve the type
11978 arguments and bind them.
11980 2003-10-21 Martin Baulig <martin@ximian.com>
11982 * convert.cs: Use `TypeManager.IsValueType' instead of
11983 'type.IsValueType' everywhere.
11985 * typemanager.cs (TypeManager.IsValueType): Return true for type
11986 parameters. The reason for this is that we need to box a type
11987 parameter when converting it to a reference type.
11989 * cs-parser.jay: Added support for default value expressions.
11991 * generics.cs (DefaultValueExpression): New public class.
11993 2003-10-17 Martin Baulig <martin@ximian.com>
11995 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
11996 TypeContainer so we can also use this for Interfaces.
11997 (TypeParameter.Resolve): Likewise.
11999 * interface.cs (Interface.DefineType): Added support for generic
12002 * cs-parser.jay: Added support for generic structs and interfaces.
12004 2003-10-17 Martin Baulig <martin@ximian.com>
12006 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12007 call generic methods :-)
12009 2003-10-16 Martin Baulig <martin@ximian.com>
12011 * cs-parser.jay (namespace_or_type_name): Only create a
12012 GenericMemberAccess if we actually have type arguments.
12014 2003-10-13 Martin Baulig <martin@ximian.com>
12016 * class.cs (Method.Define): If we're a generic method, call
12017 TypeBuilder.DefineGenericMethod () before resolving
12019 (MethodData): Added .ctor which takes an additional MethodBuilder
12020 argument; this is used for generic methods.
12021 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12022 we already have a MethodBuilder.
12024 2003-10-10 Martin Baulig <martin@ximian.com>
12026 * class.cs (Method): Added .ctor which takes a `GenericMethod'
12027 instead of a `DeclSpace'. This is used for generic methods.
12029 * cs-parser.jay (method_header): Added support for generic
12030 methods; create a `GenericMethod' instance and pass it to the
12031 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12032 parameters and locals.
12034 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12035 since we already have the location. Check whether we're a generic
12036 type declaration or a generic method and create the correct type
12039 * generic.cs (TypeParameter.DefineMethod): New public method.
12040 (GenericMethod): New public class; derives from DeclSpace and is
12041 used for generic methods.
12043 2003-10-09 Martin Baulig <martin@ximian.com>
12045 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12047 (MethodCore.DoDefineParameters): Removed the TypeContainer
12048 argument; use the DeclSpace which was passed to the .ctor instead.
12049 (MethodCore.CheckParameter): Take a DeclSpace instead of a
12050 TypeContainer; we only need a DeclSpace here.
12052 2003-10-09 Martin Baulig <martin@ximian.com>
12054 * class.cs (MethodData): Added additional `DeclSpace ds' argument
12056 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12057 EmitContext's .ctor.
12059 2003-10-09 Martin Baulig <martin@ximian.com>
12061 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12062 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12063 AsAccessible(), moved them as well.
12065 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12067 2003-10-07 Miguel de Icaza <miguel@ximian.com>
12069 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12070 generation for >=, as spotted by Paolo, bug 48679.
12071 Patch from David Waite.
12073 * cs-tokenizer.cs: Add handling for #pragma.
12075 * cs-parser.jay: Allow for both yield and yield return in the
12076 syntax. The anti-cobolization of C# fight will go on!
12078 * class.cs (TypeBuilder.DefineType): Catch error condition here
12079 (Parent.DefineType erroring out and returning null).
12081 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12082 coping with enumerations variables, we were mistakenly processing
12083 them as a regular value type instead of built-in types. Fixes the
12086 * typemanager.cs (IsBuiltinOrEnum): New method.
12088 2003-09-30 Miguel de Icaza <miguel@ximian.com>
12090 * cs-parser.jay: Upgrade: yield now needs the return clause.
12092 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12094 * cs-parser.jay : Renamed yyName to yyNames related to jay.
12096 2003-09-29 Martin Baulig <martin@ximian.com>
12098 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12099 inflated generic methods.
12101 * generics.cs (ConstructedType): Distinguish between open and
12102 closed constructed types; correctly resolve the arguments.
12104 2003-09-22 Martin Baulig <martin@ximian.com>
12106 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12107 all type arguments meet their constraints.
12109 2003-09-19 Martin Baulig <martin@ximian.com>
12111 * decl.cs (MemberCache.SetupCacheForInterface): Take a
12112 `MemberCache parent' argument. Normally, an interface doesn't
12113 have a parent type except System.Object, but we use this in gmcs
12114 for generic type parameters.
12116 2003-09-18 Martin Baulig <martin@ximian.com>
12118 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12119 on `type.IsInterface'; don't check whether the type has a parent
12120 to determine whether it's an interface.
12122 2003-09-17 Martin Baulig <martin@ximian.com>
12124 * generic.cs (ConstructedType.ToString): Always use `name' as the
12127 2003-09-15 Martin Baulig <martin@ximian.com>
12129 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12131 * generic.cs (Constraints.Resolve): New public method; this is
12132 called to resolve the constraint types and to check whether all
12133 the constraints are correct.
12134 (Constraints.Types): New public property.
12135 (TypeParameter.Resolve): New public method; resolves all the
12136 type's constraints.
12138 * class.cs (TypeContainer.DefineType): Call
12139 TypeParameter.Resolve() before actually defining the type.
12141 2003-09-15 Martin Baulig <martin@ximian.com>
12143 * class.cs (TypeContainer.DefineType): Added an error flag to
12144 avoid reporting duplicate CS0146's ("class definition is
12147 * driver.cs (Driver.MainDriver): Abort if
12148 RootContext.ResolveTree() reported any errors.
12150 2003-09-07 Martin Baulig <martin@ximian.com>
12152 * report.cs (Error, Warning): Added overloaded versions which take
12153 a `params object[] args' and call String.Format().
12155 2003-09-07 Martin Baulig <martin@ximian.com>
12157 * decl.cs (DeclSpace..ctor): Don't call
12158 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12159 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
12160 (DeclSpace.RecordDecl): New method.
12162 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12164 2003-09-02 Ravi Pratap <ravi@ximian.com>
12166 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12167 value attributes to be applied to ParameterBuilders.
12169 * class.cs (MethodCore.LabelParameters): Make static and more
12170 generic so that it can be used from other places - like interface
12171 methods, for instance.
12173 * interface.cs (Interface.Emit): Call LabelParameters before
12174 emitting attributes on the InterfaceMethod.
12176 2003-09-07 Martin Baulig <martin@ximian.com>
12178 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12179 if the number of type parameters doesn't match.
12181 2003-09-04 Martin Baulig <martin@ximian.com>
12183 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12184 for arrays of generic type params (ie. `!0[]').
12186 2003-09-04 Martin Baulig <martin@ximian.com>
12188 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12191 2003-09-04 Martin Baulig <martin@ximian.com>
12193 * decl.cs (DeclSpace.LookupGeneric): New method.
12194 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12197 * generic.cs (TypeParameterExpr): Take a TypeParameter as
12198 argument, not just a string.
12199 (TypeParameter.Define): New public method; this is called to
12200 actually define the generic parameter; after this, you can use the
12201 new `Type' property to get the type.
12203 2003-09-04 Martin Baulig <martin@ximian.com>
12205 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12206 is now an ArrayList; initialize the result of the `TypeParameters'
12208 (DeclSpace.GetGenericData): Removed.
12209 (DeclSpace.LookupGeneric): Temporarily removed; we need to
12210 implement this in a different way.
12211 (DeclSpace.GetTypeParameters): Removed; there's now a
12212 `TypeParameters' property.
12213 (DeclSpace.TypeParameters): New public property.
12215 * generic.cs (Constraints): Make this class public.
12216 (TypeParameter): New public class.
12218 2003-09-04 Martin Baulig <martin@ximian.com>
12220 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
12221 generic parameters.
12223 * class.cs (TypeContainer.DefineType): Call
12224 TypeBuilder.DefineGenericParameter () on all generic parameters if
12225 this is a generic type.
12227 2003-08-28 Martin Baulig <martin@ximian.com>
12229 * sample-stack.il: Compile this with ilasm: "ilasm /dll
12232 * sample-hello.cs: Compile this with gmcs: "gmcs
12233 /r:sample-stack.dll sample-hello.cs".
12235 2003-08-28 Martin Baulig <martin@ximian.com>
12237 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12238 the parameters to the generic type.
12240 2003-08-28 Martin Baulig <martin@ximian.com>
12242 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
12244 2003-08-28 Martin Baulig <martin@ximian.com>
12246 * cs-parser.jay (opt_type_argument_list): Use
12247 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
12248 (primary_expression): Replace `qualified_identifier' with `type_name'.
12249 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
12251 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
12252 parser to check whether it is syntactically a type parameter list;
12253 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
12256 2003-08-26 Martin Baulig <martin@ximian.com>
12258 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12259 resolving aliases; fixes #47927.
12261 2003-08-26 Martin Baulig <martin@ximian.com>
12263 * statement.cs (Using.DoResolve): This is internally emitting a
12264 try/finally clause, so we need to set ec.NeedExplicitReturn if we
12265 do not always return. Fixes #47681.
12267 2003-08-26 Martin Baulig <martin@ximian.com>
12269 * decl.cs (MemberCore): Moved WarningNotHiding(),
12270 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12272 (AdditionResult): Make this nested in DeclSpace.
12273 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12274 argument; call NamespaceEntry.Define() unless we're nested in a
12277 * namespace.cs (Namespace.DefineName): New public function. This
12278 is called from DeclSpace's .ctor to add
12279 (Namespace.Lookup): Include DeclSpaces in the lookup.
12281 * class.cs (Operator): Derive from MemberBase, not MemberCore.
12283 * const.cs (Const): Derive from MemberBase, not MemberCore.
12285 2003-08-25 Martin Baulig <martin@ximian.com>
12287 * convert.cs (Convert.ExplicitReferenceConversion): When
12288 converting from an interface type to a class, unbox if the target
12289 type is a struct type. Fixes #47822.
12291 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12293 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12296 2003-08-22 Martin Baulig <martin@ximian.com>
12298 * class.cs (TypeManager.DefineType): When defining a nested type,
12299 call DefineType() on our parent; fixes #47801.
12301 2003-08-22 Martin Baulig <martin@ximian.com>
12303 * class.cs (MethodData.Define): While checking if a method is an
12304 interface implementation, improve the test a bit more to fix #47654.
12306 2003-08-22 Martin Baulig <martin@ximian.com>
12308 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12309 correctly; fixes #47722.
12311 2003-08-22 Martin Baulig <martin@ximian.com>
12313 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12314 LocalVariableReference, ensure it's not read-only. Fixes #47536.
12316 * statement.cs (Fixed.DoResolve): Make all variables read-only.
12318 2003-08-22 Martin Baulig <martin@ximian.com>
12320 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12321 can only be assigned in static constructors. Fixes #47161.
12323 2003-08-22 Martin Baulig <martin@ximian.com>
12325 Rewrote and improved the flow analysis code.
12327 * flowbranching.cs (FlowBranching): Make this class abstract.
12328 (FlowBranching.CreateBranching): New static function to create a
12329 new flow branching.
12330 (FlowBranchingBlock, FlowBranchingException): New classes.
12331 (FlowBranching.UsageVector.Type): New public readonly field.
12332 (FlowBranching.UsageVector.Breaks): Removed the setter.
12333 (FlowBranching.UsageVector.Returns): Removed the setter.
12334 (FlowBranching.UsageVector): Added Break(), Return(),
12335 NeverReachable() and Throw() methods to modify the reachability.
12336 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12337 done by FlowBranching.Merge().
12338 (FlowBranching.UsageVector.MergeChild): New method; merges the
12339 merge result into the current vector.
12340 (FlowBranching.Merge): New abstract method to merge a branching.
12342 2003-08-12 Martin Baulig <martin@ximian.com>
12344 * expression.cs (Indirection.CacheTemporaries): Create the
12345 LocalTemporary with the pointer type, not its element type.
12347 2003-08-10 Miguel de Icaza <miguel@ximian.com>
12349 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12350 token was a keyword or not.
12352 Add `error' options where an IDENTIFIER was expected; Provide
12353 CheckToken and CheckIdentifierToken convenience error reporting
12356 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12358 * decl.cs: Rename `NamespaceEntry Namespace' public field into
12359 NameSpaceEntry NameSpaceEntry.
12361 (LookupInterfaceOrClass): Avoid creating a full qualified name
12362 from namespace and name: avoid doing lookups when we know the
12363 namespace is non-existant. Use new Tree.LookupByNamespace which
12364 looks up DeclSpaces based on their namespace, name pair.
12366 * driver.cs: Provide a new `parser verbose' to display the
12367 exception thrown during parsing. This is turned off by default
12368 now, so the output of a failure from mcs is more graceful.
12370 * namespace.cs: Track all the namespaces defined in a hashtable
12373 (IsNamespace): New method
12375 2003-08-09 Miguel de Icaza <miguel@ximian.com>
12377 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
12378 we know that we need to concatenate (full typename can never be
12383 * statement.cs: Use a bitfield; Do not initialize to null things
12384 which are done by the constructor by default.
12386 * cs-parser.jay: bug fix, parameter was 4, not 3.
12388 * expression.cs: Just use the property;
12390 * statement.cs: No need for GetVariableInfo method.
12392 2003-08-08 Martin Baulig <martin@ximian.com>
12394 * flowanalysis.cs (FlowReturns): This is now nested in the
12395 `FlowBranching' class.
12396 (MyBitVector): Moved this here from statement.cs.
12397 (FlowBranching.SiblingType): New enum type.
12398 (FlowBranching.CreateSibling): Added `SiblingType' argument.
12400 2003-08-07 Martin Baulig <martin@ximian.com>
12402 * flowanalysis.cs (FlowBranchingType): This is now nested in the
12403 `FlowBranching' class and called `BranchingType'.
12405 2003-08-07 Martin Baulig <martin@ximian.com>
12407 * flowanalysis.cs: Moved all the control flow analysis code into
12410 2003-08-07 Martin Baulig <martin@ximian.com>
12412 * assign.cs (Assign.DoResolve): `target' must either be an
12413 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
12416 2003-08-07 Miguel de Icaza <miguel@ximian.com>
12418 * expression.cs (BinaryMethod): This kind of expression is created by the
12419 Binary class if it determines that the operator has to be handled
12422 (BinaryDelegate): This kind of expression is created if we are
12423 dealing with a + or - operator on delegates.
12425 (Binary): remove method, argumetns, and DelegateOperator: when
12426 dealing with methods,
12428 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12430 * statement.cs (Block): use bitfields for the three extra booleans
12431 we had in use. Remove unused topblock parameter.
12433 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12435 * assign.cs: Drop extra unneeded tests.
12437 2003-08-06 Miguel de Icaza <miguel@ximian.com>
12439 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12441 * statement.cs (Foreach): Use VariableStorage instead of
12444 * codegen.cs (VariableStorage): New class used by clients that
12445 require a variable stored: locals or fields for variables that
12446 need to live across yield.
12448 Maybe provide a convenience api for EmitThis+EmitLoad?
12450 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12453 2003-08-05 Miguel de Icaza <miguel@ximian.com>
12455 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12456 RemapParameterLValue): New methods that are used to turn a
12457 precomputed FieldInfo into an expression like this:
12461 The idea is to use this instead of making LocalVariableReference
12462 have more than one meaning.
12464 * cs-parser.jay: Add error production to BASE.
12466 * ecore.cs: Deal with TypeManager.GetField returning null, which
12467 is now a valid return value.
12469 (FieldExprNoAddress): New expression for Fields whose address can
12472 * expression.cs (LocalVariableReference): During the resolve
12473 phases, create new expressions if we are in a remapping context.
12474 Remove code that dealt with remapping here.
12476 (ParameterReference): same.
12478 (ProxyInstance): New expression, like the `This' expression, but
12479 it is born fully resolved. We know what we are doing, so remove
12480 the errors that are targeted to user-provided uses of `this'.
12482 * statement.cs (Foreach): our variable is now stored as an
12483 Expression; During resolution, follow the protocol, dont just
12484 assume it will return this.
12486 2003-08-06 Martin Baulig <martin@ximian.com>
12488 * support.cs (SeekableStreamReader.cs): New public class.
12490 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12491 SeekableStreamReader instead of the normal StreamReader.
12493 2003-08-04 Martin Baulig <martin@ximian.com>
12495 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12496 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12497 deambiguate casts and delegate invocations.
12498 (parenthesized_expression): Use the new tokens to ensure this is
12499 not a cast of method invocation.
12501 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12502 when reading a `)' and Deambiguate_CloseParens () was previously
12505 * expression.cs (ParenthesizedExpression): New class. This is
12506 just used for the CS0075 test.
12507 (Binary.DoResolve): Check for CS0075.
12509 2003-07-29 Ravi Pratap <ravi@ximian.com>
12511 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12512 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12513 reference comparison.
12515 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12516 examine the ReturnType for equality - this is necessary in the
12517 cases of implicit and explicit operators whose signature also
12518 includes the return type.
12520 2003-07-26 Miguel de Icaza <miguel@ximian.com>
12522 * namespace.cs: Cache the result of the namespace computation,
12523 instead of computing it every time.
12525 2003-07-24 Miguel de Icaza <miguel@ximian.com>
12527 * decl.cs: Use a global arraylist that we reuse over invocations
12528 to avoid excesive memory consumption. Reduces memory usage on an
12529 mcs compile by one meg (45 average).
12531 * typemanager.cs (LookupTypeReflection): In .NET pointers are
12532 private, work around that.
12534 2003-07-23 Miguel de Icaza <miguel@ximian.com>
12536 * literal.cs (IntLiteral): Define Zero and One static literals.
12538 * cs-parser.jay (integer_literal): use static literals to reduce
12539 memory usage for the most used literals (0, 1 and -1). 211kb
12540 reduced in memory usage.
12542 Replace all calls to `new ArrayList' with `new
12543 ArrayList(4)' which is a good average number for most allocations,
12544 and also requires only 16 bytes of memory for its buffer by
12547 This reduced MCS memory usage in seven megabytes for the RSS after
12550 2003-07-28 Ravi Pratap <ravi@ximian.com>
12552 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12553 handle params methods the correct way by forming only one
12554 applicable set with params and normal methods in them. Earlier we
12555 were looking at params methods only if we found no normal methods
12556 which was not the correct thing to do.
12558 (Invocation.BetterFunction): Take separate arguments indicating
12559 when candidate and the best method are params methods in their
12562 This fixes bugs #43367 and #46199.
12564 * attribute.cs: Documentation updates.
12566 (CheckAttribute): Rename to CheckAttributeTarget.
12567 (GetValidPlaces): Rename to GetValidTargets.
12569 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12570 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12574 2003-07-28 Miguel de Icaza <miguel@ximian.com>
12576 * codegen.cs: Compute IsGeneric correctly.
12578 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
12581 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
12582 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
12583 regressions, and I was chasing more bugs than I required.
12585 * interface.cs: Use expressions for base type names (like classes
12586 and structs have been doing for a while now), and resolve that.
12587 This patch should probably go into head as well.
12589 This makes it one less user of FindType.
12591 2003-07-24 Miguel de Icaza <miguel@ximian.com>
12593 This compiler can not self host currently. Need to fix that.
12595 * Makefile: compile to `gmcs.exe'
12597 * driver.cs: Turn on v2 by default on gmcs.
12599 * generic.cs (ConstructedType): Does no longer take a container
12600 type argument; That will be taken care of later.
12602 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
12603 Use SimpleName to resolve for now, so we can continue the work on
12604 the parser, until we get Type.GetType that understands generics.
12606 (ConstructedType.ToString): Implement
12608 (TypeArguments.Resolve): Resolve the child expressions as types.
12610 * cs-parser.jay: Rename interface_constraints to
12611 type_parameter_constraints
12613 (namespace_or_type_name): Only use constructed types for the basic
12614 construction, we will deal with identifier<...> later.
12616 (type/type_name): No longer call DecomposeQI, as
12617 namespace_or_type_name is always decoded now.
12619 2003-07-22 Ravi Pratap <ravi@ximian.com>
12621 * expression.cs (Invocation.OverloadResolve): Follow the spec more
12622 closely: we eliminate methods in base types when we have an
12623 applicable method in a top-level type.
12625 Please see section 14.5.5.1 for an exact description of what goes
12628 This fixes bug #45127 and a host of other related to corlib compilation.
12630 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12631 array is the method corresponding to the top-level type (this is
12632 because of the changes made to icall.c) so we change this
12635 (MethodGroupExpr.Name): This too.
12637 * typemanager.cs (GetElementType): New method which does the right
12638 thing when compiling corlib.
12640 * everywhere: Make use of the above in the relevant places.
12642 2003-07-22 Martin Baulig <martin@ximian.com>
12644 * cs-parser.jay (invocation_expression): Moved
12645 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12646 `cast_expression', but create a InvocationOrCast which later
12647 resolves to either an Invocation or a Cast.
12649 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12650 method; call this before EmitStatement() to make sure that this
12651 expression can be used as a statement.
12653 * expression.cs (InvocationOrCast): New class; resolves to either
12654 an Invocation or a Cast.
12656 * statement.cs (StatementExpression): Call ResolveStatement() on
12657 the ExpressionStatement before emitting it.
12659 2003-07-21 Martin Baulig <martin@ximian.com>
12661 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12662 `ref' and `out' attributes match; fixes #46220.
12663 (MemberAccess.ResolveMemberAccess): You can't reference a type
12664 through an expression; fixes #33180.
12665 (Indexers.GetIndexersForType): Don't return the indexers from
12666 interfaces the class implements; fixes #46502.
12668 2003-07-21 Martin Baulig <martin@ximian.com>
12670 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12671 CS0661 checks; fixes bug #30442.
12673 2003-07-21 Martin Baulig <martin@ximian.com>
12675 * decl.cs (AdditionResult): Added `Error'.
12677 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12679 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
12680 cs0031.cs actually work.
12682 2003-07-20 Miguel de Icaza <miguel@ximian.com>
12684 * cs-parser.jay (namespace_name): do not use
12685 namespace_or_type_name, use qualified_identifier, because
12686 namespace_or_type_name will soon return a composed expression
12687 instead of a string.
12689 (namespace_or_type_name): Instead of returning a string, now this
12690 production returns an expression.
12692 * codegen.cs (EmitContext): Setup IsGeneric property based on
12693 whether our DeclSpace is generic, our the method is generic.
12695 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
12696 the method is generic.
12698 * cs-parser.jay (type_arguments, opt_type_argument_list,
12699 type_parameters, type_parameter_list, opt_type_parameter_list,
12700 type_parameter,, opt_type_parameter_constraints_clauses,
12701 type_parameter_constraints_clauses,
12702 type_parameter_constraint_clause, type_parameter_constraint,
12703 interface_constraints): Add new production
12705 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
12706 DeclSpace is generic or not.
12708 (DeclSpace.SetParameterInfo): New routine, used to set the
12709 parameter info for a type.
12711 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
12712 returns a GenericTypeExpr
12714 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
12715 generic, lookup the generic argument.
12717 * attribute.cs: Do not allow TypeParameterExpressions in
12720 * class.cs: Do not allow the Main method to be defined in a
12723 * expression.cs (SizeOf): Do not allow generic types to be used as
12724 arguments to sizeof.
12726 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
12727 it: whether a type is generic or not. Only works for types we are
12728 currently building for now.
12730 2003-07-20 Martin Baulig <martin@ximian.com>
12732 * namespace.cs: Fixed that bug which caused a crash when compiling
12733 the debugger's GUI.
12735 2003-07-20 Miguel de Icaza <miguel@ximian.com>
12737 * typemanager.cs (LookupTypeReflection): Never expose types which
12738 are NotPublic, NestedPrivate, NestedAssembly, or
12739 NestedFamANDAssem. We used to return these, and later do a check
12740 that would report a meaningful error, but the problem is that we
12741 would not get the real match, if there was a name override.
12743 2003-07-18 Miguel de Icaza <miguel@ximian.com>
12745 * namespace.cs (Namespace, Name): Do not compute the namespace
12746 name dynamically, compute it in the constructor. This reduced
12747 memory usage by 1697 KB.
12749 * driver.cs: Use --pause to pause at the end.
12751 2003-07-17 Peter Williams <peter@newton.cx>
12753 * Makefile: Change the name of the test target so that it doesn't
12754 conflict with the recursive test target.
12756 2003-07-17 Miguel de Icaza <miguel@ximian.com>
12758 * expression.cs (LocalVariableReference.Emit, EmitAssign,
12759 AddressOf): Do not use EmitThis, that was wrong, use the actual
12762 2003-07-15 Miguel de Icaza <miguel@ximian.com>
12764 * class.cs (MethodData.Define): While checking if a method is an
12765 interface implementation, improve the test: If we are not public
12766 (use new test here: use the computed MethodAttributes directly,
12767 instead of the parsed modifier flags) check if the `implementing'
12768 method comes from an interface or not.
12770 * pending.cs (VerifyPendingMethods): Slightly better error
12773 * makefile: add test target that does the mcs bootstrap.
12775 2003-07-16 Ravi Pratap <ravi@ximian.com>
12777 * interface.cs (Define): Do nothing here since there are no
12778 members to populate etc. Move the attribute emission out of here
12779 since this was just totally the wrong place to put it. Attribute
12780 application happens during the 'Emit' phase, not in the 'Define'
12783 (Emit): Add this method and move the attribute emission here
12785 * rootcontext.cs (EmitCode): Call the Emit method on interface
12788 2003-07-14 Ravi Pratap M <ravi@ximian.com>
12790 * expression.cs (OverloadResolve): Report error only if Location
12791 is not 'Null' which means that there was a probe going on.
12793 2003-07-14 Martin Baulig <martin@ximian.com>
12795 * expression.cs (ConditionalLogicalOperator): New public class to
12796 implement user defined conditional logical operators.
12797 This is section 14.11.2 in the spec and bug #40505.
12799 2003-07-14 Martin Baulig <martin@ximian.com>
12801 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12803 2003-07-14 Martin Baulig <martin@ximian.com>
12805 * codegen.cs (EmitContext.InFixedInitializer): New public field.
12807 * ecore.cs (IVariable.VerifyFixed): New interface method.
12809 * expression.cs (Unary.ResolveOperator): When resolving the `&'
12810 operator, check whether the variable is actually fixed. Fixes bug
12811 #36055. Set a variable definitely assigned when taking its
12812 address as required by the spec.
12814 * statement.cs (LocalInfo.IsFixed): New field.
12815 (LocalInfo.MakePinned): Set `IsFixed' to true.
12817 2003-07-14 Ravi Pratap M <ravi@ximian.com>
12819 * attribute.cs (Attribute.Resolve): While doing a Member lookup
12820 for .ctors, ensure that we only ask for members declared in the
12821 attribute type (BindingFlags.DeclaredOnly).
12825 * expression.cs (Error_WrongNumArguments): Report error 1501
12826 correctly the way CSC does.
12828 2003-07-13 Martin Baulig <martin@ximian.com>
12830 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12831 lookup on the fully qualified name, to make things like "X.X" work
12832 where "X.X" is a fully qualified type name, but we also have a
12833 namespace "X" in the using list. Fixes #41975.
12835 2003-07-13 Martin Baulig <martin@ximian.com>
12837 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12838 function. If we're a CompoundAssign, we need to create an embedded
12839 CompoundAssign, not an embedded Assign.
12840 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12843 2003-07-13 Martin Baulig <martin@ximian.com>
12845 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12846 work to fix bug #46088.
12848 2003-07-13 Ravi Pratap <ravi@ximian.com>
12850 * class.cs (Operator.Emit): Do not emit attributes here - it is
12851 taken care of by the Method class that we delegate too. This takes
12852 care of bug #45876.
12854 2003-07-10 Martin Baulig <martin@ximian.com>
12856 * expression.cs (TypeOfVoid): New class.
12857 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
12859 2003-07-10 Martin Baulig <martin@ximian.com>
12861 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12864 2003-07-10 Martin Baulig <martin@ximian.com>
12866 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12867 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12869 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12871 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12873 2003-07-10 Martin Baulig <martin@ximian.com>
12875 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12876 of decimal. Fixes #42850.
12878 NOTE: I also fixed the created byte blob, but this doesn't work on
12879 the MS runtime and csc never produces any byte blobs for decimal
12882 2003-07-10 Martin Baulig <martin@ximian.com>
12884 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12885 structs; fixes #32068.
12886 (Block.AddChildVariableNames): Fixed #44302.
12888 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12890 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12892 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12894 * attribute.cs: And this test is onger needed.
12896 2003-07-08 Martin Baulig <martin@ximian.com>
12898 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12899 inaccessible types. Fixes #36313.
12901 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12903 * namespace.cs (NamespaceEntry): Create implicit entries for all
12904 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12905 implicit entries for N1.N2 and N1.
12907 2003-07-08 Martin Baulig <martin@ximian.com>
12909 Rewrote the handling of namespaces to fix a lot of the issues
12910 wrt. `using' aliases etc.
12912 * namespace.cs (Namespace): Splitted this class into a
12913 per-assembly `Namespace' and a per-file `NamespaceEntry'.
12915 * typemanager.cs (TypeManager.IsNamespace): Removed.
12916 (TypeManager.ComputeNamespaces): Only compute namespaces from
12917 loaded assemblies here, not the namespaces from the assembly we're
12918 currently compiling.
12920 2003-07-08 Martin Baulig <martin@ximian.com>
12922 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12924 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12926 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12929 I thought about the memory savings here, but LookupTypeReflection
12930 is used under already very constrained scenarios. Compiling
12931 corlib or mcs only exposes one hit, so it would not really reduce
12932 any memory consumption.
12934 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12936 * typemanager.cs: fixes bug #45889 by only adding public types from
12937 other assemblies to the list of known types.
12939 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12941 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12942 on the type we resolved.
12944 2003-07-05 Martin Baulig <martin@ximian.com>
12946 * pending.cs (PendingImplementation.ParentImplements): Don't
12947 create the proxy if the parent is abstract.
12949 * class.cs (TypeContainer.DefineIndexers): Process explicit
12950 interface implementations first. Fixes #37714.
12952 2003-07-04 Miguel de Icaza <miguel@ximian.com>
12954 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12955 defined recursively; but since we modify the input parameters
12956 (left is set to `this' temporarily), we reset this value if the
12957 left_is_explicit is false, which gives the original semantics to
12960 * literal.cs (NullPointer): new class used to represent a null
12961 literal in a pointer context.
12963 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12964 type is a pointer, use a NullPointer object instead of a
12965 NullLiteral. Closes 43687
12967 (ExplicitConversion): Convert pointer values using
12968 the conv opcode to the proper type.
12970 * ecore.cs (New): change ValueTypeVariable property into a method,
12971 that returns whether the valuetype is suitable for being used.
12973 * expression.cs (Binary.DoNumericPromotions): Only return if we
12974 the int constant was a valid uint, and we can return both left and
12975 right as uints. If not, we continue processing, to trigger the
12976 type conversion. This fixes 39018.
12978 * statement.cs (Block.EmitMeta): During constant resolution, set
12979 the CurrentBlock property on the emitcontext, so that we resolve
12980 constants propertly.
12982 2003-07-02 Martin Baulig <martin@ximian.com>
12984 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12985 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12987 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12988 than emitting it here.
12990 * statement.cs: Fixed some more flow analysis bugs.
12992 2003-07-02 Martin Baulig <martin@ximian.com>
12994 * class.cs (MethodData.Define): When implementing interface
12995 methods, set Final unless we're Virtual.
12997 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12998 check work for interface methods.
13000 2003-07-01 Martin Baulig <martin@ximian.com>
13002 * ecore.cs (EmitContext.This): Replaced this property with a
13003 GetThis() method which takes a Location argument. This ensures
13004 that we get the correct error location for a CS0188.
13006 2003-07-01 Miguel de Icaza <miguel@ximian.com>
13008 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13009 ImplicitStandardConversion.
13011 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13013 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
13015 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13018 2003-06-30 Miguel de Icaza <miguel@ximian.com>
13020 * class.cs (Constructor.Define): Turn off initlocals for unsafe
13023 (MethodData.Define): Turn off initlocals for unsafe methods.
13025 2003-06-29 Miguel de Icaza <miguel@ximian.com>
13027 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13028 complete; Fixes #37521.
13030 * delegate.cs: Use Modifiers.TypeAttr to compute the
13031 TypeAttributes, instead of rolling our own. This makes the flags
13032 correct for the delegates.
13034 2003-06-28 Miguel de Icaza <miguel@ximian.com>
13036 * class.cs (Constructor.Define): Set the private flag for static
13037 constructors as well.
13039 * cs-parser.jay (statement_expression): Set the return value to
13040 null, to avoid a crash when we catch an error.
13042 2003-06-24 Miguel de Icaza <miguel@ximian.com>
13044 * cs-parser.jay: Applied patch from Jackson that adds support for
13045 extern and unsafe modifiers to destructor declarations.
13047 * expression.cs: Report error 21 if the user is trying to index a
13050 * driver.cs: Add an error message, suggested by the bug report.
13052 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13053 if we do not have a ": this ()" constructor initializer. Fixes 45149
13055 2003-06-14 Miguel de Icaza <miguel@ximian.com>
13057 * namespace.cs: Add some information to reduce FAQs.
13059 2003-06-13 Miguel de Icaza <miguel@ximian.com>
13061 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13062 underlying enumeration types. Fixes #43915.
13064 * expression.cs: Treat ushort/short as legal values to be used in
13065 bitwise operations.
13067 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13069 * delegate.cs: transfer custom attributes for paramenters from
13070 the delegate declaration to Invoke and BeginInvoke.
13072 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13074 * attribute.cs: handle custom marshalers and emit marshal info
13077 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
13079 * makefile.gnu: Added anonymous.cs to the compiler sources.
13081 2003-05-28 Miguel de Icaza <miguel@ximian.com>
13083 * iterators.cs: Change the name of the proxy class to include two
13086 * cs-parser.jay: Update grammar to include anonymous methods.
13088 * anonymous.cs: new file.
13090 2003-05-27 Miguel de Icaza <miguel@ximian.com>
13092 * class.cs (Field.Define): Add missing test for pointers and
13095 2003-05-27 Ravi Pratap <ravi@ximian.com>
13097 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13098 we use the stobj opcode.
13100 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13101 since it wasn't the correct fix.
13103 It still is puzzling that we are required to use stobj for IntPtr
13104 which seems to be a ValueType.
13106 2003-05-26 Miguel de Icaza <miguel@ximian.com>
13108 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13109 during regular simple name resolution. Now, the trick is that
13110 instead of returning for processing the simplename, we do a
13111 TypeManager.LookupType (ie, a rooted lookup as opposed to a
13112 contextual lookup type). If a match is found, return that, if
13113 not, return for further composition.
13115 This fixes long-standing 30485.
13117 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13118 using the address to initialize an object, do an Stobj instead of
13119 using the regular Stelem.
13121 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13122 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13123 Because if we are a BaseIndexerAccess that value will be true.
13126 * statement.cs (GotoCase.Resolve): Return after reporting an
13127 error, do not attempt to continue.
13129 * expression.cs (PointerArithmetic.Emit): If our operand is a
13130 long, convert our constants to match the operand before
13131 multiplying. Convert to I type before adding. Fixes 43670.
13133 2003-05-14 Ravi Pratap <ravi@ximian.com>
13135 * enum.cs (ImplicitConversionExists) : Rename to
13136 ImplicitEnumConversionExists to remove ambiguity.
13138 * ecore.cs (NullCast): New type of cast expression class which
13139 basically is very similar to EmptyCast with the difference being
13140 it still is a constant since it is used only to cast a null to
13142 (eg. (string) null)
13144 * convert.cs (ImplicitReferenceConversion): When casting a null
13145 literal, we return a NullCast.
13147 * literal.cs (NullLiteralTyped): Remove - I don't see why this
13148 should be around anymore.
13150 The renaming (reported was slightly wrong). Corrections:
13152 ConvertImplicitStandard -> ImplicitConversionStandard
13153 ConvertExplicitStandard -> ExplicitConversionStandard
13155 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13156 before passing them in !
13158 * convert.cs (ImplicitConversionStandard): When comparing for
13159 equal expr and target types, ensure that expr is not a
13162 In general, we must not be checking (expr_type ==
13163 target_type) in the top level conversion methods
13164 (ImplicitConversion, ExplicitConversion etc). This checking is
13165 done in the methods that they delegate to.
13167 2003-05-20 Miguel de Icaza <miguel@ximian.com>
13169 * convert.cs: Move Error_CannotConvertType,
13170 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13171 ImplicitNumericConversion, ImplicitConversionExists,
13172 ImplicitUserConversionExists, StandardConversionExists,
13173 FindMostEncompassedType, FindMostSpecificSource,
13174 FindMostSpecificTarget, ImplicitUserConversion,
13175 ExplicitUserConversion, GetConversionOperators,
13176 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13177 TryImplicitIntConversion, Error_CannotConvertImplicit,
13178 ConvertImplicitRequired, ConvertNumericExplicit,
13179 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13180 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13183 Perform the following renames:
13185 StandardConversionExists -> ImplicitStandardConversionExists
13186 ConvertImplicit -> ImplicitConversion
13187 ConvertImplicitStandard -> ImplicitStandardConversion
13188 TryImplicitIntConversion -> ImplicitIntConversion
13189 ConvertImplicitRequired -> ImplicitConversionRequired
13190 ConvertNumericExplicit -> ExplicitNumericConversion
13191 ConvertReferenceExplicit -> ExplicitReferenceConversion
13192 ConvertExplicit -> ExplicitConversion
13193 ConvertExplicitStandard -> ExplicitStandardConversion
13195 2003-05-19 Martin Baulig <martin@ximian.com>
13197 * statement.cs (TypeInfo.StructInfo): Made this type protected.
13198 (TypeInfo): Added support for structs having structs as fields.
13200 * ecore.cs (FieldExpr): Implement IVariable.
13201 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13202 VariableInfo for the field.
13204 2003-05-18 Martin Baulig <martin@ximian.com>
13206 * expression.cs (This.DoResolve): Report a CS0027 if we're
13207 emitting a field initializer.
13209 2003-05-18 Martin Baulig <martin@ximian.com>
13211 * expression.cs (This.ResolveBase): New public function.
13212 (This.DoResolve): Check for CS0188.
13214 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13217 * ecore.cs (MethodGroupExpr.DoResolve): Set the
13218 `instance_expression' to null if we don't have any non-static
13221 2003-05-18 Martin Baulig <martin@ximian.com>
13223 Reworked the way how local variables and parameters are handled by
13224 the flow analysis code.
13226 * statement.cs (TypeInfo, VariableMap): New public classes.
13227 (VariableInfo): New public class. This is now responsible for
13228 checking whether a variable has been assigned. It is used for
13229 parameters and local variables.
13230 (Block.EmitMeta): Take the InternalParameters as argument; compute
13231 the layout of the flow vectors here.
13232 (Block.LocalMap, Block.ParameterMap): New public properties.
13233 (FlowBranching): The .ctor doesn't get the InternalParameters
13234 anymore since Block.EmitMeta() now computes the layout of the flow
13236 (MyStructInfo): This class is now known as `StructInfo' and nested
13237 in `TypeInfo'; we don't access this directly anymore.
13239 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13240 property and removed IsAssigned(), IsFieldAssigned(),
13241 SetAssigned() and SetFieldAssigned(); we now call them on the
13242 VariableInfo so we don't need to duplicate this code everywhere.
13244 * expression.cs (ParameterReference): Added `Block block' argument
13246 (LocalVariableReference, ParameterReference, This): The new
13247 VariableInfo class is now responsible for all the definite
13250 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13251 IsParameterAssigned, SetParameterAssigned): Removed.
13253 2003-05-18 Martin Baulig <martin@ximian.com>
13255 * typemanager.cs (InitCoreTypes): Try calling
13256 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13257 the 3-args-version. Corlib now also needs our `void_type'.
13258 (GetMethod): Added overloaded version which takes an optional
13259 `bool report_errors' to allow lookups of optional methods.
13261 2003-05-12 Martin Baulig <martin@ximian.com>
13263 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13264 only used for locals and not for parameters.
13266 2003-05-12 Miguel de Icaza <miguel@ximian.com>
13268 * support.cs (InternalParameters.ParameterType): Return the
13269 ExternalType of the parameter.
13271 * parameter.cs (Parameter.ExternalType): drop the two arguments,
13274 2003-05-11 Miguel de Icaza <miguel@ximian.com>
13276 * class.cs (MethodData.Define): Do not set the `newslot' on
13277 interface members, if they are also flagged as "override".
13279 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13280 better code for ++i and i++. This only works for static fields
13281 and local variables.
13283 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13284 want to pull the DeclSpace out of the builder_to_declspace instead
13285 of the TypeBuilder (like in TypeContainer.FindMembers).
13287 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13288 instead of LookupTypeContainer. Fixes the crash on .NET for
13289 looking up interface members.
13291 * const.cs: Create our own emit context during the Definition
13292 stage, so that constants are evaluated in the proper context, when
13293 a recursive definition happens.
13295 2003-05-11 Martin Baulig <martin@ximian.com>
13297 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
13298 new block for a switch section.
13299 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13300 the adding/lookup in the switch block. Fixes #39828.
13302 2003-05-09 Miguel de Icaza <miguel@ximian.com>
13304 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13305 functionality: I needed to convert the data after I had performed
13306 the add/sub operation into the operands type size.
13308 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13309 pass the type for the box operation, otherwise the resulting
13310 object would have been of type object.
13312 (BoxedCast): Add constructor to specify the type to box as.
13314 2003-05-07 Miguel de Icaza <miguel@ximian.com>
13316 * iterators.cs: I was reusing the `count' variable inadvertently,
13317 take steps to not allow this to happen.
13319 2003-05-06 Miguel de Icaza <miguel@ximian.com>
13321 * attribute.cs (Attribute.Resolve): Params attributes are encoded
13322 by creating an array at the point where the params starts and
13323 putting all those arguments there, then adjusting the size of the
13326 2003-05-05 Miguel de Icaza <miguel@ximian.com>
13328 * expression.cs (New.AddressOf): Implement interface
13329 IMemoryLocation. This is used when the `new' operator is used in
13330 the context of an invocation to a method on a value type.
13332 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13335 * namespace.cs: Also check the using aliases here.
13337 * driver.cs: Move the test for using validity after the types have
13338 been entered, so we do a single pass that also includes the using
13341 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13342 in the regular case. CreateSiblingForFinally is doing extra
13345 * attribute.cs (GetAttributeArgumentExpression): Store the result
13346 on an out value, and use the return value to indicate failure
13347 instead of using null (which is a valid return for Constant.GetValue).
13349 * statement.cs: Perform the analysis flow for the increment
13350 portion after the statement, because this will be the real flow of
13351 execution. Fixes #42385
13353 * codegen.cs (EmitContext.EmitArgument,
13354 EmitContext.EmitStoreArgument): New helper functions when the
13355 RemapToProxy flag is set.
13357 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13360 Add support for remapping parameters.
13362 * iterators.cs: Propagate parameter values; Store parameter
13363 values in the proxy classes.
13365 2003-05-04 Miguel de Icaza <miguel@ximian.com>
13367 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
13368 need a proxy reference; I do not know what I was thinking
13370 * cs-parser.jay (constructor_initializer): catch another error,
13371 and display nice message.
13373 (field_declaration): catch void field declaration
13374 to flag a better error.
13376 * class.cs (MemberBase.CheckBase): Report an error instead of a
13377 warning if a new protected member is declared in a struct.
13378 (Field.Define): catch the error of readonly/volatile.
13380 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13382 (FieldExpr.AddressOf): ditto. Catch error where the address of a
13383 volatile variable is taken
13385 2003-05-02 Miguel de Icaza <miguel@ximian.com>
13387 * statement.cs (Fixed.Resolve): Report an error if we are not in
13390 2003-05-01 Miguel de Icaza <miguel@ximian.com>
13392 * typemanager.cs: reuse the code that handles type clashes for
13393 delegates and enumerations.
13395 * class.cs (Report28): Always report.
13397 * expression.cs (EncodeAsAttribute): Allow nulls here.
13399 2003-04-28 Miguel de Icaza <miguel@ximian.com>
13401 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13402 the functionality for testing whether an expression is valid for
13403 an attribute here. Also handle the case of arrays of elements
13406 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13407 encoding a linear array into an array of objects that are suitable
13408 to be passed to an CustomAttributeBuilder.
13410 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13412 * ecore.cs: (FieldExpr): Handle field remapping here.
13414 * iteratators.cs: Pass the instance variable (if the method is an
13415 instance method) to the constructors, so we can access the field
13416 variables on the class.
13418 TODO: Test this with structs. I think the THIS variable on
13419 structs might have to be a pointer, and not a refenrece
13421 2003-04-27 Miguel de Icaza <miguel@ximian.com>
13423 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13424 local variables to fields in a proxy class.
13426 * iterators.cs (PopulateProxy): Rename our internal fields to
13428 Create a <THIS> field if we are an instance method, so we can
13429 reference our parent container variables.
13430 (MapVariable): Called back from the EmitContext code to enter a
13431 new variable to field mapping into the proxy class (we just create
13435 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13436 for using the remapped locals to fields.
13438 I placed the code here, because that gives the same semantics to
13439 local variables, and only changes the Emit code.
13441 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13442 statements inside iterators.
13443 (VariableInfo): Add a FieldBuilder for the cases when we are
13444 remapping local variables to fields in a proxy class
13446 * ecore.cs (SimpleNameResolve): Avoid testing two times for
13447 current_block != null.
13449 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13450 not cope with strings, as it has been moved to the
13451 TableSwitchEmit. Fixed bug in switch generation.
13453 * expression.cs (New.DoResolve): Provide more context for the user
13454 when reporting an error.
13456 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13459 * expression.cs (MemberAccess.DoResolve): When we get a type back,
13460 check the permissions for it. Note than in a type-resolution
13461 context the check was already present in DeclSpace.ResolveType,
13462 but was missing from the MemberAccess.
13464 (ArrayCreation.CheckIndices): warn if the user has
13465 more nested levels of expressions, but there are no more
13466 dimensions specified. Avoids crash on bug 41906.
13468 2003-04-26 Miguel de Icaza <miguel@ximian.com>
13470 * statement.cs (Block): replace Implicit bool, for a generic
13472 New flag: `Unchecked'. This is used during the EmitMeta phase
13473 (which is out-of-line with the regular Resolve/Emit process for a
13474 statement, as this is done ahead of time, but still gets a chance
13475 to call constant resolve).
13477 (Block.Flags): new enum for adding a new flag.
13479 (Block.EmitMeta): track the state of unchecked.
13481 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13482 to enable constant resolution to work there as well.
13484 2003-04-22 Miguel de Icaza <miguel@ximian.com>
13486 * typemanager.cs (ienumerable_type): Also look up
13487 System.Collections.IEnumerable.
13489 2003-04-21 Miguel de Icaza <miguel@ximian.com>
13491 TODO: Test more than one conditional per method.
13493 * class.cs (Indexer.Define): Report the location where the user is
13494 referencing the unsupported feature.
13496 (MethodData): Overload the use of `conditionals' to
13497 minimize the creation of needless ArrayLists. This saves roughly
13498 212kb on my machine.
13500 (Method): Implement the new IIteratorContainer interface.
13501 (Method.SetYields): Implement the method by setting the ModFlags
13502 to contain METHOD_YIELDS.
13504 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13505 which just got set to null.
13507 * iterators.cs: New file.
13509 (Yield, YieldBreak): New statements.
13511 * statement.cs (Return.Resolve): Flag an error if we are used in
13512 an iterator method.
13514 * codegen.cs (InIterator): New flag set if the code is being
13515 compiled in an iterator method.
13517 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
13518 internal modifier, and we just use it to avoid adding extra
13519 fields, as this is seldom used.
13521 * cs-parser.jay: Add yield_statement (yield and yield break).
13523 * driver.cs: New flag -v2 to turn on version 2 features.
13525 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13526 hashtable when v2 is enabled.
13528 2003-04-20 Miguel de Icaza <miguel@ximian.com>
13530 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13531 there is already a namespace defined with this name.
13533 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13534 people upgraded their corlibs.
13536 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13537 always use fully qualified types, no need to use the compiler
13540 (TypeManager.IsNamespace): Use binarysearch.
13542 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13543 AddDelegate): I did not quite use the new IsValid API properly: I
13544 have to pass the short-name and the fullname. I was passing only
13545 the basename instead of the fullname sometimes.
13547 (TypeContainer.DefineType): call NamespaceClash.
13549 * interface.cs (Interface.DefineType): use NamespaceClash before
13552 * delegate.cs (Delegate.DefineType): use NamespaceClash before
13555 * enum.cs: (Enum.DefineType): use NamespaceClash before
13558 * typemanager.cs (: 3-line patch that gives us some tasty 11%
13559 speed increase. First, use the negative_hits cache when we get a
13560 negative. Second, add the type with its full original name
13561 instead of the new . and + encoded name (reflection uses + to
13562 separate type from a nested type). Use LookupTypeReflection
13563 directly which bypasses the type->name hashtable (that we already
13564 know does not contain the type.
13566 * decl.cs (DeclSpace.ResolveTypeExpr): track the
13567 location/container type.
13569 * driver.cs: When passing utf8, use directly the UTF8Encoding.
13571 2003-04-19 Miguel de Icaza <miguel@ximian.com>
13573 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13575 * delegate.cs (NewDelegate.Resolve): Test whether an instance
13576 method is being referenced in the method group from a static
13577 context, and report error 120 if so.
13579 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13582 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13583 is created, we create the A namespace).
13585 * cs-parser.jay: A namespace also introduces a DeclarationFound.
13588 2003-04-18 Miguel de Icaza <miguel@ximian.com>
13590 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13591 invocation to ModuleBuilder.GetType with the same values will
13592 return a new type instance, so we need to cache its return
13595 * expression.cs (Binary.ResolveOperator): Only allow the compare
13596 operators on enums if they are of the same type.
13598 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13599 types of ValueType on their own case. Before we were giving them
13600 the same treatment as objects.
13602 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13603 fullname. Short name is used to compare against container name.
13604 Fullname is used to check against defined namespace names.
13606 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13607 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13609 (Method.CheckBase): Call parent.
13610 (MemberBase.CheckBase): Check for protected members on sealed
13612 (PropertyBase.CheckBase): Call parent.
13613 (Field.Define): Call parent.
13615 * report.cs: Negative error codes are now mapped to 8000 - code,
13616 so that the display is render more nicely.
13618 * typemanager.cs: Do not use try/catch, instead report a regular
13621 (GetPointerType, GetReferenceType): These methods provide
13622 mechanisms to obtain the T* and T& from a T. We had the code
13623 previously scattered around the code base, and it also used
13624 TypeManager.LookupType that would go through plenty of caches.
13625 This one goes directly to the type source.
13627 In some places we did the Type.GetType followed by
13628 ModuleBuilder.GetType, but not in others, so this unifies the
13629 processing as well.
13631 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13632 statements now that we have namespace information.
13634 * typemanager.cs (IsNamespace): New method, returns whether the
13635 string presented is a namespace or not.
13637 (ComputeNamespaces): New public entry point, computes the list of
13638 available namespaces, using the GetNamespaces API call in Mono, or
13639 the slower version in MS.NET.
13641 Now before we start the semantic analysis phase, we have a
13642 complete list of namespaces including everything that the user has
13645 Deleted old code to cache namespaces in .nsc files.
13647 2003-04-17 Miguel de Icaza <miguel@ximian.com>
13649 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13650 class/struct location definition Location for the implicit
13651 constructor location.
13653 (Operator.Define): Use the location of the operator for the
13654 implicit Method definition.
13656 (Constructor.Emit): use the constructor location for the implicit
13657 base initializer constructor.
13659 * ecore.cs: Remove ITypeExpression. This interface is now gone,
13660 and the Expression class now contains two new methods:
13662 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
13663 isolate type lookup from the rest of the resolution process.
13665 Since we use Expressions to hold type definitions due to the way
13666 we parse the input we have historically overloaded Resolve to
13667 perform the Type lookups if a special flag is passed. Now this is
13668 eliminated and two methods take their place.
13670 The differences in the two methods between xStep and xTerminal is
13671 that xStep is involved in our current lookup system that uses
13672 SimpleNames to compose a name, while xTerminal is used just to
13673 catch the case where the simplename lookup failed.
13675 2003-04-16 Miguel de Icaza <miguel@ximian.com>
13677 * expression.cs (ResolveMemberAccess): Remove redundant code.
13678 TypeExpr expressions are always born fully resolved.
13680 * interface.cs (PopulateMethod): Do not lookup the types twice.
13681 We were doing it once during SemanticAnalysis and once during
13684 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13685 in local variable type definitions, were being returned as a
13686 SimpleName (we decomposed everything into a string), that is
13687 because primary_expression was being used instead of a type in the
13688 grammar (reduce/reduce conflicts).
13690 The part that was wrong is that we converted the expression into a
13691 string (an oversimplification in one hand, compounded with primary
13692 expressions doing string concatenation).
13698 Would return "A.B.C[]" as a SimpleName. This stopped things like
13699 using clauses from working on this particular context. And a type
13700 was being matched directly against "A.B.C[]".
13702 We now use the correct approach, and allow for ComposedCast to be
13703 part of the unary expression. So the "A.B.C []" become a composed
13704 cast of "A.B.C" (as a nested group of MemberAccess with a
13705 SimpleName at the end) plus the rank composition "[]".
13709 2003-04-10 Miguel de Icaza <miguel@ximian.com>
13711 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13712 for the access level checking.
13714 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
13715 `TypeContainer container', because I kept getting confused when I
13716 was debugging this code.
13718 * expression.cs (Indexers): Instead of tracking getters/setters,
13719 we now track them in parallel. We create one arraylist less, but
13720 most importantly it is possible now for the LValue code to find a
13721 matching get for a set.
13723 (IndexerAccess.DoResolveLValue): Update the code.
13724 GetIndexersForType has been modified already to extract all the
13725 indexers from a type. The code assumed it did not.
13727 Also make the code set the correct return type for the indexer.
13728 This was fixed a long time ago for properties, but was missing for
13729 indexers. It used to be void_type.
13731 (Binary.Emit): Test first for doubles instead of
13732 floats, as they are more common.
13734 (Binary.EmitBranchable): Use the .un version of the branch opcodes
13735 when dealing with floats and the <=, >= operators. This fixes bug
13738 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13739 to load the array value by emitting a load on the foreach variable
13740 type. This was incorrect.
13742 We now emit the code to load an element using the the array
13743 variable type, and then we emit the conversion operator.
13747 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
13749 * attribute.cs: Avoid allocation of ArrayLists in the common case.
13751 2003-04-09 Miguel de Icaza <miguel@ximian.com>
13753 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13754 test for protection before we test for signatures.
13756 (MethodSignature.ToString): implement.
13758 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13759 to the case where we reduced into a LongConstant.
13761 * decl.cs (CheckAccessLevel): If the type is an array, we can not
13762 depend on whether the information is acurrate, because the
13763 Microsoft runtime will always claim that the array type is public,
13764 regardless of the real state.
13766 If the type is a pointer, another problem happens: the type is
13767 reported as non-public in Microsoft.
13769 In both cases we have to call CheckAccessLevel recursively with
13770 the underlying type as the argument to be tested.
13772 2003-04-08 Miguel de Icaza <miguel@ximian.com>
13774 * assign.cs (Assign.Emit): If we are dealing with a compound
13775 assignment expression, we should use the code path that stores the
13776 intermediate result in a temporary value. This fixes #40903.
13778 *expression.cs (Indirection.ToString): Provide ToString method for
13781 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
13783 * class.cs: Null out fields holding references to Block objects so
13784 they can be garbage collected.
13786 * expression.cs (OverloadResolve): Remove unused local.
13788 2003-04-07 Martin Baulig <martin@ximian.com>
13790 * codegen.cs (EmitContext.CurrentFile): New public field.
13791 (EmitContext.Mark): Use the CurrentFile to check whether the
13792 location is in the correct file.
13793 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13795 2003-04-07 Martin Baulig <martin@ximian.com>
13797 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13799 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13800 location. [FIXME: The location argument which gets passed to this
13801 method is sometimes wrong!]
13803 2003-04-07 Nick Drochak <ndrochak@gol.com>
13805 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13807 2003-04-07 Miguel de Icaza <miguel@ximian.com>
13809 * expression.cs (Indirection.EmitAssign): We were using the
13810 temporary, but returning immediately instead of continuing the
13813 2003-04-06 Martin Baulig <martin@ximian.com>
13815 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13816 if it's a nested child, but also deriving from the outer class.
13819 * typemanager.cs (IsNestedChildOf): Make this work if it's a
13820 nested child, but also deriving from the outer class. See
13822 (FilterWithClosure): We may access private members of the outer
13823 class if we're a nested child and deriving from the outer class.
13824 (RealMemberLookup): Only set `closure_private_ok' if the
13825 `original_bf' contained BindingFlags.NonPublic.
13827 2003-04-05 Martin Baulig <martin@ximian.com>
13829 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
13830 probe if its a type parameter, and if so, flag an error.
13832 * decl.cs: Move here the SetParameterInfo code from class.cs.
13833 Handle IsGeneric here.
13835 Handle a variety of errors in the parameter info definition.
13837 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
13838 type parameters here.
13840 * cs-parser.jay (class_declaration): report errors for parameters
13843 2003-01-21 Miguel de Icaza <miguel@ximian.com>
13845 * generic.cs: New file, contains support code for generics.
13847 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
13848 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
13850 Update parser for the above removals.
13852 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
13853 now taken care of in the parser.
13855 2003-04-02 Miguel de Icaza <miguel@ximian.com>
13857 * class.cs (Event.Define): Do not allow abstract events to have
13860 2003-04-01 Miguel de Icaza <miguel@ximian.com>
13862 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13863 block in event declarations.
13865 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13866 value type, get its address.
13868 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13869 leaving a class on the stack instead of a boolean value (int
13870 0/1). Change the code so we compare against null, and then the
13871 result against zero.
13873 * class.cs (TypeContainer.GetClassBases): We were checking for the
13874 parent class being sealed too late.
13876 * expression.cs (Binary.Emit): For <= and >= when dealing with
13877 floating point values, use cgt.un and clt.un instead of cgt and
13880 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
13882 * statement.cs: Apply the same optimization as MS: skip the
13883 GetEnumerator returning an IEnumerator, and use the one returning a
13884 CharEnumerator instead. This allows us to avoid the try-finally block
13887 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
13889 * cs-parser.jay: Attributes cannot be applied to
13890 namespaces. Fixes #40473
13892 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13895 (Add*): check if the name is valid using the full name for constants,
13896 fields, properties and events.
13898 2003-03-28 Miguel de Icaza <miguel@ximian.com>
13900 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13901 char constants to be part of the enumeration.
13903 * expression.cs (Conditional.DoResolve): Add support for operator
13904 true. Implements the missing functionality from 14.12
13906 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13907 operator true/false as required by the spec.
13909 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13910 implicit conversion to boolean.
13912 * statement.cs (Statement.ResolveBoolean): A boolean expression is
13913 also one where the type implements `operator true'.
13915 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13916 get an expression that will invoke operator true based on an
13919 (GetConversionOperators): Removed the hack that called op_True
13922 (Expression.ResolveBoolean): Move this from Statement.
13924 2003-03-17 Miguel de Icaza <miguel@ximian.com>
13926 * ecore.cs (FieldExpr): do not allow initialization of initonly
13927 fields on derived classes
13929 2003-03-13 Martin Baulig <martin@ximian.com>
13931 * statement.cs (Block.Emit): Call ig.BeginScope() and
13932 ig.EndScope() when compiling with debugging info; call
13933 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13935 2003-03-08 Miguel de Icaza <miguel@ximian.com>
13937 * expression.cs (Indexers): Do not construct immediately, allow
13938 for new members to be appended as we go. Fixes 38143
13940 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13942 * expression.cs: save/restore context when resolving an unchecked
13945 2003-03-05 Miguel de Icaza <miguel@ximian.com>
13947 * cfold.cs: Catch division by zero in modulus operator during
13950 2003-03-03 Miguel de Icaza <miguel@ximian.com>
13952 * interface.cs (Interface.DefineMembers): Avoid defining members
13955 2003-02-27 Miguel de Icaza <miguel@ximian.com>
13957 * driver.cs: handle the +/- options for -noconfig
13959 * statement.cs (Unckeched.Resolve): Also track the state of
13960 unchecked in the Resolve phase.
13962 2003-02-27 Martin Baulig <martin@ximian.com>
13964 * ecore.cs (Expression.MemberLookup): Don't create a
13965 MethodGroupExpr for something which is not a method. Fixes #38291.
13967 2003-02-25 Miguel de Icaza <miguel@ximian.com>
13969 * class.cs (MemberBase.CheckParameters): Also check that the type
13970 is unmanaged if it is a pointer.
13972 * expression.cs (SizeOf.Resolve): Add location information.
13974 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13975 a managed type is declared.
13977 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13978 parameter modifiers as well. Fixes bug 38606
13980 * class.cs: Very sad. Am backing out the speed up changes
13981 introduced by the ArrayList -> Array in the TypeContainer, as they
13982 were not actually that much faster, and introduced a bug (no error
13983 reports on duplicated methods).
13985 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13986 source first, this will guarantee that we have a valid expression
13987 before calling in lower levels functions that will require a
13988 resolved object. Then use this original_source in the
13989 target.ResolveLValue instead of the original source that was
13992 Another change. Use target.Resolve instead of LValueResolve.
13993 Although we are resolving for LValues, we will let the Assign code
13994 take care of that (it will be called again from Resolve). This
13995 basically allows code like this:
13997 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13998 class Y { void A (X x) { x [0] += o; }
14000 The problem was that the indexer was trying to resolve for
14001 set_Item (idx, object o) and never finding one. The real set_Item
14002 was set_Item (idx, X). By delaying the process we get the right
14007 2003-02-23 Martin Baulig <martin@ximian.com>
14009 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14010 while calling DoEmit ().
14012 * codegen.cs (EmitContext.Mark): Don't mark locations in other
14013 source files; if you use the #line directive inside a method, the
14014 compiler stops emitting line numbers for the debugger until it
14015 reaches the end of the method or another #line directive which
14016 restores the original file.
14018 2003-02-23 Martin Baulig <martin@ximian.com>
14020 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14022 2003-02-23 Martin Baulig <martin@ximian.com>
14024 * statement.cs (Block.AddChildVariableNames): We need to call this
14025 recursively, not just for our immediate children.
14027 2003-02-23 Martin Baulig <martin@ximian.com>
14029 * class.cs (Event.Define): Always make the field private, like csc does.
14031 * typemanager.cs (TypeManager.RealMemberLookup): Make events
14032 actually work, fixes bug #37521.
14034 2003-02-23 Miguel de Icaza <miguel@ximian.com>
14036 * delegate.cs: When creating the various temporary "Parameters"
14037 classes, make sure that we call the ComputeAndDefineParameterTypes
14038 on those new parameters (just like we do with the formal ones), to
14039 allow them to be resolved in the context of the DeclSpace.
14041 This fixes the bug that Dick observed in Bugzilla #38530.
14043 2003-02-22 Miguel de Icaza <miguel@ximian.com>
14045 * expression.cs (ResolveMemberAccess): When resolving a constant,
14046 do not attempt to pull a constant if the value was not able to
14047 generate a valid constant.
14049 * const.cs (LookupConstantValue): Do not report more errors than required.
14051 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14053 * expression.cs: fixes bug #38328.
14055 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14057 * class.cs: Changed all the various members that can be part of a
14058 class from being an ArrayList to be an Array of the right type.
14059 During the DefineType type_list, interface_list, delegate_list and
14060 enum_list are turned into types, interfaces, delegates and enums
14063 And during the member population, indexer_list, event_list,
14064 constant_list, field_list, instance_constructor_list, method_list,
14065 operator_list and property_list are turned into their real arrays.
14067 Although we could probably perform this operation earlier, for
14068 good error reporting we need to keep the lists and remove the
14069 lists for longer than required.
14071 This optimization was triggered by Paolo profiling the compiler
14072 speed on the output of `gen-sample-program.pl' perl script.
14074 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14075 not crash in methods like MemberLookupFailed that use this field.
14077 This problem arises when the compiler fails to resolve a type
14078 during interface type definition for example.
14080 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14082 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14083 inherit from System.Object, so we have to stop at null, not only
14084 when reaching System.Object.
14086 2003-02-17 Miguel de Icaza <miguel@ximian.com>
14088 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14089 DeclaredOnly because the parent indexer might have had a different
14090 name, but did not loop until the top of the hierarchy was reached.
14092 The problem this one fixes is 35492: when a class implemented an
14093 indexer from an interface, we were getting the interface method
14094 (which was abstract) and we were flagging an error (can not invoke
14097 This also keeps bug 33089 functioning, and test-148 functioning.
14099 * typemanager.cs (IsSpecialMethod): The correct way of figuring
14100 out if a method is special is to see if it is declared in a
14101 property or event, or whether it is one of the predefined operator
14102 names. This should fix correctly #36804.
14104 2003-02-15 Miguel de Icaza <miguel@ximian.com>
14106 The goal here is to remove the dependency on EmptyCast.Peel ().
14107 Killing it completely.
14109 The problem is that currently in a number of places where
14110 constants are expected, we have to "probe" for an EmptyCast, and
14111 Peel, which is not the correct thing to do, as this will be
14112 repetitive and will likely lead to errors.
14114 The idea is to remove any EmptyCasts that are used in casts that
14115 can be reduced to constants, so we only have to cope with
14118 This bug hunt was triggered by Bug 37363 and the desire to remove
14119 the duplicate pattern where we were "peeling" emptycasts to check
14120 whether they were constants. Now constants will always be
14123 * ecore.cs: Use an enumconstant here instead of wrapping with
14126 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14127 throwing me off. By handling this we can get rid of a few hacks.
14129 * statement.cs (Switch): Removed Peel() code.
14131 2003-02-14 Miguel de Icaza <miguel@ximian.com>
14133 * class.cs: Location information for error 508
14135 * expression.cs (New.DoResolve): Add a guard against double
14136 resolution of an expression.
14138 The New DoResolve might be called twice when initializing field
14139 expressions (see EmitFieldInitializers, the call to
14140 GetInitializerExpression will perform a resolve on the expression,
14141 and later the assign will trigger another resolution
14143 This leads to bugs (#37014)
14145 * delegate.cs: The signature for EndInvoke should contain any ref
14146 or out parameters as well. We were not doing this in the past.
14148 * class.cs (Field.Define): Do not overwrite the type definition
14149 inside the `volatile' group. Turns out that volatile enumerations
14150 were changing the type here to perform a validity test, which
14153 2003-02-12 Miguel de Icaza <miguel@ximian.com>
14155 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14156 and structs, we do not want to load the instance variable
14158 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14159 enum_type has to be handled like an object reference (implicit
14160 conversions exists from this to object), but the regular IsClass
14161 and IsValueType tests will never return true for this one.
14163 Also we use TypeManager.IsValueType instead of type.IsValueType,
14164 just for consistency with the rest of the code (this is only
14165 needed if we ever use the construct exposed by test-180.cs inside
14166 corlib, which we dont today).
14168 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
14170 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14173 2003-02-09 Martin Baulig <martin@ximian.com>
14175 * namespace.cs (Namespace..ctor): Added SourceFile argument.
14176 (Namespace.DefineNamespaces): New static public method; this is
14177 called when we're compiling with debugging to add all namespaces
14178 to the symbol file.
14180 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14181 pass it to the Namespace's .ctor.
14183 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14184 and MethodBase arguments; pass the namespace ID to the symwriter;
14185 pass the MethodBase instead of the token to the symwriter.
14186 (SymbolWriter.DefineNamespace): New method to add a namespace to
14189 2003-02-09 Martin Baulig <martin@ximian.com>
14191 * symbolwriter.cs: New file. This is a wrapper around
14192 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
14193 methods here in near future.
14195 2003-02-09 Martin Baulig <martin@ximian.com>
14197 * codegen.cs (EmitContext.Mark): Just pass the arguments to
14198 ILGenerator.MarkSequencePoint() which are actually used by the
14201 2003-02-09 Martin Baulig <martin@ximian.com>
14203 * location.cs (SourceFile): New public sealed class. This
14204 contains the name and an index which is used in the location's token.
14205 (Location): Reserve an appropriate number of bits in the token for
14206 the source file instead of walking over that list, this gives us a
14207 really huge performance improvement when compiling with debugging.
14209 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14210 `SourceFile' argument instead of a string.
14211 (Driver.ProcessFile): Add all the files via Location.AddFile(),
14212 but don't parse/tokenize here, we need to generate the list of all
14213 source files before we do that.
14214 (Driver.ProcessFiles): New static function. Parses/tokenizes all
14217 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14218 instead of a string.
14220 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14223 2003-02-09 Martin Baulig <martin@ximian.com>
14225 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14226 filename on `#line default'.
14228 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14230 * statement.cs: don't clear the pinned var when the fixed statement
14231 returns from the method (fixes bug#37752).
14233 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14235 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
14238 2003-02-07 Martin Baulig <martin@ximian.com>
14240 * driver.cs: Removed the `--debug-args' command line argument.
14242 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14243 automatically by the AsssemblyBuilder.
14244 (CodeGen.InitializeSymbolWriter): We don't need to call any
14245 initialization function on the symbol writer anymore. This method
14246 doesn't take any arguments.
14248 2003-02-03 Miguel de Icaza <miguel@ximian.com>
14250 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14251 from referenced assemblies as well.
14253 2003-02-02 Martin Baulig <martin@ximian.com>
14255 * class.cs (MethodData.Emit): Generate debugging info for external methods.
14257 2003-02-02 Martin Baulig <martin@ximian.com>
14259 * class.cs (Constructor.Emit): Open the symbol writer before
14260 emitting the constructor initializer.
14261 (ConstructorInitializer.Emit): Call ec.Mark() to allow
14262 single-stepping through constructor initializers.
14264 2003-01-30 Miguel de Icaza <miguel@ximian.com>
14266 * class.cs: Handle error 549: do not allow virtual methods in
14269 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14271 * decl.cs: Check access levels when resolving types
14273 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14275 * statement.cs: Add parameters and locals set in catch blocks that might
14276 return to set vector
14278 2003-01-29 Miguel de Icaza <miguel@ximian.com>
14280 * class.cs (Operator): Set the SpecialName flags for operators.
14282 * expression.cs (Invocation.DoResolve): Only block calls to
14283 accessors and operators on SpecialName methods.
14285 (Cast.TryReduce): Handle conversions from char constants.
14288 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14290 * statement.cs: small memory and time optimization in FlowBranching.
14292 2003-01-28 Pedro Mart <yoros@wanadoo.es>
14294 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14295 problem that the last fix but in the other sid (Set).
14297 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14298 access when there is no indexer in the hierarchy.
14300 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14302 * class.cs: Combine some if statements.
14304 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14306 * driver.cs: fixed bug #37187.
14308 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
14310 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14311 any indexer, it's needed to build a list with all the indexers in the
14312 hierarchy (AllGetters), else we have problems. Fixes #35653.
14314 2003-01-23 Miguel de Icaza <miguel@ximian.com>
14316 * class.cs (MethodData.Define): It is wrong for an interface
14317 implementation to be static in both cases: explicit and implicit.
14318 We were only handling this in one case.
14320 Improve the if situation there to not have negations.
14322 * class.cs (Field.Define): Turns out that we do not need to check
14323 the unsafe bit on field definition, only on usage. Remove the test.
14325 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14327 * driver.cs: use assembly.Location instead of Codebase (the latest
14328 patch made mcs fail when using MS assemblies).
14330 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
14332 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14333 get the path to *corlib.dll.
14335 2003-01-21 Nick Drochak <ndrochak@gol.com>
14339 * typemanager.cs: Remove compiler warnings
14341 2003-01-20 Duncan Mak <duncan@ximian.com>
14343 * AssemblyInfo.cs: Bump the version number to 0.19.
14345 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14347 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14349 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
14351 * class.cs (Constructor::Emit): Emit debugging info for constructors.
14353 2003-01-17 Miguel de Icaza <miguel@ximian.com>
14355 * cs-parser.jay: Small fix: we were not comparing the constructor
14356 name correctly. Thanks to Zoltan for the initial pointer.
14358 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14360 * cs-tokenizer.cs: Set file name when specified with #line
14362 2003-01-15 Miguel de Icaza <miguel@ximian.com>
14364 * cs-parser.jay: Only perform the constructor checks here if we
14365 are named like the class; This will help provider a better
14366 error. The constructor path is taken when a type definition is
14367 not found, but most likely the user forgot to add the type, so
14368 report that rather than the constructor error.
14370 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14372 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14375 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14377 * cs-parser.jay: Add cleanup call.
14379 2003-01-13 Duncan Mak <duncan@ximian.com>
14381 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14382 consistent with other methods.
14384 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14386 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14388 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14390 * attribute.cs: only set GuidAttr to true when we have a
14393 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14397 * typemanager.cs: fixes to allow mcs compile corlib with the new
14398 Type.IsSubclassOf fix.
14400 2003-01-08 Miguel de Icaza <miguel@ximian.com>
14402 * expression.cs (LocalVariableReference.DoResolve): Classify a
14403 constant as a value, not as a variable. Also, set the type for
14406 * cs-parser.jay (fixed_statement): take a type instead of a
14407 pointer_type, so we can produce a better error message later.
14409 * statement.cs (Fixed.Resolve): Flag types that are not pointers
14412 (For.DoEmit): Make inifinite loops have a
14413 non-conditional branch back.
14415 (Fixed.DoEmit): First populate the pinned variables, then emit the
14416 statement, then clear the variables. Before I was emitting the
14417 code once for each fixed piece.
14420 2003-01-08 Martin Baulig <martin@ximian.com>
14422 * statement.cs (FlowBranching.MergeChild): A break in a
14423 SWITCH_SECTION does not leave a loop. Fixes #36155.
14425 2003-01-08 Martin Baulig <martin@ximian.com>
14427 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14428 lives in the same number space than `param_map'. Fixes #36154.
14430 2003-01-07 Miguel de Icaza <miguel@ximian.com>
14432 * cs-parser.jay (constructor_declaration): Set the
14433 Constructor.ModFlags before probing for it. This makes the
14434 compiler report 514, 515 and 132 (the code was there, but got
14437 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14438 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14439 (GotoCase.Resolve): Set `Returns' to ALWAYS.
14441 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14443 * enum.cs: create the enum static fields using the enum type.
14445 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14447 * class.cs: don't try to create the ParamBuilder for the return
14448 type if it's not needed (and handle it breaking for the ms runtime
14451 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14453 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14455 2002-12-29 Miguel de Icaza <miguel@ximian.com>
14457 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14458 the command. This showed up while compiling the JANET source
14459 code, which used \r as its only newline separator.
14461 2002-12-28 Miguel de Icaza <miguel@ximian.com>
14463 * class.cs (Method.Define): If we are an operator (because it
14464 reuses our code), then set the SpecialName and HideBySig. #36128
14466 2002-12-22 Miguel de Icaza <miguel@ximian.com>
14468 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14469 exception, report error 120 `object reference required'.
14471 * driver.cs: Add --pause option, used during to measure the size
14472 of the process as it goes with --timestamp.
14474 * expression.cs (Invocation.DoResolve): Do not allow methods with
14475 SpecialName to be invoked.
14477 2002-12-21 Miguel de Icaza <miguel@ximian.com>
14479 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14480 number before adding it.
14482 2002-12-21 Ravi Pratap <ravi@ximian.com>
14484 * ecore.cs (StandardImplicitConversion): When in an unsafe
14485 context, we allow conversion between void * to any other pointer
14486 type. This fixes bug #35973.
14488 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14490 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14491 is not thrown when extensionless outputs are used
14493 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14495 * rootcontext.cs: fixed compilation of corlib.
14497 2002-12-19 Miguel de Icaza <miguel@ximian.com>
14499 * attribute.cs (Attributes.Contains): Add new method.
14501 * class.cs (MethodCore.LabelParameters): if the parameter is an
14502 `out' parameter, check that no attribute `[In]' has been passed.
14504 * enum.cs: Handle the `value__' name in an enumeration.
14506 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
14508 * decl.cs: Added special case to allow overrides on "protected
14511 2002-12-18 Ravi Pratap <ravi@ximian.com>
14513 * attribute.cs (Attributes.AddAttributeSection): Rename to this
14514 since it makes much more sense.
14516 (Attributes.ctor): Don't require a Location parameter.
14518 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14520 * attribute.cs (ApplyAttributes): Remove extra Location parameters
14521 since we already have that information per attribute.
14523 * everywhere : make appropriate changes.
14525 * class.cs (LabelParameters): Write the code which actually
14526 applies attributes to the return type. We can't do this on the MS
14527 .NET runtime so we flag a warning in the case an exception is
14530 2002-12-18 Miguel de Icaza <miguel@ximian.com>
14532 * const.cs: Handle implicit null conversions here too.
14534 2002-12-17 Ravi Pratap <ravi@ximian.com>
14536 * class.cs (MethodCore.LabelParameters): Remove the extra
14537 Type [] parameter since it is completely unnecessary. Instead
14538 pass in the method's attributes so that we can extract
14539 the "return" attribute.
14541 2002-12-17 Miguel de Icaza <miguel@ximian.com>
14543 * cs-parser.jay (parse): Use Report.Error to flag errors instead
14544 of ignoring it and letting the compile continue.
14546 * typemanager.cs (ChangeType): use an extra argument to return an
14547 error condition instead of throwing an exception.
14549 2002-12-15 Miguel de Icaza <miguel@ximian.com>
14551 * expression.cs (Unary.TryReduce): mimic the code for the regular
14552 code path. Perform an implicit cast in the cases where we can
14553 implicitly convert to one of the integral types, and then reduce
14554 based on that constant. This fixes bug #35483.
14556 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14558 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14560 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14562 * namespace.cs: fixed bug #35489.
14564 2002-12-12 Miguel de Icaza <miguel@ximian.com>
14566 * class.cs: Remove some dead code.
14568 * cs-parser.jay: Estimate the number of methods needed
14569 (RootContext.MethodCount);
14571 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14572 numbers instead of StringBuilders.
14574 * support.cs (PtrHashtable): Add constructor with initial size;
14575 We can now reduce reallocations of the method table.
14577 2002-12-10 Ravi Pratap <ravi@ximian.com>
14579 * attribute.cs (ApplyAttributes): Keep track of the emitted
14580 attributes on a per-target basis. This fixes bug #35413.
14582 2002-12-10 Miguel de Icaza <miguel@ximian.com>
14584 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14585 default to the Windows 1252 encoding.
14587 (UnixParseOption): Support version, thanks to Alp for the missing
14590 * AssemblyInfo.cs: Add nice assembly information.
14592 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14595 * cs-parser.jay: Allow a trailing comma before the close bracked
14596 in the attribute_section production.
14598 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14599 address of the instance was being taken, I will take this out,
14600 because we take the address of the object immediately here.
14602 2002-12-09 Ravi Pratap <ravi@ximian.com>
14604 * typemanager.cs (AreMultipleAllowed): Take care of the most
14605 obvious case where attribute type is not in the current assembly -
14608 2002-12-08 Miguel de Icaza <miguel@ximian.com>
14610 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14611 definitions, instead of doing that afterwards.
14613 Also we use a nice little hack, depending on the constructor, we
14614 know if we are a "composed" name or a simple name. Hence, we
14615 avoid the IndexOf test, and we avoid
14617 * codegen.cs: Add code to assist in a bug reporter to track down
14618 the source of a compiler crash.
14620 2002-12-07 Ravi Pratap <ravi@ximian.com>
14622 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14623 types have been emitted for a given element and flag an error
14624 if something which does not have AllowMultiple set is used more
14627 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14628 attribute types and their corresponding AllowMultiple properties
14630 (AreMultipleAllowed): Check the property for a given type.
14632 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14633 property in the case we have a TypeContainer.
14635 (Attributes.AddAttribute): Detect duplicates and just skip on
14636 adding them. This trivial fix catches a pretty gross error in our
14637 attribute emission - global attributes were being emitted twice!
14639 Bugzilla bug #33187 is now fixed.
14641 2002-12-06 Miguel de Icaza <miguel@ximian.com>
14643 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14644 instead of pp_and).
14646 * expression.cs (Binary.ResolveOperator): I can only use the
14647 Concat (string, string, string) and Concat (string, string,
14648 string, string) if the child is actually a concatenation of
14651 2002-12-04 Miguel de Icaza <miguel@ximian.com>
14653 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14654 context where we need a 2-character lookahead.
14656 * pending.cs (PendingImplementation): Rework so we can keep track
14657 of interface types all the time, and flag those which were
14658 implemented by parents as optional.
14660 2002-12-03 Miguel de Icaza <miguel@ximian.com>
14662 * expression.cs (Binary.ResolveOperator): Use
14663 String.Concat(string,string,string) or
14664 String.Concat(string,string,string,string) when possible.
14666 * typemanager: More helper methods.
14669 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14671 * pending.cs: remove the bogus return from GetMissingInterfaces()
14672 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14674 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14676 * namespace.cs: avoid duplicated 'using xxx' being added to
14677 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14678 when we get more than one 'using' statement for the same namespace.
14679 Report a CS0105 warning for it.
14681 2002-11-30 Miguel de Icaza <miguel@ximian.com>
14683 * cs-tokenizer.cs (consume_identifier): use read directly, instead
14684 of calling getChar/putback, uses internal knowledge of it.
14686 (xtoken): Reorder tokenizer so most common patterns are checked
14687 first. This reduces the compilation time in another 5% (from 8.11s
14688 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14690 The parsing time is 22% of the compilation in mcs, and from that
14691 64% is spent on the tokenization process.
14693 I tried using a binary search for keywords, but this is slower
14694 than the hashtable. Another option would be to do a couple of
14697 * Not use a StringBuilder, instead use an array of chars,
14698 with a set value. Notice that this way we could catch
14699 the 645 error without having to do it *afterwards*.
14701 * We could write a hand-parser to avoid the hashtable
14702 compares altogether.
14704 The identifier consumption process takes 37% of the tokenization
14705 time. Another 15% is spent on is_number. 56% of the time spent
14706 on is_number is spent on Int64.Parse:
14708 * We could probably choose based on the string length to
14709 use Int32.Parse or Int64.Parse and avoid all the 64-bit
14712 Another 3% is spend on wrapping `xtoken' in the `token' function.
14714 Handle 0xa0 as whitespace (#34752)
14716 2002-11-26 Miguel de Icaza <miguel@ximian.com>
14718 * typemanager.cs (IsCLRType): New routine to tell whether a type
14719 is one of the builtin types.
14721 Maybe it needs to use TypeCodes to be faster. Maybe we could use
14722 typecode in more places instead of doing pointer comparissions.
14723 We could leverage some knowledge about the way the typecodes are
14726 New code to cache namespaces in assemblies, it is currently not
14727 invoked, to be used soon.
14729 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14731 * expression.cs (Binary.ResolveOperator): specially handle
14732 strings, and do not perform user-defined operator overloading for
14735 2002-11-24 Miguel de Icaza <miguel@ximian.com>
14737 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14738 internalcall as it is a pretty simple operation; Avoid whenever
14739 possible to call Char.IsLetter.
14741 (consume_identifier): Cut by half the number of
14742 hashtable calls by merging the is_keyword and GetKeyword behavior.
14744 Do not short-circuit, because if we do, we
14745 report errors (ie, #if false && true would produce an invalid
14749 2002-11-24 Martin Baulig <martin@ximian.com>
14751 * expression.cs (Cast.TryReduce): If we're in checked syntax,
14752 check constant ranges and report a CS0221. Fixes #33186.
14754 2002-11-24 Martin Baulig <martin@ximian.com>
14756 * cs-parser.jay: Make this work for uninitialized variable
14757 declarations in the `for' initializer. Fixes #32416.
14759 2002-11-24 Martin Baulig <martin@ximian.com>
14761 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14762 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
14764 2002-11-24 Martin Baulig <martin@ximian.com>
14766 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14767 argument; if true, we also check for user-defined conversions.
14768 This is only needed if both arguments are of a user-defined type.
14769 Fixes #30443, added test-175.cs.
14770 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14772 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14774 2002-11-24 Martin Baulig <martin@ximian.com>
14776 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14777 function to get the store opcode.
14778 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14779 only emit the Ldelema if the store opcode is Stobj. You must run
14780 both test-34 and test-167 to test this. Fixes #34529.
14782 2002-11-23 Martin Baulig <martin@ximian.com>
14784 * ecore.cs (Expression.MemberLookup): Added additional
14785 `qualifier_type' argument which is used when we're being called
14786 from MemberAccess.DoResolve() and null if we're called from a
14788 (Expression.MemberLookupFailed): New method to report errors; this
14789 does the CS1540 check and reports the correct error message.
14791 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14792 argument for the CS1540 check and redone the way how we're dealing
14793 with private members. See the comment in the source code for details.
14794 (FilterWithClosure): Reverted this back to revision 1.197; renamed
14795 `closure_start_type' to `closure_qualifier_type' and check whether
14796 it's not null. It was not this filter being broken, it was just
14797 being called with the wrong arguments.
14799 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14800 and pass it the correct `qualifier_type'; this also does the error
14803 2002-11-22 Miguel de Icaza <miguel@ximian.com>
14805 * expression.cs (Invocation.EmitParams): If the we are dealing
14806 with a non-built-in value type, load its address as well.
14808 (ArrayCreation): Use a a pretty constant instead
14809 of the hardcoded value 2. Use 6 instead of 2 for the number of
14810 static initializers.
14812 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14813 because they are not really value types, just glorified integers.
14815 * driver.cs: Do not append .exe, the CSC compiler does not do it.
14817 * ecore.cs: Remove redundant code for enumerations, make them use
14818 the same code path as everything else, fixes the casting issue
14819 with enumerations in Windows.Forms.
14821 * attribute.cs: Do only cast to string if it is a string, the
14822 validation happens later.
14824 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14825 people upgrade their corlibs.
14827 * ecore.cs: Oops, enumerations were not following the entire code path
14829 2002-11-21 Miguel de Icaza <miguel@ximian.com>
14831 * typemanager.cs (FilterWithClosure): Commented out the test for
14832 1540 in typemanager.cs, as it has problems when accessing
14833 protected methods from a parent class (see test-174.cs).
14835 * attribute.cs (Attribute.ValidateGuid): new method.
14836 (Attribute.Resolve): Use above.
14838 2002-11-19 Miguel de Icaza <miguel@ximian.com>
14840 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14842 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14843 handling for enumerations, as we only needed the TypeContainer
14844 functionality to begin with (this is required for the fix below to
14845 work for enums that reference constants in a container class for
14848 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14850 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14851 a valid TypeBuilder to perform lookups on.o
14853 * class.cs (InheritableMemberSignatureCompare): Use true in the
14854 call to GetGetMethod and GetSetMethod, because we are comparing
14855 the signature, and we need to get the methods *even* if they are
14858 (PropertyBase.CheckBase): ditto.
14860 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14861 GotoCase.Resolve): Use Peel on EmpytCasts.
14863 * ecore.cs (EmptyCast): drop child, add Peel method.
14865 2002-11-17 Martin Baulig <martin@ximian.com>
14867 * ecore.cs (EmptyCast.Child): New public property.
14869 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14870 label resolved to an EmptyCast. Fixes #34162.
14871 (GotoCase.Resolve): Likewise.
14872 (Block.EmitMeta): Likewise.
14874 2002-11-17 Martin Baulig <martin@ximian.com>
14876 * expression.cs (Invocation.BetterConversion): Prefer int over
14877 uint; short over ushort; long over ulong for integer literals.
14878 Use ImplicitConversionExists instead of StandardConversionExists
14879 since we also need to check for user-defined implicit conversions.
14880 Fixes #34165. Added test-173.cs.
14882 2002-11-16 Martin Baulig <martin@ximian.com>
14884 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14885 with the `true' and `false' literals. Fixes #33151.
14887 2002-11-16 Martin Baulig <martin@ximian.com>
14889 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14890 October 22nd; don't do the cs1540 check for static members.
14892 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14893 now using our own filter here and doing the cs1540 check again.
14895 2002-11-16 Martin Baulig <martin@ximian.com>
14897 * support.cs (InternalParameters): Don't crash if we don't have
14898 any fixed parameters. Fixes #33532.
14900 2002-11-16 Martin Baulig <martin@ximian.com>
14902 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14903 when looking up static methods to make this work on Windows.
14906 2002-11-16 Martin Baulig <martin@ximian.com>
14908 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14909 a setter rather than using PropertyInfo.CanWrite.
14911 2002-11-15 Nick Drochak <ndrochak@gol.com>
14913 * class.cs: Allow acces to block member by subclasses. Fixes build
14916 2002-11-14 Martin Baulig <martin@ximian.com>
14918 * class.cs (Constructor.Emit): Added the extern/block check.
14921 2002-11-14 Martin Baulig <martin@ximian.com>
14923 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14924 iteration while looking for indexers, this is needed because the
14925 indexer may have a different name in our base classes. Fixed the
14926 error reporting (no indexers at all, not get accessor, no
14927 overloaded match). Fixes bug #33089.
14928 (IndexerAccess.DoResolveLValue): Likewise.
14930 2002-11-14 Martin Baulig <martin@ximian.com>
14932 * class.cs (PropertyBase.CheckBase): Make this work for multiple
14933 indexers. Fixes the first part of bug #33089.
14934 (MethodSignature.InheritableMemberSignatureCompare): Added support
14937 2002-11-13 Ravi Pratap <ravi@ximian.com>
14939 * attribute.cs (Attribute.Resolve): Catch the
14940 NullReferenceException and report it since it isn't supposed to
14943 2002-11-12 Miguel de Icaza <miguel@ximian.com>
14945 * expression.cs (Binary.EmitBranchable): Also handle the cases for
14946 LogicalOr and LogicalAnd that can benefit from recursively
14947 handling EmitBranchable. The code now should be nice for Paolo.
14949 2002-11-08 Miguel de Icaza <miguel@ximian.com>
14951 * typemanager.cs (LookupType): Added a negative-hit hashtable for
14952 the Type lookups, as we perform quite a number of lookups on
14953 non-Types. This can be removed once we can deterministically tell
14954 whether we have a type or a namespace in advance.
14956 But this might require special hacks from our corlib.
14960 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14961 and double which avoids a conversion from an integer to a double.
14963 * expression.cs: tiny optimization, avoid calling IsConstant,
14964 because it effectively performs the lookup twice.
14966 2002-11-06 Miguel de Icaza <miguel@ximian.com>
14968 But a bogus return here to keep the semantics of the old code
14969 until the Mono runtime is fixed.
14971 * pending.cs (GetMissingInterfaces): New method used to remove all
14972 the interfaces that are already implemented by our parent
14973 classes from the list of pending methods.
14975 * interface.cs: Add checks for calls after ResolveTypeExpr.
14977 2002-11-05 Miguel de Icaza <miguel@ximian.com>
14979 * class.cs (Class.Emit): Report warning 67: event not used if the
14980 warning level is beyond 3.
14982 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14983 being a NullLiteral.
14985 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14988 * class.cs (TypeContainer.GetClassBases): Cover a missing code
14989 path that might fail if a type can not be resolved.
14991 * expression.cs (Binary.Emit): Emit unsigned versions of the
14994 * driver.cs: use error 5.
14996 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14998 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15000 2002-11-01 Miguel de Icaza <miguel@ximian.com>
15002 * cs-parser.jay (switch_section): A beautiful patch from Martin
15003 Baulig that fixed 33094.
15005 2002-10-31 Miguel de Icaza <miguel@ximian.com>
15007 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15008 Check whether the base is abstract and report an error if so.
15010 * expression.cs (IndexerAccess.DoResolveLValue,
15011 IndexerAccess.DoResolve): ditto.
15013 (Invocation.DoResolve): ditto.
15015 (Invocation.FullMethodDesc): Improve the report string.
15017 * statement.cs (Block): Eliminate IsVariableDefined as it is
15018 basically just a wrapper for GetVariableInfo.
15020 * ecore.cs (SimpleName): Use new
15022 * support.cs (ReflectionParamter.ParameterType): We unwrap the
15023 type, as we return the actual parameter ref/unref state on a
15026 2002-10-30 Miguel de Icaza <miguel@ximian.com>
15028 * support.cs: Return proper flags REF/OUT fixing the previous
15031 * expression.cs: Reverted last patch, that was wrong. Is_ref is
15032 not used to mean `ref' but `ref or out' in ParameterReference
15034 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15035 full type signature instead of calling TypeManger.CSharpName
15038 * support.cs (InternalParameters.ParameterDesc): Do not compare
15039 directly to the modflags, because REF/OUT will actually be bitsets
15042 * delegate.cs (VerifyMethod): Check also the modifiers.
15044 * cs-tokenizer.cs: Fix bug where floating point values with an
15045 exponent where a sign was missing was ignored.
15047 * driver.cs: Allow multiple assemblies to be specified in a single
15050 2002-10-28 Miguel de Icaza <miguel@ximian.com>
15052 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
15053 because identifiers after a parenthesis would end up in this kind
15054 of production, and we needed to desamiguate it for having casts
15057 (UserDefinedType *) xxx
15059 2002-10-24 Miguel de Icaza <miguel@ximian.com>
15061 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15062 we should set on the Bindingflags.NonPublic, but not turn on
15063 private_ok. private_ok controls whether a Private member is
15064 returned (this is chekced on the filter routine), while the
15065 BindingFlags.NonPublic just controls whether private/protected
15066 will be allowed. This fixes the problem part of the problem of
15067 private properties being allowed to be used in derived classes.
15069 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15070 so we can call the children DoResolveLValue method (this will
15071 properly signal errors on lvalue assignments to base properties)
15073 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15074 getter are null, and we have a property info, we know that this
15075 happened because the lookup failed, so we report an error 122 for
15076 protection level violation.
15078 We also silently return if setter and getter are null in the
15079 resolve functions, this condition only happens if we have flagged
15080 the error before. This is the other half of the problem.
15082 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15083 not have accessibility information, that is why we were returning
15084 true in the filter function in typemanager.cs.
15086 To properly report 122 (property is inaccessible because of its
15087 protection level) correctly, we report this error in ResolveAccess
15088 by failing if both the setter and the getter are lacking (ie, the
15091 DoResolve and DoLResolve have been modified to check for both
15092 setter/getter being null and returning silently, the reason being
15093 that I did not want to put the knowledge about this error in upper
15096 int old = Report.Errors;
15097 x = new PropertyExpr (...);
15098 if (old != Report.Errors)
15103 So the property expr is returned, but it is invalid, so the error
15104 will be flagged during the resolve process.
15106 * class.cs: Remove InheritablePropertySignatureCompare from the
15107 class, as we no longer depend on the property signature to compute
15108 whether it is possible to implement a method or not.
15110 The reason is that calling PropertyInfo.GetGetMethod will return
15111 null (in .NET, in Mono it works, and we should change this), in
15112 cases where the Get Method does not exist in that particular
15117 class X { public virtual int A { get { return 1; } } }
15119 class Z : Y { public override int A { get { return 2; } } }
15121 Would fail in Z because the parent (Y) would not have the property
15122 defined. So we avoid this completely now (because the alternative
15123 fix was ugly and slow), and we now depend exclusively on the
15126 (PropertyBase.CheckBase): Use a method-base mechanism to find our
15127 reference method, instead of using the property.
15129 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15130 routines are gone now.
15132 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15133 names, they were incorrectly named.
15135 * cs-tokenizer.cs: Return are more gentle token on failure.
15137 * pending.cs (PendingImplementation.InterfaceMethod): This routine
15138 had an out-of-sync index variable, which caused it to remove from
15139 the list of pending methods the wrong method sometimes.
15141 2002-10-22 Miguel de Icaza <miguel@ximian.com>
15143 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15144 CanWrite, because those refer to this particular instance of the
15145 property, and do not take into account the fact that we can
15146 override single members of a property.
15148 Constructor requires an EmitContext. The resolution process does
15149 not happen here, but we need to compute the accessors before,
15150 because the resolution does not always happen for properties.
15152 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15153 subclass, before we did not update this flag, but we did update
15156 (GetAccessors): Drop this routine, as it did not work in the
15157 presence of partially overwritten set/get methods.
15159 Notice that this broke the cs1540 detection, but that will require
15162 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15166 * driver.cs: issue a warning instead of an error if we don't support
15167 debugging for the platform. Also ignore a couple of errors that may
15168 arise when trying to write the symbols. Undo my previous patch.
15170 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15172 * driver.cs: ignore /debug switch except for Unix platforms.
15174 2002-10-23 Nick Drochak <ndrochak@gol.com>
15176 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15178 2002-10-21 Miguel de Icaza <miguel@ximian.com>
15180 * driver.cs: Do not make mcs-debug conditional, so we do not break
15181 builds that use it.
15183 * statement.cs (UsageVector.MergeChildren): I would like Martin to
15184 review this patch. But basically after all the children variables
15185 have been merged, the value of "Breaks" was not being set to
15186 new_breaks for Switch blocks. I think that it should be set after
15187 it has executed. Currently I set this to the value of new_breaks,
15188 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15189 conservative, but I do not understand this code very well.
15191 I did not break anything in the build, so that is good ;-)
15193 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15195 2002-10-20 Mark Crichton <crichton@gimp.org>
15197 * cfold.cs: Fixed compile blocker. Really fixed it this time.
15199 2002-10-20 Nick Drochak <ndrochak@gol.com>
15201 * cfold.cs: Fixed compile blocker.
15203 2002-10-20 Miguel de Icaza <miguel@ximian.com>
15205 * driver.cs: I was chekcing the key, not the file.
15207 2002-10-19 Ravi Pratap <ravi@ximian.com>
15209 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15210 message that we were generating - we just need to silently return
15213 2002-10-19 Miguel de Icaza <miguel@ximian.com>
15215 * class.cs (Event.Define): Change my previous commit, as this
15216 breaks the debugger. This is a temporary hack, as it seems like
15217 the compiler is generating events incorrectly to begin with.
15219 * expression.cs (Binary.ResolveOperator): Added support for
15220 "U operator - (E x, E y)"
15222 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15225 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15226 init-only variables, but this path did not take into account that
15227 there might be also instance readonly variables. Correct this
15230 This fixes bug 32253
15232 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15235 * driver.cs: Change the extension for modules to `netmodule'
15237 * cs-parser.jay: Improved slightly the location tracking for
15238 the debugger symbols.
15240 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15241 modifiers that were specified instead of the hardcoded value
15242 (FamAndAssem). This was basically ignoring the static modifier,
15243 and others. Fixes 32429.
15245 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15246 fixed a bug in the process (32476)
15248 * expression.cs (ArrayAccess.EmitAssign): Patch from
15249 hwang_rob@yahoo.ca that fixes bug 31834.3
15251 2002-10-18 Miguel de Icaza <miguel@ximian.com>
15253 * driver.cs: Make the module extension .netmodule.
15255 2002-10-16 Miguel de Icaza <miguel@ximian.com>
15257 * driver.cs: Report an error if the resource file is not found
15258 instead of crashing.
15260 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15261 false, like Emit does.
15263 2002-10-16 Nick Drochak <ndrochak@gol.com>
15265 * typemanager.cs: Remove unused private member. Also reported mcs
15266 bug to report this as a warning like csc.
15268 2002-10-15 Martin Baulig <martin@gnome.org>
15270 * statement.cs (Statement.Emit): Made this a virtual method; emits
15271 the line number info and calls DoEmit().
15272 (Statement.DoEmit): New protected abstract method, formerly knows
15273 as Statement.Emit().
15275 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15277 2002-10-11 Miguel de Icaza <miguel@ximian.com>
15279 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15280 have fixed a remaining problem: not every AddXXXX was adding a
15281 fully qualified name.
15283 Now everyone registers a fully qualified name in the DeclSpace as
15284 being defined instead of the partial name.
15286 Downsides: we are slower than we need to be due to the excess
15287 copies and the names being registered this way.
15289 The reason for this is that we currently depend (on the corlib
15290 bootstrap for instance) that types are fully qualified, because
15291 we dump all the types in the namespace, and we should really have
15292 types inserted into the proper namespace, so we can only store the
15293 basenames in the defined_names array.
15295 2002-10-10 Martin Baulig <martin@gnome.org>
15297 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15298 from bug #31834, see the bug report for a testcase which is
15301 2002-10-10 Martin Baulig <martin@gnome.org>
15303 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15304 flow analysis code for this.
15306 * statement.cs (Do, While, For): Tell the flow analysis code about
15308 (FlowBranching.UsageVector): Added support for infinite loops.
15309 (Block.Resolve): Moved the dead code elimination here and use flow
15312 2002-10-09 Miguel de Icaza <miguel@ximian.com>
15314 * class.cs (Field.Define): Catch cycles on struct type
15317 * typemanager.cs (IsUnmanagedtype): Do not recursively check
15318 fields if the fields are static. We only need to check instance
15321 * expression.cs (As.DoResolve): Test for reference type.
15323 * statement.cs (Using.ResolveExpression): Use
15324 ConvertImplicitRequired, not ConvertImplicit which reports an
15326 (Using.ResolveLocalVariableDecls): ditto.
15328 * expression.cs (Binary.ResolveOperator): Report errors in a few
15329 places where we had to.
15331 * typemanager.cs (IsUnmanagedtype): Finish implementation.
15333 2002-10-08 Miguel de Icaza <miguel@ximian.com>
15335 * expression.cs: Use StoreFromPtr instead of extracting the type
15336 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
15338 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15339 an enumeration value to a System.Enum, but System.Enum is not a
15340 value type, but an class type, so we need to box.
15342 (Expression.ConvertExplicit): One codepath could return
15343 errors but not flag them. Fix this. Fixes #31853
15345 * parameter.cs (Resolve): Do not allow void as a parameter type.
15347 2002-10-06 Martin Baulig <martin@gnome.org>
15349 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15350 if it's a class type and not a struct. Fixes #31815.
15352 2002-10-06 Martin Baulig <martin@gnome.org>
15354 * statement.cs: Reworked the flow analysis code a bit to make it
15355 usable for dead code elimination.
15357 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15359 * cs-parser.jay: allow empty source files. Fixes bug #31781.
15361 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15363 * expression.cs (ComposedCast.DoResolveType): A quick workaround
15364 to fix the test 165, will investigate deeper.
15366 2002-10-04 Martin Baulig <martin@gnome.org>
15368 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15369 finally blocks actually work.
15370 (Try.Resolve): We don't need to create a sibling for `finally' if
15371 there is no finally block.
15373 2002-10-04 Martin Baulig <martin@gnome.org>
15375 * class.cs (Constructor.Define): The default accessibility for a
15376 non-default constructor is private, not public.
15378 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15380 * class.cs (Constructor): Make AllowedModifiers public, add
15383 * cs-parser.jay: Perform the modifiers test here, as the
15384 constructor for the Constructor class usually receives a zero
15385 because of the way we create it (first we create, later we
15386 customize, and we were never checking the modifiers).
15388 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15389 is a version of LookupTypeReflection that includes the type-name
15390 cache. This can be used as a fast path for functions that know
15391 the fully qualified name and are only calling into *.GetType() to
15392 obtain a composed type.
15394 This is also used by TypeManager.LookupType during its type
15397 (LookupType): We now also track the real type name, as sometimes
15398 we can get a quey for the real type name from things like
15399 ComposedCast. This fixes bug 31422.
15401 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15402 complete type fullname, it does not have to go through the type
15403 resolution system to obtain the composed version of the type (for
15404 obtaining arrays or pointers).
15406 (Conditional.Emit): Use the EmitBoolExpression to
15407 generate nicer code, as requested by Paolo.
15409 (ArrayCreation.CheckIndices): Use the patch from
15410 hwang_rob@yahoo.ca to validate the array initializers.
15412 2002-10-03 Miguel de Icaza <miguel@ximian.com>
15414 * class.cs (ConstructorInitializer.Emit): simplify code by using
15415 Invocation.EmitCall, and at the same time, fix the bugs in calling
15416 parent constructors that took variable arguments.
15418 * ecore.cs (Expression.ConvertNumericExplicit,
15419 Expression.ImplicitNumericConversion): Remove the code that
15420 manually wrapped decimal (InternalTypeConstructor call is now gone
15423 * expression.cs (Cast.TryReduce): Also handle decimal types when
15424 trying to perform a constant fold on the type.
15426 * typemanager.cs (IsUnmanagedtype): Partially implemented.
15428 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15429 that only turned off an error report, and did nothing else.
15431 2002-10-02 Miguel de Icaza <miguel@ximian.com>
15433 * driver.cs: Handle and ignore /fullpaths
15435 2002-10-01 Miguel de Icaza <miguel@ximian.com>
15437 * expression.cs (Binary.ResolveOperator): Catch the case where
15438 DoNumericPromotions returns true,
15440 (Binary.DoNumericPromotions): Simplify the code, and the tests.
15442 2002-09-27 Miguel de Icaza <miguel@ximian.com>
15444 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15447 2002-09-26 Miguel de Icaza <miguel@ximian.com>
15449 * ecore.cs (ConvertNumericExplicit): It is not enough that the
15450 conversion exists, but it is also required that the conversion be
15451 performed. This manifested in "(Type64Enum) 2".
15453 * class.cs (TypeManager.AddMethod): The fix is not to change
15454 AddEnum, because that one was using a fully qualified name (every
15455 DeclSpace derivative does), but to change the AddMethod routine
15456 that was using an un-namespaced name. This now correctly reports
15457 the duplicated name.
15459 Revert patch until I can properly fix it. The issue
15460 is that we have a shared Type space across all namespaces
15461 currently, which is wrong.
15463 Options include making the Namespace a DeclSpace, and merge
15464 current_namespace/current_container in the parser.
15466 2002-09-25 Miguel de Icaza <miguel@ximian.com>
15468 * cs-parser.jay: Improve error reporting when we get a different
15469 kind of expression in local_variable_type and
15470 local_variable_pointer_type.
15472 Propagate this to avoid missleading errors being reported.
15474 * ecore.cs (ImplicitReferenceConversion): treat
15475 TypeManager.value_type as a target just like object_type. As
15480 Is valid, and needs to result in the int 1 being boxed before it
15481 is assigned to the value type v.
15483 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15484 to validate the enumeration name.
15486 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15487 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
15488 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15490 * ecore.cs (TryImplicitIntConversion): When doing an
15491 implicit-enumeration-conversion, check if the type is 64-bits and
15492 perform a conversion before passing to EnumConstant.
15494 2002-09-23 Miguel de Icaza <miguel@ximian.com>
15496 * decl.cs (Error_AmbiguousTypeReference); New routine used to
15497 report ambiguous type references. Unlike the MS version, we
15498 report what the ambiguity is. Innovation at work ;-)
15500 (DeclSpace.FindType): Require a location argument to
15501 display when we display an ambiguous error.
15503 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15505 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15507 * expression.cs (EmitDynamicInitializers): Apply patch from
15508 hwang_rob@yahoo.ca that fixes the order in which we emit our
15511 2002-09-21 Martin Baulig <martin@gnome.org>
15513 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15514 delegate takes no arguments.
15516 2002-09-20 Miguel de Icaza <miguel@ximian.com>
15518 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15521 * expression.cs: Extract the underlying type.
15523 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15525 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15527 2002-09-19 Miguel de Icaza <miguel@ximian.com>
15529 * class.cs (TypeContainer.DefineType): We can not use the nice
15530 PackingSize with the size set to 1 DefineType method, because it
15531 will not allow us to define the interfaces that the struct
15534 This completes the fixing of bug 27287
15536 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15537 means also structs. This fixes part of the problem.
15538 (Expresion.ImplicitReferenceConversionExists): ditto.
15540 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15541 error if there were no errors reported during the type lookup
15542 process, to avoid duplicates or redundant errors. Without this
15543 you would get an ambiguous errors plus a type not found. We have
15544 beaten the user enough with the first error.
15546 (DeclSparce.FindType): Emit a warning if we have an ambiguous
15549 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15550 during the resolution process, stop the lookup, this avoids
15551 repeated error reports (same error twice).
15553 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15555 * typemanager.cs (LookupType): Redo the type lookup code to match
15556 the needs of System.Reflection.
15558 The issue is that System.Reflection requires references to nested
15559 types to begin with a "+" sign instead of a dot. So toplevel
15560 types look like: "NameSpace.TopLevelClass", and nested ones look
15561 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15564 2002-09-19 Martin Baulig <martin@gnome.org>
15566 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15567 says that a method always returns or always throws an exception,
15568 don't report the CS0161.
15570 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15571 set `Returns = new_returns'.
15573 2002-09-19 Martin Baulig <martin@gnome.org>
15575 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15576 to an enum constant, check for a CS0176.
15578 2002-09-18 Miguel de Icaza <miguel@ximian.com>
15580 * class.cs (TypeContainer.CheckPairedOperators): Now we check
15581 for operators that must be in pairs and report errors.
15583 * ecore.cs (SimpleName.DoResolveType): During the initial type
15584 resolution process, when we define types recursively, we must
15585 check first for types in our current scope before we perform
15586 lookups in the enclosing scopes.
15588 * expression.cs (MakeByteBlob): Handle Decimal blobs.
15590 (Invocation.VerifyArgumentsCompat): Call
15591 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15592 I thought we were supposed to always call this, but there are a
15593 few places in the code where we dont do it.
15595 2002-09-17 Miguel de Icaza <miguel@ximian.com>
15597 * driver.cs: Add support in -linkres and -resource to specify the
15598 name of the identifier.
15600 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15602 * ecore.cs (StandardConversionExists): Sync with the conversion
15603 code: allow anything-* to void* conversions.
15605 (FindMostSpecificSource): Use an Expression argument
15606 instead of a Type, because we might be handed over a Literal which
15607 gets a few more implicit conversions that plain types do not. So
15608 this information was being lost.
15610 Also, we drop the temporary type-holder expression when not
15613 2002-09-17 Martin Baulig <martin@gnome.org>
15615 * class.cs (PropertyBase.CheckBase): Don't check the base class if
15616 this is an explicit interface implementation.
15618 2002-09-17 Martin Baulig <martin@gnome.org>
15620 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15621 different `IndexerName' attributes.
15623 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15624 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15625 virtual CommonResolve().
15627 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15629 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15630 and convert that to the UnderlyingType.
15632 * statement.cs (Foreach.Resolve): Indexers are just like variables
15633 or PropertyAccesses.
15635 * cs-tokenizer.cs (consume_string): Track line numbers and columns
15636 inside quoted strings, we were not doing this before.
15638 2002-09-16 Martin Baulig <martin@gnome.org>
15640 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15641 resolve it. This is needed for the definite assignment check of the
15642 instance expression, fixes bug #29846.
15643 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15645 2002-09-16 Nick Drochak <ndrochak@gol.com>
15647 * parameter.cs: Fix compile error. Cannot reference static member
15648 from an instance object. Is this an mcs bug?
15650 2002-09-14 Martin Baulig <martin@gnome.org>
15652 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15653 multiple times. Fixes bug #30295, added test-166.cs.
15655 2002-09-14 Martin Baulig <martin@gnome.org>
15657 * statement.cs (Block.Emit): Don't emit unreachable code.
15658 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15659 `break' statements.
15660 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15662 2002-09-14 Martin Baulig <martin@gnome.org>
15664 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15667 2002-09-14 Martin Baulig <martin@gnome.org>
15669 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15670 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15671 be false on the ms runtime.
15673 2002-09-13 Martin Baulig <martin@gnome.org>
15675 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15676 the CS0038 error message.
15678 2002-09-12 Miguel de Icaza <miguel@ximian.com>
15680 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15681 constant inside, return it.
15683 2002-09-12 Martin Baulig <martin@gnome.org>
15685 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15686 implicit conversion can be done between enum types.
15688 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15689 check whether an implicit conversion to the current enum's UnderlyingType
15690 exists and report an error if not.
15692 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15693 without debugging support.
15695 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15696 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
15698 2002-09-12 Martin Baulig <martin@gnome.org>
15700 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15702 * ecore.cs (IMemberExpr.DeclaringType): New property.
15703 (SimpleName.SimpleNameResolve): Check whether we're accessing a
15704 nonstatic member of an outer type (CS0038).
15706 2002-09-11 Miguel de Icaza <miguel@ximian.com>
15708 * driver.cs: Activate the using-error detector at warning level
15709 4 (at least for MS-compatible APIs).
15711 * namespace.cs (VerifyUsing): Small buglett fix.
15713 * pending.cs (PendingImplementation): pass the container pointer.
15715 * interface.cs (GetMethods): Allow for recursive definition. Long
15716 term, I would like to move every type to support recursive
15717 definitions, not the current ordering mechanism that we have right
15720 The situation is this: Attributes are handled before interfaces,
15721 so we can apply attributes to interfaces. But some attributes
15722 implement interfaces, we will now handle the simple cases
15723 (recursive definitions will just get an error).
15725 * parameter.cs: Only invalidate types at the end if we fail to
15728 2002-09-09 Martin Baulig <martin@gnome.org>
15730 * ecore.cs (PropertyExpr.Emit): Also check for
15731 TypeManager.system_int_array_get_length so this'll also work when
15732 compiling corlib. Fixes #30003.
15734 2002-09-09 Martin Baulig <martin@gnome.org>
15736 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15737 and throw an exception if we can't get the type's size. Fixed #30040,
15740 2002-09-09 Martin Baulig <martin@gnome.org>
15742 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15744 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15745 context. Fixes bug #30027.
15747 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15748 virtual functions. Fixes bug #30043, added test-164.cs.
15750 2002-09-08 Ravi Pratap <ravi@ximian.com>
15752 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15754 2002-09-08 Nick Drochak <ndrochak@gol.com>
15756 * driver.cs: Use an object to get the windows codepage since it's not a
15759 2002-09-08 Miguel de Icaza <miguel@ximian.com>
15761 * statement.cs (For.Emit): for infinite loops (test == null)
15762 return whether there is a break inside, not always "true".
15764 * namespace.cs (UsingEntry): New struct to hold the name of the
15765 using definition, the location where it is defined, and whether it
15766 has been used in a successful type lookup.
15768 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15773 2002-09-06 Ravi Pratap <ravi@ximian.com>
15775 * attribute.cs : Fix incorrect code which relied on catching
15776 a NullReferenceException to detect a null being passed in
15777 where an object was expected.
15779 2002-09-06 Miguel de Icaza <miguel@ximian.com>
15781 * statement.cs (Try): flag the catch variable as assigned
15783 * expression.cs (Cast): Simplified by using ResolveType instead of
15784 manually resolving.
15786 * statement.cs (Catch): Fix bug by using ResolveType.
15788 2002-09-06 Ravi Pratap <ravi@ximian.com>
15790 * expression.cs (BetterConversion): Special case for when we have
15791 a NullLiteral as the argument and we have to choose between string
15792 and object types - we choose string the way csc does.
15794 * attribute.cs (Attribute.Resolve): Catch the
15795 NullReferenceException and report error #182 since the Mono
15796 runtime no more has the bug and having this exception raised means
15797 we tried to select a constructor which takes an object and is
15800 2002-09-05 Ravi Pratap <ravi@ximian.com>
15802 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15803 message (1502, 1503) when we can't locate a method after overload
15804 resolution. This is much more informative and closes the bug
15807 * interface.cs (PopulateMethod): Return if there are no argument
15808 types. Fixes a NullReferenceException bug.
15810 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15811 expressions too. Previously we were checking only in one place for
15812 positional arguments leaving out named arguments.
15814 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15815 type to the enum type is not allowed. Remove code corresponding to
15818 (ConvertNumericExplicit): Allow explicit conversions from
15819 the underlying type to enum type. This precisely follows the spec
15820 and closes a bug filed by Gonzalo.
15822 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15825 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15827 2002-09-03 Miguel de Icaza <miguel@ximian.com>
15829 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15830 it was important that we stored the right value after the
15831 reduction in `converted'.
15833 2002-09-04 Martin Baulig <martin@gnome.org>
15835 * location.cs (Location.SymbolDocument): Use full pathnames for the
15838 2002-08-30 Miguel de Icaza <miguel@ximian.com>
15840 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15841 of the expression resolve mechanism, because that will catch the
15842 SimpleName error failures.
15844 (Conditional): If we can not resolve the
15845 expression, return, do not crash.
15847 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15850 (location): display token name instead of its number.
15852 2002-08-28 Martin Baulig <martin@gnome.org>
15854 * expression.cs (Binary.ResolveOperator): Don't silently return
15855 but return an error if an operator cannot be applied between two
15858 2002-08-28 Martin Baulig <martin@gnome.org>
15860 * class.cs (Constructor.Define): Set the permission attributes
15861 correctly instead of making all constructors public.
15863 2002-08-28 Martin Baulig <martin@gnome.org>
15865 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15866 for private members before reporting a CS0103; if we find anything,
15869 2002-08-28 Martin Baulig <martin@gnome.org>
15871 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15872 to check whether `closure_start_type == closure_invocation_type',
15873 we also need to check whether `m.DeclaringType == closure_invocation_type'
15874 before bypassing the permission checks. We might be accessing
15875 protected/private members from the base class.
15876 (TypeManager.RealMemberLookup): Only set private_ok if private
15877 members were requested via BindingFlags.NonPublic.
15879 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15881 * expression.cs (MemberAccess.ResolveMemberAccess): Set
15882 MethodGroupExpr.IsExplicitImpl if appropriate.
15883 (Invocation.DoResolve): Don't report the CS0120 for explicit
15884 interface implementations.
15886 2002-08-27 Martin Baulig <martin@gnome.org>
15888 * expression.cs (Invocation.DoResolve): If this is a static
15889 method and we don't have an InstanceExpression, we must report
15892 2002-08-25 Martin Baulig <martin@gnome.org>
15894 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15895 `==' between a valuetype and an object.
15897 2002-08-25 Miguel de Icaza <miguel@ximian.com>
15899 * ecore.cs (TypeExpr): Provide a ToString method.
15901 2002-08-24 Martin Baulig <martin@gnome.org>
15903 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15904 now called proggie.dbg and it's a binary file.
15906 2002-08-23 Martin Baulig <martin@gnome.org>
15908 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15910 2002-08-23 Martin Baulig <martin@gnome.org>
15912 * struct.cs (MyStructInfo.ctor): Make this work with empty
15913 structs; it's not allowed to use foreach() on null.
15915 2002-08-23 Martin Baulig <martin@gnome.org>
15917 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15918 writer the full pathname of the generated assembly.
15920 2002-08-23 Martin Baulig <martin@gnome.org>
15922 * statements.cs (FlowBranching.UsageVector.MergeChildren):
15923 A `finally' block never returns or breaks; improved handling of
15926 2002-08-23 Martin Baulig <martin@gnome.org>
15928 * statement.cs (Throw.Resolve): Allow `throw null'.
15930 2002-08-23 Martin Baulig <martin@gnome.org>
15932 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15933 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15934 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
15935 MemberLookup would return a wrong event if this is an explicit
15936 interface implementation and the class has an event with the same
15939 2002-08-23 Martin Baulig <martin@gnome.org>
15941 * statement.cs (Block.AddChildVariableNames): New public method.
15942 (Block.AddChildVariableName): Likewise.
15943 (Block.IsVariableNameUsedInChildBlock): Likewise.
15944 (Block.AddVariable): Check whether a variable name has already
15945 been used in a child block.
15947 * cs-parser.jay (declare_local_variables): Mark all variable names
15948 from the current block as being used in a child block in the
15951 2002-08-23 Martin Baulig <martin@gnome.org>
15953 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15954 find the symbol writer.
15956 * driver.cs: csc also allows the arguments to /define being
15957 separated by commas, not only by semicolons.
15959 2002-08-23 Martin Baulig <martin@gnome.org>
15961 * interface.cs (Interface.GetMembers): Added static check for events.
15963 2002-08-15 Martin Baulig <martin@gnome.org>
15965 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15966 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15968 * ecore.cs (Expression.MemberLookup): Added documentation and explained
15969 why the MethodData.EmitDestructor() change was necessary.
15971 2002-08-20 Martin Baulig <martin@gnome.org>
15973 * class.cs (TypeContainer.FindMembers): Added static check for events.
15975 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15977 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15978 use Type.GetEvents(), not Type.FindMembers().
15980 2002-08-20 Martin Baulig <martin@gnome.org>
15982 * decl.cs (MemberCache): Added a special method cache which will
15983 be used for method-only searched. This ensures that a method
15984 search will return a MethodInfo with the correct ReflectedType for
15987 2002-08-20 Martin Baulig <martin@gnome.org>
15989 * decl.cs (DeclSpace.FindMembers): Made this public.
15991 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15993 * delegate.cs: fixed build on windows.
15994 [FIXME: Filed as bug #29150: MCS must report these errors.]
15996 2002-08-19 Ravi Pratap <ravi@ximian.com>
15998 * ecore.cs (StandardConversionExists): Return a false
15999 if we are trying to convert the void type to anything else
16000 since that is not allowed.
16002 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16003 we flag error 70 in the event an event is trying to be accessed
16004 directly from outside the declaring type.
16006 2002-08-20 Martin Baulig <martin@gnome.org>
16008 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16009 MemberCache from typemanager.cs to decl.cs.
16011 2002-08-19 Martin Baulig <martin@gnome.org>
16013 * class.cs (TypeContainer): Implement IMemberContainer.
16014 (TypeContainer.DefineMembers): Create the MemberCache.
16015 (TypeContainer.FindMembers): Do better BindingFlags checking; only
16016 return public members if BindingFlags.Public was given, check
16017 whether members are static.
16019 2002-08-16 Martin Baulig <martin@gnome.org>
16021 * decl.cs (DeclSpace.Define): Splitted this in Define and
16022 DefineMembers. DefineMembers is called first and initializes the
16025 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
16026 DefineMembers() on all our DeclSpaces.
16028 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16029 but call DefineMembers() on all nested interfaces. We call their
16030 Define() in our new Define() function.
16032 * interface.cs (Interface): Implement IMemberContainer.
16033 (Interface.Define): Moved all code except the attribute stuf to
16035 (Interface.DefineMembers): Initialize the member cache.
16037 * typemanager.cs (IMemberFinder): Removed this interface, we don't
16038 need this anymore since we can use MemberCache.FindMembers directly.
16040 2002-08-19 Martin Baulig <martin@gnome.org>
16042 * typemanager.cs (MemberCache): When creating the cache for an
16043 interface type, add all inherited members.
16044 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16045 to `out bool used_cache' and documented it.
16046 (TypeManager.MemberLookup): If we already used the cache in the first
16047 iteration, we don't need to do the interfaces check.
16049 2002-08-19 Martin Baulig <martin@gnome.org>
16051 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
16052 here from IMemberFinder and don't implement this interface anymore.
16053 (DeclSpace.MemberCache): Moved here from IMemberFinder.
16055 * typemanager.cs (IMemberFinder): This interface is now only used by
16056 classes which actually support the member cache.
16057 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16058 since we only put DeclSpaces into this Hashtable.
16059 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16060 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16062 2002-08-16 Martin Baulig <martin@gnome.org>
16064 * typemanager.cs (ICachingMemberFinder): Removed.
16065 (IMemberFinder.MemberCache): New property.
16066 (TypeManager.FindMembers): Merged this with RealFindMembers().
16067 This function will never be called from TypeManager.MemberLookup()
16068 so we can't use the cache here, just the IMemberFinder.
16069 (TypeManager.MemberLookup_FindMembers): Check whether the
16070 IMemberFinder has a MemberCache and call the cache's FindMembers
16072 (MemberCache): Rewrote larger parts of this yet another time and
16073 cleaned it up a bit.
16075 2002-08-15 Miguel de Icaza <miguel@ximian.com>
16077 * driver.cs (LoadArgs): Support quoting.
16079 (Usage): Show the CSC-like command line arguments.
16081 Improved a few error messages.
16083 2002-08-15 Martin Baulig <martin@gnome.org>
16085 * typemanager.cs (IMemberContainer.Type): New property.
16086 (IMemberContainer.IsInterface): New property.
16088 The following changes are conditional to BROKEN_RUNTIME, which is
16089 defined at the top of the file.
16091 * typemanager.cs (MemberCache.MemberCache): Don't add the base
16092 class'es members, but add all members from TypeHandle.ObjectType
16093 if we're an interface.
16094 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16095 is the current type.
16096 (MemberCache.CacheEntry.Container): Removed this field.
16097 (TypeHandle.GetMembers): Include inherited members.
16099 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16101 * typemanager.cs: fixed compilation and added a comment on a field that
16104 2002-08-15 Martin Baulig <martin@gnome.org>
16106 * class.cs (ConstructorInitializer.Resolve): In the
16107 Expression.MemberLookup call, use the queried_type as
16110 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16111 declared' attribute, it's always true.
16112 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16113 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16114 temporary wrapper for FindMembers which tells MemberLookup whether
16115 members from the base classes are included in the return value.
16116 This will go away soon.
16117 (TypeManager.MemberLookup): Use this temporary hack here; once the
16118 new MemberCache is completed, we don't need to do the DeclaredOnly
16119 looping here anymore since the MemberCache will take care of this.
16120 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16121 (MemberCache): When creating the MemberCache for a class, get
16122 members from the current class and all its base classes.
16123 (MemberCache.CacheEntry.Container): New field. This is a
16124 temporary hack until the Mono runtime is fixed to distinguish
16125 between ReflectedType and DeclaringType. It allows us to use MCS
16126 with both the MS runtime and the unfixed Mono runtime without
16127 problems and without accecting performance.
16128 (MemberCache.SearchMembers): The DeclaredOnly looping from
16129 TypeManager.MemberLookup is now done here.
16131 2002-08-14 Martin Baulig <martin@gnome.org>
16133 * statement.cs (MyStructInfo.MyStructInfo): Don't call
16134 Type.GetFields on dynamic types but get the fields from the
16135 corresponding TypeContainer.
16136 (MyStructInfo.GetStructInfo): Added check for enum types.
16138 * typemanager.cs (MemberList.IsSynchronized): Implemented.
16139 (MemberList.SyncRoot): Implemented.
16140 (TypeManager.FilterWithClosure): No need to check permissions if
16141 closure_start_type == closure_invocation_type, don't crash if
16142 closure_invocation_type is null.
16144 2002-08-13 Martin Baulig <martin@gnome.org>
16146 Rewrote TypeContainer.FindMembers to use a member cache. This
16147 gives us a speed increase of about 35% for the self-hosting MCS
16148 build and of about 15-20% for the class libs (both on GNU/Linux).
16150 * report.cs (Timer): New class to get enhanced profiling. This
16151 whole class is "TIMER" conditional since it remarkably slows down
16154 * class.cs (MemberList): New class. This is an IList wrapper
16155 which we're now using instead of passing MemberInfo[]'s around to
16156 avoid copying this array unnecessarily.
16157 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16158 (ICachingMemberFinder, IMemberContainer): New interface.
16159 (TypeManager.FilterWithClosure): If `criteria' is null, the name
16160 has already been checked, otherwise use it for the name comparision.
16161 (TypeManager.FindMembers): Renamed to RealMemberFinder and
16162 provided wrapper which tries to use ICachingMemberFinder.FindMembers
16163 if possible. Returns a MemberList, not a MemberInfo [].
16164 (TypeHandle): New class, implements IMemberContainer. We create
16165 one instance of this class per type, it contains a MemberCache
16166 which is used to do the member lookups.
16167 (MemberCache): New class. Each instance of this class contains
16168 all members of a type and a name-based hash table.
16169 (MemberCache.FindMembers): This is our new member lookup
16170 function. First, it looks up all members of the requested name in
16171 the hash table. Then, it walks this list and sorts out all
16172 applicable members and returns them.
16174 2002-08-13 Martin Baulig <martin@gnome.org>
16176 In addition to a nice code cleanup, this gives us a performance
16177 increase of about 1.4% on GNU/Linux - not much, but it's already
16178 half a second for the self-hosting MCS compilation.
16180 * typemanager.cs (IMemberFinder): New interface. It is used by
16181 TypeManager.FindMembers to call FindMembers on a TypeContainer,
16182 Enum, Delegate or Interface.
16183 (TypeManager.finder_to_member_finder): New PtrHashtable.
16184 (TypeManager.finder_to_container): Removed.
16185 (TypeManager.finder_to_delegate): Removed.
16186 (TypeManager.finder_to_interface): Removed.
16187 (TypeManager.finder_to_enum): Removed.
16189 * interface.cs (Interface): Implement IMemberFinder.
16191 * delegate.cs (Delegate): Implement IMemberFinder.
16193 * enum.cs (Enum): Implement IMemberFinder.
16195 * class.cs (TypeContainer): Implement IMemberFinder.
16197 2002-08-12 Martin Baulig <martin@gnome.org>
16199 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16201 2002-08-12 Martin Baulig <martin@gnome.org>
16203 * ecore.cs (ITypeExpression): New interface for expressions which
16205 (TypeExpression): Renamed to TypeLookupExpression.
16206 (Expression.DoResolve): If we're doing a types-only lookup, the
16207 expression must implement the ITypeExpression interface and we
16208 call DoResolveType() on it.
16209 (SimpleName): Implement the new ITypeExpression interface.
16210 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16211 hack, the situation that we're only looking up types can't happen
16212 anymore when this method is called. Moved the type lookup code to
16213 DoResolveType() and call it.
16214 (SimpleName.DoResolveType): This ITypeExpression interface method
16215 is now doing the types-only lookup.
16216 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16217 (ResolveFlags): Added MaskExprClass.
16219 * expression.cs (MemberAccess): Implement the ITypeExpression
16221 (MemberAccess.DoResolve): Added support for a types-only lookup
16222 when we're called via ITypeExpression.DoResolveType().
16223 (ComposedCast): Implement the ITypeExpression interface.
16225 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
16226 Expression.Resolve() with ResolveFlags.Type instead.
16228 2002-08-12 Martin Baulig <martin@gnome.org>
16230 * interface.cs (Interface.Define): Apply attributes.
16232 * attribute.cs (Attribute.ApplyAttributes): Added support for
16233 interface attributes.
16235 2002-08-11 Martin Baulig <martin@gnome.org>
16237 * statement.cs (Block.Emit): Only check the "this" variable if we
16238 do not always throw an exception.
16240 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16241 whether the property has a set accessor.
16243 2002-08-11 Martin Baulig <martin@gnome.org>
16245 Added control flow analysis support for structs.
16247 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16248 with control flow analysis turned off.
16249 (IVariable): New interface.
16250 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16251 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16252 (FieldExpr.DoResolve): Resolve the instance expression with flow
16253 analysis turned off and do the definite assignment check after the
16254 resolving when we know what the expression will resolve to.
16256 * expression.cs (LocalVariableReference, ParameterReference):
16257 Implement the new IVariable interface, only call the flow analysis
16258 code if ec.DoFlowAnalysis is true.
16259 (This): Added constructor which takes a Block argument. Implement
16260 the new IVariable interface.
16261 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16262 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16263 This does the definite assignment checks for struct members.
16265 * class.cs (Constructor.Emit): If this is a non-static `struct'
16266 constructor which doesn't have any initializer, call
16267 Block.AddThisVariable() to tell the flow analysis code that all
16268 struct elements must be initialized before control returns from
16271 * statement.cs (MyStructInfo): New public class.
16272 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16273 argument to this indexer. If non-zero, check an individual struct
16274 member, not the whole struct.
16275 (FlowBranching.CheckOutParameters): Check struct members.
16276 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16277 overloaded versions of these methods which take an additional
16278 `int field_idx' argument to check struct members.
16279 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16280 overloaded versions of these methods which take an additional
16281 `string field_name' argument to check struct member.s
16282 (VariableInfo): Implement the IVariable interface.
16283 (VariableInfo.StructInfo): New public property. Returns the
16284 MyStructInfo instance of the variable if it's a struct or null.
16285 (Block.AddThisVariable): New public method. This is called from
16286 Constructor.Emit() for non-static `struct' constructor which do
16287 not have any initializer. It creates a special variable for the
16288 "this" instance variable which will be checked by the flow
16289 analysis code to ensure that all of the struct's fields are
16290 initialized before control returns from the constructor.
16291 (UsageVector): Added support for struct members. If a
16292 variable/parameter is a struct with N members, we reserve a slot
16293 in the usage vector for each member. A struct is considered fully
16294 initialized if either the struct itself (slot 0) or all its
16295 members are initialized.
16297 2002-08-08 Martin Baulig <martin@gnome.org>
16299 * driver.cs (Driver.MainDriver): Only report an error CS5001
16300 if there were no compilation errors.
16302 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16303 `UnsafeContext' property to determine whether the parent is in
16304 unsafe context rather than checking the parent's ModFlags:
16305 classes nested in an unsafe class are unsafe as well.
16307 2002-08-08 Martin Baulig <martin@gnome.org>
16309 * statement.cs (UsageVector.MergeChildren): Distinguish between
16310 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16311 we return. Added test17() and test18() to test-154.cs.
16313 2002-08-08 Martin Baulig <martin@gnome.org>
16315 * typemanager.cs (TypeManager.FilterWithClosure): If we have
16316 Family access, make sure the invoking type isn't a subclass of the
16317 queried type (that'd be a CS1540).
16319 * ecore.cs (Expression.MemberLookup): Added overloaded version of
16320 this method which takes an additional `Type invocation_type'.
16322 * expression.cs (BaseAccess.DoResolve): Use the base type as
16323 invocation and query type.
16324 (MemberAccess.DoResolve): If the lookup failed and we're about to
16325 report a CS0122, try a lookup with the ec.ContainerType - if this
16326 succeeds, we must report a CS1540.
16328 2002-08-08 Martin Baulig <martin@gnome.org>
16330 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16331 (MethodGroupExpr): Implement the IMemberExpr interface.
16333 * expression (MemberAccess.ResolveMemberAccess): No need to have
16334 any special code for MethodGroupExprs anymore, they're now
16337 2002-08-08 Martin Baulig <martin@gnome.org>
16339 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16340 Family, FamANDAssem and FamORAssem permissions.
16341 (TypeManager.IsSubclassOrNestedChildOf): New public method.
16343 2002-08-08 Martin Baulig <martin@gnome.org>
16345 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16346 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16349 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16351 * driver.cs: implemented /resource option to embed managed resources.
16353 2002-08-07 Martin Baulig <martin@gnome.org>
16355 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16356 (FieldBase.HasFieldInitializer): New public property.
16357 (FieldBase.GetInitializerExpression): New public method. Resolves and
16358 returns the field initializer and makes sure it is only resolved once.
16359 (TypeContainer.EmitFieldInitializers): Call
16360 FieldBase.GetInitializerExpression to get the initializer, this ensures
16361 that it isn't resolved multiple times.
16363 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
16364 the resolving process (SimpleName/MemberLookup) that we're currently
16365 emitting a field initializer (which must not access any instance members,
16366 this is an error CS0236).
16368 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16369 argument, if the `IsFieldInitializer' flag is set, we must report and
16370 error CS0236 and not an error CS0120.
16372 2002-08-07 Martin Baulig <martin@gnome.org>
16374 * ecore.cs (IMemberExpr): New public interface.
16375 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16376 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16377 if the expression is an IMemberExpr.
16379 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16380 to be null, implicitly default to `this' if we're non-static in
16381 this case. Simplified the code a lot by using the new IMemberExpr
16382 interface. Also fixed bug #28176 here.
16384 2002-08-06 Martin Baulig <martin@gnome.org>
16386 * cs-parser.jay (SimpleLookup): Removed. We need to create
16387 ParameterReferences during semantic analysis so that we can do a
16388 type-only search when resolving Cast, TypeOf and SizeOf.
16389 (block): Pass the `current_local_parameters' to the Block's
16392 * class.cs (ConstructorInitializer): Added `Parameters parameters'
16393 argument to the constructor.
16394 (ConstructorInitializer.Resolve): Create a temporary implicit
16395 block with the parameters.
16397 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16398 references here if we aren't doing a type-only search.
16400 * statement.cs (Block): Added constructor which takes a
16401 `Parameters parameters' argument.
16402 (Block.Parameters): New public property.
16404 * support.cs (InternalParameters.Parameters): Renamed `parameters'
16405 to `Parameters' and made it public readonly.
16407 2002-08-06 Martin Baulig <martin@gnome.org>
16409 * ecore.cs (Expression.Warning): Made this public as well.
16411 * report.cs (Report.Debug): Print the contents of collections.
16413 2002-08-06 Martin Baulig <martin@gnome.org>
16415 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
16416 used to tell Resolve() which kinds of expressions it may return.
16417 (Expression.Resolve): Added overloaded version of this method which
16418 takes a `ResolveFlags flags' argument. This can be used to tell
16419 Resolve() which kinds of expressions it may return. Reports a
16421 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16422 ResolveFlags.SimpleName.
16423 (Expression.Error118): Added overloaded version of this method which
16424 takes a `ResolveFlags flags' argument. It uses the flags to determine
16425 which kinds of expressions are allowed.
16427 * expression.cs (Argument.ResolveMethodGroup): New public method.
16428 Resolves an argument, but allows a MethodGroup to be returned.
16429 This is used when invoking a delegate.
16431 * TODO: Updated a bit.
16433 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16435 Fixed compilation with csc.
16437 * ecore.cs: Expression.Error made public. Is this correct? Should
16438 Warning be made public too?
16440 * expression.cs: use ea.Location instead of ea.loc.
16441 [FIXME: Filed as bug #28607: MCS must report these errors.]
16443 2002-08-06 Martin Baulig <martin@gnome.org>
16445 * ecore.cs (Expression.loc): Moved the location here instead of
16446 duplicating it in all derived classes.
16447 (Expression.Location): New public property.
16448 (Expression.Error, Expression.Warning): Made them non-static and
16449 removed the location argument.
16450 (Expression.Warning): Added overloaded version which takes an
16451 `int level' argument.
16452 (Expression.Error118): Make this non-static and removed the
16453 expression and location arguments.
16454 (TypeExpr): Added location argument to the constructor.
16456 * expression.cs (StaticCallExpr): Added location argument to
16458 (Indirection, PointerArithmetic): Likewise.
16459 (CheckedExpr, UnCheckedExpr): Likewise.
16460 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16461 (StringPtr): Likewise.
16464 2002-08-05 Martin Baulig <martin@gnome.org>
16466 * expression.cs (BaseAccess.DoResolve): Actually report errors.
16468 * assign.cs (Assign.DoResolve): Check whether the source
16469 expression is a value or variable.
16471 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16472 while resolving the corresponding blocks.
16474 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16475 an error, don't silently return null.
16477 * statement.cs (Block.AddVariable): Do the error reporting here
16478 and distinguish between CS0128 and CS0136.
16479 (Block.DoResolve): Report all unused labels (warning CS0164).
16480 (LabeledStatement): Pass the location to the constructor.
16481 (LabeledStatement.HasBeenReferenced): New property.
16482 (LabeledStatement.Resolve): Set it to true here.
16484 * statement.cs (Return.Emit): Return success even after reporting
16485 a type mismatch error (CS0126 or CS0127), this is what csc does and
16486 it avoids confusing the users with any consecutive errors.
16488 2002-08-05 Martin Baulig <martin@gnome.org>
16490 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16492 * const.cs (Const.LookupConstantValue): Catch circular definitions.
16494 * expression.cs (MemberAccess.DoResolve): Silently return if an
16495 error has already been reported.
16497 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16498 error has already been reported.
16500 2002-08-05 Martin Baulig <martin@gnome.org>
16502 * statement.cs (UsageVector): Only initialize the `parameters'
16503 vector if we actually have any "out" parameters.
16505 2002-08-05 Martin Baulig <martin@gnome.org>
16507 * expression.cs (Binary.ResolveOperator): When combining delegates,
16508 they must have the same type.
16510 2002-08-05 Martin Baulig <martin@gnome.org>
16512 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16513 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16514 work with the ms runtime and we also don't need it: if we're a
16515 PropertyBuilder and not in the `indexer_arguments' hash, then we
16516 are a property and not an indexer.
16518 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16519 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16520 since the latter one doesn't work with the ms runtime.
16522 2002-08-03 Martin Baulig <martin@gnome.org>
16524 Fixed bugs #27998 and #22735.
16526 * class.cs (Method.IsOperator): New public field.
16527 (Method.CheckBase): Report CS0111 if there's already a method
16528 with the same parameters in the current class. Report CS0508 when
16529 attempting to change the return type of an inherited method.
16530 (MethodData.Emit): Report CS0179 if a method doesn't have a body
16531 and it's not marked abstract or extern.
16532 (PropertyBase): New abstract base class for Property and Indexer.
16533 (PropertyBase.CheckBase): Moved here from Property and made it work
16535 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16536 the same so we can reuse it there.
16537 (Property, Indexer): Derive from PropertyBase.
16538 (MethodSignature.inheritable_property_signature_filter): New delegate
16539 to find properties and indexers.
16541 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16542 argument and improved error reporting.
16544 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16545 EmptyReadOnlyParameters and made it a property.
16547 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16548 version of this method which takes a `PropertyInfo indexer'.
16549 (TypeManager.RegisterIndexer): New method.
16551 * class.cs: Added myself as author of this file :-)
16553 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16555 * class.cs: fixed compilation on windoze.
16557 2002-08-03 Martin Baulig <martin@gnome.org>
16559 * interface.cs (Interface.GetInterfaceBases): Check whether all
16560 base interfaces are at least as accessible than the current one.
16562 * class.cs (TypeContainer.GetClassBases): Check whether base types
16563 are at least as accessible than the current type.
16564 (TypeContainer.AsAccessible): Implemented and made non-static.
16565 (MemberBase.CheckParameters): Report errors if the accessibility
16568 * delegate.cs (Delegate.Delegate): The default visibility is
16569 internal for top-level types and private for nested types.
16570 (Delegate.Define): Report errors if the accessibility checks fail.
16572 * enum.cs (Enum.Enum): The default visibility is internal for
16573 top-level types and private for nested types.
16574 (Enum.DefineType): Compute the correct visibility.
16576 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16577 function which takes a `bool is_toplevel' instead of a TypeContainer.
16579 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16582 2002-08-02 Martin Baulig <martin@gnome.org>
16584 * expression.cs (LocalVariableReferenc): Added constructor which
16585 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16586 (LocalVariableReference.IsReadOnly): New property.
16587 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16588 variable is readonly, use our own readonly flag to do this; you can
16589 use the new constructor to get a writable reference to a read-only
16592 * cs-parser.jay (foreach_statement, using_statement): Get a writable
16593 reference to the local variable.
16595 2002-08-01 Miguel de Icaza <miguel@ximian.com>
16597 * rootcontext.cs (ResolveCore): Also include System.Exception
16599 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16600 we reach an EmptyStatement.
16602 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16605 * expression.cs (Binary.ResolveOperator): Check error result in
16608 use brtrue/brfalse directly and avoid compares to null.
16610 2002-08-02 Martin Baulig <martin@gnome.org>
16612 * class.cs (TypeContainer.Define): Define all nested interfaces here.
16613 Fixes bug #28407, added test-155.cs.
16615 2002-08-01 Martin Baulig <martin@gnome.org>
16617 * class.cs (Event.EmitDefaultMethod): Make this work with static
16618 events. Fixes #28311, added verify-3.cs.
16620 2002-08-01 Martin Baulig <martin@gnome.org>
16622 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16623 `is_disposable' fields.
16624 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16625 `hm.is_disposable' if we're using the collection pattern.
16626 (Foreach.EmitCollectionForeach): Use the correct type for the
16627 enumerator's local variable, only emit the try/finally block if
16628 necessary (fixes #27713).
16630 2002-08-01 Martin Baulig <martin@gnome.org>
16632 * ecore.cs (Expression.report118): Renamed to Error118 and made
16635 * statement.cs (Throw.Resolve): Check whether the expression is of
16636 the correct type (CS0118) and whether the type derives from
16637 System.Exception (CS0155).
16638 (Catch.Resolve): New method. Do the type lookup here and check
16639 whether it derives from System.Exception (CS0155).
16640 (Catch.CatchType, Catch.IsGeneral): New public properties.
16642 * typemanager.cs (TypeManager.exception_type): Added.
16644 2002-07-31 Miguel de Icaza <miguel@ximian.com>
16646 * driver.cs: Updated About function.
16648 2002-07-31 Martin Baulig <martin@gnome.org>
16650 Implemented Control Flow Analysis.
16652 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16653 (EmitContext.CurrentBranching): Added.
16654 (EmitContext.StartFlowBranching): Added.
16655 (EmitContext.EndFlowBranching): Added.
16656 (EmitContext.KillFlowBranching): Added.
16657 (EmitContext.IsVariableAssigned): Added.
16658 (EmitContext.SetVariableAssigned): Added.
16659 (EmitContext.IsParameterAssigned): Added.
16660 (EmitContext.SetParameterAssigned): Added.
16661 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16662 Added control flow analysis stuff here.
16664 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16665 resolve the expression as lvalue.
16666 (LocalVariableReference.DoResolve): Check whether the variable has
16667 already been assigned.
16668 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16669 the parameter as assigned here.
16670 (ParameterReference.DoResolve): Check whether the parameter has already
16672 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16673 expression as lvalue.
16675 * statement.cs (FlowBranching): New class for the flow analysis code.
16676 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16677 (LabeledStatement.IsDefined): New public property.
16678 (LabeledStatement.AddUsageVector): New public method to tell flow
16679 analyis that the label may be reached via a forward jump.
16680 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16682 (VariableInfo.Number): New public field. This is used by flow analysis
16683 to number all locals of a block.
16684 (Block.CountVariables): New public property. This is the number of
16685 local variables in this block (including the locals from all parent
16687 (Block.EmitMeta): Number all the variables.
16689 * statement.cs: Added flow analysis support to all classes.
16691 2002-07-31 Martin Baulig <martin@gnome.org>
16693 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16694 To get debugging messages, compile mcs with /define:MCS_DEBUG and
16695 then use this argument.
16697 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16699 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16700 use this to specify /define options.
16702 2002-07-29 Martin Baulig <martin@gnome.org>
16704 * statement.cs (Fixed): Moved all code that does variable lookups
16705 and resolvings from Emit to Resolve.
16707 * statement.cs (For): Moved all code that does variable lookups
16708 and resolvings from Emit to Resolve.
16710 * statement.cs (Using): Moved all code that does variable lookups
16711 and resolvings from Emit to Resolve.
16713 2002-07-29 Martin Baulig <martin@gnome.org>
16715 * attribute.cs (Attribute.Resolve): Explicitly catch a
16716 System.NullReferenceException when creating the
16717 CustromAttributeBuilder and report a different warning message.
16719 2002-07-29 Martin Baulig <martin@gnome.org>
16721 * support.cs (ParameterData.ParameterName): Added method to
16722 get the name of a parameter.
16724 * typemanager.cs (TypeManager.IsValueType): New public method.
16726 2002-07-29 Martin Baulig <martin@gnome.org>
16728 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
16729 is a flag which specifies that it's either ref or out.
16730 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16731 the out parameter to `out Parameter.Modifier mod', also set the
16732 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16734 * support.cs (InternalParameters.ParameterModifier): Distinguish
16735 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16736 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16738 * expression.cs (Argument.GetParameterModifier): Distinguish
16739 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16740 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16742 2002-07-29 Martin Baulig <martin@gnome.org>
16744 * expression.cs (ParameterReference.ParameterReference): Added
16745 `Location loc' argument to the constructor.
16747 * cs-parser.jay: Pass location to ParameterReference.
16749 2002-07-28 Miguel de Icaza <miguel@ximian.com>
16751 * statement.cs (Try): Initialize the location.
16753 * cs-parser.jay: pass location to Try.
16755 * expression.cs (Unary.Reduce): Change the prototype to return
16756 whether a constant fold could be performed or not. The result is
16757 returned in an out parameters. In the case of Indirection and
16758 AddressOf, we want to perform the full tests.
16760 2002-07-26 Miguel de Icaza <miguel@ximian.com>
16762 * statement.cs (Statement.Emit): Flag dead code.
16764 2002-07-27 Andrew Birkett <andy@nobugs.org>
16766 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16768 2002-07-27 Martin Baulig <martin@gnome.org>
16770 * class.cs (MethodData.Define): Put back call to
16771 TypeManager.AddMethod(), accidentally commented this out.
16773 * report.cs (Debug): New public method to print debugging information,
16774 this is `[Conditional ("DEBUG")]'.
16776 2002-07-26 Martin Baulig <martin@gnome.org>
16778 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16779 (switch_statement): Push the current_block to the switch_stack and
16780 pop it again when we're done with the switch.
16781 (switch_section): The new block is a child of the current_block.
16782 Fixes bug #24007, added test-152.cs.
16784 2002-07-27 Martin Baulig <martin@gnome.org>
16786 * expression.cs (Invocation.EmitArguments): When calling a varargs
16787 function with only its fixed arguments, we need to pass an empty
16790 2002-07-27 Martin Baulig <martin@gnome.org>
16792 Mono 0.13 has been released.
16794 2002-07-25 Miguel de Icaza <miguel@ximian.com>
16796 * driver.cs: Rename --resource to --linkres, because that is what
16797 we do currently, we dont support --resource yet.
16799 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16801 2002-07-25 Martin Baulig <martin@gnome.org>
16803 * class.cs (MethodData): New public class. This is a `method builder'
16804 class for a method or one accessor of a Property/Indexer/Event.
16805 (MethodData.GetMethodFlags): Moved here from MemberBase.
16806 (MethodData.ApplyAttributes): Likewise.
16807 (MethodData.ApplyObsoleteAttribute): Likewise.
16808 (MethodData.ApplyConditionalAttribute): Likewise.
16809 (MethodData.ApplyDllImportAttribute): Likewise.
16810 (MethodData.CheckAbstractAndExternal): Likewise.
16811 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16812 (MethodData.Emit): Formerly known as Method.Emit().
16813 (MemberBase): Moved everything which was specific to a single
16814 accessor/method to MethodData.
16815 (Method): Create a new MethodData and call Define() and Emit() on it.
16816 (Property, Indexer, Event): Create a new MethodData objects for each
16817 accessor and call Define() and Emit() on them.
16819 2002-07-25 Martin Baulig <martin@gnome.org>
16821 Made MethodCore derive from MemberBase to reuse the code from there.
16822 MemberBase now also checks for attributes.
16824 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16825 (MemberBase.GetMethodFlags): Moved here from class Method and marked
16827 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16828 `CallingConventions cc' and `Attributes opt_attrs' arguments.
16829 (MemberBase.ApplyAttributes): New virtual method; applies the
16830 attributes to a method or accessor.
16831 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16832 (MemberBase.ApplyConditionalAttribute): Likewise.
16833 (MemberBase.ApplyDllImportAttribute): Likewise.
16834 (MemberBase.CheckAbstractAndExternal): Likewise.
16835 (MethodCore.ParameterTypes): This is now a property instead of a
16836 method, it's initialized from DoDefineParameters().
16837 (MethodCore.ParameterInfo): Removed the set accessor.
16838 (MethodCore.DoDefineParameters): New protected virtual method to
16839 initialize ParameterTypes and ParameterInfo.
16840 (Method.GetReturnType): We can now simply return the MemberType.
16841 (Method.GetMethodFlags): Override the MemberBase version and add
16842 the conditional flags.
16843 (Method.CheckBase): Moved some code from Define() here, call
16844 DoDefineParameters() here.
16845 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16846 here to avoid some larger code duplication.
16847 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16848 ensure that abstract and external accessors don't declare a body.
16850 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16851 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16852 lookup in the attribute's parent classes, so we need to abort as soon
16853 as we found the first match.
16854 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16855 the attribute has no arguments.
16857 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16860 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16862 * cs-parser.jay: reverted previous patch.
16864 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16866 * cs-parser.jay: fixed bug #22119.
16868 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16870 * attribute.cs: fixed compilation. The error was:
16871 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
16872 be assigned to before control leaves the current method."
16873 [FIXME: Filed as bug #28186: MCS must report this error.]
16875 2002-07-25 Martin Baulig <martin@gnome.org>
16877 * attribute.cs (Attribute.Conditional_GetConditionName): New static
16878 method to pull the condition name ouf of a Conditional attribute.
16879 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16880 the obsolete message and error flag out of an Obsolete attribute.
16882 * class.cs (Method.GetMethodFlags): New public method to get the
16883 TypeManager.MethodFlags for this method.
16884 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16886 (Method.Define): Get and apply the Obsolete and Conditional attributes;
16887 if we're overriding a virtual function, set the new private variable
16888 `parent_method'; call the new TypeManager.AddMethod().
16890 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
16891 the MethodBuilder and the Method in a PtrHashtable.
16892 (TypeManager.builder_to_method): Added for this purpose.
16893 (TypeManager.MethodFlags): Added IsObsoleteError.
16894 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
16895 Obsolete and Conditional arguments in MethodBuilders. If we discover
16896 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16897 the message from the attribute.
16899 2002-07-24 Martin Baulig <martin@gnome.org>
16901 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16902 preprocessor directives, ensure that the argument to #define/#undef is
16903 exactly one identifier and that it's actually an identifier.
16905 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16908 2002-07-24 Martin Baulig <martin@gnome.org>
16910 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16911 initialize it to TypeManager.object_type in the constructor.
16912 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16913 of the `hm.get_current' method if we're using the collection pattern.
16914 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16915 for the explicit conversion to make it work when we're using the collection
16916 pattern and the `Current' property has a different return type than `object'.
16919 2002-07-24 Martin Baulig <martin@gnome.org>
16921 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16922 does not match, but don't report any errors. This method is called in
16923 order for all methods in a MethodGroupExpr until a matching method is
16924 found, so we don't want to bail out if the first method doesn't match.
16925 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16926 matches, report the 123. Fixes #28070.
16928 2002-07-24 Martin Baulig <martin@gnome.org>
16930 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16931 TypeManager.TypeToCoreType() to the top of the method so the
16932 following equality checks will work. Fixes #28107.
16934 2002-07-24 Martin Baulig <martin@gnome.org>
16936 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16937 operand is of type uint, and the other operand is of type sbyte,
16938 short or int, the operands are converted to type long." -
16939 Actually do what this comment already told us. Fixes bug #28106,
16942 2002-07-24 Martin Baulig <martin@gnome.org>
16944 * class.cs (MethodBase): New abstract class. This is now a base
16945 class for Property, Indexer and Event to avoid some code duplication
16946 in their Define() and DefineMethods() methods.
16947 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16948 generic methods for Define() and DefineMethods().
16949 (FieldBase): Derive from MemberBase, not MemberCore.
16950 (Property): Derive from MemberBase, not MemberCore.
16951 (Property.DefineMethod): Moved all the code from this method to the
16952 new MethodBase.DefineAccessor(), just call it with appropriate
16954 (Property.Define): Call the new Property.DoDefine(), this does some
16955 sanity checks and we don't need to duplicate the code everywhere.
16956 (Event): Derive from MemberBase, not MemberCore.
16957 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16958 accessors, this will also make them work with interface events.
16959 (Indexer): Derive from MemberBase, not MemberCore.
16960 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16961 (Indexer.Define): Use the new MethodBase functions.
16963 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16964 argument to the constructor.
16965 (Interface.FindMembers): Added support for interface events.
16966 (Interface.PopluateEvent): Implemented.
16968 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
16970 2002-07-22 Miguel de Icaza <miguel@ximian.com>
16972 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16973 but this is required to check for a method name being the same as
16974 the containing class.
16978 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16980 * interface.cs: initialize variable.
16982 2002-07-23 Martin Baulig <martin@gnome.org>
16984 Implemented the IndexerName attribute in interfaces.
16986 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16987 name if this is an explicit interface implementation.
16988 (Indexer.InterfaceIndexerName): New public variable. If we're
16989 implementing an interface indexer, this is the IndexerName in that
16990 interface. Otherwise, it's the IndexerName.
16991 (Indexer.DefineMethod): If we're implementing interface indexer,
16992 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
16993 and Pending.ImplementIndexer methods.
16994 (Indexer.Define): Also define the PropertyBuilder if we're
16995 implementing an interface indexer and this is neither an explicit
16996 interface implementation nor do the IndexerName match the one in
16999 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17000 If a method is defined here, then we always need to create a proxy
17001 for it. This is used when implementing interface indexers.
17002 (Pending.IsInterfaceIndexer): New public method.
17003 (Pending.ImplementIndexer): New public method.
17004 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17005 This is used when implementing interface indexers to define a proxy
17007 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17008 define a proxy if necessary.
17010 * interface.cs (Interface.IndexerName): New public variable.
17011 (Interface.PopulateIndexer): Set the IndexerName.
17012 (Interface.DefineIndexers): New private method. Populate all the
17013 indexers and make sure their IndexerNames match.
17015 * typemanager.cs (IndexerPropertyName): Added support for interface
17018 2002-07-22 Martin Baulig <martin@gnome.org>
17020 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17021 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17022 ret if HasReturnLabel.
17023 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17026 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17027 and set the ec.LoopBeginTryCatchLevel.
17028 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17029 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17030 the current ec.TryCatchLevel, the branch goes out of an exception
17031 block. In this case, we need to use Leave and not Br.
17033 2002-07-22 Martin Baulig <martin@gnome.org>
17035 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17036 block unless the block does not always return or it is contained in
17037 another try { ... } catch { ... } block. Fixes bug #26506.
17038 Added verify-1.cs to the test suite.
17040 2002-07-22 Martin Baulig <martin@gnome.org>
17042 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17043 then we do not always return. Fixes bug #24985.
17045 2002-07-22 Martin Baulig <martin@gnome.org>
17047 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17048 lookup on a per-class level; ie. walk up the class hierarchy until we
17049 found at least one applicable method, then choose the best among them.
17050 Fixes bug #24463 and test-29.cs.
17052 2002-07-22 Martin Baulig <martin@gnome.org>
17054 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17055 return types of the methods. The return type is not part of the
17056 signature and we must not check it to make the `new' modifier work.
17057 Fixes bug #27999, also added test-147.cs.
17058 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17060 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17061 on the method's return type.
17063 2002-07-21 Martin Baulig <martin@gnome.org>
17065 * assign.cs: Make this work if the rightmost source is a constant and
17066 we need to do an implicit type conversion. Also adding a few more tests
17067 to test-38.cs which should have caught this.
17069 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17070 target in the makefile for this. The makefile.gnu is primarily intended
17071 for end-users who don't want to debug the compiler.
17073 2002-07-21 Martin Baulig <martin@gnome.org>
17075 * assign.cs: Improved the Assign class so it can now handle embedded
17076 assignments (X = Y = Z = something). As a side-effect this'll now also
17077 consume less local variables. test-38.cs now passes with MCS, added
17078 a few new test cases to that test.
17080 2002-07-20 Martin Baulig <martin@gnome.org>
17082 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17083 instructions. Fixes bug #27977, also added test-146.cs.
17085 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17087 * cs-tokenizer.cs: fixed getHex ().
17089 2002-07-19 Martin Baulig <martin@gnome.org>
17091 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17092 not Type.GetType() to lookup the array type. This is needed when
17093 we're constructing an array of a user-defined type.
17094 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17095 single-dimensional arrays, but also for single-dimensial arrays of
17098 2002-07-19 Martin Baulig <martin@gnome.org>
17100 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17101 this function is called, it's not allowed to share LocalBuilders
17102 among ILGenerators.
17104 2002-07-19 Martin Baulig <martin@gnome.org>
17106 * expression.cs (Argument.Resolve): Report an error 118 when trying
17107 to pass a type as argument.
17109 2002-07-18 Martin Baulig <martin@gnome.org>
17111 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17112 Conv_R_Un for the signed `long' type.
17114 2002-07-15 Miguel de Icaza <miguel@ximian.com>
17116 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17117 `expr' for the temporary result, as that will fail if we do
17118 multiple resolves on the same expression.
17120 2002-07-05 Miguel de Icaza <miguel@ximian.com>
17122 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17123 ec.TypeContainer for looking up aliases.
17125 * class.cs (TypeContainer): Remove LookupAlias from here.
17127 * decl.cs (DeclSpace); Move here.
17129 2002-07-01 Miguel de Icaza <miguel@ximian.com>
17131 * class.cs (FindMembers): Only call filter if the constructor
17132 bulider is not null.
17134 Also handle delegates in `NestedTypes' now. Now we will perform
17135 type lookups using the standard resolution process. This also
17138 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17139 This uses Expressions (the limited kind that can be parsed by the
17140 tree) instead of strings.
17142 * expression.cs (ComposedCast.ToString): Implement, used to flag
17143 errors since now we have to render expressions.
17145 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
17148 * ecore.cs (SimpleName.ToString): ditto.
17150 * cs-parser.jay: Instead of using strings to assemble types, use
17151 Expressions to assemble the type (using SimpleName, ComposedCast,
17152 MemberAccess). This should fix the type lookups in declarations,
17153 because we were using a different code path for this.
17155 * statement.cs (Block.Resolve): Continue processing statements
17156 even when there is an error.
17158 2002-07-17 Miguel de Icaza <miguel@ximian.com>
17160 * class.cs (Event.Define): Also remove the `remove' method from
17161 the list of pending items.
17163 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17164 generate more compact code.
17166 2002-07-17 Martin Baulig <martin@gnome.org>
17168 * const.cs (Const.LookupConstantValue): Add support for constant
17169 `unchecked' and `checked' expressions.
17170 Also adding test case test-140.cs for this.
17172 2002-07-17 Martin Baulig <martin@gnome.org>
17174 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17175 check whether mi.ReturnType implements the IEnumerator interface; the
17176 `==' and the IsAssignableFrom() will fail in this situation.
17178 2002-07-16 Ravi Pratap <ravi@ximian.com>
17180 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
17183 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17185 * expression.cs: fixed bug #27811.
17187 2002-07-14 Miguel de Icaza <miguel@ximian.com>
17189 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17190 Molaro: when we are a ref, the value already contains a pointer
17191 value, do not take the address of it.
17193 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17194 * removed mb-parser.jay and mb-tokenizer.cs
17196 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17198 * expression.cs: check against the building corlib void type.
17200 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17202 * ecore.cs: fix for valuetype static readonly fields: when
17203 initializing them, we need their address, not the address of a copy.
17205 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17207 * typemanager.cs: register also enum_type in corlib.
17209 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17211 * class.cs: allow calling this (but not base) initializers in structs.
17213 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17215 * ecore.cs: make sure we compare against the building base types
17218 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17220 * typemanager.cs: fix TypeToCoreType() to handle void and object
17221 (corlib gets no more typerefs after this change).
17223 2002-07-12 Miguel de Icaza <miguel@ximian.com>
17225 * expression.cs (ArrayCreation.EmitArrayArguments): use
17226 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17228 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17229 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
17230 array indexes, the runtime actually forbids them.
17232 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17233 for array arguments here.
17235 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17236 instead of the default for ValueTypes.
17238 (New.DoEmit): Use IsValueType instead of
17239 IsSubclassOf (value_type)
17240 (New.DoResolve): ditto.
17241 (Invocation.EmitCall): ditto.
17243 * assign.cs (Assign): ditto.
17245 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17246 Statements *are* currently doing part of their resolution during
17249 Expressions do always resolve during resolve, but statements are
17250 only required to propagate resolution to their children.
17252 2002-07-11 Miguel de Icaza <miguel@ximian.com>
17254 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17256 (LoadAssembly): Do not add the dll if it is already specified
17258 (MainDriver): Add the System directory to the link path at the end,
17259 after all the other -L arguments.
17261 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17262 wrong opcode for loading bytes and bools (ldelem.i1 instead of
17263 ldelem.u1) and using the opposite for sbytes.
17265 This fixes Digger, and we can finally run it.
17267 * driver.cs (UnixParseOption): Move the option parsing here.
17268 (CSCParseOption): Implement CSC-like parsing of options.
17270 We now support both modes of operation, the old Unix way, and the
17271 new CSC-like way. This should help those who wanted to make cross
17272 platform makefiles.
17274 The only thing broken is that /r:, /reference: and /lib: are not
17275 implemented, because I want to make those have the same semantics
17276 as the CSC compiler has, and kill once and for all the confussion
17277 around this. Will be doing this tomorrow.
17279 * statement.cs (Unsafe.Resolve): The state is checked during
17280 resolve, not emit, so we have to set the flags for IsUnsfe here.
17282 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17284 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17285 not catch the Error_ObjectRefRequired in SimpleName (as it is
17286 possible to have a class/instance variable name that later gets
17287 deambiguated), we have to check this here.
17289 2002-07-10 Ravi Pratap <ravi@ximian.com>
17291 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17292 make static and put into Expression.
17294 (Event.Define): Register the private field of the event with the
17295 TypeManager so that GetFieldFromEvent can get at it.
17297 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17298 keep track of the private field associated with an event which
17301 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17304 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17306 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17308 * expression.cs (Binary.EmitBranchable): this routine emits the
17309 Binary expression in a branchable context. This basically means:
17310 we need to branch somewhere, not just get the value on the stack.
17312 This works together with Statement.EmitBoolExpression.
17314 * statement.cs (Statement.EmitBoolExpression): Use
17317 2002-07-09 Miguel de Icaza <miguel@ximian.com>
17319 * statement.cs (For): Reduce the number of jumps in loops.
17321 (For): Implement loop inversion for the For statement.
17323 (Break): We can be breaking out of a Try/Catch controlled section
17324 (foreach might have an implicit try/catch clause), so we need to
17325 use Leave instead of Br.
17327 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17328 now). If the instace expression supports IMemoryLocation, we use
17329 the AddressOf method from the IMemoryLocation to extract the
17330 address instead of emitting the instance.
17332 This showed up with `This', as we were emitting the instance
17333 always (Emit) instead of the Address of This. Particularly
17334 interesting when This is a value type, as we dont want the Emit
17335 effect (which was to load the object).
17337 2002-07-08 Miguel de Icaza <miguel@ximian.com>
17339 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17341 * statement.cs (Checked): Set the CheckedState during the resolve
17342 process too, as the ConvCast operations track the checked state on
17343 the resolve process, and not emit.
17345 * cs-parser.jay (namespace_member_declaration): Flag that we have
17346 found a declaration when we do. This is used to flag error 1529
17348 * driver.cs: Report ok when we display the help only.
17350 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
17352 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17354 2002-07-04 Miguel de Icaza <miguel@ximian.com>
17356 * cs-tokenizer.cs (define): We also have to track locally the
17357 defines. AllDefines is just used for the Conditional Attribute,
17358 but we also need the local defines for the current source code.
17360 2002-07-03 Miguel de Icaza <miguel@ximian.com>
17362 * statement.cs (While, For, Do): These loops can exit through a
17363 Break statement, use this information to tell whether the
17364 statement is the last piece of code.
17366 (Break): Flag that we break.
17368 * codegen.cs (EmitContexts): New `Breaks' state variable.
17370 2002-07-03 Martin Baulig <martin@gnome.org>
17372 * class.cs (TypeContainer.MethodModifiersValid): Allow override
17373 modifiers in method declarations in structs. Otherwise, you won't
17374 be able to override things like Object.Equals().
17376 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17378 * class.cs (Method, Property, Indexer): Do not allow the public
17379 modifier to be used in explicit interface implementations.
17381 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17382 override modifiers in method declarations in structs
17384 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
17386 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17387 integer or real overflow, report an error
17389 2002-07-02 Martin Baulig <martin@gnome.org>
17391 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17392 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17393 to tell the runtime about our newly created System.Object and
17394 System.ValueType types.
17396 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17398 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17399 struct instead of Ldarg/Starg.
17401 2002-07-02 Martin Baulig <martin@gnome.org>
17403 * expression.cs (Indirection.Indirection): Call
17404 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17406 2002-07-02 Martin Baulig <martin@gnome.org>
17408 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17409 ValueType, call TypeManager.TypeToCoreType() on it.
17410 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17411 the OpCodes.Newarr argument.
17413 2002-07-02 Martin Baulig <martin@gnome.org>
17415 * expression.cs (Invocation.EmitCall): When compiling corlib,
17416 replace all calls to the system's System.Array type to calls to
17417 the newly created one.
17419 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17420 System.Array methods.
17421 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17422 from the system's System.Array type which must be replaced.
17424 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17426 * typemanager.cs: load unverifiable_code_ctor so we can build
17427 corlib using the correct type. Avoid using GetTypeCode() with
17429 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17430 TypeManager.object_type to allow building corlib.
17432 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17434 * ecore.cs: handle System.Enum separately in LoadFromPtr().
17436 2002-07-01 Martin Baulig <martin@gnome.org>
17438 * class.cs: Make the last change actually work, we need to check
17439 whether `ifaces != null' to avoid a crash.
17441 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17443 * class.cs: when we build structs without fields that implement
17444 interfaces, we need to add the interfaces separately, since there is
17445 no API to both set the size and add the interfaces at type creation
17448 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17450 * expression.cs: the dimension arguments to the array constructors
17451 need to be converted if they are a long.
17453 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17455 * class.cs: don't emit ldarg.0 if there is no parent constructor
17456 (fixes showstopper for corlib).
17458 2002-06-29 Martin Baulig <martin@gnome.org>
17460 MCS now compiles corlib on GNU/Linux :-)
17462 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17463 ie. check for MethodImplOptions.InternalCall.
17465 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17466 and TypeManager.attribute_type are null, so we must explicitly check
17467 whether parent is not null to find out whether it's an attribute type.
17468 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17469 and SetBuilder, not only if the property is neither abstract nor external.
17470 This is necessary to set the MethodImplOptions on the accessor methods.
17471 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17472 SetBuilder, see Property.Emit().
17474 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17475 populate "System.Object", "System.ValueType" and "System.Attribute" since
17476 they've already been populated from BootCorlib_PopulateCoreTypes().
17478 2002-06-29 Martin Baulig <martin@gnome.org>
17480 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17481 is the NullLiteral, we also need to make sure that target_type is not
17484 2002-06-29 Martin Baulig <martin@gnome.org>
17486 * rootcontext.cs (RootContext.ResolveCore): We must initialize
17487 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17488 before calling BootstrapCorlib_ResolveDelegate ().
17490 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17492 * statement.cs: fixed build-breaker. All tests passed ok.
17494 2002-06-27 Martin Baulig <martin@gnome.org>
17496 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17497 for System.Decimal when compiling corlib.
17499 2002-06-27 Martin Baulig <martin@gnome.org>
17501 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17502 switch blocks which contain nothing but a default clause.
17504 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
17506 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17508 2002-06-27 Martin Baulig <martin@gnome.org>
17510 * ecore.cs (PropertyExpr.PropertyExpr): Call
17511 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17513 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17514 is already a TypeBuilder.
17516 2002-06-27 Martin Baulig <martin@gnome.org>
17518 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17519 `target_type == TypeManager.array_type', not IsAssignableFrom() in
17520 the "from an array-type to System.Array" case. This makes it work
17521 when compiling corlib.
17523 2002-06-27 Martin Baulig <martin@gnome.org>
17525 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17526 non-static PropertyExpr, set its InstanceExpression. This makes
17527 the `ICollection.Count' property work in System/Array.cs.
17529 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
17531 * driver.cs: Made error handling more consistent. Errors now
17532 tracked by Report class, so many methods which used to return int
17533 now return void. Main() now prints success/failure and
17534 errors/warnings message.
17536 Renamed '--probe' compiler argument to '--expect-error'. Removed
17537 the magic number return values (123 and 124). Now, if the
17538 expected error occurs, the compiler exits with success (exit value
17539 0). If the compilation completes without seeing that particular
17540 error, the compiler exits with failure (exit value 1). The
17541 makefile in mcs/errors has been changed to handle the new behaviour.
17543 * report.cs: Made 'expected error' number a property and renamed
17544 it from 'Probe' to 'ExpectedError'.
17546 * genericparser.cs: Removed error handling support, since it is
17547 now all done by Report class.
17549 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17550 class, so parse() no longer returns an int.
17552 * namespace.cs: Use Report.Error instead of GenericParser.error
17554 2002-06-22 Miguel de Icaza <miguel@ximian.com>
17556 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17557 TypeContainer.AddOperator): At the front of the list put the
17558 explicit implementations, so they get resolved/defined first.
17560 2002-06-21 Miguel de Icaza <miguel@ximian.com>
17562 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17563 interface type is implemented by this TypeContainer. Used during
17564 explicit interface implementation.
17566 (Property.Define, Indexer.Define, Method.Define): Validate that
17567 the given interface in the explicit implementation is one of the
17568 base classes for the containing type.
17570 Also if we are explicitly implementing an interface, but there is
17571 no match in the pending implementation table, report an error.
17573 (Property.Define): Only define the property if we are
17574 not explicitly implementing a property from an interface. Use the
17575 correct name also for those properties (the same CSC uses,
17576 although that is really not needed).
17578 (Property.Emit): Do not emit attributes for explicitly implemented
17579 properties, as there is no TypeBuilder.
17581 (Indexer.Emit): ditto.
17583 Hiding then means that we do not really *implement* a pending
17584 implementation, which makes code fail.
17586 2002-06-22 Martin Baulig <martin@gnome.org>
17588 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17589 the return value of Object.GetType(). [FIXME: we need to do this whenever
17590 we get a type back from the reflection library].
17592 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17594 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17596 2002-06-20 Miguel de Icaza <miguel@ximian.com>
17598 * attribute.cs: Return null if we can not look up the type.
17600 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17601 the interface types found.
17603 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17604 interface types found.
17606 * typemanager.cs (GetInterfaces): Make this routine returns alll
17607 the interfaces and work around the lame differences between
17608 System.Type and System.Reflection.Emit.TypeBuilder in the results
17609 result for GetInterfaces.
17611 (ExpandInterfaces): Given an array of interface types, expand and
17612 eliminate repeated ocurrences of an interface. This expands in
17613 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17616 2002-06-21 Martin Baulig <martin@gnome.org>
17618 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17621 2002-06-21 Martin Baulig <martin@gnome.org>
17623 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
17624 and called with one of the core types, return the corresponding typebuilder for
17627 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17630 2002-06-21 Martin Baulig <martin@gnome.org>
17632 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17633 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17634 (Expression.ConvertReferenceExplicit): Likewise.
17636 * expression.cs (ElementAccess.DoResolve): Likewise.
17637 (ElementAccess.DoResolveLValue): Likewise.
17639 2002-06-10 Martin Baulig <martin@gnome.org>
17641 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17642 add the "value" parameter to the parameter list.
17644 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17647 2002-06-19 Miguel de Icaza <miguel@ximian.com>
17649 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17650 the argument to an int, uint, long or ulong, per the spec. Also
17651 catch negative constants in array creation.
17653 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17655 * class.cs: do not allow the same interface to appear twice in
17656 the definition list.
17658 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17660 * ecore.cs: don't use ldlen with System.Array.
17662 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17664 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17666 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17668 * modifiers.cs: produce correct field attributes for protected
17669 internal. Easy fix so miguel can work on ther harder stuff:-)
17671 2002-06-18 Miguel de Icaza <miguel@ximian.com>
17673 * pending.cs: New file. Move the code from class.cs here.
17674 Support clearning the pending flag for all methods (when not doing
17675 explicit interface implementation).
17677 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17679 * rootcontext.cs: added a couple more types needed to bootstrap.
17681 2002-06-17 Miguel de Icaza <miguel@ximian.com>
17683 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17684 constructor in the type, instead of any constructor in the type
17685 hierarchy. Thanks to Paolo for finding this bug (it showed up as
17686 a bug in the Mono runtime when applying the params attribute).
17688 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17689 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17691 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
17693 * expression.cs (Unary.ResolveOperator): Use TypeManager
17694 to resolve the type.
17696 2002-06-13 Ravi Pratap <ravi@ximian.com>
17698 * cs-parser.jay (enum_member_declaration): Pass in the attributes
17701 * enum.cs (AddEnumMember): Add support to store the attributes associated
17702 with each member too.
17704 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17705 field builders too - this takes care of the enum member case.
17707 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
17709 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17710 address-of operator on both value types and pointers.
17712 2002-06-10 Martin Baulig <martin@gnome.org>
17714 * interface.cs (Interface.PopulateIndexer): Add the indexer's
17715 PropertyBuilder to the `property_builders' list.
17717 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17718 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17719 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
17720 find any indexers which are inherited from an interface.
17722 2002-06-09 Martin Baulig <martin@gnome.org>
17724 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17725 the same type as the constant if necessary. There's also a test-130.cs
17728 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17730 * typemanager.cs (TypeManager.ChangeType): Previously known as
17731 Enum.ChangeEnumType().
17733 2002-06-09 Martin Baulig <martin@gnome.org>
17735 * expression.cs (Cast.TryReduce): Added support for consts.
17737 2002-06-08 Ravi Pratap <ravi@ximian.com>
17739 * class.cs (Accessor): Hold attributes information so we can pass
17742 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17743 Modify to pass in attributes attached to the methods.
17745 (add_accessor_declaration, remove_accessor_declaration): Ditto.
17747 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17748 to handle the Accessor kind :-)
17750 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17752 2002-06-08 Martin Baulig <martin@gnome.org>
17754 * expression.cs (Unary.TryReduceNegative): Added support for
17757 2002-06-08 Martin Baulig <martin@gnome.org>
17759 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17760 name can't be found in the `defined_names' - the caller will do a
17761 MemberLookup in this case and thus find methods in System.Enum
17762 such as Enum.IsDefined().
17764 2002-06-08 Martin Baulig <martin@gnome.org>
17766 * enum.cs (Enum.ChangeEnumType): This is a custom version of
17767 Convert.ChangeType() which works with TypeBuilder created types.
17768 (Enum.LookupEnumValue, Enum.Define): Use it here.
17770 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17771 `TypeBuilder.BaseType != null' check.
17772 (TypeContainer.FindMembers): Only lookup parent members if we
17773 actually have a parent.
17774 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17775 (ConstructorInitializer.Resolve): Likewise.
17777 * interface.cs (Interface.FindMembers): Added
17778 `TypeBuilder.BaseType != null' check.
17780 * rootcontext.cs (RootContext.ResolveCore): Added
17781 "System.Runtime.CompilerServices.IndexerNameAttribute" to
17782 classes_second_stage.
17784 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17785 debug_type and trace_type when compiling with --nostdlib.
17787 2002-06-07 Martin Baulig <martin@gnome.org>
17789 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17790 (AddField): Set it to true when adding a non-static field.
17791 (DefineType): Use `have_nonstatic_fields' to find out whether we
17792 have non-static fields, not `Fields != null'.
17794 2002-06-02 Miguel de Icaza <miguel@ximian.com>
17796 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17797 dereferencing a null on the static-field code path)
17799 2002-05-30 Martin Baulig <martin@gnome.org>
17801 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17802 to take command line arguments. Use reflection to call the new
17803 custom `Initialize' function on the symbol writer and pass it the
17804 command line arguments.
17806 * driver.cs (--debug-args): New command line argument to pass command
17807 line arguments to the symbol writer.
17809 2002-05-28 Miguel de Icaza <miguel@ximian.com>
17811 * assign.cs (DoResolve): Forgot to do the implicit conversion to
17812 the target type for indexers and properties. Thanks to Joe for
17815 2002-05-27 Miguel de Icaza <miguel@ximian.com>
17817 * typemanager.cs (MethodFlags): returns the method flags
17818 (Obsolete/ShouldIgnore) that control warning emission and whether
17819 the invocation should be made, or ignored.
17821 * expression.cs (Invocation.Emit): Remove previous hack, we should
17822 not do this on matching a base type, we should do this based on an attribute
17824 Only emit calls to System.Diagnostics.Debug and
17825 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17826 on the command line.
17828 * rootcontext.cs: Global settings for tracing and debugging.
17830 * cs-tokenizer.cs (define): New utility function to track
17831 defines. Set the global settings for TRACE and DEBUG if found.
17833 2002-05-25 Ravi Pratap <ravi@ximian.com>
17835 * interface.cs (Populate*): Pass in the TypeContainer as well as
17836 the DeclSpace as parameters so that we can create EmitContexts and
17837 then use that to apply attributes etc.
17839 (PopulateMethod, PopulateEvent, PopulateProperty)
17840 (PopulateIndexer): Apply attributes everywhere.
17842 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17845 (ApplyAttributes): Update accordingly.
17847 We now apply interface attributes for all members too.
17849 2002-05-26 Miguel de Icaza <miguel@ximian.com>
17851 * class.cs (Indexer.Define); Correctly check if we are explicit
17852 implementation (instead of checking the Name for a ".", we
17853 directly look up if the InterfaceType was specified).
17855 Delay the creation of the PropertyBuilder.
17857 Only create the PropertyBuilder if we are not an explicit
17858 interface implementation. This means that explicit interface
17859 implementation members do not participate in regular function
17860 lookups, and hence fixes another major ambiguity problem in
17861 overload resolution (that was the visible effect).
17863 (DefineMethod): Return whether we are doing an interface
17866 * typemanager.cs: Temporary hack until we get attributes in
17867 interfaces (Ravi is working on that) and we get IndexerName
17868 support in interfaces.
17870 * interface.cs: Register the indexers as properties.
17872 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17873 warning, I have verified that this is a bug in the .NET runtime
17874 (JavaScript suffers of the same problem).
17876 * typemanager.cs (MemberLookup): When looking up members for
17877 interfaces, the parent of an interface is the implicit
17878 System.Object (so we succeed in searches of Object methods in an
17879 interface method invocation. Example: IEnumerable x; x.ToString
17882 2002-05-25 Miguel de Icaza <miguel@ximian.com>
17884 * class.cs (Event): Events should also register if they do
17885 implement the methods that an interface requires.
17887 * typemanager.cs (MemberLookup); use the new GetInterfaces
17890 (GetInterfaces): The code used to lookup interfaces for a type is
17891 used in more than one place, factor it here.
17893 * driver.cs: Track the errors at the bottom of the file, we kept
17896 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17897 instance if the method we are calling is static!
17899 2002-05-24 Miguel de Icaza <miguel@ximian.com>
17901 * attribute.cs (ApplyAttributes): Make this function filter out
17902 the IndexerName attribute (as that attribute in reality is never
17903 applied) and return the string constant for the IndexerName
17906 * class.cs (TypeContainer.Emit): Validate that all the indexers
17907 have the same IndexerName attribute, and if so, set the
17908 DefaultName attribute on the class.
17910 * typemanager.cs: The return value might contain other stuff (not
17911 only methods). For instance, consider a method with an "Item"
17912 property and an Item method.
17914 * class.cs: If there is a problem with the parameter types,
17917 2002-05-24 Ravi Pratap <ravi@ximian.com>
17919 * ecore.cs (ImplicitConversionExists): Wrapper function which also
17920 looks at user defined conversion after making a call to
17921 StandardConversionExists - we need this for overload resolution.
17923 * expression.cs : Update accordingly the various method calls.
17925 This fixes 2 bugs filed against implicit user defined conversions
17927 2002-05-22 Miguel de Icaza <miguel@ximian.com>
17929 * statement.cs: Track the result of the assignment.
17931 2002-05-21 Miguel de Icaza <miguel@ximian.com>
17933 * expression.cs (MemberAccess): Improved error reporting for
17934 inaccessible members.
17936 2002-05-22 Martin Baulig <martin@gnome.org>
17938 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
17939 itself with debugging support.
17941 2002-05-22 Martin Baulig <martin@gnome.org>
17943 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17944 Removed, this isn't needed anymore.
17946 2002-05-20 Martin Baulig <martin@gnome.org>
17948 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17949 be underlying type for an enum.
17951 2002-05-20 Miguel de Icaza <miguel@ximian.com>
17953 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17954 that splits out the loading of just the core types.
17956 * rootcontext.cs (ResolveCore): Split the struct resolution in
17957 two, so we can load the enumeration underlying types before any
17960 * expression.cs (Is): Bandaid until we fix properly Switch (see
17961 bug #24985 for details).
17963 * typemanager.cs (ImplementsInterface): The hashtable will contain
17964 a null if there are no interfaces implemented.
17966 2002-05-18 Miguel de Icaza <miguel@ximian.com>
17968 * cs-parser.jay (indexer_declarator): It is fine to have array
17971 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17973 * typemanager.cs: (RegisterBuilder): New function used to register
17974 TypeBuilders that implement interfaces. Since
17975 TypeBuilder.GetInterfaces (as usual) does not work with lame
17977 (AddUserType): register interfaces.
17979 (ImplementsInterface): Use the builder_to_ifaces hash if we are
17980 dealing with TypeBuilder. Also, arrays are showing up as
17981 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17982 methods can not be invoked on them!
17984 * ecore.cs (ExplicitReferenceConversionExists): Made public.
17985 (ImplicitReferenceConversionExists): Split out from
17986 StandardConversionExists.
17988 * expression.cs (As): We were only implementing one of the three
17989 cases for the as operator. We now implement them all.
17990 (Is): Implement the various other cases for Is as well.
17992 * typemanager.cs (CACHE): New define used to control if we want or
17993 not the FindMembers cache. Seems to have a negative impact on
17994 performance currently
17996 (MemberLookup): Nested types have full acess to
17997 enclosing type members
17999 Remove code that coped with instance/static returns for events, we
18000 now catch this in RealFindMembers.
18002 (RealFindMembers): only perform static lookup if the instance
18003 lookup did not return a type or an event.
18005 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18007 * assign.cs (CompoundAssign): We pass more semantic information
18008 now to Compound Assignments than we did before: now we have all
18009 the information at hand, and now we resolve the target *before* we
18010 do the expression expansion, which allows the "CacheValue" method
18011 to have the effect we intended (before, a [x] += 1 would generate
18012 two differen ArrayAccess expressions from the ElementAccess,
18013 during the resolution process).
18015 (CompoundAssign.DoResolve): Resolve target and original_source here.
18017 2002-05-16 Miguel de Icaza <miguel@ximian.com>
18019 * expression.cs (ArrayAccess): dropped debugging information.
18021 * typemanager.cs: Small bug fix: I was always returning i_members,
18022 instead of one of i_members or s_members (depending on which had
18025 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
18026 method is invoked before any code generation takes place, and it
18027 is a mechanism to inform that the expression will be invoked more
18028 than once, and that the method should use temporary values to
18029 avoid having side effects
18031 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18033 * ecore.cs (Expression.CacheTemporaries): Provide empty default
18036 * expression.cs (Indirection, ArrayAccess): Add support for
18037 CacheTemporaries in these two bad boys.
18039 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18040 ldobj or ldind_ref.
18041 (StoreFromPtr): Handle stobj as well.
18043 * expression.cs (UnaryMutator): Share more code.
18045 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18046 down: I was not tracking the Filter function as well, which
18047 was affecting the results of the cache.
18049 2002-05-15 Miguel de Icaza <miguel@ximian.com>
18051 * attribute.cs: Remove the hack to handle the CharSet property on
18054 2002-05-14 Miguel de Icaza <miguel@ximian.com>
18056 * attribute.cs (DoResolve): More uglyness, we now only try to
18057 resolve the attribute partially, to extract the CharSet
18058 information (only if we are a StructLayout attribute). Otherwise
18060 (GetExtraTypeInfo): Add some code to conditionally kill in the
18061 future this. I am more and more convinced that the .NET
18062 framework has special code to handle the attribute setting on
18065 * expression.cs (IsParamsMethodApplicable): Revert my previous
18066 foreach change here, it was wrong.
18068 2002-05-13 Miguel de Icaza <miguel@ximian.com>
18070 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18071 (pp_expr): do not abort on unknown input, just return.
18072 (eval): abort if there are pending chars.
18074 * attribute.cs (Attribute.Resolve): Positional parameters are
18075 optional. Deal with that case.
18077 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18078 the Ansi/Unicode/Auto information for the type.
18080 (TypeContainer.DefineType): instantiate the EmitContext here, as
18081 we will be using it during the type definition (to resolve
18082 attributes) and during the emit phase.
18084 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18085 to pull type information out of the attributes
18087 (Attribute.Resolve): track the constructor builder, and allow for
18088 multiple invocations (structs and classes will use this).
18090 * ecore.cs (MemberLookupFinal): new version with all the
18091 parameters customizable.
18093 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18094 constructors. Return if the result value is null (as the error
18095 would have been flagged already by MemberLookupFinal)
18097 Do not allow instances of abstract classes or interfaces to be
18100 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18101 We have to compare the assembly property here when dealing with
18102 FamANDAssem and Assembly access modifiers, because we might be
18103 creating an assembly from *modules* (that means that we are not
18104 getting TypeBuilders for types defined in other modules that are
18105 part of this assembly).
18107 (Method.Emit): If the method is marked abstract and has a body,
18110 (TypeContainer.DefineMembers): If both the defined member and the
18111 parent name match are methods, then do not emit any warnings: let
18112 the Method.Define routine take care of flagging warnings. But if
18113 there is a mismatch (method overrides something else, or method is
18114 overriwritten by something, then emit warning).
18116 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18117 set to null, this means `do not check for the return type on the
18120 (Method.Define): set the return type for the method signature to
18121 null, so that we get methods with the same name and parameters and
18122 different return types. This is used to flag warning 114 (you are
18123 hiding a method, and you probably want to use the new/override
18126 * typemanager.cs (MemberLookup): Implemented proper access
18127 control, closing a long standing set of bug reports. The problem
18128 was that the Framework only has two bits: Public and NonPublic,
18129 and NonPublic includes private and protected methods, but we need
18130 to enforce the FamANDAssem, FamOrAssem and Family.
18132 2002-05-11 Miguel de Icaza <miguel@ximian.com>
18134 * statement.cs (GotoCase): Return true: Ammounts to giving up
18135 knowledge on whether we return or not, and letting the other case
18136 be responsible for it.
18138 2002-05-10 Miguel de Icaza <miguel@ximian.com>
18140 * driver.cs: Do not load directories for each file processed, only
18141 do it if there is a pattern.
18143 * ecore.cs: Report readonly assigns here as well, as we might have
18144 been resolved only by MemberAccess.
18146 (SimpleName.SimpleNameResolve): Also be useful for LValue
18147 resolution. We need this to propagate assign to local readonly variables
18149 * typemanager.cs: Use a ptrhashtable for the criteria, because we
18150 do not want to reuse potential criteria memory.
18152 * class.cs (MyEventBuilder): Set reflected_type;
18154 * ecore.cs (Constantify): Added support for constifying bools.
18156 (RootContext.LookupType): Added a cache for values looked up in
18157 the declaration space.
18159 * typemanager.cs (FindMembers): Now is a front-end to
18160 RealFindMembers, and provides a two-level hashtable-based cache to
18163 15% performance improvement: from 22.5 to 19.2 seconds.
18165 * expression.cs (IsParamsMethodApplicable): use foreach.
18166 (Invocation.DoResolve): ditto.
18167 (New.DoResolve): ditto.
18168 (ArrayCreation.DoResolve): ditto.
18170 * ecore.cs (FindMostEncompassingType): use foreach.
18172 * delegate.cs (NewDelegate.DoResolve): Use foreach
18174 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18175 (RemoveMethods): use foreach.
18177 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18178 nested foreach statements instead of for, and also break out of
18179 the inner loop once a match is found.
18181 (Invocation.OverloadResolve): Use foreach, simplify the code.
18183 2002-05-08 Miguel de Icaza <miguel@ximian.com>
18185 * cfold.cs (BinaryFold): During an enumeration evaluation context,
18186 we actually unwrap the expression to allow for extra information
18189 * expression.cs: Use Shr_Un on unsigned operations.
18191 2002-05-08 Ravi Pratap <ravi@ximian.com>
18193 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
18194 applicable operators was not being considered correctly. This closes
18195 the bug Miguel reported.
18197 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18199 * attribute.cs: check that the type derives from System.Attribute
18200 and report the correct error in that case (moved the duplicate code to
18201 its own method, too).
18203 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18205 * attribute.cs: lookup attribute type name as the spec says: first the
18206 bare attribute name and then name + "Attribute" (nant compiles with
18207 mcs after this fix).
18209 2002-05-07 Miguel de Icaza <miguel@ximian.com>
18211 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
18212 Because of the way we parse things, we should try to see if a
18213 UIntConstant can fit in an integer.
18215 2002-05-07 Ravi Pratap <ravi@ximian.com>
18217 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18218 when we are in an explicit context.
18220 (ConvertReferenceExplicit): When converting from Iface type S to Class
18221 T make sure the rules are implemented as an OR.
18223 * parameter.cs (ParameterType): Make it a property for now although the
18224 purpose really isn't anything immediate.
18226 * expression.cs (Is*Applicable): Do better checking on the parameter type
18227 of a ref/out parameter. The ones from the system assemblies are already
18228 marked with the correct type so we don't need to do any correction.
18230 * ecore.cs (StandardConversionExists): Conversion from Interface types to
18231 the object type is standard too so include that.
18233 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18235 * ecore.cs (StandardConversionExists): Augment with missing code:
18236 deal with IntConstant, LongConstants and Enumerations.
18238 * assign.cs: Report the error, instead of failing silently
18240 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18241 typecontainer that they are declared, because the
18242 typecontainer/namespace will have the list of using clauses that
18243 need to be applied.
18245 Assembly Attributes were escaping the normal registration
18248 (EmitCode): Apply attributes within an EmitContext that represents
18249 the container they were declared on.
18251 * cs-parser.jay: Track bases for structs. How did I get this wrong?
18253 2002-05-06 Ravi Pratap <ravi@ximian.com>
18255 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18256 Revamp completely - make much cleaner as we now operate only
18259 (FindMostSpecificSource, FindMostSpecificTarget): New methods
18260 to implement the logic detailed in the spec more correctly.
18262 (UserDefinedConversion): Update accordingly.
18264 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18266 * statement.cs: Return flow analysis information up.
18268 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18271 (token): Do not consume an extra character before calling
18274 2002-05-06 Piers Haken <piersh@friskit.com>
18276 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18278 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18280 * class.cs (Constructor.Emit): Set the IsStatic flag in the
18281 EmitContext during the instance constructor initializer
18282 resolution, to stop access to instance variables.
18284 This is mandated by the spec, last paragraph of the `constructor
18285 initializers' section.
18287 2002-05-05 Miguel de Icaza <miguel@ximian.com>
18289 * cs-parser.jay, class.cs (Accessor): new class used to represent
18290 an accessor (get or set). In the past we used `null' to represent
18291 a missing accessor. But this is ambiguous because there was no
18292 way to tell in abstract indexers/properties if one of them was
18295 Now there is a way of addressing that.
18297 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18298 instead of FindMembers.
18300 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18301 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18303 * attribute.cs: Treat indexers and properties as the same in terms
18304 of applying attributes
18306 * ecore.cs (FindMostEncompassedType): Use statically initialized
18307 EmptyExpressions()s like we do elsewhere to avoid creating useless
18308 objects (and we take this out of the tight loop).
18310 (GetConversionOperators): Move the code to extract the actual
18311 operators to a separate routine to clean things up.
18313 2002-05-04 Miguel de Icaza <miguel@ximian.com>
18315 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18316 events are always registered FieldBuilders.
18318 * class.cs (FieldBase): New class shared by Fields
18320 * delegate.cs: If we are a toplevel delegate, use our full name.
18321 If we are a nested delegate, then only use our tail name.
18323 2002-05-02 Ravi Pratap <ravi@ximian.com>
18325 * expression.cs (IsApplicable): Ensure that we add the "&" to
18326 ref/out types before comparing it with the type of the argument.
18328 (IsParamsMethodApplicable): Ditto.
18330 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
18333 * delegate.cs : Handle the case when we have more than one applicable
18334 method. Flag an error only when we finish checking all.
18336 2002-05-02 Miguel de Icaza <miguel@ximian.com>
18338 * expression.cs: Add support for boolean static initializers.
18340 2002-05-01 Miguel de Icaza <miguel@ximian.com>
18342 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18344 * parameter.cs (ComputeParameterTypes,
18345 ComputeAndDefineParameterTypes): Better error handling: now we
18346 clear the `types' cache if we fail during any of the type lookups.
18347 We also return the status code correctly to our caller
18349 * delegate.cs: If we fail to define a delegate, abort the extra
18352 * expression.cs (Binary.ResolveOperator): for
18353 operator==(object,object) and operator !=(object, object) we also
18354 have to verify that there is an implicit conversion from one to
18357 (ArrayAccess.DoResolve): Array Access can operate on
18360 2002-04-30 Miguel de Icaza <miguel@ximian.com>
18362 * assign.cs (CompoundAssign): A new class used as a "flag" that
18363 the assignment actually is happening as part of a compound
18364 assignment operator.
18366 During compound assignment, a few new rules exist to enable things
18373 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18374 to the type of x) if y is implicitly convertible to the type of x,
18375 and the operator is a builtin operator and the return type of the
18376 operator is explicitly convertible to the type of x.
18378 * rootcontext.cs: Reset warning level to 2. 4 catches various
18379 "interesting" features in mcs, we must clean this up at some
18380 point, but currently am trying to kill other bugs ;-)
18382 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18383 in container classes as well.
18385 * expression.cs (Binary.ResolveOperator): Handle string case
18386 before anything else (as operator overloading does emit an error
18387 before doing anything else).
18389 This code could go away when we move to a table driven model, but
18390 i could not come up with a good plan last night.
18392 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
18394 * typemanager.cs (CSharpName): reimplementation using regex.
18395 * class.cs: added null check for fields in Emit
18396 * rootcontext.cs: set warninglevel to 4
18398 2002-04-29 Miguel de Icaza <miguel@ximian.com>
18400 * typemanager.cs (CSharpName): reimplemented with Lupus
18403 2002-04-28 Miguel de Icaza <miguel@ximian.com>
18405 * statement.cs (If): correclty implement Resolve, because we were
18406 not catching sem errors in there. The same process is needed
18408 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18411 (Statement.Warning_DeadCodeFound): Factorize code.
18412 (While): Report dead code here too.
18414 (Statement): Added Resolve virtual method to allow
18415 for resolution split from the emit code.
18417 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18419 * statement.cs (EmitBoolExpression): No longer try to resolve the
18421 (MakeBoolean): New utility function that resolve, implicitly
18422 converts to boolean and tags the expression.
18425 (If, Do): Implement dead code elimination.
18426 (While): Implement loop inversion
18428 (Do, While, For, If): Resolve the expression prior to calling our
18431 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
18434 - added method Report28 (warning: program has more than one entry point)
18435 - added method IsEntryPoint, implements paragraph 10.1 of the spec
18436 - modified method Method.Define, the part at the end of the method
18438 * rootcontext.cs: added static public Location EntryPointLocation;
18440 * ../errors/cs0028.cs : Add test case for the above warning.
18443 - modified method CSharpName to allow arrays of primitive type to
18444 be printed nicely (e.g. instead of System.Int32[][] it now prints
18446 - added method CSharpSignature: returns the signature of a method
18447 in string format to be used in reporting errors, warnings, etc.
18449 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18452 2002-04-26 Ravi Pratap <ravi@ximian.com>
18454 * delegate.cs (Define): Fix extremely silly bug where I was
18455 setting the type of the 'object' parameter of the BeginInvoke
18456 method to System.IAsyncResult instead of System.Object ;-)
18458 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18460 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18463 (Constructor.Emit): return if we fail to initialize the
18464 constructor. Another door closed!
18466 * expression.cs (New.DoResolve): Improve error message (from -6 to
18467 1501). Use DeclaredOnly lookup to find the exact constructor.
18469 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18470 loop. This is useful.
18472 * cs-parser.jay: Adjust the default parameters so that destructors
18473 have the proper signature.
18475 2002-04-26 Martin Baulig <martin@gnome.org>
18477 * driver.cs (LoadAssembly): If `assembly' contains any characters
18478 which are only valid in path names and not in assembly names
18479 (currently slash, backslash and point), use Assembly.LoadFrom ()
18480 instead of Assembly.Load () on the `assembly' (before iteration
18481 over the link_paths).
18483 2002-04-26 Martin Baulig <martin@gnome.org>
18485 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18487 2002-04-25 Miguel de Icaza <miguel@ximian.com>
18489 * class.cs (Property): use the new typemanager.MemberLookup
18491 (TypeContainer.MemberLookup): Implement using the
18492 TypeManager.MemberLookup now.
18494 * typemanager.cs: Make MemberLookup a function of the TypeManager,
18495 and return MemberInfos, so that these can be used without an
18496 EmitContext (what we had before).
18498 2002-04-24 Miguel de Icaza <miguel@ximian.com>
18500 * expression.cs: Fix the case where the argument to params if the
18501 type of the params. I omitted handling this before. Fixed
18503 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18505 * driver.cs: Call BootCorlib_PopulateCoreType
18507 * class.cs (Property.CheckBase): Check for properties only, not
18510 * interface.cs: Temporary hack: try/catch around the
18511 CustomAttributeBuilder, because I am getting an exception that I
18514 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18515 types whose definitions are required to be there (attributes are
18516 defined before standard types).
18518 Compute definitions as we boot the various types, as they are used
18519 immediately (value_type class will need object_type, but if we do
18520 not initialize object_type, we will pass a null, which will let
18521 the runtime pick the System.Object from the existing corlib, which
18522 is not what we want).
18524 2002-04-22 Patrik Torstensson <totte@labs2.com>
18526 * cs-tokenizer.cs: fixed a number of trim() issues.
18528 2002-04-22 Ravi Pratap <ravi@ximian.com>
18530 * expression.cs (Argument.Type): Ensure that we return the correct
18531 type when we have out or ref parameters [in which case we
18534 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18536 * class.cs (Property, Indexer): Allow extern modifier in there.
18538 * typemanager.cs (InitBaseTypes): Initializes object_type and
18539 value_type, since those will be used early on during the bootstrap
18540 process to compile corlib.
18542 (InitCoreTypes): Move code from here to InitBaseTypes.
18544 2002-04-21 Miguel de Icaza <miguel@ximian.com>
18546 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18547 single-dimension arrays as using the ldlen opcode.
18549 Daniel Lewis discovered this optimization.
18551 * typemanager.cs: Add signature for System.Array::get_Length
18553 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18555 * statement.cs: report the error when the foreach does not apply to an
18556 array nor a collection.
18558 2002-04-19 Miguel de Icaza <miguel@ximian.com>
18560 * expression.cs: Add implicit conversions to the operator ~.
18562 * constant.cs (DecimalConstant.Emit): Emit decimal value.
18564 * typemanager.cs: Locate the decimal constructor.
18566 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18568 * attribute.cs: use the new property of TypeOf.
18569 * expression.cs: added 'get' property around typearg.
18571 These changes fix a build breaker reported by NickD. Is this the
18572 correct way to fix? If not, please, revert my changes and make it
18575 2002-04-17 Miguel de Icaza <miguel@ximian.com>
18577 * attribute.cs: Add support for typeof in attribute invocations.
18578 I am not sure that this is right though.
18580 2002-04-14 Duncan Mak <duncan@ximian.com>
18582 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18583 Binary.Operator.Division case.
18585 2002-04-13 Ravi Pratap <ravi@ximian.com>
18587 * class.cs (DefineType): Ensure that we do a proper check on
18588 attribute types and also register it with the TypeManager.
18590 (TypeContainer.Targets): The default for attribute types is
18591 AttributeTargets.All.
18593 * attribute.cs (ApplyAttributes): Registering the attribute type
18594 is done elsewhere, not when we discover we have a Usage attribute.
18596 2002-04-12 Ravi Pratap <ravi@ximian.com>
18598 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18599 and get rid of is_delegate parameter.
18601 * everywhere : update.
18603 2002-04-12 Ravi Pratap <ravi@ximian.com>
18605 * cs-parser.jay (compilation_unit): Revamp completely to use
18606 some new ideas that I got from Rhys' grammar to solve the problems
18607 with assembly level attributes.
18609 (outer_declaration): New grammar production.
18611 (attribute_sections): Add.
18613 (opt_attributes): Base on attribute_sections
18615 (namespace_declaration): Allow opt_attributes to tackle the case
18616 when we have assembly level attributes - we are clever in this
18619 * attribute.cs (ApplyAttributes): Do not worry about assembly
18620 attributes in the non-global context.
18622 * rootcontext.cs (AddGlobalAttributes): Go back to using this
18623 instead of SetGlobalAttributes.
18625 * class.cs, rootcontext.cs : Ensure we define and generate
18626 attribute types before anything else.
18628 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18629 and flag the new error -20 for the case when the attribute type
18630 does not have valid targets specified. csc does not catch this.
18632 * ../errors/errors.txt : update for error # -20
18634 2002-04-11 Ravi Pratap <ravi@ximian.com>
18636 * support.cs (InternalParameters.ParameterModifier): Do some null
18637 checking and return sane values.
18639 * class.cs (Method.Define): If we are a PInvoke method, ensure
18640 that we are static and extern. Report error # 601
18642 * ../errors/cs0601.cs : Add test case for the above error.
18644 2002-04-07 Ravi Pratap <ravi@ximian.com>
18646 * rootcontext.cs (attribute_types): We need to keep type of
18647 all attribute types separately and emit code for them first.
18649 (RegisterAttribute) : Implement.
18651 * class.cs (DefineType): Check if the current Type is a custom
18652 attribute type and register it accordingly.
18654 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18655 adding the first attribute twice and rename to
18657 (SetGlobalAttributes): this.
18659 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18662 * attribute.cs (ApplyAttributes): Take an additional argument telling us
18663 if we are processing global arguments. Hmm, I am unsure of this.
18665 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18667 * expression.cs: added static array of strings to avoid calling
18668 Enum.ToString () for Operator in Binary. Significant recover of
18671 2002-04-10 Miguel de Icaza <miguel@ximian.com>
18673 * class.cs (FindMembers): Allow the Builders of the various
18674 members to be null. If they are skip them. This only happens
18675 during the PInvoke declaration.
18677 2002-04-09 Miguel de Icaza <miguel@ximian.com>
18679 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18680 failure, so we do not keep going afterwards.
18682 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18683 wanted to pass `false' as the `is_delegate' argument. If this is
18684 the case, why not use delegate_type == null to mean `is_delegate =
18685 false' and anything else as is_delegate = true.
18687 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
18689 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18690 code for the section, not the beginning of the tests.
18692 2002-04-08 Miguel de Icaza <miguel@ximian.com>
18694 * cfold.cs: Handle operator + (Enum x, Underlying x)
18696 * expression.cs (Binary): same. Warn about errors where we have
18697 Enum/Enum in operator + as well.
18699 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
18702 - added support for switch(bool)
18703 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18704 - add TableSwitchEmit() to handle table-based switch statements
18706 2002-04-05 Ravi Pratap <ravi@ximian.com>
18708 * expression.cs (Invocation.OverloadResolve): Factor out code which
18709 does parameter compatibility checking with arguments so that we can
18710 re-use the code even from Delegate.VerifyApplicability
18712 (VerifyArgumentsCompat): Move above code here.
18714 * delegate.cs (VerifyApplicability): Get rid of duplicate code
18715 and instead make a call to the above method.
18717 2002-03-31 Ravi Pratap <ravi@ximian.com>
18719 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18720 We use it to keep track of classes which are attribute types.
18722 2002-04-02 Miguel de Icaza <miguel@ximian.com>
18724 * delegate.cs (Delegate.Define): Correctly define the types in the
18725 presence of fixed and array parameters.
18727 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18730 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18731 include NonPublic after the first iteration.
18733 * class.cs (Indexer.CheckBase): Only check if both parents are
18736 * cs-parser.jay (accessor_body): If empty, set to null.
18738 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18739 same code path here to resolve constants names that we did have in
18740 MemberAccess.DoResolve. There is too much code duplicated here.
18742 2002-04-01 Miguel de Icaza <miguel@ximian.com>
18744 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18746 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18749 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18750 tokens, numbers and strings.
18752 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18755 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18756 asyncronous parameters and the regular parameters.
18758 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18759 specify the target directory.
18761 * expression.cs: (This.DoResolve): Simplify
18762 (As.Emit): Optimize, do not generate IsInst if the expression is
18763 always of the given type.
18765 (Is.DoResolve): Bug fix, we were reporting both always/never for
18768 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18769 creating too many unnecessary arrays.
18771 2002-03-31 Miguel de Icaza <miguel@ximian.com>
18773 * class.cs (EmitFieldInitializer): Use Assign expression to assign
18774 fields instead of rolling our own initializer. Takes care of all
18775 implicit conversions, and drops unnecessary static checks/argument.
18777 2002-03-31 Dick Porter <dick@ximian.com>
18779 * driver.cs: use the GetDirectories() return values properly, and
18780 use "/" as path separator.
18782 2002-03-30 Miguel de Icaza <miguel@ximian.com>
18784 * expression.cs (Unary): Optimize - - expr into expr.
18785 (Binary): Optimize a + (-b) into a -b.
18787 * codegen.cs (CodeGen): Made all methods static.
18789 2002-03-29 Miguel de Icaza <miguel@ximian.com>
18793 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18794 TypeBuilder property.
18796 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18799 * tree.cs: Removed the various RecordXXXX, and replaced with a
18800 single RecordDecl. Removed all the accessor methods, and just
18801 left a single access point Type
18803 * enum.cs: Rename DefineEnum to DefineType.
18805 * decl.cs: New abstract method `DefineType' used to unify the
18806 Defines for Enumerations, Interfaces, TypeContainers and
18809 (FindType): Moved LookupInterfaceOrClass here. Moved the
18810 LookupBaseClasses method that used to live in class.cs and
18811 interface.cs here, and renamed to FindType.
18813 * delegate.cs: Implement DefineType. Take advantage of the
18814 refactored pattern for locating the parent builder without taking
18815 the parent_builder argument (which we know does not work if we are
18816 nested, and triggering a toplevel definition).
18818 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18820 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18821 accessibility of a member has changed during override and report
18824 * class.cs (Method.Define, Property.Define): Only complain on
18825 overrides if the method is private, any other accessibility is
18826 fine (and since we just checked the permission is the same, we are
18829 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18830 and elif are processed always. The other pre-processing
18831 directives are only processed if we are "taking" the path
18833 2002-03-29 Martin Baulig <martin@gnome.org>
18835 * class.cs (Method.Emit): Only emit symbolic debugging info if the
18836 current location is not Null.
18838 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18839 a separate method so we can profile it.
18841 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18842 `span.Seconds' are just seconds, but no minutes or hours.
18843 (MainDriver): Profile the CodeGen.SaveSymbols calls.
18845 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18847 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18848 Remove the gratuitous set of Final:
18850 // If an interface implementation, then we can set Final.
18851 if (((flags & MethodAttributes.Abstract) == 0) &&
18852 implementing.DeclaringType.IsInterface)
18853 flags |= MethodAttributes.Final;
18855 I do not know what I was smoking when I used that.
18858 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18859 step into fixing the name resolution issues for delegates and
18860 unifying the toplevel name resolution.
18862 2002-03-28 Martin Baulig <martin@gnome.org>
18864 * class.cs (Method.Emit): If we have a symbol writer, call its
18865 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18866 tell it about the current method.
18868 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18869 writer that we're going to emit the first byte of IL code for a new
18870 statement (a new source line).
18871 (EmitContext.EmitTopBlock): If we have a symbol writer, call
18872 EmitContext.Mark() before emitting any code.
18874 * location.cs (SymbolDocument): Return null when we're Null.
18876 * statement.cs (Statement): Moved the `Location loc' variable here.
18877 (Statement.EmitBoolExpression): If we have a symbol writer, call
18878 ec.Mark() before emitting any code to tell it that we're at the
18879 beginning of a new statement.
18880 (StatementExpression): Added `Location' argument to the constructor.
18881 (Block): Added public readonly variable `StartLocation' and public
18882 variable `EndLocation'. The latter is to be set using SetEndLocation().
18883 (Block): Added constructor which takes a start and end location.
18884 (Block.SetEndLocation): New method. This sets the end location.
18885 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18886 local variables we create.
18887 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18888 each statement and do also mark the begin and end of the block.
18890 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18891 tell it the current lexer.Location, use Location.Null for the end of the
18893 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18894 current block, set its end location using SetEndLocation().
18895 (statement_expression): StatementExpression constructor now takes the
18896 lexer.Location as additional argument.
18897 (for_statement, declare_local_variables): Likewise.
18898 (declare_local_variables): When creating a new implicit block, use the
18899 new Block constructor and pass it the lexer.Location.
18901 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18903 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18904 members also on the parent interfaces recursively.
18906 2002-03-27 Miguel de Icaza <miguel@ximian.com>
18908 * report.cs: Use new formats, since Gonzalo finished the missing
18911 * expression.cs (Binary.ResolveOperator): added missing operator|
18912 operator& and operator^ for bool/bool.
18914 * cs-parser.jay: CheckDef now takes a Location argument that is
18915 used to report errors more precisly (instead of reporting the end
18916 of a definition, we try to track something which is a lot closer
18917 to the source of the problem).
18919 * cs-tokenizer.cs: Track global token use, so we can properly flag
18920 the use of #define/#undef after the first token has been seen.
18922 Also, rename the reportXXXX to Error_DescriptiveName
18924 * decl.cs (DeclSpace.IsTopLevel): Move property here from
18925 TypeContainer, so that Enum and Interface can use this too.
18927 * class.cs (TypeContainer.LookupInterfaceOrClass,
18928 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18929 `builder' argument. Typically this was used to pass the parent
18930 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18933 The problem is that a nested class could trigger the definition of
18934 a toplevel class, and the builder would be obviously wrong in that
18937 So we drop this argument, and we compute dynamically the
18938 TypeBuilder/ModuleBuilder (the correct information was available
18939 to us anyways from DeclSpace.Parent)
18941 * interface.cs (Interface.DefineInterface): Drop builder
18942 parameter cleanup like class.cs
18944 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
18947 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18950 (Try.Emit): Propagate the returns value from the statement.
18952 (Return.Emit): Even if we are leavning
18954 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18956 * modifiers.cs: Fix the computation of MethodAttributes flags.
18958 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18960 * driver.cs: allow compilation of files that start with '/'.
18961 Add a default case when checking the argument of --target.
18963 2002-03-25 Miguel de Icaza <miguel@ximian.com>
18965 * interface.cs: Implement the same search algorithm for types in
18966 the interface code.
18968 * delegate.cs: Do not allow multiple definition.
18970 * Recovered ChangeLog that got accidentally amputated
18972 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18974 * rootcontext.cs: Load manually enum to allow core classes to
18975 contain enumerations.
18977 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18978 Update to new static methods in TypeManager.
18980 * typemanager.cs (GetMethod, GetConstructor): Use our
18981 implementation of FindMembers to find the members, since during
18982 corlib compilation, the types are TypeBuilders and GetMethod and
18983 GetConstructor do not work.
18985 Make all methods in TypeManager static.
18987 (InitCodeHelpers): Split the functionality from
18988 the InitCodeTypes function.
18990 * driver.cs: Call InitCodeHelpers after we have populated the
18993 * cs-parser.jay (delegate_declaration): we did not used to compute
18994 the delegate name correctly for void delegates.
18996 2002-03-24 Miguel de Icaza <miguel@ximian.com>
18998 * rootcontext.cs (RootContext): Init the interface_resolve_order
18999 and type_container_resolve_order always.
19001 (ResolveCore, BootstrapCorlib_ResolveClass,
19002 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19003 compiler when compiling with --nostdlib
19005 * class.cs (TypeContainer.DefineType): Check that our parent is
19006 not null. This test is most important when we are bootstraping
19009 * codegen.cs: Split out the symbol writing code.
19011 2002-03-25 Martin Baulig <martin@gnome.org>
19013 * driver.cs (-g): Made -g an alias for --debug.
19015 2002-03-24 Martin Baulig <martin@gnome.org>
19017 * codegen.cs (SymbolWriter): New public variable. Returns the
19018 current symbol writer.
19019 (CodeGen): Added `bool want_debugging_support' argument to the
19020 constructor. If true, tell the ModuleBuild that we want debugging
19021 support and ask it for the ISymbolWriter.
19022 (Save): If we have a symbol writer, call it's Close() method after
19023 saving the assembly.
19025 * driver.c (--debug): New command line argument to create a
19026 debugger information file.
19028 * location.cs (SymbolDocument): New public property. Returns an
19029 ISymbolDocumentWriter object for the current source file or null
19030 if we don't have a symbol writer.
19032 2002-03-21 Miguel de Icaza <miguel@ximian.com>
19034 * driver.cs (LoadAssembly): Correctly return when all the paths
19035 have been tried and not before.
19037 * statement.cs (Switch.Emit): return the actual coverage for this
19038 statement (returns/not-returns)
19040 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19041 switch of the statement if we are the last switch section. That
19042 kills two problems: try/catch problems (we used to emit an empty
19043 nop at the end) and switch statements where all branches would
19046 2002-03-19 Miguel de Icaza <miguel@ximian.com>
19048 * driver.cs: Add default assemblies (the equivalent to the
19049 Microsoft CSC.RSP file)
19051 * cs-tokenizer.cs: When updating `cols and setting it to zero,
19052 also update tokens_seen and set it to false.
19054 * driver.cs: Implement --recurse for Mike.
19056 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19057 correctly splitting out the paths.
19059 2002-03-18 Miguel de Icaza <miguel@ximian.com>
19061 * interface.cs (Interface.PopulateProperty): Instead of using
19062 `parent' as the declaration space for the set parameters, use
19065 * support.cs (InternalParameters): InternalParameters constructor
19066 takes a DeclSpace instead of a TypeContainer.
19068 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19069 types are being initialized, load the address of it before calling
19072 (New): Provide a mechanism to disable the generation of local
19073 value type temporaries when the caller will be providing us with
19074 an address to store it.
19076 (ArrayCreation.EmitDynamicInitializers): Use it.
19078 2002-03-17 Miguel de Icaza <miguel@ximian.com>
19080 * expression.cs (Invocation.EmitArguments): Only probe for array
19081 property if there is more than one argument. Sorry about that.
19083 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19084 empty param arrays.
19086 * class.cs (Method.LabelParameters): Fix incorrect code path that
19087 prevented the `ParamArrayAttribute' from being applied to the
19090 2002-03-16 Miguel de Icaza <miguel@ximian.com>
19092 * support.cs (ReflectionParameters): Correctly compute whether the
19093 last argument is a params array. Fixes the problem with
19096 * typemanager.cs: Make the assemblies array always be non-null
19097 (empty, but non-null)
19099 * tree.cs (RecordDecl): New function that abstracts the recording
19100 of names. This reports error 101, and provides a pointer to the
19101 previous declaration. Fixes a crash in the compiler.
19103 * cs-parser.jay (constructor_declaration): Update to new grammar,
19104 and provide a constructor_body that can be empty.
19106 2002-03-15 Miguel de Icaza <miguel@ximian.com>
19108 * driver.cs: Add support for --resources.
19110 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19111 Make all types for the various array helper methods be integer.
19113 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19114 CheckState to ConvCast.
19116 (ConvCast): Now it takes a `checked' state argument, to avoid
19117 depending on the emit context for the conversion, and just using
19118 the resolve time setting.
19120 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19121 instead of Invocation.EmitArguments. We do not emit the original
19122 arguments, instead we emit those which have been converted to
19123 unsigned int expressions.
19125 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19127 * codegen.cs: ditto.
19129 * expression.cs (LocalVariableReference): Drop the use of the
19130 Store function that depended on the variable index.
19132 * statement.cs (VariableInfo): Drop the `Idx' property from this
19133 class, as this is not taking into account the indexes for
19134 temporaries tat we generate during the execution, getting the
19137 * class.cs: First emit class initializers, then call the parent
19140 * expression.cs (Binary): Fix opcode emision.
19141 (UnaryMutator.EmitCode): Support checked code generation
19143 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19144 matches for events for both the Static and Instance scans,
19145 pointing to the same element. Fix that.
19147 2002-03-14 Miguel de Icaza <miguel@ximian.com>
19149 * rootcontext.cs (ResolveTree): Always set the
19150 interface_resolve_order, because nested interfaces will be calling
19153 * class.cs (GetInterfaceOrClass): Track the same resolution
19154 process used by TypeManager.LookupType. This fixes the nested
19155 type lookups in class declarations (separate path from
19158 (TypeContainer.DefineType): Also define nested interfaces.
19159 (TypeContainer.RegisterOrder): New public function used to
19160 register the order in which child interfaces need to be closed.
19162 Nested interfaces need to be closed after their parents have been
19165 * interface.cs (InterfaceAttr): Put all the logic for computing
19166 the interface attribute here.
19168 (DefineInterface): Register our interface order with the
19169 RootContext or with the TypeContainer depending on the case.
19171 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19173 * cs-parser.jay: rework foreach statement to work with the new
19174 changes to the policy on SimpleNames.
19176 * report.cs: support Stacktrace on warnings as well.
19178 * makefile: drop --unsafe and /unsafe from the compile.
19180 2002-03-13 Ravi Pratap <ravi@ximian.com>
19182 * ecore.cs (StandardConversionExists): Modify to take an Expression
19183 as the first parameter. Ensure we do null -> reference type conversion
19186 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19187 temporary Expression objects.
19189 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19191 * interface.cs: workaround bug in method overloading resolution
19192 (there is already a bugzilla bug for it).
19194 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19196 We could also solve this problem by having a separate path for
19197 performing type lookups, instead of DoResolve, we could have a
19198 ResolveType entry point, and only participating pieces of the
19199 production (simplename, deref, array) would implement this.
19201 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19202 signal SimpleName to only resolve type names and not attempt to
19203 resolve anything else.
19205 * expression.cs (Cast): Set the flag.
19207 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19209 * class.cs: Only report 108 if there is no `new' modifier.
19211 * cs-parser.jay: rework foreach statement to work with the new
19212 changes to the policy on SimpleNames.
19214 * report.cs: support Stacktrace on warnings as well.
19216 * makefile: drop --unsafe and /unsafe from the compile.
19218 2002-03-11 Miguel de Icaza <miguel@ximian.com>
19220 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19221 lookups here, instead of doing that at parse time. This means
19222 that our grammar will not introduce `LocalVariableReferences' as
19223 expressions at this point. That solves the problem of code like
19227 static void Main ()
19231 This is only half the fix. The full fix requires parameters to
19232 also be handled in this way.
19234 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19235 makes the use more obvious of the DeclSpace. The
19236 ec.TypeContainer.TypeBuilder is now only used to pull the
19237 TypeBuilder for it.
19239 My theory is that I can get rid of the TypeBuilder completely from
19240 the EmitContext, and have typecasts where it is used (from
19241 DeclSpace to where it matters).
19243 The only pending problem is that the code that implements Aliases
19244 is on TypeContainer, and probably should go in DeclSpace.
19246 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19247 lookups here, instead of doing that at parse time. This means
19248 that our grammar will not introduce `LocalVariableReferences' as
19249 expressions at this point. That solves the problem of code like
19253 static void Main ()
19257 This is only half the fix. The full fix requires parameters to
19258 also be handled in this way.
19260 * class.cs (Property.DefineMethod): When implementing an interface
19261 method, set newslot, when implementing an abstract method, do not
19262 set the flag (before we tried never setting it, or always setting
19263 it, which is the difference).
19264 (Indexer.DefineMethod): same.
19265 (Method.DefineMethod): same.
19267 * ecore.cs: Only set the status used flag if we get back a Field.
19269 * attribute.cs: Temporary hack, so Paolo can keep working.
19271 2002-03-08 Ravi Pratap <ravi@ximian.com>
19273 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19274 the unmanaged type in the case we have a MarshalAs attribute.
19276 (Resolve): Handle the case when we are parsing the special MarshalAs
19277 attribute [we need to store the unmanaged type to use later]
19279 * typemanager.cs (marshal_as_attr_type): Built in type for the
19280 MarshalAs Attribute.
19282 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
19283 on parameters and accordingly set the marshalling info.
19285 2002-03-09 Miguel de Icaza <miguel@ximian.com>
19287 * class.cs: Optimizing slightly by removing redundant code after
19288 we switched to the `NoTypes' return value.
19289 (Property.DefineMethod): use NoTypes here too.
19291 This fixes the bug I introduced in my last batch of changes.
19293 2002-03-05 Ravi Pratap <ravi@ximian.com>
19295 * tree.cs (RecordEnum): Add. We now keep track of enums too.
19297 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19298 Enums since those are types too.
19300 * cs-parser.jay (enum_declaration): Record enums as we parse them.
19302 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
19303 thanks to a call during the lookup process.
19305 2002-03-07 Miguel de Icaza <miguel@ximian.com>
19307 * statement.cs (Foreach): Lots of work to accomodate a particular
19308 kind of foreach statement that I had not kept in mind. It is
19309 possible to have foreachs on classes that provide a GetEnumerator
19310 method that return objects that implement the "pattern" for using
19311 a foreach, there is no need to support GetEnumerator
19314 This is needed to compile nant.
19316 * decl.cs: Only report 114 if the member is not `Finalize' and if
19317 the warning level is at least 2.
19319 * class.cs: Moved the compare function from Method to
19322 (MethodSignature.InheritableMemberSignatureCompare): Add new
19323 filter function that is used to extract inheritable methods from a
19326 (Method.Define): Use the new `inheritable_method_signature_filter'
19329 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19332 2002-03-06 Miguel de Icaza <miguel@ximian.com>
19334 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19336 * cs-parser.jay: Add opt_semicolon to the interface declaration.
19338 * expression.cs: Pass location information to
19339 ConvertImplicitStandard.
19341 * class.cs: Added debugging code to track return values from
19344 2002-03-05 Miguel de Icaza <miguel@ximian.com>
19346 * expression.cs (Is.DoResolve): If either side of the `is' is an
19347 interface, do not flag the warning.
19349 * ecore.cs (ImplicitReferenceConversion): We need a separate test
19352 * report.cs: Allow for --fatal to be used with --probe.
19354 * typemanager.cs (NoTypes): Move the definition for the empty Type
19357 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19359 (TypeContainer.DefineProxy): New function used to proxy to parent
19360 implementations when implementing interfaces.
19361 (TypeContainer.ParentImplements): used to lookup if our parent
19362 implements a public function that is required by an interface.
19363 (TypeContainer.VerifyPendingMethods): Hook this up.
19365 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19366 `modules' and `assemblies' arraylists into arrays. We only grow
19367 these are the very early start up of the program, so this improves
19368 the speedof LookupType (nicely measured).
19370 * expression.cs (MakeByteBlob): Replaced unsafe code with
19371 BitConverter, as suggested by Paolo.
19373 * cfold.cs (ConstantFold.Binary): Special case: perform constant
19374 folding of string concatenation, but if either side is a string,
19375 and the other is not, then return null, and let the runtime use
19376 the concatenation on the string plus the object (using
19377 `Object.ToString').
19379 2002-03-04 Miguel de Icaza <miguel@ximian.com>
19381 Constant Folding has been implemented now.
19383 * expression.cs (Unary.Reduce): Do not throw an exception, catch
19384 the error instead on types that are not supported in one's
19387 * constant.cs (Constant and all children): New set of functions to
19388 perform implict and explicit conversions.
19390 * ecore.cs (EnumConstant): Implement the new functions to perform
19391 conversion by proxying to the child expression.
19393 * codegen.cs: (ConstantCheckState): Constant evaluation has its
19394 own separate setting that can not be turned off from the command
19395 line using --unchecked or --checked and is only controlled using
19396 the checked/unchecked statements and expressions. This setting is
19397 used by the constant folder to flag errors.
19399 * expression.cs (CheckedExpr, UncheckedExpr): Set the
19400 ConstantCheckState as well.
19402 During Resolve, they also have to flag the state, because the
19403 constant folder runs completely in the Resolve phase.
19405 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19408 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19410 * cfold.cs: New file, this file contains the constant folder.
19412 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19413 argument to track whether we are using the resulting address to
19414 load or store a value and provide better error messages.
19416 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19417 new AddressOf arguments.
19419 * statement.cs (Foreach.EmitCollectionForeach): Update
19421 * expression.cs (Argument.Emit): Call AddressOf with proper
19422 arguments to track usage.
19424 (New.DoEmit): Call AddressOf with new arguments.
19426 (Unary.Emit): Adjust AddressOf call.
19428 2002-03-01 Ravi Pratap <ravi@ximian.com>
19430 * cs-parser.jay (member_access): Change the case for pre-defined types
19431 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
19434 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19437 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19438 essentially like methods and apply attributes like MethodImplOptions to them too.
19440 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19443 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19444 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19447 * Update code everywhere accordingly.
19449 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19451 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19453 2002-02-28 Ravi Pratap <ravi@ximian.com>
19455 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19456 try performing lookups against those instead of jumping straight into using
19457 the 'using' clauses.
19459 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19461 (LookupType): Perform lookups in implicit parents too.
19463 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19464 sequence as RootContext.LookupType.
19466 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
19467 the various cases of namespace lookups into this method.
19469 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19471 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19472 in positional arguments)
19474 * class.cs (Operator): Update the AllowedModifiers to contain
19477 * cs-parser.jay: Update operator declaration to allow for the
19478 operator body to be empty.
19480 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19483 2002-02-27 Miguel de Icaza <miguel@ximian.com>
19485 * class.cs (Method.Emit): Label parameters.
19487 * driver.cs: Return 1 or 0 as the program exit code.
19489 2002-02-26 Miguel de Icaza <miguel@ximian.com>
19491 * expression.cs: Special case the `null' object when trying to
19492 auto-compute the type, as anything can be explicitly converted to
19495 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19496 spotting this Paolo.
19498 (Expression.ImplicitNumericConversion): Perform comparissions of
19499 the type using the underlying type in the case of an enumeration
19500 rather than using the enumeration type for the compare.
19502 Cope with the underlying == type case, which is not possible to
19505 (Expression.ConvertNumericExplicit): Perform comparissions of
19506 the type using the underlying type in the case of an enumeration
19507 rather than using the enumeration type for the compare.
19509 * driver.cs: If the user does not supply an extension, assume .exe
19511 * cs-parser.jay (if_statement): Rewrote so that we can track the
19512 location for the if statement.
19514 * expression.cs (Binary.ConstantFold): Only concat strings when
19515 the operation is "+", not everything ;-)
19517 * statement.cs (Statement.EmitBoolExpression): Take a location
19519 (If, While, Do): Track location.
19521 * expression.cs (Binary.ResolveOperator): In the object + string
19522 case, I was missing a call to ConvertImplicit
19524 2002-02-25 Ravi Pratap <ravi@ximian.com>
19526 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19527 Location arguments. Ensure we use RootContext.LookupType to do our work
19528 and not try to do a direct Type.GetType and ModuleBuilder.GetType
19530 * interface.cs (PopulateMethod): Handle the type of the parameter being
19533 * expression.cs (Invocation.BetterFunction): Handle the case when we
19534 have a params method with no fixed arguments and a call is made with no
19537 2002-02-25 Miguel de Icaza <miguel@ximian.com>
19539 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19540 the verbatim-string-literal
19542 * support.cs (InternalParameters.ParameterModifier): handle null
19544 (InternalParameters.ParameterType): ditto.
19546 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19547 duplicating the name of the variable parameter.
19548 (GetParameterByName): Fix bug where we were not looking up array
19549 paramters if they were the only present (thanks Paolo!).
19550 (GetParameterInfo): We only have an empty set of types if both
19551 fixed and array are set to null.
19552 (GetParameterInfo-idx): Handle FixedParameter == null
19554 * cs-parser.jay: Handle the case where there is no catch
19555 statements (missing null test).
19557 2002-02-22 Miguel de Icaza <miguel@ximian.com>
19559 * driver.cs (MainDriver): Be conservative on our command line
19562 Catch DirectoryNotFoundException when calling GetFiles.
19564 (SplitPathAndPattern): Used to split the input specification into
19565 a path and a pattern that we can feed to Directory.GetFiles.
19567 2002-02-21 Miguel de Icaza <miguel@ximian.com>
19569 * statement.cs (Fixed): Implement the last case of the Fixed
19570 statement (string handling).
19572 * expression.cs (StringPtr): New class used to return a char * to
19573 a string; Used by the Fixed statement.
19575 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
19577 * expression.cs (Binary.ResolveOperator): Remove redundant
19578 MemberLookup pn parent type.
19579 Optimize union call, we do not need a union if the types are the same.
19580 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19583 Specialize the use of MemberLookup everywhere, instead of using
19584 the default settings.
19586 (StackAlloc): Implement stackalloc keyword.
19588 * cs-parser.jay: Add rule to parse stackalloc.
19590 * driver.cs: Handle /h, /help, /?
19592 * expression.cs (MakeByteBlob): Removed the hacks we had in place
19593 before we supported unsafe code.
19595 * makefile: add --unsafe to the self compilation of mcs.
19597 2002-02-20 Miguel de Icaza <miguel@ximian.com>
19599 * expression.cs (PointerArithmetic): New class that is used to
19600 perform pointer arithmetic.
19601 (Binary.Resolve): Handle pointer arithmetic
19602 Handle pointer comparission.
19603 (ArrayPtr): Utility expression class that is used to take the
19604 address of an array.
19606 (ElementAccess): Implement array access for pointers
19608 * statement.cs (Fixed): Implement fixed statement for arrays, we
19609 are missing one more case before we are done.
19611 * expression.cs (Indirection): Implement EmitAssign and set the
19612 ExprClass to Variable. This allows pointer dereferences to be
19613 treated as variables, and to have values assigned to them.
19615 * ecore.cs (Expression.StoreFromPtr): New utility function to
19616 store values dereferencing.
19618 2002-02-20 Ravi Pratap <ravi@ximian.com>
19620 * expression.cs (Binary.ResolveOperator): Ensure that we are
19621 not trying to operate on a void type - this fixes the reported
19624 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19625 the parent implementation is sealed.
19627 * ../errors/cs0239.cs : Add.
19629 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19631 * typemanager.cs (unverifiable_code_type): Corresponds to
19632 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19633 which have unsafe code in them.
19635 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
19638 2002-02-19 Miguel de Icaza <miguel@ximian.com>
19640 * cs-tokenizer.cs: Add support for @"litreal strings"
19642 Make tokenizer accept pre-processor directives
19643 on any column (remove the old C-like limitation).
19645 * rootcontext.cs (EmitCode): Emit any global attributes.
19646 (AddGlobalAttributes): Used to keep track of assembly attributes.
19648 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19650 * cs-parser.jay: Add support for global attributes.
19652 2002-02-17 Miguel de Icaza <miguel@ximian.com>
19654 * expression.cs (Indirection): New helper class. Unary will
19655 create Indirection classes to be able to implement the
19656 IMemoryLocation interface on it.
19658 2002-02-16 Miguel de Icaza <miguel@ximian.com>
19660 * cs-parser.jay (fixed_statement): reference the right statement.
19662 * statement.cs (Fixed.Emit): Finish implementing the fixed
19663 statement for the &x case.
19665 2002-02-14 Miguel de Icaza <miguel@ximian.com>
19667 * class.cs (Property.Define, Method.Define): Remove newslot when
19670 * modifiers.cs: My use of NewSlot when `Abstract' was set was
19671 wrong. NewSlot should only be used if the `new' keyword is present.
19673 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19674 locating our system dir. Sorry about this.
19676 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19678 * driver.cs (GetSystemDir): Compute correctly the location of our
19679 system assemblies. I was using the compiler directory instead of
19680 the library directory.
19682 2002-02-13 Ravi Pratap <ravi@ximian.com>
19684 * expression.cs (BetterFunction): Put back in what Miguel commented out
19685 since it is the correct fix. The problem is elsewhere ;-)
19687 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19688 parameters of the parms method are themselves compatible or not !
19690 (StandardConversionExists): Fix very dangerous bug where we were forgetting
19691 to check that a class implements an interface before saying that an implicit
19692 conversion was allowed. Use ImplementsInterface to do the checking.
19694 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19696 * class.cs (Method.Define): Track whether we are an explicit
19697 implementation or not. And only call DefineMethodOverride if we
19698 are an explicit implementation.
19700 (Property.DefineMethod): Ditto.
19702 2002-02-11 Ravi Pratap <ravi@ximian.com>
19704 * expression.cs (BetterFunction): Catch hideous bug which was
19705 preventing us from detecting ambiguous calls due to implicit casts i.e
19708 2002-01-29 Miguel de Icaza <miguel@ximian.com>
19710 * support.cs (Pair): Remove un-needed method. I figured why I was
19711 getting the error in cs-parser.jay, the variable in a foreach loop
19712 is readonly, and the compiler does not really treat this as a variable.
19714 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
19715 instead of EQUALS in grammar.
19717 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19719 * expression.cs (Unary.DoResolve): Check whether the argument is
19722 2002-01-28 Miguel de Icaza <miguel@ximian.com>
19724 * support.cs: Api for Pair to set a value. Despite the fact that
19725 the variables are public the MS C# compiler refuses to compile
19726 code that accesses the field if the variable is part of a foreach
19729 * statement.cs (Fixed): Begin implementation of the fixed
19732 (Block.AddVariable): Return the VariableInfo on success and null
19733 on failure instead of true/false.
19735 * cs-parser.jay (foreach): Catch errors on variables already
19736 defined (we were ignoring this value before) and properly unwind
19737 the block hierarchy
19739 (fixed_statement): grammar for the fixed statement.
19741 2002-01-25 Miguel de Icaza <miguel@ximian.com>
19743 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19744 pointer types to be incretemented.
19746 (SizeOf): Implement.
19748 * cs-parser.jay (pointer_member_access): Implement
19749 expr->IDENTIFIER production.
19751 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19752 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19755 (Unary): Implement indirection.
19757 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19758 use in non-unsafe context).
19760 (SimpleName.DoResolve): Check for pointers in field access on safe
19763 (Expression.LoadFromPtr): Factor the load-indirect code in this
19764 function. This was duplicated in UnboxCast and ParameterReference
19766 2002-01-24 Miguel de Icaza <miguel@ximian.com>
19768 * expression.cs (ComposedCast): report an error if a pointer cast
19769 is used in a safe region.
19771 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19772 pointer type casts in unsafe context.
19774 * codegen.cs (EmitContext): Set up IsUnsafe.
19776 * cs-parser.jay (non_expression_type): Add productions for pointer
19779 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19780 code. We should not use force into static mode if the method is
19781 not virtual. Fixes bug in MIS
19783 * statement.cs (Do.Emit, While.Emit, For.Emit,
19784 Statement.EmitBoolExpression): Add support to Do and While to
19785 propagate infinite loop as `I do return' semantics.
19787 Improve the For case to also test for boolean constants.
19789 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19790 to the list of attributes we can add.
19792 Remove `EmitContext' argument.
19794 * class.cs (Method.Define): Apply parameter attributes.
19795 (Constructor.Define): Apply parameter attributes.
19796 (MethodCore.LabelParameters): Move here the core of labeling
19799 * support.cs (ReflectionParameters.ParameterModifier,
19800 InternalParameters.ParameterModifier): Use IsByRef on the type and
19801 only return the OUT bit for these parameters instead of in/out/ref
19804 This is because I miss-understood things. The ParameterInfo.IsIn
19805 and IsOut represent whether the parameter has the [In] and [Out]
19808 2002-01-22 Miguel de Icaza <miguel@ximian.com>
19810 * ecore.cs (FieldExpr.Emit): Release temporaries.
19812 * assign.cs (LocalTemporary.Release): new function.
19814 * codegen.cs (EmitContext.GetTemporaryStorage,
19815 EmitContext.FreeTemporaryStorage): Rework the way we deal with
19816 temporary storage. Now we can "put back" localbuilders when we
19819 2002-01-21 Miguel de Icaza <miguel@ximian.com>
19821 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19822 need to make a copy of the variable to generate verifiable code.
19824 2002-01-19 Miguel de Icaza <miguel@ximian.com>
19826 * driver.cs: Compute dynamically the system directory.
19828 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19829 Slower, but more generally useful. Used by the abstract
19830 registering implementation.
19832 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19833 the rules for the special rule on Type/instances. First check if
19834 we have the same name, and if so, try that special static path
19835 rather than the instance path.
19837 2002-01-18 Miguel de Icaza <miguel@ximian.com>
19839 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19842 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19843 Enum, ValueType, Delegate or Array for non-corlib compiles.
19845 * cs-tokenizer.cs: Catch long identifiers (645)
19847 * typemanager.cs (IndexerPropetyName): Ravi never tested this
19850 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19851 fix, we were returning too early, so we were not registering
19852 pending methods from abstract classes.
19854 Do not register pending methods if the class is abstract.
19856 * expression.cs (Conditional.DoResolve): Report circular implicit
19857 conversions when we neecd to compute it for conditional
19860 (Is.DoResolve): If the expression is always of the provided type,
19861 flag warning 183. If the expression can not ever be of the
19862 provided type flag warning 184.
19864 * class.cs: Catch 169 as well.
19866 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19869 2002-01-18 Nick Drochak <ndrochak@gol.com>
19871 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
19873 2002-01-17 Miguel de Icaza <miguel@ximian.com>
19875 * interface.cs: (PopulateMethod): Check for pointers being defined
19876 only if the unsafe context is active.
19877 (PopulateProperty): ditto.
19878 (PopulateIndexer): ditto.
19880 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19881 specified. If pointers are present, make sure that they are
19882 present in an unsafe context.
19883 (Constructor, Constructor.Define): ditto.
19884 (Field, Field.Define): ditto.
19885 (Property, Property.Define): ditto.
19886 (Event, Event.Define): ditto.
19888 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19889 hashtable if there are classes or structs defined.
19891 * expression.cs (LocalVariableReference.DoResolve): Simplify this
19892 code, as the constant resolution moved.
19894 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19895 the metadata, so we can flag error 133.
19897 * decl.cs (MemberCore.UnsafeOK): New function to test that a
19898 pointer is being declared in an unsafe context.
19900 2002-01-16 Miguel de Icaza <miguel@ximian.com>
19902 * modifiers.cs (Modifiers.Check): Require a Location argument.
19903 Report error 227 for Unsafe use.
19905 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19907 * statement.cs (For.Emit): If the test is null, then report that
19908 we do `return', as we wont reach anything afterwards.
19910 (Switch.SwitchGoverningType): Track the expression that matched
19913 * driver.cs: Allow negative numbers as an error code to flag.
19915 * cs-parser.jay: Handle 1551.
19917 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19919 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19921 * cs-parser.jay: Report 1518 (type declaration can only contain
19922 class, struct, interface, enum or delegate)
19924 (switch_label): Report 1523 (keywords `case' or `default' must
19927 (opt_switch_sections): Report 1522 (empty switch)
19929 * driver.cs: Report 1515 (response file specified multiple times)
19930 Report 1516 (Source file specified multiple times).
19932 * expression.cs (Argument.Resolve): Signal 1510
19934 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19935 access not allowed in static code)
19937 2002-01-11 Ravi Pratap <ravi@ximian.com>
19939 * typemanager.cs (IsPointerType): Utility method which we are going
19942 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19943 the object type, so we take care of that.
19945 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19947 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19948 added to non-params parameters :-)
19950 * typemanager.cs (CSharpName): Include 'void' type too.
19952 (void_ptr_type): Include in the set of core types.
19954 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
19957 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
19960 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
19961 completely forgotten about it.
19963 2002-01-10 Ravi Pratap <ravi@ximian.com>
19965 * cs-parser.jay (pointer_type): Add. This begins our implementation
19966 of parsing rules for unsafe code.
19968 (unsafe_statement): Implement.
19970 (embedded_statement): Modify to include the above.
19972 * statement.cs (Unsafe): Implement new class for unsafe blocks.
19974 * codegen.cs (EmitContext.InUnsafe): Add. This determines
19975 if the current context is an unsafe one.
19977 * cs-parser.jay (local_variable_pointer_type): Since local variable types
19978 are handled differently, we need separate rules for them.
19980 (local_variable_declaration): Update to use local_variable_pointer_type
19981 to allow variable declarations of unmanaged pointer types.
19983 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19984 in unsafe contexts.
19986 * ../errors/cs0214.cs : Add.
19988 2002-01-16 Nick Drochak <ndrochak@gol.com>
19990 * makefile: remove 'response' file when cleaning.
19992 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19994 * cs-parser.jay: Report 1524.
19996 2002-01-14 Miguel de Icaza <miguel@ximian.com>
19998 * typemanager.cs (RegisterMethod): drop checking if we have
19999 registered this from here
20001 2002-01-12 Miguel de Icaza <miguel@ximian.com>
20003 * class.cs (Method.EmitDestructor): Implement calling our base
20006 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20007 value of InFinally.
20009 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20010 this routine and will wrap the call in a try/catch block. Deal
20013 2002-01-11 Miguel de Icaza <miguel@ximian.com>
20015 * ecore.cs (Expression.MemberLookup): instead of taking a
20016 parameter `same_type' that was used to tell whether we could
20017 access private members we compute our containing type from the
20020 (FieldExpr): Added partial support for volatile fields. This does
20021 not work for volatile fields exposed from assemblies, as I can not
20022 figure out how to extract the modreq from it.
20024 Updated all the source files to use this.
20026 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20027 because it is referenced by MemberLookup very often.
20029 2002-01-09 Ravi Pratap <ravi@ximian.com>
20031 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20032 TypeBuilder.GetCustomAttributes to retrieve what we need.
20034 Get rid of redundant default_member_attr_type as this is the same as
20035 default_member_type which already exists.
20037 * interface.cs, attribute.cs : Update accordingly.
20039 2002-01-08 Miguel de Icaza <miguel@ximian.com>
20041 * typemanager.cs: Enable IndexerPropertyName again. It does not
20042 work for TYpeBuilders though. Ravi, can you please fix this?
20044 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20046 * expression.cs (Argument.Emit): Handle the case of ref objects
20047 being passed to ref functions;
20049 (ParameterReference.EmitLoad): Loads the content of the pointer
20050 without dereferencing.
20052 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20054 * cs-tokenizer.cs: Implemented the pre-processing expressions.
20056 2002-01-08 Ravi Pratap <ravi@ximian.com>
20058 * class.cs (Indexer.DefineMethod): Incorporate the interface
20059 type in the name of the method if we are doing explicit interface
20062 * expression.cs (ConversionExists): Remove as it is completely obsolete.
20064 (BetterConversion): Fix extremely trivial bug where we were referring to
20065 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20068 * ../errors/bug16.cs : Add although we have fixed it.
20070 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20072 * expression.cs (BaseIndexer): Begin implementation.
20074 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20076 * cs-parser.jay (indexer_declarator): Use qualified_identifier
20077 production directly to remove a shift/reduce, and implement
20078 explicit interface implementation.
20080 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20081 after a floating point suffix.
20083 * expression.cs (DoNumericPromotions): Improved the conversion for
20084 uint/uint. If we have a constant, we avoid doing a typecast to a
20087 * class.cs (Indexer): Implement explicit interface implementation
20090 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20092 * class.cs: make the default instance constructor public and hidebysig.
20094 2001-01-03 Ravi Pratap <ravi@ximian.com>
20096 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20097 so we can call it from elsewhere.
20099 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20100 we emit it internally if the class has a defined indexer; otherwise the user
20101 emits it by decorating the class definition with the DefaultMemberAttribute.
20103 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20104 attribute is not used on a type which defines an indexer.
20106 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20107 character when we skip whitespace.
20109 * ../errors/cs0646.cs : Add.
20111 2002-01-03 Miguel de Icaza <miguel@ximian.com>
20113 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20116 * makefile: Add practical target `mcs3.exe' which builds the third
20117 generation compiler.
20119 * expression.cs (New): Fix structures constructor calling.
20121 * class.cs (Property, Method, Indexer): Emit Final flag on the
20122 method if we are an interface implementation and we are not
20125 * ecore.cs (PropertyExpr): New public field `IsBase', tells
20126 whether this property is referencing a `base' method.
20128 * expression.cs (Invocation.EmitCall): take an extra argument:
20129 is_base, this is used to determine whether the `call' or
20130 `callvirt' opcode should be used.
20133 * delegate.cs: update EmitCall.
20135 * class.cs (Method.Define): Set NewSlot for the cases where we are
20136 not implementing an interface method.
20138 (Property.Define): ditto.
20140 2002-01-02 Miguel de Icaza <miguel@ximian.com>
20142 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20143 'r'. Allows mcs to parse itself fully.
20145 2002-01-02 Ravi Pratap <ravi@ximian.com>
20147 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20148 of the number of initializers that require the InitializeArray method.
20150 (CheckIndices): Store the Expression in all cases - not the plain value. Also
20151 update the above field where necessary.
20153 (MakeByteBlob): Update accordingly.
20155 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
20158 (EmitDynamicInitializers): Update in accordance with the new optimization.
20160 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20161 same OpCode applies.
20163 * cs-parser.jay : Fix some glaring errors I introduced.
20165 2002-01-01 Ravi Pratap <ravi@ximian.com>
20167 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20168 so that we can check for name clashes there too.
20170 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20171 for interface indexers.
20173 * interfaces.cs (Define): Emit the default member attribute.
20175 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20176 variable was being referred to while setting the value ;-)
20178 2002-01-01 Miguel de Icaza <miguel@ximian.com>
20180 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20181 byte-by-byte information when we know the data is zero.
20183 Make the block always a multiple of 4, because
20184 DefineInitializedData has a bug.
20186 * assign.cs: Fix, we should assign from the temporary, not from
20189 * expression.cs (MakeByteBlob): Fix my incorrect code.
20191 2001-12-31 Miguel de Icaza <miguel@ximian.com>
20193 * typemanager.cs (EnumToUnderlying): This function is used to get
20194 the underlying type from an enumeration, because it does not
20197 * constant.cs: Use the I4_S form for values between -128 and 127.
20199 * statement.cs (Block.LookupLabel): Looks up a label.
20200 (Block): Drop support for labeled blocks.
20202 (LabeledStatement): New kind of statement that represents a label
20205 (Goto): Finally implement this bad boy.
20207 * cs-parser.jay: Update to reflect new mechanism to implement
20210 2001-12-30 Miguel de Icaza <miguel@ximian.com>
20212 * codegen.cs (EmitContext.This): a codegen property that keeps the
20213 a single instance of this instead of creating many different this
20216 * delegate.cs (Delegate.DoResolve): Update to use the property;
20218 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20220 * expression.cs (BaseAccess.DoResolve): Ditto.
20222 2001-12-29 Ravi Pratap <ravi@ximian.com>
20224 * typemanager.cs (methodimpl_attr_type): Add to hold the type
20225 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20227 (InitCoreTypes): Update accordingly.
20229 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20230 so we can quickly store the state.
20232 (ApplyAttributes): Set the correct implementation flags
20233 for InternalCall methods.
20235 2001-12-29 Miguel de Icaza <miguel@ximian.com>
20237 * expression.cs (EmitCall): if a method is not virtual, then do
20238 not use callvirt on it.
20240 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20241 user defined stuff) requires the use of stobj, which takes an
20242 address on the stack instead of an array and an index. So emit
20243 the Ldelema operation for it.
20245 (EmitStoreOpcode): Use stobj for valuetypes.
20247 (UnaryMutator.EmitCode): Use the right 1 value depending on
20248 whether we are dealing with int64/uint64, float or doubles.
20250 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20251 constructors that I implemented last night.
20253 (Constructor.IsDefault): Fix to work properly for static
20256 * cs-parser.jay (CheckDef): report method signature errors.
20257 Update error number 103 to be 132.
20259 * decl.cs: New AdditionResult enumeration value: MethodExists.
20260 Although we do this check for methods later on in the semantic
20261 analysis, catching repeated default constructors is so easy that
20262 we catch these here.
20264 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20267 (ParameterReference.EmitAssign, Emit): handle
20270 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20271 (ArrayAccess.EmitStoreOpcode): ditto.
20273 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20275 * expression.cs (MakeByteBlob): Complete all the missing types
20276 (uint, short, ushort, byte, sbyte)
20278 * class.cs: Only init instance field initializers on instance
20281 Rename `constructors' to instance_constructors.
20283 (TypeContainer.AddConstructor): Only add constructors to the list
20284 if it is not static.
20286 Make sure that we handle default_static_constructor independently
20287 everywhere where we handle instance_constructors
20289 2001-12-28 Miguel de Icaza <miguel@ximian.com>
20291 * class.cs: Do not lookup or create a base initializer for a
20292 static constructor.
20294 (ConstructorInitializer.Resolve): use the proper type to lookup
20297 * cs-parser.jay: Report error 1585 (modifiers between type and name).
20299 * enum.cs, interface.cs: Remove CloseType, this is taken care by
20302 * decl.cs: CloseType is now an virtual method, the default
20303 implementation just closes this type.
20305 2001-12-28 Ravi Pratap <ravi@ximian.com>
20307 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20308 to PreserveSig by default. Also emit HideBySig on such methods.
20310 Basically, set the defaults to standard values.
20312 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20313 argument, if candidate is better, it can't be worse than the best !
20315 (Invocation): Re-write bits to differentiate between methods being
20316 applicable in their expanded form and their normal form - for params
20319 Get rid of use_standard everywhere as only standard conversions are allowed
20320 in overload resolution.
20322 More spec conformance.
20324 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20326 * driver.cs: Add --timestamp, to see where the compiler spends
20329 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20330 `this' in static code.
20332 (SimpleName.DoResolve): Implement in terms of a helper function
20333 that allows static-references to be passed upstream to
20336 (Expression.ResolveWithSimpleName): Resolve specially simple
20337 names when called by MemberAccess to implement the special
20340 (Expression.ImplicitReferenceConversion): Handle conversions from
20341 Null to reference types before others, as Null's type is
20344 * expression.cs (Invocation.EmitCall): Handle the special case of
20345 calling methods declared on a reference type from a ValueType
20346 (Base classes System.Object and System.Enum)
20348 (MemberAccess.Resolve): Only perform lookups on Enumerations if
20349 the left hand side is a TypeExpr, not on every enumeration.
20351 (Binary.Resolve): If types are reference types, then do a cast to
20352 object on operators != and == of both arguments.
20354 * typemanager.cs (FindMembers): Extract instance and static
20355 members if requested.
20357 * interface.cs (PopulateProperty): Use void_type instead of null
20358 as the return type for the setter method.
20360 (PopulateIndexer): ditto.
20362 2001-12-27 Ravi Pratap <ravi@ximian.com>
20364 * support.cs (ReflectionParameters): Fix minor bug where we
20365 were examining the wrong parameter for the ParamArray attribute.
20367 Cope with requests for the type of the parameter at position
20368 greater than the params parameter's. We now return the element
20369 type of the params array as that makes more sense.
20371 * expression.cs (Invocation.IsParamsMethodApplicable): Update
20372 accordingly as we no longer have to extract the element type
20375 (Invocation.OverloadResolve): Update.
20377 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20379 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20380 against IEnumerator, test whether the return value is a descendant
20381 of the IEnumerator interface.
20383 * class.cs (Indexer.Define): Use an auxiliary method to implement
20384 the other bits of the method definition. Begin support for
20385 explicit interface implementation.
20387 (Property.DefineMethod): Use TypeManager.void_type instead of null
20388 for an empty return value.
20390 2001-12-26 Miguel de Icaza <miguel@ximian.com>
20392 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20393 dealing with a FieldExpr which is composed of a FieldBuilder, in
20394 the code path we did extract the constant, but we should have
20395 obtained the underlying value to be able to cast it (otherwise we
20396 end up in an infinite loop, this is what Ravi was running into).
20398 (ArrayCreation.UpdateIndices): Arrays might be empty.
20400 (MemberAccess.ResolveMemberAccess): Add support for section
20401 14.5.4.1 that deals with the special case of E.I when E is a type
20402 and something else, that I can be a reference to a static member.
20404 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20405 handle a particular array type to create byte blobs, it is just
20406 something we dont generate byteblobs for.
20408 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20411 * location.cs (Push): remove the key from the hashtable that we
20412 are about to add. This happens for empty files.
20414 * driver.cs: Dispose files after we have parsed them.
20416 (tokenize): new function that only runs the tokenizer on its
20417 input, for speed testing.
20419 2001-12-26 Ravi Pratap <ravi@ximian.com>
20421 * class.cs (Event.Define): Define the private field only if there
20422 are no accessors defined.
20424 * expression.cs (ResolveMemberAccess): If there is no associated
20425 field with the event, that means we have an event defined with its
20426 own accessors and we should flag error cs0070 since transforming
20427 ourselves into a field is not valid in that case.
20429 * ecore.cs (SimpleName.DoResolve): Same as above.
20431 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20432 and charset to sane values.
20434 2001-12-25 Ravi Pratap <ravi@ximian.com>
20436 * assign.cs (DoResolve): Perform check on events only if they
20437 are being accessed outside the declaring type.
20439 * cs-parser.jay (event_declarations): Update rules to correctly
20440 set the type of the implicit parameter etc.
20442 (add_accessor, remove_accessor): Set current local parameters.
20444 * expression.cs (Binary): For delegate addition and subtraction,
20445 cast the return value from the method into the appropriate delegate
20448 2001-12-24 Ravi Pratap <ravi@ximian.com>
20450 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20451 of these as the workaround is unnecessary.
20453 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20454 delegate data - none of that is needed at all.
20456 Re-write bits to extract the instance expression and the delegate method
20459 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
20462 * attribute.cs (ApplyAttributes): New method to take care of common tasks
20463 of attaching attributes instead of duplicating code everywhere.
20465 * everywhere : Update code to do attribute emission using the above method.
20467 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20469 * expression.cs (IsParamsMethodApplicable): if there are not
20470 parameters, return immediately.
20472 * ecore.cs: The 0 literal can be implicity converted to an enum
20475 (SimpleName.DoResolve): First lookup the type, then lookup the
20478 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20479 want to get its address. If the InstanceExpression is not
20480 addressable, store the result in a temporary variable, then get
20483 * codegen.cs: Only display 219 errors on warning level or above.
20485 * expression.cs (ArrayAccess): Make it implement the
20486 IMemoryLocation interface.
20488 (Binary.DoResolve): handle the operator == (object a, object b)
20489 and operator != (object a, object b) without incurring into a
20490 BoxedCast (because 5 != o should never be performed).
20492 Handle binary enumerator operators.
20494 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20495 value type, otherwise use Ldelem_ref.
20497 Use precomputed names;
20499 (AddressOf): Implement address of
20501 * cs-parser.jay (labeled_statement): Fix recursive block
20502 addition by reworking the production.
20504 * expression.cs (New.DoEmit): New has a special case:
20506 If we are dealing with a ValueType, we have a few
20507 situations to deal with:
20509 * The target of New is a ValueType variable, that is
20510 easy, we just pass this as the variable reference
20512 * The target of New is being passed as an argument,
20513 to a boxing operation or a function that takes a
20516 In this case, we need to create a temporary variable
20517 that is the argument of New.
20520 2001-12-23 Ravi Pratap <ravi@ximian.com>
20522 * rootcontext.cs (LookupType): Check that current_type is not null before
20523 going about looking at nested types.
20525 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20526 not implement the IAssignMethod interface any more.
20528 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20529 where we tranform them into FieldExprs if they are being resolved from within
20530 the declaring type.
20532 * ecore.cs (SimpleName.DoResolve): Do the same here.
20534 * assign.cs (DoResolve, Emit): Clean up code considerably.
20536 * ../errors/bug10.cs : Add.
20538 * ../errors/cs0070.cs : Add.
20540 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20542 * assign.cs : Get rid of EventIsLocal everywhere.
20544 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20546 * ecore.cs (ConvertIntLiteral): finished the implementation.
20548 * statement.cs (SwitchLabel): Convert the value we are using as a
20549 key before looking up the table.
20551 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20553 * codegen.cs (EmitTopBlock): Require a Location argument now.
20555 * cs-parser.jay (constructor_declarator): We need to setup
20556 current_local_parameters before we parse the
20557 opt_constructor_initializer, to allow the variables to be bound
20558 to the constructor arguments.
20560 * rootcontext.cs (LookupType): First lookup nested classes in our
20561 class and our parents before we go looking outside our class.
20563 * expression.cs (ConstantFold): Extract/debox the values at the
20566 * rootcontext.cs (EmitCode): Resolve the constants first before we
20567 resolve the types. This is not really needed, but it helps debugging.
20569 * statement.cs: report location.
20571 * cs-parser.jay: pass location to throw statement.
20573 * driver.cs: Small bug fix.
20575 * report.cs: Updated format to be 4-zero filled digits.
20577 2001-12-22 Ravi Pratap <ravi@ximian.com>
20579 * expression.cs (CheckIndices): Fix minor bug where the wrong
20580 variable was being referred to ;-)
20582 (DoEmit): Do not call EmitStaticInitializers when the
20583 underlying type is System.Object.
20585 2001-12-21 Ravi Pratap <ravi@ximian.com>
20587 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20588 and do the usual workaround for SRE.
20590 * class.cs (MyEventBuilder.EventType): New member to get at the type
20591 of the event, quickly.
20593 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20595 * assign.cs (Assign.DoResolve): Handle the case when the target
20596 is an EventExpr and perform the necessary checks.
20598 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20601 (SimpleName.MemberStaticCheck): Include check for EventExpr.
20603 (EventExpr): Set the type in the constructor itself since we
20604 are meant to be born fully resolved.
20606 (EventExpr.Define): Revert code I wrote earlier.
20608 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20609 instance expression is null. The instance expression is a This in that case
20610 or a null, depending on whether it is a static method or not.
20612 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20613 refers to more than one method.
20615 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20616 and accordingly flag errors.
20618 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20620 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20622 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20624 * location.cs (ToString): Provide useful rutine.
20626 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20628 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20629 objects, return the actual integral boxed.
20631 * statement.cs (SwitchLabel): define an ILLabel for each
20634 (Switch.CheckSwitch): If the value is a Literal, extract
20635 the underlying literal.
20637 Also in the unused hashtable we had, add the SwitchLabel so we can
20638 quickly look this value up.
20640 * constant.cs: Implement a bunch of new constants. Rewrite
20641 Literal based on this. Made changes everywhere to adapt to this.
20643 * expression.cs (Expression.MakeByteBlob): Optimize routine by
20644 dereferencing array only once, and also copes with enumrations.
20646 bytes are two bytes wide, not one.
20648 (Cast): Perform constant conversions.
20650 * ecore.cs (TryImplicitIntConversion): Return literals instead of
20651 wrappers to the literals here.
20653 * expression.cs (DoNumericPromotions): long literals can converted
20654 to ulong implicity (this is taken care of elsewhere, but I was
20655 missing this spot).
20657 * ecore.cs (Expression.Literalize): Make the return type Literal,
20658 to improve type checking.
20660 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20662 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20664 * literal.cs: Revert code from ravi that checked the bounds. The
20665 bounds are sane by the definition of the type itself.
20667 * typemanager.cs: Fix implementation of ImplementsInterface. We
20668 need to actually look up in our parent hierarchy for interfaces
20671 * const.cs: Use the underlying type for enumerations
20673 * delegate.cs: Compute the basename for the delegate creation,
20674 that should fix the delegate test case, and restore the correct
20675 Type Lookup semantics in rootcontext
20677 * rootcontext.cs: Revert Ravi's last patch. The correct way of
20678 referencing a nested type with the Reflection API is using the "+"
20681 * cs-parser.jay: Do not require EOF token at the end.
20683 2001-12-20 Ravi Pratap <ravi@ximian.com>
20685 * rootcontext.cs (LookupType): Concatenate type names with
20686 a '.' instead of a '+' The test suite passes again.
20688 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20689 field of the enumeration.
20691 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20692 the case when the member is an EventExpr.
20694 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20695 static has an associated instance expression.
20697 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20699 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20701 * class.cs (Event.Define): Register event and perform appropriate checks
20704 We define the Add and Remove methods even if the use provides none because
20705 in that case, we provide default implementations ourselves.
20707 Define a private field of the type of the event. This is done by the CSC compiler
20708 and we should be doing it too ;-)
20710 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20711 More methods we use in code we generate.
20713 (multicast_delegate_type, delegate_type): Two separate types since the distinction
20716 (InitCoreTypes): Update accordingly for the above.
20718 * class.cs (Event.Emit): Generate code for default accessors that we provide
20720 (EmitDefaultMethod): Do the job in the above.
20722 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
20725 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20727 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20728 builders even if we were missing one.
20730 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20731 pass the Basename as our class name instead of the Name. The
20732 basename will be correctly composed for us.
20734 * parameter.cs (Paramters): Now takes a Location argument.
20736 * decl.cs (DeclSpace.LookupType): Removed convenience function and
20737 make all the code call directly LookupType in RootContext and take
20738 this chance to pass the Location information everywhere.
20740 * Everywhere: pass Location information.
20742 2001-12-19 Miguel de Icaza <miguel@ximian.com>
20744 * class.cs (Constructor.Define): Updated way of detecting the
20745 length of the parameters.
20747 (TypeContainer.DefineType): Use basename as the type name for
20750 (TypeContainer.Define): Do not recursively define types here, as
20751 definition is taken care in order by the RootContext.
20753 * tree.cs: Keep track of namespaces in a per-file basis.
20755 * parameter.cs (Parameter.ComputeSignature): Update to use
20758 (Parameters.GetSignature): ditto.
20760 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20761 instead of a TypeContainer.
20763 (Interface.SemanticAnalysis): Use `this' instead of our parent to
20764 resolve names. Because we need to be resolve in our context, not
20767 * driver.cs: Implement response files.
20769 * class.cs (TypeContainer.DefineType): If we are defined, do not
20770 redefine ourselves.
20772 (Event.Emit): Emit the code for add/remove handlers.
20773 (Event.Define): Save the MethodBuilders for add/remove.
20775 * typemanager.cs: Use pair here too.
20777 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20778 DictionaryEntry requires the first argument to be non-null.
20780 (enum_declaration): Compute full name for registering the
20783 (delegate_declaration): Instead of using
20784 formal_parameter_list, use opt_formal_parameter_list as the list
20787 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20788 (EventParsing): New property that controls whether `add' and
20789 `remove' are returned as tokens or identifiers (for events);
20791 2001-12-19 Ravi Pratap <ravi@ximian.com>
20793 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20794 use MyEventBuilder only and let it wrap the real builder for us.
20796 (MyEventBuilder): Revamp constructor etc.
20798 Implement all operations that we perform on EventBuilder in precisely the same
20801 (FindMembers): Update to use the EventBuilder member.
20803 (Event.Emit): Update accordingly.
20805 2001-12-18 Ravi Pratap <ravi@ximian.com>
20807 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20808 by calling the appropriate methods.
20810 (GetCustomAttributes): Make stubs as they cannot possibly do anything
20813 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20815 2001-12-17 Ravi Pratap <ravi@ximian.com>
20817 * delegate.cs (Delegate.Populate): Check that the return type
20818 and various parameters types are indeed accessible.
20820 * class.cs (Constructor.Define): Same here.
20822 (Field.Define): Ditto.
20824 (Event.Define): Ditto.
20826 (Operator.Define): Check that the underlying Method defined itself
20827 correctly - so it's MethodBuilder should not be null.
20829 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20830 expression happens to be null.
20832 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20833 members but as of now we don't seem to be able to do anything really useful with it.
20835 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20836 not the EventBuilder.
20838 2001-12-18 Miguel de Icaza <miguel@ximian.com>
20840 * cs-tokenizer.cs: Add support for defines.
20841 Add support for #if, #elif, #else, #endif
20843 (eval_var): evaluates a variable.
20844 (eval): stubbed for evaluating functions.
20846 * cs-parser.jay: Pass the defines information
20848 * driver.cs: Add --define command line option.
20850 * decl.cs: Move MemberCore here.
20852 Make it the base class for DeclSpace. This allows us to catch and
20853 report 108 and 109 for everything now.
20855 * class.cs (TypeContainer.Define): Extract all the members
20856 before populating and emit the warning 108 (new keyword required
20857 to override) instead of having each member implement this.
20859 (MemberCore.Define): New abstract method, we will be using this in
20860 the warning reporting engine in Populate.
20862 (Operator.Define): Adjust to new MemberCore protocol.
20864 * const.cs (Const): This does not derive from Expression, it is a
20865 temporary object we use to create fields, it is a MemberCore.
20867 * class.cs (Method.Define): Allow the entry point to be in a
20870 * driver.cs: Rewrite the argument handler to clean it up a bit.
20872 * rootcontext.cs: Made it just an auxiliary namespace feature by
20873 making everything static.
20875 * driver.cs: Adapt code to use RootContext type name instead of
20878 * delegate.cs: Remove RootContext argument.
20880 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20883 * class.cs (Event.Define): The lookup can fail.
20885 * cs-tokenizer.cs: Begin implementation of pre-procesor.
20887 * expression.cs: Resolve the this instance before invoking the code.
20889 2001-12-17 Miguel de Icaza <miguel@ximian.com>
20891 * cs-parser.jay: Add a production in element_access that allows
20892 the thing to become a "type" reference. This way we can parse
20893 things like "(string [])" as a type.
20895 Note that this still does not handle the more complex rules of
20899 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
20901 * ecore.cs: (CopyNewMethods): new utility function used to
20902 assemble the list of methods from running FindMembers.
20904 (MemberLookup): Rework FindMembers so that
20906 2001-12-16 Miguel de Icaza <miguel@ximian.com>
20908 * class.cs (TypeContainer): Remove Delegates who fail to be
20911 * delegate.cs (Populate): Verify that we dont get null return
20912 values. TODO: Check for AsAccessible.
20914 * cs-parser.jay: Use basename to emit error 574 (destructor should
20915 have the same name as container class), not the full name.
20917 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20918 possible representation.
20920 Also implements integer type suffixes U and L.
20922 2001-12-15 Miguel de Icaza <miguel@ximian.com>
20924 * expression.cs (ArrayCreation.DoResolve): We need to do the
20925 argument resolution *always*.
20927 * decl.cs: Make this hold the namespace. Hold the root context as
20929 (LookupType): Move here.
20931 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20933 * location.cs (Row, Name): Fixed the code, it was always returning
20934 references to the first file.
20936 * interface.cs: Register properties defined through interfaces.
20938 * driver.cs: Add support for globbing on the command line
20940 * class.cs (Field): Make it derive from MemberCore as well.
20943 2001-12-15 Ravi Pratap <ravi@ximian.com>
20945 * class.cs (Event::Define): Check that the type of the event is a delegate
20946 type else flag error #66.
20948 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20951 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20952 values of EntryPoint, CharSet etc etc.
20954 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20956 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20957 be null and we should ignore this. I am not sure if this is really clean. Apparently,
20958 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20959 which needs this to do its work.
20961 * ../errors/cs0066.cs : Add.
20963 2001-12-14 Miguel de Icaza <miguel@ximian.com>
20965 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20968 * class.cs: (MethodSignature.MethodSignature): Removed hack that
20969 clears out the parameters field.
20970 (MemberSignatureCompare): Cleanup
20972 (MemberCore): New base class used to share code between MethodCore
20975 (RegisterRequiredImplementations) BindingFlags.Public requires
20976 either BindingFlags.Instace or Static. Use instance here.
20978 (Property): Refactored code to cope better with the full spec.
20980 * parameter.cs (GetParameterInfo): Return an empty array instead
20983 * class.cs (Property): Abstract or extern properties have no bodies.
20985 * parameter.cs (GetParameterInfo): return a zero-sized array.
20987 * class.cs (TypeContainer.MethodModifiersValid): Move all the
20988 method modifier validation to the typecontainer so we can reuse
20989 this on properties.
20991 (MethodCore.ParameterTypes): return an empty sized array of types.
20993 (Property.Define): Test property modifier validity.
20995 Add tests for sealed/override too.
20997 (Method.Emit): abstract or extern methods have no bodies.
20999 2001-12-14 Ravi Pratap <ravi@ximian.com>
21001 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21004 (Method::Define, ::Emit): Modify accordingly.
21006 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21008 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21010 * makefile: Pass in /unsafe.
21012 2001-12-13 Miguel de Icaza <miguel@ximian.com>
21014 * class.cs (MakeKey): Kill routine.
21016 * class.cs (TypeContainer.Define): Correctly define explicit
21017 method implementations (they require the full interface name plus
21020 * typemanager.cs: Deply the PtrHashtable here and stop using the
21021 lame keys. Things work so much better.
21023 This of course broke everyone who depended on `RegisterMethod' to
21024 do the `test for existance' test. This has to be done elsewhere.
21026 * support.cs (PtrHashtable): A hashtable that avoid comparing with
21027 the object stupid Equals method (because, that like fails all over
21028 the place). We still do not use it.
21030 * class.cs (TypeContainer.SetRequiredInterface,
21031 TypeContainer.RequireMethods): Killed these two routines and moved
21032 all the functionality to RegisterRequiredImplementations.
21034 (TypeContainer.RegisterRequiredImplementations): This routine now
21035 registers all the implementations required in an array for the
21036 interfaces and abstract methods. We use an array of structures
21037 which can be computed ahead of time to reduce memory usage and we
21038 also assume that lookups are cheap as most classes will not
21039 implement too many interfaces.
21041 We also avoid creating too many MethodSignatures.
21043 (TypeContainer.IsInterfaceMethod): Update and optionally does not
21044 clear the "pending" bit if we find that there are problems with
21047 (TypeContainer.VerifyPendingMethods): Update to report errors of
21048 methods that look like implementations but are not.
21050 (TypeContainer.Define): Add support for explicit interface method
21053 2001-12-12 Miguel de Icaza <miguel@ximian.com>
21055 * typemanager.cs: Keep track of the parameters here instead of
21056 being a feature of the TypeContainer.
21058 * class.cs: Drop the registration of parameters here, as
21059 InterfaceMethods are also interface declarations.
21061 * delegate.cs: Register methods with the TypeManager not only with
21062 the TypeContainer. This code was buggy.
21064 * interface.cs: Full registation here.
21066 2001-12-11 Miguel de Icaza <miguel@ximian.com>
21068 * expression.cs: Remove reducer for binary expressions, it can not
21071 * const.cs: Put here the code that used to go into constant.cs
21073 * constant.cs: Put here the code for constants, this is a new base
21074 class for Literals.
21076 * literal.cs: Make Literal derive from Constant.
21078 2001-12-09 Miguel de Icaza <miguel@ximian.com>
21080 * statement.cs (Return.Emit): Report error 157 if the user
21081 attempts to return from a finally block.
21083 (Return.Emit): Instead of emitting a return, jump to the end of
21086 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21087 LocalBuilder to store the result of the function. ReturnLabel is
21088 the target where we jump.
21091 2001-12-09 Radek Doulik <rodo@ximian.com>
21093 * cs-parser.jay: remember alias in current namespace
21095 * ecore.cs (SimpleName::DoResolve): use aliases for types or
21098 * class.cs (LookupAlias): lookup alias in my_namespace
21100 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21102 (LookupAlias): lookup alias in this and if needed in parent
21105 2001-12-08 Miguel de Icaza <miguel@ximian.com>
21109 * rootcontext.cs: (ModuleBuilder) Made static, first step into
21110 making things static. I need this to avoid passing the
21111 TypeContainer when calling ParameterType.
21113 * support.cs (InternalParameters.ParameterType): Remove ugly hack
21114 that did string manipulation to compute the type and then call
21115 GetType. Use Parameter.ParameterType instead.
21117 * cs-tokenizer.cs: Consume the suffix for floating values.
21119 * expression.cs (ParameterReference): figure out whether this is a
21120 reference parameter or not. Kill an extra variable by computing
21121 the arg_idx during emission.
21123 * parameter.cs (Parameters.GetParameterInfo): New overloaded
21124 function that returns whether a parameter is an out/ref value or not.
21126 (Parameter.ParameterType): The type of the parameter (base,
21127 without ref/out applied).
21129 (Parameter.Resolve): Perform resolution here.
21130 (Parameter.ExternalType): The full type (with ref/out applied).
21132 * statement.cs (Using.Emit, Using.EmitExpression): Implement
21133 support for expressions on the using statement.
21135 2001-12-07 Miguel de Icaza <miguel@ximian.com>
21137 * statement.cs (Using.EmitLocalVariableDecls): Split the
21138 localvariable handling of the using statement.
21140 (Block.EmitMeta): Keep track of variable count across blocks. We
21141 were reusing slots on separate branches of blocks.
21143 (Try.Emit): Emit the general code block, we were not emitting it.
21145 Check the type of the declaration to be an IDisposable or
21146 something that can be implicity converted to it.
21148 Emit conversions if required.
21150 * ecore.cs (EmptyExpression): New utility class.
21151 (Expression.ImplicitConversionExists): New utility function.
21153 2001-12-06 Miguel de Icaza <miguel@ximian.com>
21155 * statement.cs (Using): Implement.
21157 * expression.cs (LocalVariableReference): Support read only variables.
21159 * statement.cs: Remove the explicit emit for the Leave opcode.
21160 (VariableInfo): Add a readonly field.
21162 2001-12-05 Miguel de Icaza <miguel@ximian.com>
21164 * ecore.cs (ConvCast): new class used to encapsulate the various
21165 explicit integer conversions that works in both checked and
21166 unchecked contexts.
21168 (Expression.ConvertNumericExplicit): Use new ConvCast class to
21169 properly generate the overflow opcodes.
21171 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21173 * statement.cs: The correct type for the EmptyExpression is the
21174 element_type, not the variable type. Ravi pointed this out.
21176 2001-12-04 Ravi Pratap <ravi@ximian.com>
21178 * class.cs (Method::Define): Handle PInvoke methods specially
21179 by using DefinePInvokeMethod instead of the usual one.
21181 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21182 above to do the task of extracting information and defining the method.
21184 2001-12-04 Ravi Pratap <ravi@ximian.com>
21186 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21187 of the condition for string type.
21189 (Emit): Move that here.
21191 (ArrayCreation::CheckIndices): Keep string literals in their expression
21194 (EmitDynamicInitializers): Handle strings appropriately.
21196 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21198 * codegen.cs (EmitContext): Replace multiple variables with a
21199 single pointer to the current Switch statement.
21201 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21204 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21208 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21211 (Foreach.Emit): Foreach on arrays was not setting
21212 up the loop variables (for break/continue).
21214 (GotoCase): Semi-implented.
21216 2001-12-03 Ravi Pratap <ravi@ximian.com>
21218 * attribute.cs (CheckAttribute): Handle system attributes by using
21219 Attribute.GetAttributes to examine information we need.
21221 (GetValidPlaces): Same here.
21223 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21225 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21227 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21229 (Method::Define): Set appropriate flags if we have a DllImport attribute.
21231 (Method::Emit): Handle the case when we are a PInvoke method.
21233 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21235 * expression.cs: Use ResolveWithSimpleName on compound names.
21237 2001-12-02 Ravi Pratap <ravi@ximian.com>
21239 * constant.cs (EmitConstant): Make sure we resolve the associated expression
21240 before trying to reduce it.
21242 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21244 * constant.cs (LookupConstantValue): Implement.
21246 (EmitConstant): Use the above in emitting the constant.
21248 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21249 that are user-defined by doing a LookupConstantValue on them.
21251 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21254 2001-11-29 Miguel de Icaza <miguel@ximian.com>
21256 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21258 (BaseAccess.DoResolve): Implement.
21260 (MemberAccess.DoResolve): Split this routine into a
21261 ResolveMemberAccess routine that can be used independently
21263 2001-11-28 Miguel de Icaza <miguel@ximian.com>
21265 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21266 As that share bits of the implementation. Is returns a boolean,
21267 while As returns the Type that is being probed.
21269 2001-12-01 Ravi Pratap <ravi@ximian.com>
21271 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21272 instead of a Literal - much easier.
21274 (EnumInTransit): Remove - utterly useless :-)
21276 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21278 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21280 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21281 chain when we have no associated expression.
21283 2001-11-30 Ravi Pratap <ravi@ximian.com>
21285 * constant.cs (Define): Use Location while reporting the errror.
21287 Also emit a warning when 'new' is used and there is no inherited
21290 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
21293 (LookupEnumValue): Implement to lookup an enum member's value and define it
21296 (Populate): Re-write accordingly to use the above routine.
21298 2001-11-27 Miguel de Icaza <miguel@ximian.com>
21300 * expression.cs (This): Fix prototype for DoResolveLValue to
21301 override the base class DoResolveLValue.
21303 * cs-parser.cs: Report errors cs574 and cs575 (destructor
21306 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21307 (we need to load the address of the field here). This fixes
21310 (FieldExpr.DoResolveLValue): Call the DoResolve
21311 function to initialize the Instance expression.
21313 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21314 correctly the GetEnumerator operation on a value type.
21316 * cs-parser.jay: Add more simple parsing error catches.
21318 * statement.cs (Switch): Add support for string switches.
21319 Handle null specially.
21321 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
21323 2001-11-28 Ravi Pratap <ravi@ximian.com>
21325 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21327 (declare_local_constant): New helper function.
21329 * statement.cs (AddConstant): Keep a separate record of constants
21331 (IsConstant): Implement to determine if a variable is a constant.
21333 (GetConstantExpression): Implement.
21335 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21337 * statement.cs (IsVariableDefined): Re-write.
21339 2001-11-27 Ravi Pratap <ravi@ximian.com>
21341 * class.cs (TypeContainer::FindMembers): Look for constants
21342 in the case when we are looking for MemberTypes.Field
21344 * expression.cs (MemberAccess::DoResolve): Check that in the
21345 case we are a FieldExpr and a Literal, we are not being accessed
21346 by an instance reference.
21348 * cs-parser.jay (local_constant_declaration): Implement.
21350 (declaration_statement): Implement for constant declarations.
21352 2001-11-26 Miguel de Icaza <miguel@ximian.com>
21354 * statement.cs (Switch): Catch double defaults.
21356 (Switch): More work on the switch() statement
21357 implementation. It works for integral values now, need to finish
21361 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21363 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21364 integer literals into other integer literals. To be used by
21367 2001-11-24 Ravi Pratap <ravi@ximian.com>
21369 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21372 (EmitDynamicInitializers): Cope with the above since we extract data
21373 directly from ArrayData now.
21375 (ExpectInitializers): Keep track of whether initializers are mandatory
21378 (Bounds): Make it a hashtable to prevent the same dimension being
21379 recorded for every element in that dimension.
21381 (EmitDynamicInitializers): Fix bug which prevented the Set array method
21384 Also fix bug which was causing the indices to be emitted in the reverse
21387 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21389 * expression.cs (ArrayCreation): Implement the bits that Ravi left
21390 unfinished. They do not work, because the underlying code is
21393 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21395 * cs-parser.jay: Remove bogus fixme.
21397 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21398 on Switch statement.
21400 2001-11-23 Ravi Pratap <ravi@ximian.com>
21402 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21405 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21406 parameter. Apparently, any expression is allowed.
21408 (ValidateInitializers): Update accordingly.
21410 (CheckIndices): Fix some tricky bugs thanks to recursion.
21412 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
21413 I was being completely brain-dead.
21415 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21416 and re-write acordingly.
21418 (DelegateInvocation): Re-write accordingly.
21420 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21422 (MakeByteBlob): Handle types more correctly.
21424 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21425 initialization from expressions but it is incomplete because I am a complete
21428 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21430 * statement.cs (If.Emit): Fix a bug that generated incorrect code
21431 on If. Basically, we have to return `true' (ie, we do return to
21432 our caller) only if both branches of the if return.
21434 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21435 short-circuit operators, handle them as short circuit operators.
21437 (Cast.DoResolve): Resolve type.
21438 (Cast.Cast): Take an expression as the target type.
21440 * cs-parser.jay (cast_expression): Remove old hack that only
21441 allowed a limited set of types to be handled. Now we take a
21442 unary_expression and we resolve to a type during semantic
21445 Use the grammar productions from Rhys to handle casts (this is
21446 not complete like Rhys syntax yet, we fail to handle that corner
21447 case that C# has regarding (-x), but we will get there.
21449 2001-11-22 Ravi Pratap <ravi@ximian.com>
21451 * class.cs (EmitFieldInitializer): Take care of the case when we have a
21452 field which is an array type.
21454 * cs-parser.jay (declare_local_variables): Support array initialization too.
21456 * typemanager.cs (MakeKey): Implement.
21458 (everywhere): Use the above appropriately.
21460 * cs-parser.jay (for_statement): Update for array initialization while
21461 declaring variables.
21463 * ecore.cs : The error message was correct, it's the variable's names that
21464 were misleading ;-) Make the code more readable.
21466 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21467 the correct type etc.
21469 (ConvertExplicit): Handle Enum types by examining the underlying type.
21471 2001-11-21 Ravi Pratap <ravi@ximian.com>
21473 * parameter.cs (GetCallingConvention): Always return
21474 CallingConventions.Standard for now.
21476 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21478 * expression.cs (Binary.ResolveOperator): Update the values of `l'
21479 and `r' after calling DoNumericPromotions.
21481 * ecore.cs: Fix error message (the types were in the wrong order).
21483 * statement.cs (Foreach.ProbeCollectionType): Need to pass
21484 BindingFlags.Instance as well
21486 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21487 implicit int literal conversion in an empty cast so that we
21488 propagate the right type upstream.
21490 (UnboxCast): new class used to unbox value types.
21491 (Expression.ConvertExplicit): Add explicit type conversions done
21494 (Expression.ImplicitNumericConversion): Oops, forgot to test for
21495 the target type before applying the implicit LongLiterals to ULong
21498 2001-11-21 Miguel de Icaza <miguel@ximian.com>
21500 * cs-parser.jay (for_statement): Reworked the way For works: now
21501 we declare manually any variables that are introduced in
21502 for_initializer to solve the problem of having out-of-band code
21503 emition (that is what got for broken).
21505 (declaration_statement): Perform the actual variable declaration
21506 that used to be done in local_variable_declaration here.
21508 (local_variable_declaration): Do not declare anything, just pass
21509 the information on a DictionaryEntry
21511 2001-11-20 Ravi Pratap <ravi@ximian.com>
21513 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21514 re-write of the logic to now make it recursive.
21516 (UpdateIndices): Re-write accordingly.
21518 Store element data in a separate ArrayData list in the above methods.
21520 (MakeByteBlob): Implement to dump the array data into a byte array.
21522 2001-11-19 Ravi Pratap <ravi@ximian.com>
21524 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21527 * constant.cs (Define): Implement.
21529 (EmitConstant): Re-write fully.
21531 Pass in location info.
21533 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21536 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21537 DictionaryEntry since we need location info too.
21539 (constant_declaration): Update accordingly.
21541 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21542 code into another method : UpdateIndices.
21544 2001-11-18 Ravi Pratap <ravi@ximian.com>
21546 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21547 some type checking etc.
21549 2001-11-17 Ravi Pratap <ravi@ximian.com>
21551 * expression.cs (ArrayCreation::ValidateInitializers): Implement
21552 bits to provide dimension info if the user skips doing that.
21554 Update second constructor to store the rank correctly.
21556 2001-11-16 Ravi Pratap <ravi@ximian.com>
21558 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21559 and try to implement.
21561 * ../errors/cs0150.cs : Add.
21563 * ../errors/cs0178.cs : Add.
21565 2001-11-16 Miguel de Icaza <miguel@ximian.com>
21567 * statement.cs: Implement foreach on multi-dimensional arrays.
21569 * parameter.cs (Parameters.GetParameterByName): Also lookup the
21570 name of the params argument.
21572 * expression.cs: Use EmitStoreOpcode to get the right opcode while
21573 initializing the array.
21575 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21576 we can use this elsewhere.
21578 * statement.cs: Finish implementation of foreach for single
21581 * cs-parser.jay: Use an out-of-band stack to pass information
21582 around, I wonder why I need this.
21584 foreach_block: Make the new foreach_block the current_block.
21586 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21587 function used to return a static Parameters structure. Used for
21588 empty parameters, as those are created very frequently.
21590 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21592 2001-11-15 Ravi Pratap <ravi@ximian.com>
21594 * interface.cs : Default modifier is private, not public. The
21595 make verify test passes again.
21597 2001-11-15 Ravi Pratap <ravi@ximian.com>
21599 * support.cs (ReflectionParameters): Fix logic to determine
21600 whether the last parameter is a params one. Test 9 passes again.
21602 * delegate.cs (Populate): Register the builders we define with
21603 RegisterParameterForBuilder. Test 19 passes again.
21605 * cs-parser.jay (property_declaration): Reference $6 instead
21606 of $$ to get at the location.
21608 (indexer_declaration): Similar stuff.
21610 (attribute): Ditto.
21612 * class.cs (Property): Register parameters for the Get and Set methods
21613 if they exist. Test 23 passes again.
21615 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21616 call to EmitArguments as we are sure there aren't any params arguments.
21617 Test 32 passes again.
21619 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21620 IndexOutOfRangeException.
21622 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21623 Test 33 now passes again.
21625 2001-11-15 Miguel de Icaza <miguel@ximian.com>
21627 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21628 broke a bunch of things. Will have to come up with a better way
21629 of tracking locations.
21631 * statement.cs: Implemented foreach for single dimension arrays.
21633 2001-11-09 Miguel de Icaza <miguel@ximian.com>
21635 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21636 an error. This removes the lookup from the critical path.
21638 * cs-parser.jay: Removed use of temporary_loc, which is completely
21641 2001-11-14 Miguel de Icaza <miguel@ximian.com>
21643 * support.cs (ReflectionParameters.ParameterModifier): Report
21644 whether the argument is a PARAMS argument or not.
21646 * class.cs: Set the attribute `ParamArrayAttribute' on the
21647 parameter argument.
21649 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21650 and cons_param_array_attribute (ConstructorInfo for
21651 ParamArrayAttribute).,
21653 * codegen.cs: Emit the return using the `Return' statement, that
21654 way we can report the error correctly for missing return values.
21656 * class.cs (Method.Emit): Clean up.
21658 * expression.cs (Argument.Resolve): Take another argument: the
21659 location where this argument is used. Notice that this is not
21660 part of the "Argument" class as to reduce the size of the
21661 structure (we know the approximate location anyways).
21663 Test if the argument is a variable-reference, if not, then
21664 complain with a 206.
21666 (Argument.Emit): Emit addresses of variables.
21668 (Argument.FullDesc): Simplify.
21670 (Invocation.DoResolve): Update for Argument.Resolve.
21672 (ElementAccess.DoResolve): ditto.
21674 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21675 method should be virtual, as this method is always virtual.
21677 (NewDelegate.DoResolve): Update for Argument.Resolve.
21679 * class.cs (ConstructorInitializer.DoResolve): ditto.
21681 * attribute.cs (Attribute.Resolve): ditto.
21683 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21685 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21687 * expression.cs (ParameterReference): Drop IStackStorage and implement
21688 IAssignMethod instead.
21690 (LocalVariableReference): ditto.
21692 * ecore.cs (FieldExpr): Drop IStackStorage and implement
21693 IAssignMethod instead.
21695 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21697 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21698 enumerations that are used in heavily used structures derive from
21699 byte in a laughable and pathetic attempt to reduce memory usage.
21700 This is the kind of pre-optimzations that you should not do at
21701 home without adult supervision.
21703 * expression.cs (UnaryMutator): New class, used to handle ++ and
21704 -- separatedly from the other unary operators. Cleans up the
21705 code, and kills the ExpressionStatement dependency in Unary.
21707 (Unary): Removed `method' and `Arguments' from this class, making
21708 it smaller, and moving it all to SimpleCall, so I can reuse this
21709 code in other locations and avoid creating a lot of transient data
21710 strucutres when not required.
21712 * cs-parser.jay: Adjust for new changes.
21714 2001-11-11 Miguel de Icaza <miguel@ximian.com>
21716 * enum.cs (Enum.Populate): If there is a failure during
21719 * cs-parser.jay (opt_enum_base): we used to catch type errors
21720 here, but this is really incorrect. The type error should be
21721 catched during semantic analysis.
21723 2001-12-11 Ravi Pratap <ravi@ximian.com>
21725 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21726 current_local_parameters as expected since I, in my stupidity, had forgotten
21729 * attribute.cs (GetValidPlaces): Fix stupid bug.
21731 * class.cs (Method::Emit): Perform check on applicability of attributes.
21733 (Constructor::Emit): Ditto.
21735 (Field::Emit): Ditto.
21737 (Field.Location): Store location information.
21739 (Property, Event, Indexer, Operator): Ditto.
21741 * cs-parser.jay (field_declaration): Pass in location for each field.
21743 * ../errors/cs0592.cs : Add.
21745 2001-11-12 Ravi Pratap <ravi@ximian.com>
21747 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21749 (InitCoreTypes): Update accordingly.
21751 (RegisterAttrType, LookupAttr): Implement.
21753 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21754 info about the same.
21756 (Resolve): Update to populate the above as necessary.
21758 (Error592): Helper.
21760 (GetValidPlaces): Helper to the above.
21762 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21764 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21766 2001-11-12 Ravi Pratap <ravi@ximian.com>
21768 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21770 * ../errors/cs0617.cs : Add.
21772 2001-11-11 Ravi Pratap <ravi@ximian.com>
21774 * enum.cs (Emit): Rename to Populate to be more consistent with what
21775 we expect it to do and when exactly it is called.
21777 * class.cs, rootcontext.cs : Update accordingly.
21779 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21780 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21782 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21784 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21785 of a fieldinfo using the above, when dealing with a FieldBuilder.
21787 2001-11-10 Ravi Pratap <ravi@ximian.com>
21789 * ../errors/cs0031.cs : Add.
21791 * ../errors/cs1008.cs : Add.
21793 * ../errrors/cs0543.cs : Add.
21795 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21798 (FindMembers): Implement.
21800 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21801 enums and delegates too.
21803 (enum_types): Rename to builder_to_enum.
21805 (delegate_types): Rename to builder_to_delegate.
21807 * delegate.cs (FindMembers): Implement.
21809 2001-11-09 Ravi Pratap <ravi@ximian.com>
21811 * typemanager.cs (IsEnumType): Implement.
21813 * enum.cs (Emit): Re-write parts to account for the underlying type
21814 better and perform checking etc.
21816 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21817 of the underlying type.
21819 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21822 * enum.cs (error31): Helper to report error #31.
21824 * cs-parser.jay (enum_declaration): Store location of each member too.
21826 * enum.cs (member_to_location): New hashtable.
21828 (AddEnumMember): Update location hashtable.
21830 (Emit): Use the location of each member while reporting errors.
21832 2001-11-09 Miguel de Icaza <miguel@ximian.com>
21834 * cs-parser.jay: A for_initializer if is a
21835 local_variable_declaration really ammount to have an implicit
21836 block with the variable declaration and no initializer for for.
21838 * statement.cs (For.Emit): Cope with null initializers.
21840 This fixes the infinite loop on for initializers.
21842 2001-11-08 Miguel de Icaza <miguel@ximian.com>
21844 * enum.cs: More cleanup.
21846 * ecore.cs: Remove dead code.
21848 * class.cs (Property.Emit): More simplification.
21849 (Event.Emit): ditto.
21851 Reworked to have less levels of indentation.
21853 2001-11-08 Ravi Pratap <ravi@ximian.com>
21855 * class.cs (Property): Emit attributes.
21865 * enum.cs (Emit): Ditto.
21867 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21870 * class.cs (Field, Event, etc.): Move attribute generation into the
21871 Emit method everywhere.
21873 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21874 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21875 as we had no way of defining nested enums !
21877 * rootcontext.cs : Adjust code accordingly.
21879 * typemanager.cs (AddEnumType): To keep track of enum types separately.
21881 2001-11-07 Ravi Pratap <ravi@ximian.com>
21883 * expression.cs (EvalConstantExpression): Move into ecore.cs
21885 * enum.cs (Enum): Rename some members and make them public and readonly
21886 according to our convention.
21888 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21891 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21893 (Enum::Emit): Write a simple version for now which doesn't try to compute
21894 expressions. I shall modify this to be more robust in just a while.
21896 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21898 (TypeContainer::CloseType): Create the Enum types too.
21900 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21902 * expression.cs (EvalConstantExpression): Get rid of completely.
21904 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21905 user-defined values and other cases.
21907 (IsValidEnumLiteral): Helper function.
21909 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
21910 out there in the case we had a literal FieldExpr.
21912 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21914 (Literalize): Revamp a bit to take two arguments.
21916 (EnumLiteral): New class which derives from Literal to wrap enum literals.
21918 2001-11-06 Ravi Pratap <ravi@ximian.com>
21920 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21922 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21924 (Resolve): Use the above to ensure we have proper initializers.
21926 2001-11-05 Ravi Pratap <ravi@ximian.com>
21928 * expression.cs (Expression::EvalConstantExpression): New method to
21929 evaluate constant expressions.
21931 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21933 2001-11-07 Miguel de Icaza <miguel@ximian.com>
21935 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21938 (Binary.ResolveOperator): Handle operator != (object a, object b)
21939 and operator == (object a, object b);
21941 (Binary.DoNumericPromotions): Indicate whether the numeric
21942 promotion was possible.
21944 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21947 Made the ArrayAccess implement interface IAssignMethod instead of
21948 IStackStore as the order in which arguments are passed reflects
21951 * assign.cs: Instead of using expr.ExprClass to select the way of
21952 assinging, probe for the IStackStore/IAssignMethod interfaces.
21954 * typemanager.cs: Load InitializeArray definition.
21956 * rootcontext.cs (RootContext.MakeStaticData): Used to define
21957 static data that can be used to initialize arrays.
21959 2001-11-05 Miguel de Icaza <miguel@ximian.com>
21961 * expression.cs: Handle operator== and operator!= for booleans.
21963 (Conditioal.Reduce): Implement reducer for the ?: operator.
21965 (Conditional.Resolve): Implement dead code elimination.
21967 (Binary.Resolve): Catch string literals and return a new
21968 concatenated string.
21970 (Unary.Reduce): Implement reduction of unary expressions.
21972 * ecore.cs: Split out the expression core handling here.
21974 (Expression.Reduce): New method used to perform constant folding
21975 and CSE. This is needed to support constant-expressions.
21977 * statement.cs (Statement.EmitBoolExpression): Pass true and false
21978 targets, and optimize for !x.
21980 2001-11-04 Ravi Pratap <ravi@ximian.com>
21982 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21983 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21984 set custom atttributes.
21986 * literal.cs (Literal::GetValue): New abstract method to return the actual
21987 value of the literal, cast as an object.
21989 (*Literal): Implement GetValue method.
21991 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21992 expressions to the arraylist but objects of type Argument.
21994 * class.cs (TypeContainer::Emit): Emit our attributes too.
21996 (Method::Emit, Constructor::Emit): Ditto.
21998 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21999 to be ignoring earlier.
22001 2001-11-03 Ravi Pratap <ravi@ximian.com>
22003 * attribute.cs (AttributeSection::Define): Implement to do the business
22004 of constructing a CustomAttributeBuilder.
22006 (Attribute): New trivial class. Increases readability of code.
22008 * cs-parser.jay : Update accordingly.
22010 (positional_argument_list, named_argument_list, named_argument): New rules
22012 (attribute_arguments): Use the above so that we are more correct.
22014 2001-11-02 Ravi Pratap <ravi@ximian.com>
22016 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22017 to perform all checks for a method with a params parameter.
22019 (Invocation::OverloadResolve): Update to use the above method and therefore
22020 cope correctly with params method invocations.
22022 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
22025 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22026 constructors in our parent too because we can't afford to miss out on
22029 * attribute.cs (AttributeSection): New name for the class Attribute
22031 Other trivial changes to improve readability.
22033 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22034 use the new class names.
22036 2001-11-01 Ravi Pratap <ravi@ximian.com>
22038 * class.cs (Method::Define): Complete definition for params types too
22040 (Indexer::Define): Ditto.
22042 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22043 Cope everywhere with a request for info about the array parameter.
22045 2001-11-01 Ravi Pratap <ravi@ximian.com>
22047 * tree.cs (RecordNamespace): Fix up to check for the correct key.
22049 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
22050 local_variable_type to extract the string corresponding to the type.
22052 (local_variable_type): Fixup the action to use the new helper method.
22054 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
22057 * expression.cs : Clean out code which uses the above.
22059 2001-10-31 Ravi Pratap <ravi@ximian.com>
22061 * typemanager.cs (RegisterMethod): Check if we already have an existing key
22062 and bale out if necessary by returning a false.
22064 (RegisterProperty): Ditto.
22066 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22067 and print out appropriate error messages.
22069 * interface.cs (everywhere): Ditto.
22071 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22072 location to constructor.
22074 * class.cs (Property, Event, Indexer): Update accordingly.
22076 * ../errors/cs111.cs : Added.
22078 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22079 of a method, as laid down by the spec.
22081 (Invocation::OverloadResolve): Use the above method.
22083 2001-10-31 Ravi Pratap <ravi@ximian.com>
22085 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22086 now take a TypeContainer and a Parameters object.
22088 (ParameterData): Modify return type of ParameterModifier method to be
22089 Parameter.Modifier and not a string.
22091 (ReflectionParameters, InternalParameters): Update accordingly.
22093 * expression.cs (Argument::GetParameterModifier): Same here.
22095 * support.cs (InternalParameters::ParameterType): Find a better way of determining
22096 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22097 symbol in it at all so maybe this is only for now.
22099 2001-10-30 Ravi Pratap <ravi@ximian.com>
22101 * support.cs (InternalParameters): Constructor now takes an extra argument
22102 which is the actual Parameters class.
22104 (ParameterDesc): Update to provide info on ref/out modifiers.
22106 * class.cs (everywhere): Update call to InternalParameters to pass in
22107 the second argument too.
22109 * support.cs (ParameterData): Add ParameterModifier, which is a method
22110 to return the modifier info [ref/out etc]
22112 (InternalParameters, ReflectionParameters): Implement the above.
22114 * expression.cs (Argument::ParameterModifier): Similar function to return
22115 info about the argument's modifiers.
22117 (Invocation::OverloadResolve): Update to take into account matching modifiers
22120 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22121 a new SetFormalParameters object which we pass to InternalParameters.
22123 2001-10-30 Ravi Pratap <ravi@ximian.com>
22125 * expression.cs (NewArray): Merge into the ArrayCreation class.
22127 2001-10-29 Ravi Pratap <ravi@ximian.com>
22129 * expression.cs (NewArray): Merge classes NewBuiltinArray and
22130 NewUserdefinedArray into one as there wasn't much of a use in having
22133 * expression.cs (Argument): Change field's name to ArgType from Type.
22135 (Type): New readonly property which returns the proper type, taking into
22136 account ref/out modifiers.
22138 (everywhere): Adjust code accordingly for the above.
22140 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22141 whether we are emitting for a ref or out parameter.
22143 * expression.cs (Argument::Emit): Use the above field to set the state.
22145 (LocalVariableReference::Emit): Update to honour the flag and emit the
22148 * parameter.cs (Attributes): Set the correct flags for ref parameters.
22150 * expression.cs (Argument::FullDesc): New function to provide a full desc.
22152 * support.cs (ParameterData): Add method ParameterDesc to the interface.
22154 (ReflectionParameters, InternalParameters): Implement the above method.
22156 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22159 (Invocation::FullMethodDesc): Ditto.
22161 2001-10-29 Miguel de Icaza <miguel@ximian.com>
22163 * cs-parser.jay: Add extra production for the second form of array
22166 * expression.cs (ArrayCreation): Update to reflect the above
22169 * Small changes to prepare for Array initialization.
22171 2001-10-28 Miguel de Icaza <miguel@ximian.com>
22173 * typemanager.cs (ImplementsInterface): interface might be null;
22174 Deal with this problem;
22176 Also, we do store negative hits on the cache (null values), so use
22177 this instead of calling t.GetInterfaces on the type everytime.
22179 2001-10-28 Ravi Pratap <ravi@ximian.com>
22181 * typemanager.cs (IsBuiltinType): New method to help determine the same.
22183 * expression.cs (New::DoResolve): Get rid of array creation code and instead
22184 split functionality out into different classes.
22186 (New::FormArrayType): Move into NewBuiltinArray.
22188 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22191 (NewBuiltinArray): New class to handle creation of built-in arrays.
22193 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22194 account creation of one-dimensional arrays.
22196 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22198 (NewUserdefinedArray::DoResolve): Implement.
22200 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22202 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22203 we maintain inside the TypeManager. This is necessary to perform lookups on the
22206 (LookupType): Update to perform GetType on the module builders too.
22208 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22210 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22212 2001-10-23 Ravi Pratap <ravi@ximian.com>
22214 * expression.cs (New::DoResolve): Implement guts of array creation.
22216 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22218 2001-10-27 Miguel de Icaza <miguel@ximian.com>
22220 * expression.cs: Fix bug I introduced lsat night that broke
22223 (Expression.Resolve): Report a 246 error (can not resolve name)
22224 if we find a SimpleName in the stream.
22226 (Expression.ResolveLValue): Ditto.
22228 (Expression.ResolveWithSimpleName): This function is a variant of
22229 ResolveName, this one allows SimpleNames to be returned without a
22230 warning. The only consumer of SimpleNames is MemberAccess
22232 2001-10-26 Miguel de Icaza <miguel@ximian.com>
22234 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22235 might arrive here. I have my doubts that this is correct.
22237 * statement.cs (Lock): Implement lock statement.
22239 * cs-parser.jay: Small fixes to support `lock' and `using'
22241 * cs-tokenizer.cs: Remove extra space
22243 * driver.cs: New flag --checked, allows to turn on integer math
22246 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22247 Threading.Monitor.Exit
22249 2001-10-23 Miguel de Icaza <miguel@ximian.com>
22251 * expression.cs (IndexerAccess::DoResolveLValue): Set the
22252 Expression Class to be IndexerAccess.
22254 Notice that Indexer::DoResolve sets the eclass to Value.
22256 2001-10-22 Miguel de Icaza <miguel@ximian.com>
22258 * class.cs (TypeContainer::Emit): Emit code for indexers.
22260 * assign.cs (IAssignMethod): New interface implemented by Indexers
22261 and Properties for handling assignment.
22263 (Assign::Emit): Simplify and reuse code.
22265 * expression.cs (IndexerAccess, PropertyExpr): Implement
22266 IAssignMethod, clean up old code.
22268 2001-10-22 Ravi Pratap <ravi@ximian.com>
22270 * typemanager.cs (ImplementsInterface): New method to determine if a type
22271 implements a given interface. Provides a nice cache too.
22273 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22276 (ConvertReferenceExplicit): Ditto.
22278 * delegate.cs (Delegate::Populate): Update to define the parameters on the
22279 various methods, with correct names etc.
22281 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
22282 Operator.UnaryNegation.
22284 * cs-parser.jay (operator_declarator): Be a little clever in the case where
22285 we have a unary plus or minus operator.
22287 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
22290 * everywhere : update accordingly.
22292 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22295 * class.cs (Method::Define): For the case where we are implementing a method
22296 inherited from an interface, we need to set the MethodAttributes.Final flag too.
22297 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22299 2001-10-21 Ravi Pratap <ravi@ximian.com>
22301 * interface.cs (FindMembers): Implement to work around S.R.E
22304 * typemanager.cs (IsInterfaceType): Implement.
22306 (FindMembers): Update to handle interface types too.
22308 * expression.cs (ImplicitReferenceConversion): Re-write bits which
22309 use IsAssignableFrom as that is not correct - it doesn't work.
22311 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22312 and accordingly override EmitStatement.
22314 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22315 using the correct logic :-)
22317 2001-10-19 Ravi Pratap <ravi@ximian.com>
22319 * ../errors/cs-11.cs : Add to demonstrate error -11
22321 2001-10-17 Miguel de Icaza <miguel@ximian.com>
22323 * assign.cs (Assign::Resolve): Resolve right hand side first, and
22324 then pass this as a hint to ResolveLValue.
22326 * expression.cs (FieldExpr): Add Location information
22328 (FieldExpr::LValueResolve): Report assignment to readonly
22331 (Expression::ExprClassFromMemberInfo): Pass location information.
22333 (Expression::ResolveLValue): Add new method that resolves an
22336 (Expression::DoResolveLValue): Default invocation calls
22339 (Indexers): New class used to keep track of indexers in a given
22342 (IStackStore): Renamed from LValue, as it did not really describe
22343 what this did. Also ResolveLValue is gone from this interface and
22344 now is part of Expression.
22346 (ElementAccess): Depending on the element access type
22348 * typemanager.cs: Add `indexer_name_type' as a Core type
22349 (System.Runtime.CompilerServices.IndexerNameAttribute)
22351 * statement.cs (Goto): Take a location.
22353 2001-10-18 Ravi Pratap <ravi@ximian.com>
22355 * delegate.cs (Delegate::VerifyDelegate): New method to verify
22356 if two delegates are compatible.
22358 (NewDelegate::DoResolve): Update to take care of the case when
22359 we instantiate a delegate from another delegate.
22361 * typemanager.cs (FindMembers): Don't even try to look up members
22362 of Delegate types for now.
22364 2001-10-18 Ravi Pratap <ravi@ximian.com>
22366 * delegate.cs (NewDelegate): New class to take care of delegate
22369 * expression.cs (New): Split the delegate related code out into
22370 the NewDelegate class.
22372 * delegate.cs (DelegateInvocation): New class to handle delegate
22375 * expression.cs (Invocation): Split out delegate related code into
22376 the DelegateInvocation class.
22378 2001-10-17 Ravi Pratap <ravi@ximian.com>
22380 * expression.cs (New::DoResolve): Implement delegate creation fully
22381 and according to the spec.
22383 (New::DoEmit): Update to handle delegates differently.
22385 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22386 because of which we were printing out arguments in reverse order !
22388 * delegate.cs (VerifyMethod): Implement to check if the given method
22389 matches the delegate.
22391 (FullDelegateDesc): Implement.
22393 (VerifyApplicability): Implement.
22395 * expression.cs (Invocation::DoResolve): Update to accordingly handle
22396 delegate invocations too.
22398 (Invocation::Emit): Ditto.
22400 * ../errors/cs1593.cs : Added.
22402 * ../errors/cs1594.cs : Added.
22404 * delegate.cs (InstanceExpression, TargetMethod): New properties.
22406 2001-10-16 Ravi Pratap <ravi@ximian.com>
22408 * typemanager.cs (intptr_type): Core type for System.IntPtr
22410 (InitCoreTypes): Update for the same.
22412 (iasyncresult_type, asynccallback_type): Ditto.
22414 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22417 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22420 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22421 the builders for the 4 members of a delegate type :-)
22423 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22426 * expression.cs (New::DoResolve): Implement guts for delegate creation.
22428 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22430 2001-10-15 Miguel de Icaza <miguel@ximian.com>
22432 * statement.cs (Break::Emit): Implement.
22433 (Continue::Emit): Implement.
22435 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
22436 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
22437 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
22438 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
22441 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22442 properties that track the label for the current loop (begin of the
22443 loop and end of the loop).
22445 2001-10-15 Ravi Pratap <ravi@ximian.com>
22447 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22448 use of emitting anything at all.
22450 * class.cs, rootcontext.cs : Get rid of calls to the same.
22452 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22454 (Populate): Define the constructor correctly and set the implementation
22457 * typemanager.cs (delegate_types): New hashtable to hold delegates that
22460 (AddDelegateType): Implement.
22462 (IsDelegateType): Implement helper method.
22464 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22466 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22467 and accordingly handle it.
22469 * delegate.cs (Populate): Take TypeContainer argument.
22470 Implement bits to define the Invoke method. However, I still haven't figured out
22471 how to take care of the native int bit :-(
22473 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
22474 Qualify the name of the delegate, not its return type !
22476 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22479 (StandardConversionExists): Checking for array types turns out to be recursive.
22481 (ConvertReferenceExplicit): Implement array conversion.
22483 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22485 2001-10-12 Ravi Pratap <ravi@ximian.com>
22487 * cs-parser.jay (delegate_declaration): Store the fully qualified
22488 name as it is a type declaration.
22490 * delegate.cs (ReturnType, Name): Rename members to these. Make them
22493 (DefineDelegate): Renamed from Define. Does the same thing essentially,
22494 as TypeContainer::DefineType.
22496 (Populate): Method in which all the definition of the various methods (Invoke)
22499 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22502 (CloseDelegate): Finally creates the delegate.
22504 * class.cs (TypeContainer::DefineType): Update to define delegates.
22505 (Populate, Emit and CloseType): Do the same thing here too.
22507 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22508 delegates in all these operations.
22510 2001-10-14 Miguel de Icaza <miguel@ximian.com>
22512 * expression.cs: LocalTemporary: a new expression used to
22513 reference a temporary that has been created.
22515 * assign.cs: Handle PropertyAccess back here, so that we can
22516 provide the proper semantic access to properties.
22518 * expression.cs (Expression::ConvertReferenceExplicit): Implement
22519 a few more explicit conversions.
22521 * modifiers.cs: `NEW' modifier maps to HideBySig.
22523 * expression.cs (PropertyExpr): Make this into an
22524 ExpressionStatement, and support the EmitStatement code path.
22526 Perform get/set error checking, clean up the interface.
22528 * assign.cs: recognize PropertyExprs as targets, and if so, turn
22529 them into toplevel access objects.
22531 2001-10-12 Miguel de Icaza <miguel@ximian.com>
22533 * expression.cs: PropertyExpr::PropertyExpr: use work around the
22536 * typemanager.cs: Keep track here of our PropertyBuilders again to
22537 work around lameness in SRE.
22539 2001-10-11 Miguel de Icaza <miguel@ximian.com>
22541 * expression.cs (LValue::LValueResolve): New method in the
22542 interface, used to perform a second resolution pass for LValues.
22544 (This::DoResolve): Catch the use of this in static methods.
22546 (This::LValueResolve): Implement.
22548 (This::Store): Remove warning, assigning to `this' in structures
22551 (Invocation::Emit): Deal with invocation of
22552 methods on value types. We need to pass the address to structure
22553 methods rather than the object itself. (The equivalent code to
22554 emit "this" for structures leaves the entire structure on the
22555 stack instead of a pointer to it).
22557 (ParameterReference::DoResolve): Compute the real index for the
22558 argument based on whether the method takes or not a `this' pointer
22559 (ie, the method is static).
22561 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22562 value types returned from functions when we need to invoke a
22563 method on the sturcture.
22566 2001-10-11 Ravi Pratap <ravi@ximian.com>
22568 * class.cs (TypeContainer::DefineType): Method to actually do the business of
22569 defining the type in the Modulebuilder or Typebuilder. This is to take
22570 care of nested types which need to be defined on the TypeBuilder using
22571 DefineNestedMethod.
22573 (TypeContainer::GetClassBases): Implement. Essentially the code from the
22574 methods in RootContext, only ported to be part of TypeContainer.
22576 (TypeContainer::GetInterfaceOrClass): Ditto.
22578 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22580 * interface.cs (Interface::DefineInterface): New method. Does exactly
22581 what RootContext.CreateInterface did earlier, only it takes care of nested types
22584 (Interface::GetInterfaces): Move from RootContext here and port.
22586 (Interface::GetInterfaceByName): Same here.
22588 * rootcontext.cs (ResolveTree): Re-write.
22590 (PopulateTypes): Re-write.
22592 * class.cs (TypeContainer::Populate): Populate nested types too.
22593 (TypeContainer::Emit): Emit nested members too.
22595 * typemanager.cs (AddUserType): Do not make use of the FullName property,
22596 instead just use the name argument passed in as it is already fully
22599 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22600 to TypeContainer mapping to see if a type is user-defined.
22602 * class.cs (TypeContainer::CloseType): Implement.
22604 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22605 the default constructor.
22607 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22610 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22612 * interface.cs (CloseType): Create the type here.
22614 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22617 Remove all the methods which are now in TypeContainer.
22619 2001-10-10 Ravi Pratap <ravi@ximian.com>
22621 * delegate.cs (Define): Re-write bits to define the delegate
22624 2001-10-10 Miguel de Icaza <miguel@ximian.com>
22626 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22628 * expression.cs (ImplicitReferenceConversion): handle null as well
22629 as a source to convert to any reference type.
22631 * statement.cs (Return): Perform any implicit conversions to
22632 expected return type.
22634 Validate use of return statement.
22636 * codegen.cs (EmitContext): Pass the expected return type here.
22638 * class.cs (Method, Constructor, Property): Pass expected return
22639 type to EmitContext.
22641 2001-10-09 Miguel de Icaza <miguel@ximian.com>
22643 * expression.cs: Make DoResolve take an EmitContext instead of a
22646 Replaced `l' and `location' for `loc', for consistency.
22648 (Error, Warning): Remove unneeded Tc argument.
22650 * assign.cs, literal.cs, constant.cs: Update to new calling
22653 * codegen.cs: EmitContext now contains a flag indicating whether
22654 code is being generated in a static method or not.
22656 * cs-parser.jay: DecomposeQI, new function that replaces the old
22657 QualifiedIdentifier. Now we always decompose the assembled
22658 strings from qualified_identifier productions into a group of
22661 2001-10-08 Miguel de Icaza <miguel@ximian.com>
22663 * rootcontext.cs: Deal with field-less struct types correctly now
22664 by passing the size option to Define Type.
22666 * class.cs: Removed hack that created one static field.
22668 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22670 * statement.cs: Moved most of the code generation here.
22672 2001-10-09 Ravi Pratap <ravi@ximian.com>
22674 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22677 (ElementAccess): Remove useless bits for now - keep checks as the spec
22680 2001-10-08 Ravi Pratap <ravi@ximian.com>
22682 * expression.cs (ElementAccess::DoResolve): Remove my crap code
22683 and start performing checks according to the spec.
22685 2001-10-07 Ravi Pratap <ravi@ximian.com>
22687 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22688 rank_specifiers instead.
22690 (rank_specifiers): Change the order in which the rank specifiers are stored
22692 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22694 * expression.cs (ElementAccess): Implement the LValue interface too.
22696 2001-10-06 Ravi Pratap <ravi@ximian.com>
22698 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22699 except that user defined conversions are not included.
22701 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
22702 perform the conversion of the return type, if necessary.
22704 (New::DoResolve): Check whether we are creating an array or an object
22705 and accordingly do the needful.
22707 (New::Emit): Same here.
22709 (New::DoResolve): Implement guts of array creation.
22711 (New::FormLookupType): Helper function.
22713 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22715 * codegen.cs: Removed most of the code generation here, and move the
22716 corresponding code generation bits to the statement classes.
22718 Added support for try/catch/finalize and throw.
22720 * cs-parser.jay: Added support for try/catch/finalize.
22722 * class.cs: Catch static methods having the flags override,
22723 virtual or abstract.
22725 * expression.cs (UserCast): This user cast was not really doing
22726 what it was supposed to do. Which is to be born in fully resolved
22727 state. Parts of the resolution were being performed at Emit time!
22731 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22733 * expression.cs: Implicity convert the result from UserCast.
22735 2001-10-05 Ravi Pratap <ravi@ximian.com>
22737 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22738 prevented it from working correctly.
22740 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22741 merely ConvertImplicit.
22743 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22745 * typemanager.cs: Make the LookupTypeContainer function static,
22746 and not per-instance.
22748 * class.cs: Make static FindMembers (the one that takes a Type
22751 * codegen.cs: Add EmitForeach here.
22753 * cs-parser.jay: Make foreach a toplevel object instead of the
22754 inline expansion, as we need to perform semantic analysis on it.
22756 2001-10-05 Ravi Pratap <ravi@ximian.com>
22758 * expression.cs (Expression::ImplicitUserConversion): Rename to
22759 UserDefinedConversion.
22761 (Expression::UserDefinedConversion): Take an extra argument specifying
22762 whether we look for explicit user conversions too.
22764 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22766 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22768 (ExplicitUserConversion): Make it a call to UserDefinedConversion
22769 with the appropriate arguments.
22771 * cs-parser.jay (cast_expression): Record location too.
22773 * expression.cs (Cast): Record location info.
22775 (Expression::ConvertExplicit): Take location argument.
22777 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22778 to determine if we are doing explicit conversions.
22780 (UserCast::Emit): Update accordingly.
22782 (Expression::ConvertExplicit): Report an error if everything fails.
22784 * ../errors/cs0030.cs : Add.
22786 2001-10-04 Miguel de Icaza <miguel@ximian.com>
22788 * modifiers.cs: If the ABSTRACT keyword is present, also set the
22789 virtual and newslot bits.
22791 * class.cs (TypeContainer::RegisterRequiredImplementations):
22792 Record methods we need.
22794 (TypeContainer::MakeKey): Helper function to make keys for
22795 MethodBases, since the Methodbase key is useless.
22797 (TypeContainer::Populate): Call RegisterRequiredImplementations
22798 before defining the methods.
22800 Create a mapping for method_builders_to_methods ahead of time
22801 instead of inside a tight loop.
22803 (::RequireMethods): Accept an object as the data to set into the
22804 hashtable so we can report interface vs abstract method mismatch.
22806 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22808 * report.cs: Make all of it static.
22810 * rootcontext.cs: Drop object_type and value_type computations, as
22811 we have those in the TypeManager anyways.
22813 Drop report instance variable too, now it is a global.
22815 * driver.cs: Use try/catch on command line handling.
22817 Add --probe option to debug the error reporting system with a test
22820 * report.cs: Add support for exiting program when a probe
22821 condition is reached.
22823 2001-10-03 Ravi Pratap <ravi@ximian.com>
22825 * expression.cs (Binary::DoNumericPromotions): Fix the case when
22826 we do a forcible conversion regardless of type, to check if
22827 ForceConversion returns a null.
22829 (Binary::error19): Use location to report error.
22831 (Unary::error23): Use location here too.
22833 * ../errors/cs0019.cs : Check in.
22835 * ../errors/cs0023.cs : Check in.
22837 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22838 case of a non-null MethodInfo object with a length of 0 !
22840 (Binary::ResolveOperator): Flag error if overload resolution fails to find
22841 an applicable member - according to the spec :-)
22842 Also fix logic to find members in base types.
22844 (Unary::ResolveOperator): Same here.
22846 (Unary::report23): Change name to error23 and make first argument a TypeContainer
22847 as I was getting thoroughly confused between this and error19 :-)
22849 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22850 (::FindMostEncompassedType): Implement.
22851 (::FindMostEncompassingType): Implement.
22852 (::StandardConversionExists): Implement.
22854 (UserImplicitCast): Re-vamp. We now need info about most specific
22855 source and target types so that we can do the necessary conversions.
22857 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22858 mathematical union with no duplicates.
22860 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22862 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22863 in order from base classes to child classes, so that we can in
22864 child classes look up in our parent for method names and
22865 attributes (required for handling abstract, virtual, new, override
22866 constructs: we need to instrospect our base class, and if we dont
22867 populate the classes in order, the introspection might be
22868 incorrect. For example, a method could query its parent before
22869 the parent has any methods and would determine that the parent has
22870 no abstract methods (while it could have had them)).
22872 (RootContext::CreateType): Record the order in which we define the
22875 2001-10-02 Miguel de Icaza <miguel@ximian.com>
22877 * class.cs (TypeContainer::Populate): Also method definitions can
22878 fail now, keep track of this.
22880 (TypeContainer::FindMembers): Implement support for
22881 DeclaredOnly/noDeclaredOnly flag.
22883 (Constructor::Emit) Return the ConstructorBuilder.
22885 (Method::Emit) Return the MethodBuilder.
22886 Check for abstract or virtual methods to be public.
22888 * rootcontext.cs (RootContext::CreateType): Register all the
22889 abstract methods required for the class to be complete and the
22890 interface methods that must be implemented.
22892 * cs-parser.jay: Report error 501 (method requires body if it is
22893 not marked abstract or extern).
22895 * expression.cs (TypeOf::Emit): Implement.
22897 * typemanager.cs: runtime_handle_type, new global type.
22899 * class.cs (Property::Emit): Generate code for properties.
22901 2001-10-02 Ravi Pratap <ravi@ximian.com>
22903 * expression.cs (Unary::ResolveOperator): Find operators on base type
22904 too - we now conform exactly to the spec.
22906 (Binary::ResolveOperator): Same here.
22908 * class.cs (Operator::Define): Fix minor quirk in the tests.
22910 * ../errors/cs0215.cs : Added.
22912 * ../errors/cs0556.cs : Added.
22914 * ../errors/cs0555.cs : Added.
22916 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22918 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22919 single integer which is really efficient
22921 2001-10-01 Ravi Pratap <ravi@ximian.com>
22923 * expression.cs (Expression::ImplicitUserConversion): Use location
22924 even in the case when we are examining True operators.
22926 * class.cs (Operator::Define): Perform extensive checks to conform
22927 with the rules for operator overloading in the spec.
22929 * expression.cs (Expression::ImplicitReferenceConversion): Implement
22930 some of the other conversions mentioned in the spec.
22932 * typemanager.cs (array_type): New static member for the System.Array built-in
22935 (cloneable_interface): For System.ICloneable interface.
22937 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22938 we start resolving the tree and populating types.
22940 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22942 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22944 * expression.cs (Expression::ExprClassFromMemberInfo,
22945 Expression::Literalize): Create literal expressions from
22946 FieldInfos which are literals.
22948 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22949 type casts, because they were wrong. The test suite in tests
22952 (ImplicitNumericConversion): ushort to ulong requires a widening
22955 Int32 constant to long requires widening cast as well.
22957 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22958 for integers because the type on the stack is not i4.
22960 2001-09-30 Miguel de Icaza <miguel@ximian.com>
22962 * expression.cs (report118): require location argument.
22964 * parameter.cs: Do not dereference potential null value.
22966 * class.cs: Catch methods that lack the `new' keyword when
22967 overriding a name. Report warnings when `new' is used without
22968 anything being there to override.
22970 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22972 * class.cs: Only add constructor to hashtable if it is non-null
22973 (as now constructors can fail on define).
22975 (TypeManager, Class, Struct): Take location arguments.
22977 Catch field instance initialization in structs as errors.
22979 accepting_filter: a new filter for FindMembers that is static so
22980 that we dont create an instance per invocation.
22982 (Constructor::Define): Catch errors where a struct constructor is
22985 * cs-parser.jay: Pass location information for various new
22988 * delegate.cs (Delegate): take a location argument.
22990 * driver.cs: Do not call EmitCode if there were problesm in the
22991 Definition of the types, as many Builders wont be there.
22993 * decl.cs (Decl::Decl): Require a location argument.
22995 * cs-tokenizer.cs: Handle properly hex constants that can not fit
22996 into integers, and find the most appropiate integer for it.
22998 * literal.cs: Implement ULongLiteral.
23000 * rootcontext.cs: Provide better information about the location of
23001 failure when CreateType fails.
23003 2001-09-29 Miguel de Icaza <miguel@ximian.com>
23005 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23008 * expression.cs (Binary::CheckShiftArguments): Add missing type
23010 (Binary::ResolveOperator): Add type to the logical and and logical
23011 or, Bitwise And/Or and Exclusive Or code paths, it was missing
23014 (Binary::DoNumericPromotions): In the case where either argument
23015 is ulong (and most signed types combined with ulong cause an
23016 error) perform implicit integer constant conversions as well.
23018 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23020 * expression.cs (UserImplicitCast): Method should always be
23022 (Invocation::BetterConversion): Simplified test for IntLiteral.
23024 (Expression::ImplicitNumericConversion): Split this routine out.
23025 Put the code that performs implicit constant integer conversions
23028 (Expression::Resolve): Become a wrapper around DoResolve so we can
23029 check eclass and type being set after resolve.
23031 (Invocation::Badness): Remove this dead function
23033 (Binary::ResolveOperator): Do not compute the expensive argumnets
23034 unless we have a union for it.
23036 (Probe::Emit): Is needs to do an isinst and then
23037 compare against null.
23039 (::CanConvert): Added Location argument. If the Location argument
23040 is null (Location.Null), then we do not report errors. This is
23041 used by the `probe' mechanism of the Explicit conversion. We do
23042 not want to generate an error for something that the user
23043 explicitly requested to be casted. But the pipeline for an
23044 explicit cast first tests for potential implicit casts.
23046 So for now, if the Location is null, it means `Probe only' to
23047 avoid adding another argument. Might have to revise this
23050 (ClassCast): New class used to type cast objects into arbitrary
23051 classes (used in Explicit Reference Conversions).
23053 Implement `as' as well.
23055 Reverted all the patches from Ravi below: they were broken:
23057 * The use of `level' as a mechanism to stop recursive
23058 invocations is wrong. That was there just to catch the
23059 bug with a strack trace but not as a way of addressing
23062 To fix the problem we have to *understand* what is going
23063 on and the interactions and come up with a plan, not
23064 just get things going.
23066 * The use of the type conversion cache that I proposed
23067 last night had an open topic: How does this work across
23068 protection domains. A user defined conversion might not
23069 be public in the location where we are applying the
23070 conversion, a different conversion might be selected
23071 (ie, private A->B (better) but public B->A (worse),
23072 inside A, A->B applies, but outside it, B->A will
23075 * On top of that (ie, even if the above is solved),
23076 conversions in a cache need to be abstract. Ie, `To
23077 convert from an Int to a Short use an OpcodeCast', not
23078 `To convert from an Int to a Short use the OpcodeCast on
23079 the variable 5' (which is what this patch was doing).
23081 2001-09-28 Ravi Pratap <ravi@ximian.com>
23083 * expression.cs (Invocation::ConversionExists): Re-write to use
23084 the conversion cache
23086 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23087 cache all conversions done, not just user-defined ones.
23089 (Invocation::BetterConversion): The real culprit. Use ConversionExists
23090 to determine if a conversion exists instead of acutually trying to
23091 perform the conversion. It's faster too.
23093 (Expression::ConvertExplicit): Modify to use ConversionExists to check
23094 and only then attempt the implicit conversion.
23096 2001-09-28 Ravi Pratap <ravi@ximian.com>
23098 * expression.cs (ConvertImplicit): Use a cache for conversions
23099 already found. Check level of recursion and bail out if necessary.
23101 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23103 * typemanager.cs (string_concat_string_string, string_concat_object_object):
23104 Export standard methods that we expect for string operations.
23106 * statement.cs (Block::UsageWarning): Track usage of variables and
23107 report the errors for not used variables.
23109 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23112 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23114 * codegen.cs: remove unnneded code
23116 * expression.cs: Removed BuiltinTypeAccess class
23118 Fix the order in which implicit conversions are
23121 The previous fixed dropped support for boxed conversions (adding a
23122 test to the test suite now)
23124 (UserImplicitCast::CanConvert): Remove test for source being null,
23125 that code is broken. We should not feed a null to begin with, if
23126 we do, then we should track the bug where the problem originates
23127 and not try to cover it up here.
23129 Return a resolved expression of type UserImplicitCast on success
23130 rather than true/false. Ravi: this is what I was talking about,
23131 the pattern is to use a static method as a "constructor" for
23134 Also, do not create arguments until the very last minute,
23135 otherwise we always create the arguments even for lookups that
23136 will never be performed.
23138 (UserImplicitCast::Resolve): Eliminate, objects of type
23139 UserImplicitCast are born in a fully resolved state.
23141 * typemanager.cs (InitCoreTypes): Init also value_type
23142 (System.ValueType).
23144 * expression.cs (Cast::Resolve): First resolve the child expression.
23146 (LValue): Add new method AddressOf to be used by
23149 Change the argument of Store to take an EmitContext instead of an
23150 ILGenerator, because things like FieldExpr need to be able to call
23151 their children expression to generate the instance code.
23153 (Expression::Error, Expression::Warning): Sugar functions for
23156 (Expression::MemberLookup): Accept a TypeContainer instead of a
23157 Report as the first argument.
23159 (Expression::ResolvePrimary): Killed. I still want to improve
23160 this as currently the code is just not right.
23162 (Expression::ResolveMemberAccess): Simplify, but it is still
23165 (Unary::Resolve): Catch errors in AddressOf operators.
23167 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23168 index to a byte for the short-version, or the compiler will choose
23169 the wrong Emit call, which generates the wrong data.
23171 (ParameterReference::Emit, ::Store): same.
23173 (FieldExpr::AddressOf): Implement.
23175 * typemanager.cs: TypeManager: made public variable instead of
23178 * driver.cs: document --fatal.
23180 * report.cs (ErrorMessage, WarningMessage): new names for the old
23181 Error and Warning classes.
23183 * cs-parser.jay (member_access): Turn built-in access to types
23184 into a normal simplename
23186 2001-09-27 Ravi Pratap <ravi@ximian.com>
23188 * expression.cs (Invocation::BetterConversion): Fix to cope
23189 with q being null, since this was introducing a bug.
23191 * expression.cs (ConvertImplicit): Do built-in conversions first.
23193 2001-09-27 Ravi Pratap <ravi@ximian.com>
23195 * expression.cs (UserImplicitCast::Resolve): Fix bug.
23197 2001-09-27 Ravi Pratap <ravi@ximian.com>
23199 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23200 I had introduced long ago (what's new ?).
23202 * expression.cs (UserImplicitCast::CanConvert): Static method to do
23203 the work of all the checking.
23204 (ConvertImplicit): Call CanConvert and only then create object if necessary.
23205 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23207 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23208 that is the right way.
23210 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
23211 overloading resolution. Use everywhere instead of cutting and pasting code.
23213 (Binary::ResolveOperator): Use MakeUnionSet.
23215 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
23216 we have to convert to bool types. Not complete yet.
23218 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23220 * typemanager.cs (TypeManager::CSharpName): support ushort.
23222 * expression.cs (Expression::TryImplicitIntConversion): Attempts
23223 to provide an expression that performsn an implicit constant int
23224 conversion (section 6.1.6).
23225 (Expression::ConvertImplicitRequired): Reworked to include
23226 implicit constant expression conversions.
23228 (Expression::ConvertNumericExplicit): Finished.
23230 (Invocation::Emit): If InstanceExpression is null, then it means
23231 that we perform a call on this.
23233 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23235 * expression.cs (Unary::Emit): Remove some dead code.
23236 (Probe): Implement Resolve and Emit for `is'.
23237 (Expression::ConvertImplicitRequired): Attempt to do constant
23238 expression conversions here. Maybe should be moved to
23239 ConvertImplicit, but I am not sure.
23240 (Expression::ImplicitLongConstantConversionPossible,
23241 Expression::ImplicitIntConstantConversionPossible): New functions
23242 that tell whether is it possible to apply an implicit constant
23243 expression conversion.
23245 (ConvertNumericExplicit): Started work on explicit numeric
23248 * cs-parser.jay: Update operator constants.
23250 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23251 (Parameters::GetSignature): Hook up VerifyArgs here.
23252 (Parameters::VerifyArgs): Verifies that no two arguments have the
23255 * class.cs (Operator): Update the operator names to reflect the
23256 ones that the spec expects (as we are just stringizing the
23259 * expression.cs (Unary::ResolveOperator): Fix bug: Use
23260 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23261 previous usage did only work for our methods.
23262 (Expression::ConvertImplicit): Handle decimal implicit numeric
23263 conversions as well.
23264 (Expression::InternalTypeConstructor): Used to invoke constructors
23265 on internal types for default promotions.
23267 (Unary::Emit): Implement special handling for the pre/post
23268 increment/decrement for overloaded operators, as they need to have
23269 the same semantics as the other operators.
23271 (Binary::ResolveOperator): ditto.
23272 (Invocation::ConversionExists): ditto.
23273 (UserImplicitCast::Resolve): ditto.
23275 2001-09-26 Ravi Pratap <ravi@ximian.com>
23277 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23278 operator, return after emitting body. Regression tests pass again !
23280 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23281 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23282 (Invocation::OverloadResolve): Ditto.
23283 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23285 * everywhere : update calls to the above methods accordingly.
23287 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23289 * assign.cs (Assign): Make it inherit from ExpressionStatement.
23291 * expression.cs (ExpressionStatement): New base class used for
23292 expressions that can appear in statements, so that we can provide
23293 an alternate path to generate expression that do not leave a value
23296 (Expression::Emit, and all the derivatives): We no longer return
23297 whether a value is left on the stack or not. Every expression
23298 after being emitted leaves a single value on the stack.
23300 * codegen.cs (EmitContext::EmitStatementExpression): Use the
23301 facilties of ExpressionStatement if possible.
23303 * cs-parser.jay: Update statement_expression.
23305 2001-09-25 Miguel de Icaza <miguel@ximian.com>
23307 * driver.cs: Change the wording of message
23309 2001-09-25 Ravi Pratap <ravi@ximian.com>
23311 * expression.cs (Binary::ResolveOperator): Had forgottten to set
23312 the type of the expression to the return type of the method if
23313 we have an overloaded operator match ! The regression tests pass again !
23314 (Unary::ResolveOperator): Ditto.
23316 * expression.cs (Invocation::ConversionExists): Correct the member lookup
23317 to find "op_Implicit", not "implicit" ;-)
23318 (UserImplicitCast): New class to take care of user-defined implicit conversions.
23319 (ConvertImplicit, ForceConversion): Take TypeContainer argument
23321 * everywhere : Correct calls to the above accordingly.
23323 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23324 (ConvertImplicit): Do user-defined conversion if it exists.
23326 2001-09-24 Miguel de Icaza <miguel@ximian.com>
23328 * assign.cs: track location.
23329 (Resolve): Use implicit conversions on assignment.
23331 * literal.cs: Oops. Not good, Emit of short access values should
23332 pass (Bytes) or the wrong argument will be selected.
23334 * expression.cs (Unary::Emit): Emit code for -expr.
23336 (Unary::ResolveOperator): Handle `Substract' for non-constants
23337 (substract from zero from the non-constants).
23338 Deal with Doubles as well.
23340 (Expression::ConvertImplicitRequired): New routine that reports an
23341 error if no implicit conversion exists.
23343 (Invocation::OverloadResolve): Store the converted implicit
23344 expressions if we make them
23346 2001-09-24 Ravi Pratap <ravi@ximian.com>
23348 * class.cs (ConstructorInitializer): Take a Location argument.
23349 (ConstructorBaseInitializer): Same here.
23350 (ConstructorThisInitializer): Same here.
23352 * cs-parser.jay : Update all calls accordingly.
23354 * expression.cs (Unary, Binary, New): Take location argument.
23355 Update accordingly everywhere.
23357 * cs-parser.jay : Update all calls to the above to take a location
23360 * class.cs : Ditto.
23362 2001-09-24 Ravi Pratap <ravi@ximian.com>
23364 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23365 (Invocation::BetterConversion): Same here
23366 (Invocation::ConversionExists): Ditto.
23368 (Invocation::ConversionExists): Implement.
23370 2001-09-22 Ravi Pratap <ravi@ximian.com>
23372 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23373 Also take an additional TypeContainer argument.
23375 * All over : Pass in TypeContainer as argument to OverloadResolve.
23377 * typemanager.cs (CSharpName): Update to check for the string type and return
23380 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23383 2001-09-21 Ravi Pratap <ravi@ximian.com>
23385 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23386 (Invocation::BetterFunction): Implement.
23387 (Invocation::BetterConversion): Implement.
23388 (Invocation::ConversionExists): Skeleton, no implementation yet.
23390 Okay, things work fine !
23392 2001-09-21 Miguel de Icaza <miguel@ximian.com>
23394 * typemanager.cs: declare and load enum_type, delegate_type and
23397 * expression.cs (Expression::Emit): Now emit returns a value that
23398 tells whether a value is left on the stack or not. This strategy
23399 might be reveted tomorrow with a mechanism that would address
23400 multiple assignments.
23401 (Expression::report118): Utility routine to report mismatches on
23404 (Unary::Report23): Report impossible type/operator combination
23407 (Unary::IsIncrementableNumber): Whether the type can be
23408 incremented or decremented with add.
23409 (Unary::ResolveOperator): Also allow enumerations to be bitwise
23411 (Unary::ResolveOperator): Implement ++, !, ~,
23413 (Invocation::Emit): Deal with new Emit convetion.
23415 * All Expression derivatives: Updated their Emit method to return
23416 whether they leave values on the stack or not.
23418 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23419 stack for expressions that are statements.
23421 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23423 * expression.cs (LValue): New interface. Must be implemented by
23425 (LocalVariableReference, ParameterReference, FieldExpr): Implement
23428 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23429 interface for generating code, simplifies the code.
23431 2001-09-20 Ravi Pratap <ravi@ximian.com>
23433 * expression.cs (everywhere): Comment out return statements in ::Resolve
23434 methods to avoid the warnings.
23436 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23438 * driver.cs (parse): Report error 2001 if we can not open the
23441 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23444 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23447 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23448 otherwise nested blocks end up with the same index.
23450 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23452 * expression.cs: Instead of having FIXMEs in the Resolve
23453 functions, throw exceptions so it is obvious that we are facing a
23456 * cs-parser.jay (invocation_expression): Pass Location information.
23458 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23459 Use a basename for those routines because .NET does not like paths
23462 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23465 2001-09-19 Miguel de Icaza <miguel@ximian.com>
23467 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23468 are loading the correct data types (throws an exception if not).
23469 (TypeManager::InitCoreTypes): Use CoreLookupType
23471 * expression.cs (Unary::ResolveOperator): return the child
23472 expression for expressions which are just +expr.
23473 (Unary::ResolveOperator): Return negative literals for -LITERAL
23474 expressions (otherwise they are Unary {Literal}).
23475 (Invocation::Badness): Take into account `Implicit constant
23476 expression conversions'.
23478 * literal.cs (LongLiteral): Implement long literal class.
23479 (IntLiteral): export the `Value' of the intliteral.
23481 2001-09-19 Ravi Pratap <ravi@ximian.com>
23483 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23485 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
23486 instead of 'Operator'
23488 * expression.cs (Binary::ResolveOperator): Update accordingly.
23489 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23492 * cs-parser.jay (unary_expression): Update to use the new names.
23494 * gen-treedump.cs (GetUnary): Same here.
23496 * expression.cs (Unary::Resolve): Implement.
23497 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
23498 operators are found instead of making noise ;-)
23499 (Unary::ResolveOperator): New method to do precisely the same thing which
23500 Binary::ResolveOperator does for Binary expressions.
23501 (Unary.method, .Arguments): Add.
23502 (Unary::OperName): Implement.
23503 (Unary::ForceConversion): Copy and Paste !
23505 * class.cs (Operator::Define): Fix a small bug for the case when we have
23508 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23509 for the inbuilt operators. Only overloading works for now ;-)
23511 2001-09-18 Miguel de Icaza <miguel@ximian.com>
23513 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23514 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23516 * expression.cs (This::Emit): Implement.
23517 (This::Resolve): Implement.
23518 (TypeOf:Resolve): Implement.
23519 (Expression::ResolveSimpleName): Add an implicit this to instance
23521 (MemberAccess::Resolve): Deal with Parameters and Fields.
23522 Bind instance variable to Field expressions.
23523 (FieldExpr::Instance): New field used to track the expression that
23524 represents the object instance.
23525 (FieldExpr::Resolve): Track potential errors from MemberLookup not
23527 (FieldExpr::Emit): Implement.
23529 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23530 the last instruction contains a return opcode to avoid generating
23531 the last `ret' instruction (this generates correct code, and it is
23532 nice to pass the peverify output).
23534 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23535 initializer for static and instance variables.
23536 (Constructor::Emit): Allow initializer to be null in the case of
23537 static constructors. Only emit initializer for instance
23540 (TypeContainer::FindMembers): Return a null array if there are no
23543 Also fix the code for the MemberTypes.Method branch, as it was not
23544 scanning that for operators (or tried to access null variables before).
23546 * assign.cs (Assign::Emit): Handle instance and static fields.
23550 * driver.cs: Stop compilation if there are parse errors.
23552 * cs-parser.jay (constructor_declaration): Provide default base
23553 initializer for non-static constructors.
23554 (constructor_declarator): Do not provide a default base
23555 initializers if none was specified.
23556 Catch the fact that constructors should not have parameters.
23558 * class.cs: Do not emit parent class initializers for static
23559 constructors, that should be flagged as an error.
23561 2001-09-18 Ravi Pratap <ravi@ximian.com>
23563 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23564 Move back code into TypeContainer::Populate.
23566 2001-09-18 Ravi Pratap <ravi@ximian.com>
23568 * class.cs (TypeContainer::AddConstructor): Fix the check to
23569 compare against Name, not Basename.
23570 (Operator::OpType): Change Plus and Minus to Add and Subtract.
23572 * cs-parser.jay : Update accordingly.
23574 * class.cs (TypeContainer::FindMembers): For the case where we are searching
23575 for methods, don't forget to look into the operators too.
23576 (RegisterMethodBuilder): Helper method to take care of this for
23577 methods, constructors and operators.
23578 (Operator::Define): Completely revamp.
23579 (Operator.OperatorMethod, MethodName): New fields.
23580 (TypeContainer::Populate): Move the registering of builders into
23581 RegisterMethodBuilder.
23582 (Operator::Emit): Re-write.
23584 * expression.cs (Binary::Emit): Comment out code path to emit method
23585 invocation stuff for the case when we have a user defined operator. I am
23586 just not able to get it right !
23588 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23590 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23593 (Expression::MemberLookup): Provide a version that allows to
23594 specify the MemberTypes and BindingFlags.
23596 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23597 so it was not fetching variable information from outer blocks.
23599 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23600 Beforefieldinit as it was buggy.
23602 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23603 that Ravi put here.
23605 * class.cs (Constructor::Emit): Only emit if block is not null.
23606 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23607 deal with this by semantically definining it as if the user had
23610 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23611 constructors as we now "emit" them at a higher level.
23613 (TypeContainer::DefineDefaultConstructor): Used to define the
23614 default constructors if none was provided.
23616 (ConstructorInitializer): Add methods Resolve and Emit.
23618 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23620 2001-09-17 Ravi Pratap <ravi@ximian.com>
23622 * class.cs (TypeContainer::EmitDefaultConstructor): Register
23623 the default constructor builder with our hashtable for methodbuilders
23626 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23627 and argument_count is 0 in which case we have a match.
23628 (Binary::ResolveOperator): More null checking and miscellaneous coding
23631 2001-09-17 Ravi Pratap <ravi@ximian.com>
23633 * rootcontext.cs (IsNameSpace): Compare against null.
23635 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23637 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23638 and Unary::Operator.
23640 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23643 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23644 we have overloaded operators.
23645 (Binary::ResolveOperator): Implement the part which does the operator overload
23648 * class.cs (Operator::Emit): Implement.
23649 (TypeContainer::Emit): Emit the operators we have too.
23651 * expression.cs (Binary::Emit): Update to emit the appropriate code for
23652 the case when we have a user-defined operator.
23654 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23656 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23658 2001-09-16 Ravi Pratap <ravi@ximian.com>
23660 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23661 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23662 (Constructor::Emit): Implement.
23663 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23664 if we have no work to do.
23665 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
23668 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23669 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23671 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23674 2001-09-15 Ravi Pratap <ravi@ximian.com>
23676 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23678 (Tree::RecordNamespace): Method to do what the name says ;-)
23679 (Tree::Namespaces): Property to get at the namespaces hashtable.
23681 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
23684 * rootcontext.cs (IsNamespace): Fixed it :-)
23686 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23688 * class.cs (TypeContainer::FindMembers): Add support for
23690 (MethodCore): New class that encapsulates both the shared aspects
23691 of a Constructor and a Method.
23692 (Method, Constructor): Factored pieces into MethodCore.
23694 * driver.cs: Added --fatal which makes errors throw exceptions.
23695 Load System assembly as well as part of the standard library.
23697 * report.cs: Allow throwing exceptions on errors for debugging.
23699 * modifiers.cs: Do not use `parent', instead use the real type
23700 container to evaluate permission settings.
23702 * class.cs: Put Ravi's patch back in. He is right, and we will
23703 have to cope with the
23705 2001-09-14 Ravi Pratap <ravi@ximian.com>
23707 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23708 FamORAssem, not FamANDAssem.
23710 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23712 * driver.cs: Added --parse option that only parses its input files
23715 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
23716 incorrect. IsTopLevel is not used to tell whether an object is
23717 root_types or not (that can be achieved by testing this ==
23718 root_types). But to see if this is a top-level *class* (not
23719 necessarly our "toplevel" container).
23721 2001-09-14 Ravi Pratap <ravi@ximian.com>
23723 * enum.cs (Enum::Define): Modify to call the Lookup method on the
23724 parent instead of a direct call to GetType.
23726 2001-09-14 Ravi Pratap <ravi@ximian.com>
23728 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23729 Modifiers.TypeAttr. This should just be a call to that method.
23731 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23732 object so that we can determine if we are top-level or not.
23734 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
23737 * enum.cs (Enum::Define): Ditto.
23739 * modifiers.cs (FieldAttr): Re-write.
23741 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23742 (TypeContainer::HaveStaticConstructor): New property to provide access
23743 to precisely that info.
23745 * modifiers.cs (MethodAttr): Re-write.
23746 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23748 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23749 of top-level types as claimed.
23751 2001-09-13 Miguel de Icaza <miguel@ximian.com>
23753 * expression.cs (MemberLookup): Fruitless attempt to lookup
23754 constructors. Maybe I need to emit default constructors? That
23755 might be it (currently .NET emits this for me automatically).
23756 (Invocation::OverloadResolve): Cope with Arguments == null.
23757 (Invocation::EmitArguments): new function, shared by the new
23758 constructor and us.
23759 (Invocation::Emit): Handle static and instance methods. Emit
23760 proper call instruction for virtual or non-virtual invocations.
23761 (New::Emit): Implement.
23762 (New::Resolve): Implement.
23763 (MemberAccess:Resolve): Implement.
23764 (MethodGroupExpr::InstanceExpression): used conforming to the spec
23765 to track instances.
23766 (FieldExpr::Resolve): Set type.
23768 * support.cs: Handle empty arguments.
23770 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23771 SimpleLookup): Auxiliary routines to help parse a qualifier
23774 Update qualifier_identifier rule.
23776 * codegen.cs: Removed debugging messages.
23778 * class.cs: Make this a global thing, this acts just as a "key" to
23779 objects that we might have around.
23781 (Populate): Only initialize method_builders_to_methods once.
23783 * expression.cs (PropertyExpr): Initialize type from the
23786 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23787 Resolve pattern. Attempt to implicitly convert value to boolean.
23790 * expression.cs: Set the type for the int32/int32 argument case.
23791 (Binary::ResolveOperator): Set the return type to boolean for
23792 comparission operators
23794 * typemanager.cs: Remove debugging print code.
23796 (Invocation::Resolve): resolve type.
23798 * class.cs: Allocate a MemberInfo of the correct size, as the code
23799 elsewhere depends on the test to reflect the correct contents.
23801 (Method::) Keep track of parameters, due to System.Reflection holes
23803 (TypeContainer::Populate): Keep track of MethodBuilders to Method
23806 (TypeContainer::FindMembers): Use ArrayList and then copy an array
23807 of the exact size and return that.
23809 (Class::LookupMethodByBuilder): New function that maps
23810 MethodBuilders to its methods. Required to locate the information
23811 on methods because System.Reflection bit us again.
23813 * support.cs: New file, contains an interface ParameterData and
23814 two implementations: ReflectionParameters and InternalParameters
23815 used to access Parameter information. We will need to grow this
23818 * expression.cs (Invocation::GetParameterData): implement a cache
23819 and a wrapper around the ParameterData creation for methods.
23820 (Invocation::OverloadResolve): Use new code.
23822 2001-09-13 Ravi Pratap <ravi@ximian.com>
23824 * class.cs (TypeContainer::EmitField): Remove and move into
23825 (Field::Define): here and modify accordingly.
23826 (Field.FieldBuilder): New member.
23827 (TypeContainer::Populate): Update accordingly.
23828 (TypeContainer::FindMembers): Implement.
23830 2001-09-13 Miguel de Icaza <miguel@ximian.com>
23832 * statement.cs: (VariableInfo::VariableType): New field to be
23833 initialized with the full type once it is resolved.
23835 2001-09-12 Miguel de Icaza <miguel@ximian.com>
23837 * parameter.cs (GetParameterInfo): Use a type cache to compute
23838 things only once, and to reuse this information
23840 * expression.cs (LocalVariableReference::Emit): Implement.
23841 (OpcodeCast::Emit): fix.
23843 (ParameterReference::Resolve): Implement.
23844 (ParameterReference::Emit): Implement.
23846 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23847 that are expressions need to stay as Expressions.
23849 * typemanager.cs (CSharpName): Returns the C# name of a type if
23852 * expression.cs (Expression::ConvertImplicit): New function that
23853 implements implicit type conversions.
23855 (Expression::ImplicitReferenceConversion): Implements implicit
23856 reference conversions.
23858 (EmptyCast): New type for transparent casts.
23860 (OpcodeCast): New type for casts of types that are performed with
23861 a sequence of bytecodes.
23863 (BoxedCast): New type used for casting value types into reference
23864 types. Emits a box opcode.
23866 (Binary::DoNumericPromotions): Implements numeric promotions of
23867 and computation of the Binary::Type.
23869 (Binary::EmitBranchable): Optimization.
23871 (Binary::Emit): Implement code emission for expressions.
23873 * typemanager.cs (TypeManager): Added two new core types: sbyte
23876 2001-09-12 Ravi Pratap <ravi@ximian.com>
23878 * class.cs (TypeContainer::FindMembers): Method which does exactly
23879 what Type.FindMembers does, only we don't have to use reflection. No
23880 implementation yet.
23882 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23883 typecontainer objects as we need to get at them.
23884 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23886 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23887 typecontainer object.
23889 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23890 of just a Report object.
23892 2001-09-11 Ravi Pratap <ravi@ximian.com>
23894 * class.cs (Event::Define): Go back to using the prefixes "add_" and
23896 (TypeContainer::Populate): Now define the delegates of the type too.
23897 (TypeContainer.Delegates): Property to access the list of delegates defined
23900 * delegates.cs (Delegate::Define): Implement partially.
23902 * modifiers.cs (TypeAttr): Handle more flags.
23904 2001-09-11 Ravi Pratap <ravi@ximian.com>
23906 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23908 (Operator::Define): Re-write logic to get types by using the LookupType method
23909 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23910 (Indexer::Define): Ditto.
23911 (Event::Define): Ditto.
23912 (Property::Define): Ditto.
23914 2001-09-10 Ravi Pratap <ravi@ximian.com>
23916 * class.cs (TypeContainer::Populate): Now define operators too.
23917 (TypeContainer.Operators): New property to access the list of operators
23919 (Operator.OperatorMethodBuilder): New member to hold the method builder
23920 for the operator we are defining.
23921 (Operator::Define): Implement.
23923 2001-09-10 Ravi Pratap <ravi@ximian.com>
23925 * class.cs (Event::Define): Make the prefixes of the accessor methods
23926 addOn_ and removeOn_
23928 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23929 of the location being passed in too. Ideally, this should go later since all
23930 error reporting should be done through the Report object.
23932 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23933 (Populate): Iterate thru the indexers we have and define them too.
23934 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23935 for the get and set accessors.
23936 (Indexer::Define): Implement.
23938 2001-09-09 Miguel de Icaza <miguel@ximian.com>
23940 * expression.cs (Binary::Resolve): Beginning of it. I scratched
23941 my previous implementation, did not work.
23943 * typemanager.cs: Add a couple of missing types (the longs).
23945 * literal.cs: Use TypeManager.bool_type instead of getting it.
23947 * expression.cs (EventExpr): New kind of expressions.
23948 (Expressio::ExprClassFromMemberInfo): finish
23950 2001-09-08 Miguel de Icaza <miguel@ximian.com>
23952 * assign.cs: Emit stores to static fields differently.
23954 2001-09-08 Ravi Pratap <ravi@ximian.com>
23956 * Merge in changes and adjust code to tackle conflicts. Backed out my
23957 code in Assign::Resolve ;-)
23959 2001-09-08 Ravi Pratap <ravi@ximian.com>
23961 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23962 instead Report.Error and also pass in the location.
23963 (CSharpParser::Lexer): New readonly property to return the reference
23964 to the Tokenizer object.
23965 (declare_local_variables): Use Report.Error with location instead of plain
23969 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23970 (Operator.CheckBinaryOperator): Ditto.
23972 * cs-parser.jay (operator_declarator): Update accordingly.
23974 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23975 (CheckBinaryOperator): Same here.
23977 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23978 on the name without any prefixes of namespace names etc. This is because we
23979 already might have something already fully qualified like
23980 'System.Console.WriteLine'
23982 * assign.cs (Resolve): Begin implementation. Stuck ;-)
23984 2001-09-07 Ravi Pratap <ravi@ximian.com>
23986 * cs-tokenizer.cs (location): Return a string which also contains
23989 * expression.cs (ElementAccess): New class for expressions of the
23990 type 'element access.'
23991 (BaseAccess): New class for expressions of the type 'base access.'
23992 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23995 * cs-parser.jay (element_access): Implement action.
23996 (base_access): Implement actions.
23997 (checked_expression, unchecked_expression): Implement.
23999 * cs-parser.jay (local_variable_type): Correct and implement.
24000 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24002 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24004 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24005 name and the specifiers.
24007 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24009 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
24010 making them all public ;-)
24012 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24015 2001-09-07 Miguel de Icaza <miguel@ximian.com>
24017 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24019 (FieldExpr, PropertyExprs): New resolved expressions.
24020 (SimpleName::MemberStaticCheck): Perform static checks for access
24021 to non-static fields on static methods. Maybe this should be
24022 generalized for MemberAccesses.
24023 (SimpleName::ResolveSimpleName): More work on simple name
24026 * cs-parser.jay (primary_expression/qualified_identifier): track
24027 the parameter index.
24029 * codegen.cs (CodeGen::Save): Catch save exception, report error.
24030 (EmitContext::EmitBoolExpression): Chain to expression generation
24031 instead of temporary hack.
24032 (::EmitStatementExpression): Put generic expression code generation.
24034 * assign.cs (Assign::Emit): Implement variable assignments to
24035 local variables, parameters and fields.
24037 2001-09-06 Miguel de Icaza <miguel@ximian.com>
24039 * statement.cs (Block::GetVariableInfo): New method, returns the
24040 VariableInfo for a variable name in a block.
24041 (Block::GetVariableType): Implement in terms of GetVariableInfo
24043 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24044 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24046 2001-09-06 Ravi Pratap <ravi@ximian.com>
24048 * cs-parser.jay (operator_declaration): Continue on my quest : update
24049 to take attributes argument.
24050 (event_declaration): Ditto.
24051 (enum_declaration): Ditto.
24052 (indexer_declaration): Ditto.
24054 * class.cs (Operator::Operator): Update constructor accordingly.
24055 (Event::Event): Ditto.
24057 * delegate.cs (Delegate::Delegate): Same here.
24059 * enum.cs (Enum::Enum): Same here.
24061 2001-09-05 Ravi Pratap <ravi@ximian.com>
24063 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24065 * ../tests/cs0658.cs : New file to demonstrate error 0658.
24067 * attribute.cs (Attributes): New class to encapsulate all attributes which were
24068 being passed around as an arraylist.
24069 (Attributes::AddAttribute): Method to add attribute sections.
24071 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24072 (struct_declaration): Update accordingly.
24073 (constant_declaration): Update.
24074 (field_declaration): Update.
24075 (method_header): Update.
24076 (fixed_parameter): Update.
24077 (parameter_array): Ditto.
24078 (property_declaration): Ditto.
24079 (destructor_declaration): Ditto.
24081 * class.cs (Struct::Struct): Update constructors accordingly.
24082 (Class::Class): Ditto.
24083 (Field::Field): Ditto.
24084 (Method::Method): Ditto.
24085 (Property::Property): Ditto.
24086 (TypeContainer::OptAttribute): update property's return type.
24088 * interface.cs (Interface.opt_attributes): New member.
24089 (Interface::Interface): Update to take the extra Attributes argument.
24091 * parameter.cs (Parameter::Parameter): Ditto.
24093 * constant.cs (Constant::Constant): Ditto.
24095 * interface.cs (InterfaceMemberBase): New OptAttributes field.
24096 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
24097 the attributes as a parameter.
24098 (InterfaceProperty): Update constructor call.
24099 (InterfaceEvent): Ditto.
24100 (InterfaceMethod): Ditto.
24101 (InterfaceIndexer): Ditto.
24103 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
24104 pass the attributes too.
24105 (interface_event_declaration): Ditto.
24106 (interface_property_declaration): Ditto.
24107 (interface_method_declaration): Ditto.
24108 (interface_declaration): Ditto.
24110 2001-09-05 Miguel de Icaza <miguel@ximian.com>
24112 * class.cs (Method::Define): Track the "static Main" definition to
24113 create an entry point.
24115 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24116 EntryPoint if we find it.
24118 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24119 (EmitContext::ig): Make this variable public.
24121 * driver.cs: Make the default output file be the first file name
24122 with the .exe extension.
24124 Detect empty compilations
24126 Handle various kinds of output targets. Handle --target and
24127 rename -t to --dumper.
24129 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24130 methods inherited from Expression return now an Expression. This
24131 will is used during the tree rewriting as we resolve them during
24134 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24135 the spec. Missing entirely is the information about
24136 accessability of elements of it.
24138 (Expression::ExprClassFromMemberInfo): New constructor for
24139 Expressions that creates a fully initialized Expression based on
24140 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24143 (Invocation::Resolve): Begin implementing resolution of invocations.
24145 * literal.cs (StringLiteral): Implement Emit.
24147 2001-09-05 Ravi Pratap <ravi@ximian.com>
24149 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24152 2001-09-04 Ravi Pratap <ravi@ximian.com>
24154 * cs-parser.jay (attribute_arguments): Implement actions.
24155 (attribute): Fix bug in production. Implement action.
24156 (attribute_list): Implement.
24157 (attribute_target): Implement.
24158 (attribute_target_specifier, opt_target_specifier): Implement
24159 (CheckAttributeTarget): New method to check if the attribute target
24161 (attribute_section): Implement.
24162 (opt_attributes): Implement.
24164 * attribute.cs : New file to handle attributes.
24165 (Attribute): Class to hold attribute info.
24167 * cs-parser.jay (opt_attribute_target_specifier): Remove production
24168 (attribute_section): Modify production to use 2 different rules to
24169 achieve the same thing. 1 s/r conflict down !
24170 Clean out commented, useless, non-reducing dimension_separator rules.
24172 * class.cs (TypeContainer.attributes): New member to hold list
24173 of attributes for a type.
24174 (Struct::Struct): Modify to take one more argument, the attribute list.
24175 (Class::Class): Ditto.
24176 (Field::Field): Ditto.
24177 (Method::Method): Ditto.
24178 (Property::Property): Ditto.
24180 * cs-parser.jay (struct_declaration): Update constructor call to
24181 pass in the attributes too.
24182 (class_declaration): Ditto.
24183 (constant_declaration): Ditto.
24184 (field_declaration): Ditto.
24185 (method_header): Ditto.
24186 (fixed_parameter): Ditto.
24187 (parameter_array): Ditto.
24188 (property_declaration): Ditto.
24190 * constant.cs (Constant::Constant): Update constructor similarly.
24191 Use System.Collections.
24193 * parameter.cs (Parameter::Parameter): Update as above.
24195 2001-09-02 Ravi Pratap <ravi@ximian.com>
24197 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24198 (TypeContainer.delegates): New member to hold list of delegates.
24200 * cs-parser.jay (delegate_declaration): Implement the action correctly
24201 this time as I seem to be on crack ;-)
24203 2001-09-02 Miguel de Icaza <miguel@ximian.com>
24205 * rootcontext.cs (RootContext::IsNamespace): new function, used to
24206 tell whether an identifier represents a namespace.
24208 * expression.cs (NamespaceExpr): A namespace expression, used only
24209 temporarly during expression resolution.
24210 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24211 utility functions to resolve names on expressions.
24213 2001-09-01 Miguel de Icaza <miguel@ximian.com>
24215 * codegen.cs: Add hook for StatementExpressions.
24217 * class.cs: Fix inverted test for static flag in methods.
24219 2001-09-02 Ravi Pratap <ravi@ximian.com>
24221 * class.cs (Operator::CheckUnaryOperator): Correct error number used
24222 to make it coincide with MS' number.
24223 (Operator::CheckBinaryOperator): Ditto.
24225 * ../errors/errors.txt : Remove error numbers added earlier.
24227 * ../errors/cs1019.cs : Test case for error # 1019
24229 * ../errros/cs1020.cs : Test case for error # 1020
24231 * cs-parser.jay : Clean out commented cruft.
24232 (dimension_separators, dimension_separator): Comment out. Ostensibly not
24233 used anywhere - non-reducing rule.
24234 (namespace_declarations): Non-reducing rule - comment out.
24236 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24237 with TypeContainer::AddEnum.
24239 * delegate.cs : New file for delegate handling classes.
24240 (Delegate): Class for declaring delegates.
24242 * makefile : Update.
24244 * cs-parser.jay (delegate_declaration): Implement.
24246 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
24248 * class.cs (Event::Define): Implement.
24249 (Event.EventBuilder): New member.
24251 * class.cs (TypeContainer::Populate): Update to define all enums and events
24253 (Events): New property for the events arraylist we hold. Shouldn't we move to using
24254 readonly fields for all these cases ?
24256 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24258 * class.cs (Property): Revamp to use the convention of making fields readonly.
24259 Accordingly modify code elsewhere.
24261 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24262 the Define method of the Property class.
24264 * class.cs : Clean up applied patch and update references to variables etc. Fix
24266 (TypeContainer::Populate): Update to define all the properties we have. Also
24267 define all enumerations.
24269 * enum.cs (Define): Implement.
24271 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24273 * cs-parser.jay (overloadable_operator): The semantic value is an
24274 enum of the Operator class.
24275 (operator_declarator): Implement actions.
24276 (operator_declaration): Implement.
24278 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24279 validity of definitions.
24280 (Operator::CheckBinaryOperator): Static method to check for binary operators
24281 (TypeContainer::AddOperator): New method to add an operator to a type.
24283 * cs-parser.jay (indexer_declaration): Added line to actually call the
24284 AddIndexer method so it gets added ;-)
24286 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
24287 already taken care of by the MS compiler ?
24289 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24291 * class.cs (Operator): New class for operator declarations.
24292 (Operator::OpType): Enum for the various operators.
24294 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24296 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24297 ostensibly handle this in semantic analysis.
24299 * cs-parser.jay (general_catch_clause): Comment out
24300 (specific_catch_clauses, specific_catch_clause): Ditto.
24301 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24302 (catch_args, opt_catch_args): New productions.
24303 (catch_clause): Rewrite to use the new productions above
24304 (catch_clauses): Modify accordingly.
24305 (opt_catch_clauses): New production to use in try_statement
24306 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24307 and re-write the code in the actions to extract the specific and
24308 general catch clauses by being a little smart ;-)
24310 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24311 Hooray, try and catch statements parse fine !
24313 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24315 * statement.cs (Block::GetVariableType): Fix logic to extract the type
24316 string from the hashtable of variables.
24318 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24319 I end up making that mistake ;-)
24320 (catch_clauses): Fixed gross error which made Key and Value of the
24321 DictionaryEntry the same : $1 !!
24323 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24325 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24327 * cs-parser.jay (event_declaration): Correct to remove the semicolon
24328 when the add and remove accessors are specified.
24330 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24332 * cs-parser.jay (IndexerDeclaration): New helper class to hold
24333 information about indexer_declarator.
24334 (indexer_declarator): Implement actions.
24335 (parsing_indexer): New local boolean used to keep track of whether
24336 we are parsing indexers or properties. This is necessary because
24337 implicit_parameters come into picture even for the get accessor in the
24338 case of an indexer.
24339 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24341 * class.cs (Indexer): New class for indexer declarations.
24342 (TypeContainer::AddIndexer): New method to add an indexer to a type.
24343 (TypeContainer::indexers): New member to hold list of indexers for the
24346 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24348 * cs-parser.jay (add_accessor_declaration): Implement action.
24349 (remove_accessor_declaration): Implement action.
24350 (event_accessors_declaration): Implement
24351 (variable_declarators): swap statements for first rule - trivial.
24353 * class.cs (Event): New class to hold information about event
24355 (TypeContainer::AddEvent): New method to add an event to a type
24356 (TypeContainer::events): New member to hold list of events.
24358 * cs-parser.jay (event_declaration): Implement actions.
24360 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24362 * cs-parser.jay (dim_separators): Implement. Make it a string
24363 concatenating all the commas together, just as they appear.
24364 (opt_dim_separators): Modify accordingly
24365 (rank_specifiers): Update accordingly. Basically do the same
24366 thing - instead, collect the brackets here.
24367 (opt_rank_sepcifiers): Modify accordingly.
24368 (array_type): Modify to actually return the complete type string
24369 instead of ignoring the rank_specifiers.
24370 (expression_list): Implement to collect the expressions
24371 (variable_initializer): Implement. We make it a list of expressions
24372 essentially so that we can handle the array_initializer case neatly too.
24373 (variable_initializer_list): Implement.
24374 (array_initializer): Make it a list of variable_initializers
24375 (opt_array_initializer): Modify accordingly.
24377 * expression.cs (New::NType): Add enumeration to help us
24378 keep track of whether we have an object/delegate creation
24379 or an array creation.
24380 (New:NewType, New::Rank, New::Indices, New::Initializers): New
24381 members to hold data about array creation.
24382 (New:New): Modify to update NewType
24383 (New:New): New Overloaded contructor for the array creation
24386 * cs-parser.jay (array_creation_expression): Implement to call
24387 the overloaded New constructor.
24389 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
24391 * class.cs (TypeContainer::Constructors): Return member
24392 constructors instead of returning null.
24394 2001-08-26 Miguel de Icaza <miguel@ximian.com>
24396 * typemanager.cs (InitCoreTypes): Initialize the various core
24397 types after we have populated the type manager with the user
24398 defined types (this distinction will be important later while
24399 compiling corlib.dll)
24401 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24402 on Expression Classification. Now all expressions have a method
24403 `Resolve' and a method `Emit'.
24405 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24406 generation from working. Also add some temporary debugging
24409 2001-08-24 Miguel de Icaza <miguel@ximian.com>
24411 * codegen.cs: Lots of code generation pieces. This is only the
24412 beginning, will continue tomorrow with more touches of polish. We
24413 handle the fundamentals of if, while, do, for, return. Others are
24414 trickier and I need to start working on invocations soon.
24416 * gen-treedump.cs: Bug fix, use s.Increment here instead of
24419 * codegen.cs (EmitContext): New struct, used during code
24420 emission to keep a context. Most of the code generation will be
24423 * cs-parser.jay: Add embedded blocks to the list of statements of
24424 this block. So code generation proceeds in a top down fashion.
24426 2001-08-23 Miguel de Icaza <miguel@ximian.com>
24428 * statement.cs: Add support for multiple child blocks.
24430 2001-08-22 Miguel de Icaza <miguel@ximian.com>
24432 * codegen.cs (EmitCode): New function, will emit the code for a
24433 Block of code given a TypeContainer and its ILGenerator.
24435 * statement.cs (Block): Standard public readonly optimization.
24436 (Block::Block constructors): Link children.
24437 (Block::Child): Child Linker.
24438 (Block::EmitVariables): Emits IL variable declarations.
24440 * class.cs: Drop support for MethodGroups here, delay until
24442 (Method::): Applied the same simplification that I did before, and
24443 move from Properties to public readonly fields.
24444 (Method::ParameterTypes): Returns the parameter types for the
24445 function, and implements a cache that will be useful later when I
24446 do error checking and the semantic analysis on the methods is
24448 (Constructor::GetCallingConvention): Renamed from CallingConvetion
24449 and made a method, optional argument tells whether this is a class
24450 or a structure to apply the `has-this' bit.
24451 (Method::GetCallingConvention): Implement, returns the calling
24453 (Method::Define): Defines the type, a second pass is performed
24454 later to populate the methods.
24456 (Constructor::ParameterTypes): implement a cache similar to the
24457 one on Method::ParameterTypes, useful later when we do semantic
24460 (TypeContainer::EmitMethod): New method. Emits methods.
24462 * expression.cs: Removed MethodGroup class from here.
24464 * parameter.cs (Parameters::GetCallingConvention): new method.
24466 2001-08-21 Miguel de Icaza <miguel@ximian.com>
24468 * class.cs (TypeContainer::Populate): Drop RootContext from the
24471 (Constructor::CallingConvention): Returns the calling convention.
24472 (Constructor::ParameterTypes): Returns the constructor parameter
24475 (TypeContainer::AddConstructor): Keep track of default constructor
24476 and the default static constructor.
24478 (Constructor::) Another class that starts using `public readonly'
24479 instead of properties.
24481 (Constructor::IsDefault): Whether this is a default constructor.
24483 (Field::) use readonly public fields instead of properties also.
24485 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24486 track of static constructors; If none is used, turn on
24487 BeforeFieldInit in the TypeAttributes.
24489 * cs-parser.jay (opt_argument_list): now the return can be null
24490 for the cases where there are no arguments.
24492 (constructor_declarator): If there is no implicit `base' or
24493 `this', then invoke the default parent constructor.
24495 * modifiers.cs (MethodAttr): New static function maps a set of
24496 modifiers flags into a MethodAttributes enum
24497 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
24498 MethodAttr, TypeAttr to represent the various mappings where the
24499 modifiers are used.
24500 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
24502 2001-08-19 Miguel de Icaza <miguel@ximian.com>
24504 * parameter.cs (GetParameterInfo): Fix bug where there would be no
24507 * interface.cs (PopulateIndexer): Implemented the code generator
24508 for interface indexers.
24510 2001-08-17 Miguel de Icaza <miguel@ximian.com>
24512 * interface.cs (InterfaceMemberBase): Now we track the new status
24515 (PopulateProperty): Implement property population. Woohoo! Got
24516 Methods and Properties going today.
24518 Removed all the properties for interfaces, and replaced them with
24519 `public readonly' fields.
24521 2001-08-16 Miguel de Icaza <miguel@ximian.com>
24523 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24524 initialize their hashtables/arraylists only when they are needed
24525 instead of doing this always.
24527 * parameter.cs: Handle refs and out parameters.
24529 * cs-parser.jay: Use an ArrayList to construct the arguments
24530 instead of the ParameterCollection, and then cast that to a
24533 * parameter.cs: Drop the use of ParameterCollection and use
24534 instead arrays of Parameters.
24536 (GetParameterInfo): Use the Type, not the Name when resolving
24539 2001-08-13 Miguel de Icaza <miguel@ximian.com>
24541 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24542 and instead use public readonly fields.
24544 * class.cs: Put back walking code for type containers.
24546 2001-08-11 Miguel de Icaza <miguel@ximian.com>
24548 * class.cs (MakeConstant): Code to define constants.
24550 * rootcontext.cs (LookupType): New function. Used to locate types
24553 2001-08-08 Miguel de Icaza <miguel@ximian.com>
24555 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
24556 this System.Reflection code is. Kudos to Microsoft
24558 * typemanager.cs: Implement a type cache and avoid loading all
24559 types at boot time. Wrap in LookupType the internals. This made
24560 the compiler so much faster. Wow. I rule!
24562 * driver.cs: Make sure we always load mscorlib first (for
24563 debugging purposes, nothing really important).
24565 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
24566 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
24568 * rootcontext.cs: Lookup types on their namespace; Lookup types
24569 on namespaces that have been imported using the `using' keyword.
24571 * class.cs (TypeContainer::TypeAttr): Virtualize.
24572 (Class::TypeAttr): Return attributes suitable for this bad boy.
24573 (Struct::TypeAttr): ditto.
24574 Handle nested classes.
24575 (TypeContainer::) Remove all the type visiting code, it is now
24576 replaced with the rootcontext.cs code
24578 * rootcontext.cs (GetClassBases): Added support for structs.
24580 2001-08-06 Miguel de Icaza <miguel@ximian.com>
24582 * interface.cs, statement.cs, class.cs, parameter.cs,
24583 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24584 Drop use of TypeRefs, and use strings instead.
24586 2001-08-04 Miguel de Icaza <miguel@ximian.com>
24590 * class.cs (Struct::Struct): set the SEALED flags after
24591 checking the modifiers.
24592 (TypeContainer::TypeAttr): new property, returns the
24593 TypeAttributes for a class.
24595 * cs-parser.jay (type_list): Oops, list production was creating a
24596 new list of base types.
24598 * rootcontext.cs (StdLib): New property.
24599 (GetInterfaceTypeByName): returns an interface by type name, and
24600 encapsulates error handling here.
24601 (GetInterfaces): simplified.
24602 (ResolveTree): Encapsulated all the tree resolution here.
24603 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24606 * driver.cs: Add support for --nostdlib, to avoid loading the
24607 default assemblies.
24608 (Main): Do not put tree resolution here.
24610 * rootcontext.cs: Beginning of the class resolution.
24612 2001-08-03 Miguel de Icaza <miguel@ximian.com>
24614 * rootcontext.cs: Provide better error reporting.
24616 * cs-parser.jay (interface_base): set our $$ to be interfaces.
24618 * rootcontext.cs (CreateInterface): Handle the case where there
24619 are no parent interfaces.
24621 (CloseTypes): Routine to flush types at the end.
24622 (CreateInterface): Track types.
24623 (GetInterfaces): Returns an array of Types from the list of
24624 defined interfaces.
24626 * typemanager.c (AddUserType): Mechanism to track user types (puts
24627 the type on the global type hash, and allows us to close it at the
24630 2001-08-02 Miguel de Icaza <miguel@ximian.com>
24632 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24633 RecordInterface instead.
24635 * cs-parser.jay: Updated to reflect changes above.
24637 * decl.cs (Definition): Keep track of the TypeBuilder type that
24638 represents this type here. Not sure we will use it in the long
24639 run, but wont hurt for now.
24641 * driver.cs: Smaller changes to accomodate the new code.
24643 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24646 * rootcontext.cs (CreateInterface): New method, used to create
24647 the System.TypeBuilder type for interfaces.
24648 (ResolveInterfaces): new entry point to resolve the interface
24650 (CodeGen): Property, used to keep track of the code generator.
24652 2001-07-26 Miguel de Icaza <miguel@ximian.com>
24654 * cs-parser.jay: Add a second production for delegate_declaration
24657 (enum_body): Put an opt_comma here instead of putting it on
24658 enum_body or enum_member_declarations so we can handle trailing
24659 commas on enumeration members. Gets rid of a shift/reduce.
24661 (type_list): Need a COMMA in the middle.
24663 (indexer_declaration): Tell tokenizer to recognize get/set
24665 * Remove old targets.
24667 * Re-add the parser target.
24669 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24671 * cs-parser.jay: Add precendence rules for a number of operators
24672 ot reduce the number of shift/reduce conflicts in the grammar.
24674 2001-07-17 Miguel de Icaza <miguel@ximian.com>
24676 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24679 Get rid of old crufty code.
24681 * rootcontext.cs: Use this to keep track of the parsed
24682 representation and the defined types available to the program.
24684 * gen-treedump.cs: adjust for new convention.
24686 * type.cs: Split out the type manager, and the assembly builder
24689 * typemanager.cs: the type manager will live here now.
24691 * cil-codegen.cs: And the code generator here.
24693 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
24695 * makefile: Fixed up for easy making.
24697 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24699 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24702 (unary_expression): Expand pre_increment_expression and
24703 post_decrement_expression to reduce a shift/reduce.
24705 2001-07-11 Simon Cozens
24707 * cs-tokenizer.cs: Hex numbers should begin with a 0.
24709 Improve allow_keyword_as_indent name.
24711 2001-06-19 Miguel de Icaza <miguel@ximian.com>
24713 * Adjustments for Beta2.
24715 2001-06-13 Miguel de Icaza <miguel@ximian.com>
24717 * decl.cs: Added `Define' abstract method.
24718 (InTransit): new property, used to catch recursive definitions.
24720 * interface.cs: Implement `Define'.
24722 * modifiers.cs: Map Modifiers.constants to
24723 System.Reflection.TypeAttribute flags.
24725 * class.cs: Keep track of types and user-defined types.
24726 (BuilderInit): New method for creating an assembly
24727 (ResolveType): New function to launch the resolution process, only
24728 used by interfaces for now.
24730 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24731 that are inserted into the name space.
24733 2001-06-08 Miguel de Icaza <miguel@ximian.com>
24735 * ARGH. I have screwed up my tree so many times due to the use of
24736 rsync rather than using CVS. Going to fix this at once.
24738 * driver.cs: Objetify driver. Load assemblies, use assemblies to
24741 2001-06-07 Miguel de Icaza <miguel@ximian.com>
24743 * Experiment successful: Use System.Type rather that our own
24746 2001-05-25 Miguel de Icaza <miguel@ximian.com>
24748 * cs-parser.jay: Removed nsAliases from here.
24750 Use new namespaces, handle `using XXX;'
24752 * namespace.cs: Reimplemented namespace handling, use a recursive
24753 definition of the class. Now we can keep track of using clauses
24754 and catch invalid using clauses.
24756 2001-05-24 Miguel de Icaza <miguel@ximian.com>
24758 * gen-treedump.cs: Adapted for all the renaming.
24760 * expression.cs (Expression): this class now has a Type property
24761 which returns an expression Type.
24763 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24764 `Type', as this has a different meaning now in the base
24766 2001-05-22 Miguel de Icaza <miguel@ximian.com>
24768 * interface.cs, class.cs: Removed from all the sources the
24769 references to signature computation, as we can not do method
24770 signature computation during the parsing time, as we are not
24771 trying to solve at that point distinguishing:
24775 void a (NS.Blah x) {}
24778 Which depending on the context might be valid or not, as we do not
24779 know if Blah is the same thing as NS.Blah at that point.
24781 * Redid everything so the code uses TypeRefs now instead of
24782 Types. TypeRefs are just temporary type placeholders, that need
24783 to be resolved. They initially have a pointer to a string and the
24784 current scope in which they are used. This is used later by the
24785 compiler to resolve the reference to an actual Type.
24787 * DeclSpace is no longer a CIR.Type, and neither are
24788 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
24789 are all DeclSpaces, but no Types.
24791 * type.cs (TypeRefManager): This implements the TypeRef manager,
24792 which keeps track of all the types that need to be resolved after
24793 the parsing has finished.
24795 2001-05-13 Miguel de Icaza <miguel@ximian.com>
24797 * ARGH. We are going to have to store `foreach' as a class rather
24798 than resolving it, as we need to verify error 1579 after name
24799 resolution. *OR* we could keep a flag that says `This request to
24800 IEnumerator comes from a foreach statement' which we can then use
24801 to generate the error.
24803 2001-05-10 Miguel de Icaza <miguel@ximian.com>
24805 * class.cs (TypeContainer.AddMethod): we now add methods to the
24806 MethodGroup instead of the method hashtable.
24808 * expression.cs: Add MethodGroup abstraction, which gets us one
24809 step closer to the specification in the way we handle method
24812 * cs-parser.jay (primary_expression): qualified_identifier now
24813 tried to match up an identifier to a local variable reference or
24814 to a parameter reference.
24816 current_local_parameters is now a parser global variable that
24817 points to the current parameters for the block, used during name
24820 (property_declaration): Now creates an implicit `value' argument to
24823 2001-05-09 Miguel de Icaza <miguel@ximian.com>
24825 * parameter.cs: Do not use `param' arguments as part of the
24826 signature, per the spec.
24828 2001-05-08 Miguel de Icaza <miguel@ximian.com>
24830 * decl.cs: Base class for classes, structs and interfaces. This
24831 is the "Declaration Space"
24833 * cs-parser.jay: Use CheckDef for checking declaration errors
24834 instead of having one on each function.
24836 * class.cs: Factor out some code for handling error handling in
24837 accordance to the "Declarations" section in the "Basic Concepts"
24838 chapter in the ECMA C# spec.
24840 * interface.cs: Make all interface member classes derive from
24841 InterfaceMemberBase.
24843 2001-05-07 Miguel de Icaza <miguel@ximian.com>
24845 * Many things: all interfaces are parsed and generated in
24846 gen-treedump. Support for member variables, constructors,
24847 destructors, properties, constants is there.
24849 Beginning of the IL backend, but very little done, just there for
24852 2001-04-29 Miguel de Icaza <miguel@ximian.com>
24854 * cs-parser.jay: Fix labeled statement.
24856 * cs-tokenizer.cs (escape): Escape " and ' always.
24857 ref_line, ref_name: keep track of the line/filename as instructed
24858 by #line by the compiler.
24861 2001-04-27 Miguel de Icaza <miguel@ximian.com>
24863 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24864 to match the values in System.CodeDOM.
24866 Divid renamed to Divide.
24868 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24870 (Statements.set): remove.
24872 * System.CodeDOM/CodeCatchClause.cs: always have a valid
24875 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24876 falseStatements always have valid values.
24878 * cs-parser.jay: Use System.CodeDOM now.