1 2006-01-12 Miguel de Icaza <miguel@novell.com>
3 This fixes the problem where we used ldfld instead of ldflda to
4 load the "THIS" pointer on captured parameters, when THIS is a
5 value type. See bug #77205.
7 * iterators.cs (CapturedThisReference.Emit): Pass false to
8 EmitThis (we do not need the address).
10 * codegen.cs (EmitThis): it needs to know whether we need the
11 address of `this' or not. This is used by value types.
13 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
14 every other call passes false.
16 2006-01-12 Raja R Harinath <rharinath@novell.com>
19 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
21 * expression.cs (Invocation.OverloadResolve): Update.
22 (Invocation.DoResolve): Avoid double resolution of invocation.
24 2006-01-11 Raja R Harinath <rharinath@novell.com>
27 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
28 unary negation of floating point types as 0-expr; negation cannot
29 overflow in floating point types.
32 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
33 on operands of 'void' type.
36 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
37 and ExclusiveOr for boolean constants too.
39 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
41 * expression.cs: Fix Console.WriteLine ((this = x).foo);
43 2006-01-12 Miguel de Icaza <miguel@novell.com>
45 * cs-tokenizer.cs (Position): New class used to save and restore
46 the position state in the tokenizer. Before this patch the save
47 and restore was not complete enough so the line and columns would
48 start to drift and the debugger and stack traces will get the
51 2006-01-10 Martin Baulig <martin@ximian.com>
54 (TypeParameter.InflateConstraints): New public method.
56 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
57 constraints; fixes #77042.
59 2006-01-10 Martin Baulig <martin@ximian.com>
61 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
62 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
65 2006-01-09 Raja R Harinath <rharinath@novell.com>
68 * expression.cs (Invocation.OverloadResolve): Replace reflected
69 override methods with their base virtual methods, rather than
71 * typemanager.cs (TypeManager.GetOverride): New.
73 2005-12-21 Miguel de Icaza <miguel@novell.com>
75 * driver.cs: Report the case of no source files and no -out:
78 2005-12-20 Raja R Harinath <rharinath@novell.com>
81 * expression.cs (ComposedCast.GetSignatureForError): Define.
83 2006-01-05 Jb Evain <jbevain@gmail.com>
85 * class.cs (Property.Define, Indexer.Define): do not tag the
86 properties as SpecialName | RTSpecialName.
88 2006-01-04 Miguel de Icaza <miguel@novell.com>
90 * class.cs (MethodCore.IsDuplicateImplementation): This method was
91 doing a low-level comparission of parameter types. It was lacking
92 a check for __argslist.
94 2005-12-30 Miguel de Icaza <miguel@novell.com>
96 * expression.cs (ParameterReference.DoResolveBase): Allow
97 reference parameters if they are local to this block.
99 This allows the ref and out parameters of a delegate to be used in
100 an anonymous method, for example:
102 delegate void set (out int x);
104 set s = delegate (out int x){
108 This is used by functionality introduced late in the C# language.
110 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
111 method that take ref and out parameters.
113 Fixes #77119 which was a late change in the spec.
115 2005-12-23 Miguel de Icaza <miguel@novell.com>
117 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
118 parent if its the same scope. Fixes #77060.
120 2005-12-22 Marek Safar <marek.safar@seznam.cz>
122 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
124 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
126 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
127 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
128 that doesn't contain the full public key. This is a update of the
129 friend assemblies in .Net 2.0 release.
131 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
135 * namespace.cs (NamespaceEntry): Add extern_aliases as a
136 ListDictionary, to contain the ExternAliasEntry entries (in
137 addition to the NamespaceEntry.aliases hashtable). This field is
138 shared between the original entry and its doppelganger (bodyless
140 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
141 extern_aliases field.
142 (NamespaceEntry.Lookup): Move the IsImplicit check after the
143 lookup in extern_aliases.
145 2005-12-16 Raja R Harinath <rharinath@novell.com>
148 * class.cs (TypeContainer.Mark_HasEquals): New.
149 (TypeContainer.Mark_HasGetHashCode): New.
150 (ClassPart): Override them.
151 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
153 * generic.cs (GenericMethod.DefineMembers): Update to changes.
154 (TypeParameter.TypeParameter): Change type of 'parent' argument to
158 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
159 'parent' argument to the base constructor.
161 Remove all mention of TypeContainer from decl.cs.
162 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
163 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
164 (DeclSpace.DeclSpace): Likewise.
165 (DeclSpace.DefineMembers): Remove unused argument.
166 * cs-parser.jay (pop_current_class): Update to changes. Simplify
167 debugging check -- we don't care if the debug code throws an
168 InvalidCastException instead of an InternalErrorException.
169 * class.cs (TypeContainer.DefineMembers): Update to changes.
170 (TypeContainer.DoDefineMembers): Likewise.
171 (TypeContainer.GetMethods): Likewise.
172 (PropertyMember.Define): Likewise.
173 (MemberBase.Parent): New property that forwards to
174 MemberCore.Parent, but ensures that we get a TypeContainer.
175 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
176 (RootContext.PopulateTypes): Likewise. Remove special case code
177 for !RootContext.StdLib: DefineMembers is idempotent.
179 2005-12-13 Marek Safar <marek.safar@seznam.cz>
181 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
183 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
185 * doc.cs : The search for referenced namespace was insufficient to
186 get global one as it used to do. Fixed bug #76965.
188 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
190 * doc.cs : check name in cref in the last phase that whether it is
193 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
195 * cs-tokenizer.cs : reverted the latest change: it somehow broke
198 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
200 * doc.cs : so it turned out that we cannot skip override check for
201 interface members. Fixed bug #76954.
203 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
205 * cs-tokenizer.cs : fixed bug #75984:
206 - #warning and #error should not be handled when the source line
208 - #line is not checked strictly when the source line is disabled.
209 - #define and #undef is on the other hand checked strictly at any
212 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
214 * cs-tokenizer.cs : missing Location (actually, filename) in one of
217 2005-12-15 Raja R Harinath <rharinath@novell.com>
219 * generic.cs (TypeManager.IsGeneric): Remove unused method.
221 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
224 2005-12-14 Martin Baulig <martin@ximian.com>
226 * typemanager.cs (TypeManager.GetFullName): Make this public;
227 `Type.Fullname' now never returns null.
229 * class.cs (Method.Define): Use TypeManager.GetFullName() for
230 explicit interface implementations; we're now using the same
231 naming convention than csc does.
233 2005-12-14 Miguel de Icaza <miguel@novell.com>
235 * convert.cs (ExplicitConversionCore): Check the return value from
236 ExplicitConversionCore which can return null on failure. Fixes #76914
238 2005-12-09 Raja R Harinath <rharinath@novell.com>
240 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
241 instead of IsGenericInstance.
242 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
243 code that's now covered by the more general test.
244 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
246 * generic.cs (DropGenericTypeArguments): New. Captures the common
247 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
248 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
249 * generic.cs, report.cs, typemanager.cs: Likewise.
251 2005-12-08 Martin Baulig <martin@ximian.com>
253 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
255 * typemanager.cs (TypeManager.CSharpSignature): Include type
256 arguments in the signature of a generic method.
258 2005-12-07 Martin Baulig <martin@ximian.com>
260 Add support for custom attributes on type parameters.
262 * cs-parser.jay (type_arguments): Added `opt_attributes'.
264 * generic.cs (TypeParameterName): New public class; we use this
265 instead of a `string' to store the name of a type parameter, so we
266 can also have `Attributes'.
267 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
268 array instead of a `string[]' array.
269 (TypeParameter.ctor): We now also take an `Attributes' argument.
270 (TypeParameter.EmitAttributes): New public method; emit our
271 `OptAttributes' here.
272 (GenericMethod.EmitAttributes): New public method; emit the custom
273 attributes on all our type parameters.
275 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
277 (MethodData.Define): If we're a generic method, call
278 EmitAttributes() on it.
280 2005-12-07 Martin Baulig <martin@ximian.com>
283 (ConstraintChecker): New public abstract class; move the
284 constraint checking here from `ConstructedType' and also do
285 constraint checking for generic methods here.
287 * expression.cs (Invocation.OverloadResolve): Use
288 ConstraintChecker.CheckConstraints() if we resolved to a generic
291 2005-12-05 Marek Safar <marek.safar@seznam.cz>
293 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
295 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
297 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
298 (FieldBase.Initializer): Initializer is now optional.
299 (EventField.Define): Only event field can have initializer.
301 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
303 * const.cs (Const): Reuse initializer.
305 * cs-parser.jay: Updated after FieldBase changes.
306 Added current_array_type to simplify array initializers.
308 * ecore.cs (NullCast.IsDefaultValue): Implemented.
310 * expression.cs, iterators.cs: Updated.
312 * namespace.cs (NamespaceEntry): Made UsingFound private.
314 2005-12-05 Marek Safar <marek.safar@seznam.cz>
316 * parameterCollection.cs: Obsolete, removed.
317 * parser.cs: Obsolete, removed.
319 2005-12-05 Marek Safar <marek.safar@seznam.cz>
322 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
324 * enum.cs (Enum.Define): Set obsolete context here.
326 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
329 - FindDocumentedMember() now expects 1) paramList as null
330 when "we don't have to check the number of parameters" and
331 2) Type.EmptyTypes when "there is no arguments".
332 - Introduced FoundMember struct to hold the exact type which was
333 used to find the documented member (the above change broke
334 test-xml-044; it might be better just to use DeclaringType than
335 what MS does, like this change does, but it depends on usage.)
337 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
339 * doc.cs : documented member might be from DeclaringType for nested
340 types. Fixed bug #76782.
342 2005-12-03 Ben Maurer <bmaurer@ximian.com>
344 * anonymous.cs: Have the param code handle leaving copies on the
345 stack etc. Allows anonymous params to take part in the assignment
346 code (++, +=, etc). Fixes bug #76550
348 * expression.cs: Handle the prepare_for_load/leave_copy by passing
349 it down to the anon code.
351 * iterators.cs: Use dummy var here
353 * codegen.cs: Handle new vars
355 2005-12-01 Marek Safar <marek.safar@seznam.cz>
358 * class.cs (MethodData.Define): Set proper Obsolete context.
360 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
362 (FieldExpr.DoResolve): Ditto.
364 2005-12-01 Marek Safar <marek.safar@seznam.cz>
367 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
368 parent is not obsolete.
370 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
372 * doc.cs : (FindDocumentedMember) find parameterless members first
373 and get CS0419 in the early stage. Fixed first case of bug #76727.
375 2005-11-30 Marek Safar <marek.safar@seznam.cz>
378 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
379 no error was reported.
381 *expression.cs (Binary.DoResolve): left can be null.
383 2005-12-06 Raja R Harinath <rharinath@novell.com>
385 * class.cs (MethodCore.CheckGenericOverride): Delete unused
386 abstract method and all overrides.
387 * support.cs (ParameterData.GenericConstraints): Delete.
388 (ReflectionParameters.type_params): Delete.
389 (ReflectionParameters.ReflectionParameters): Make private.
390 (ReflectionParameters.GetConstaints): New factory method.
391 * generic.cs (TypeParameterDefineType): Use it.
392 (TypeManager.GetTypeParameterConstraints): Likewise.
394 2005-11-22 Marek Safar <marek.safar@seznam.cz>
397 * class.cs (MethodData.Emit): Parameters should be labeled first.
399 2005-11-21 Marek Safar <marek.safar@seznam.cz>
402 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
404 2005-11-18 Marek Safar <marek.safar@seznam.cz>
406 * attribute.cs (AreParametersCompliant): Moved to Parameter.
408 * class.cs (MethodCore): Parameter clean up.
409 (IMethodData): Added ParameterInfo.
410 (MethodData): Parameter clean up.
411 (Indexer.Define): Parameter clean up.
423 * typemanager.cs: Parameter clean up.
425 * delegate.cs (Define): Get rid of duplicated code.
427 * expression.cs (ParameterReference): Removed useless parameters
431 * parameter.cs (ParamsParameter): New class, params specialization.
432 (ArglistParameter): Attemp to separate arglist.
433 (Parameter): Refactored to be reusable and faster.
434 (Parameter.Modifier): Made understandable.
435 (Parameters): Changed to be used as a class for `this' assembly
436 parameters. Refactored to use new specialized classes.
438 * support.cs (ParameterData): Added Types property.
439 (InternalParameters): Deleted.
441 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
443 * doc.cs : the previous patch does not actually fix the bug.
444 PropertyInfo override check is now implemented and really fixed it.
445 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
447 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
449 * doc.cs : apply "override filter" also to properties.
452 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
454 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
455 no need to check overrides. For classes, omit those results from
456 interfaces since they must exist in the class. Fixed bug #76726.
458 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
460 * typemanager.cs : (GetFullNameSignature) differentiate indexers
461 with different parameters. Fixed the second problem in #76685.
463 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
465 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
466 get expected 'protected' access in CheckValidFamilyAccess()).
469 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
471 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
472 Fixed bug #76705. CS1569 was incorrectly commented out.
474 2005-11-23 Martin Baulig <martin@ximian.com>
476 * generic.cs (Constraints.Define): Removed.
477 (TypeParameter.DefineConstraints): Removed.
478 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
479 on the GenericTypeParameterBuilder here.
481 2005-11-23 Martin Baulig <martin@ximian.com>
483 * typemanager.cs (TypeManager.GetProperty): Make this public.
485 * generic.cs (Nullable.NullableInfo.ctor): Use
486 TypeManager.GetProperty() rather than using reflection directly.
488 2005-11-17 Martin Baulig <martin@ximian.com>
490 * expression.cs (Indexers.GetIndexersForType): Added support for
491 generic parameters; fixes #76587.
493 2005-11-17 Martin Baulig <martin@ximian.com>
496 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
497 inherit the scope from our parent. Fixes #76653.
499 2005-11-15 Martin Baulig <martin@ximian.com>
501 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
502 instead of `ScopeTypeBuilder' to refer to the "current" type.
503 (AnonymousMethod.CreateScopeType): Correctly create the helper
504 class if we're inside a generic type definition.
506 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
508 * doc.cs : use Invocation.IsOverride() to do real override check.
509 * expression.cs : made Invocation.IsOverride() internal.
511 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
513 * doc.cs : use TypeManager.FindMembers() instead of (possible)
514 TypeBuilder.FindMembers() and filter overriden base members out.
517 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
519 * doc.cs : ref/out parameters are represented as '@' (instead of
520 '&' in type FullName). Fixed bug #76630 (additionally crefs).
522 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
524 * doc.cs : when there was no '.' in cref to methods in doc comment,
525 then parameters were missing in the output. Fixed bug #76691.
527 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
529 * driver.cs : don't output docs when there is an error.
532 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
535 Now it should detect indexers. Fixed primary concern in bug #76685.
536 Fixed CS0419 message to not show the identical member signature in
539 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
541 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
542 instead of Type.FindMembers() since it does not handle events.
545 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
547 * codegen.cs: Fixed typo (speficied -> specified).
549 2005-11-11 Marek Safar <marek.safar@seznam.cz>
552 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
554 2005-11-11 Marek Safar <marek.safar@seznam.cz>
556 * attribute.cs: Changed error message.
558 * cs-tokenizer.cs: One more check.
560 2005-11-10 Marek Safar <marek.safar@seznam.cz>
562 * statement.cs (Block.Resolve): Ignore empty statement.
564 2005-11-10 Marek Safar <marek.safar@seznam.cz>
566 * report.cs: Made error/warning methods more strict to avoid
569 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
570 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
571 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
572 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
574 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
576 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
577 Use the more explicit AssemblyName.FullName instead of
578 AssemblyName.Name to report errors.
580 2005-11-11 Marek Safar <marek.safar@seznam.cz>
582 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
585 2005-11-10 Marek Safar <marek.safar@seznam.cz>
595 * report.cs: Fixed error reporting and typos.
597 * generic.cs (TypeParameter.GetSignatureForError): New method.
598 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
600 * typemanager.cs (GetFullName): Refactored.
602 2005-11-08 Marek Safar <marek.safar@seznam.cz>
604 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
605 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
607 * class.cs (TypeContainer.IsComImport): New property.
608 (Constructor.Define): Create proper ctor for ComImport types.
610 * expression.cs (New.CheckComImport): Fixed.
612 2005-11-07 Miguel de Icaza <miguel@novell.com>
614 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
615 that a parameter has been captured does not mean that we do not
616 have to do the rest of the processing. This fixes the second part
617 of #76592. If there was another anonymous method capturing
618 values in the past, the Scope would never be set for the second
619 method that captured the same parameter.
621 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
622 properly manipulate the stack. Second part of fix for #76592.
624 * expression.cs (New): Add support for invoking "new" on
625 interfaces that have been flagged with the ComImport attribute and
626 the CoClass. Fixes #76637
628 * statement.cs (Try.DoEmit): When a variable is captured, do not
629 try to emit the vi.LocalBuilder variable as it has been captured.
630 Create a temporary variable and store the results on the
631 FieldBuilder. Fixes #76642
633 2005-11-07 Marek Safar <marek.safar@seznam.cz>
635 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
637 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
639 * expression.cs (Binary.DoResolve): Added && optimalization.
641 * typemanager.cs (AddUserType): Removed useless argument.
643 2005-11-04 Marek Safar <marek.safar@seznam.cz>
645 * statement.cs (Block.variables): Uses ListDictionary.
647 2005-11-03 Marek Safar <marek.safar@seznam.cz>
650 * class.cs (PartialContainer.EmitType): Customized to emit
652 (ClassPart.ApplyAttributeBuilder): Transform security attribute
655 2005-11-03 Marek Safar <marek.safar@seznam.cz>
658 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
659 access has to be fixed.
661 * typemanager.cs (IsUnmanagedType): Wrong common field type.
663 2005-11-01 Marek Safar <marek.safar@seznam.cz>
666 * ecore.cs (NullCast.Reduce): Implemented.
668 * expression.cs (ArrayCreation.CheckIndices): Correcly check
671 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
673 (Foreach.Resolve): Catch null properly.
675 2005-10-29 Marek Safar <marek.safar@seznam.cz>
677 * cs-tokenizer.cs: Warning text fix.
679 * driver.cs: AllWarningNumbers exposed on public interface.
681 * report.cs (): Reviewed warning numbers.
682 (IsValidWarning): Use binary search.
684 2005-10-29 Marek Safar <marek.safar@seznam.cz>
686 * driver.cs: Implemeted resource visibility.
687 (Resources): New class for code sharing between /res: and
690 2005-11-07 Marek Safar <marek.safar@seznam.cz>
692 decl.cs (CurrentTypeParameters): Fixed to be public.
694 2005-11-07 Marek Safar <marek.safar@seznam.cz>
696 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
698 2005-11-07 Marek Safar <marek.safar@seznam.cz>
700 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
702 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
704 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
706 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
708 Add friend assembly access support.
709 * typemanager.cs: assembly_internals_vis_attrs
710 cache for friend assembly access.
711 (TypeManager.IsFriendAssembly): New method for
712 checking friend assembly access.
713 (TypeManager.Error_FriendAccessNameNotMatching): New
715 (TypeManager.CompareKeyTokens): Likewise.
716 (TypeManager.Filter): Handle friend accessible
719 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
720 friend accessible types.
722 * ecore.cs (Expression.IsAccessorAccessible): Handle
723 friend accessible properties.
725 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
728 2005-10-28 Marek Safar <marek.safar@seznam.cz>
731 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
734 * convert (Convert.ImplicitReferenceConversion): NullCast holds
737 * ecore.cs (NullCast): Child is contant only.
739 * literal.cs (NullLiteral.Reduce): null can be converted to any
742 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
744 * driver.cs: Use Encoding.Default as default code page instead
747 2005-10-27 Raja R Harinath <rharinath@novell.com>
750 * expression.cs (Invocation.Error_InvalidArguments): Handle
751 __arglist parameters.
752 (Invocation.VerifyArgumentsCompat): Likewise.
753 * support.cs (ReflectionParameters.GetSignatureForError): Print
754 __arglist parameters.
755 (InternalParamters.GetSignatureForError): Likewise.
756 * parameter.cs (Parameters.GetSignatureForError): Likewise.
758 2005-10-26 Marek Safar <marek.safar@seznam.cz>
760 * attribute.cs (GetPropertyValue): Made public.
762 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
764 Add new property WrapNonExceptionThrows to handle 2.0 assembly
766 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
769 * driver.cs: Reflect method name change.
771 * statement.cs (Try.Resolve): Warn when try has both general
774 * typemanager.cs: runtime_compatibility_attr_type new predefined
777 2005-10-26 Raja R Harinath <harinath@gmail.com>
780 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
781 treat it as an empty parameter list.
783 2005-10-26 Raja R Harinath <rharinath@novell.com>
786 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
787 ResolveAsTypeStep silent.
788 * statement.cs (Block.AddConstant): Mark block as used.
789 (Block.ResolveMeta): Avoid piling on error messages
790 if a constant initializer resolution fails.
792 2005-10-25 Raja R Harinath <rharinath@novell.com>
794 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
796 (NamespaceEntry.VerifyAllUsing): New.
797 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
798 behaviour. Delegates actual resolution of alias to ...
799 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
800 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
802 * driver.cs (Driver.MainDriver): Update.
804 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
805 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
807 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
809 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
810 RootNamespace.DefineNamespacesForAll.
812 2005-10-24 Raja R Harinath <harinath@gmail.com>
814 * typemanager.cs (assemblies, external_aliases, modules)
815 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
816 (ComputeNamespaces, GetRootNamespace): Remove extra staging
817 overhead. Move resposibility ...
818 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
819 * driver.cs, attribute.cs, codegen.cs: Update to changes.
821 2005-10-23 Raja R Harinath <harinath@gmail.com>
823 * namespace.cs (RootNamespace.all_namespaces): Renamed from
824 cached_namespaces. Improve usage.
825 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
826 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
827 Move from GlobalRootNamespace and simplify.
828 (RootNamespace.Global): Make instance variable.
829 (RootNamespace.RootNamespace): Add "alias name" parameter.
830 (GlobalRootNamespace): Simplify drastically.
831 (Namespace.Lookup): Don't use GetNamespace.
832 * typemanager.cs (GetRootNamespace): Rename from
833 ComputeNamespaceForAlias.
834 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
836 2005-10-23 Marek Safar <marek.safar@seznam.cz>
838 * anonymous.cs (AnonymousContainer): Don't crash when container
841 2005-10-23 Marek Safar <marek.safar@seznam.cz>
843 * expression.cs (Binary.DoResolve): Warn when comparing same
846 2005-10-23 Marek Safar <marek.safar@seznam.cz>
849 * expression.cs (Binary.DoResolve): It looks like there are no
850 convetsion rules in enum context.
852 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
854 Add support for extern alias qualifiers.
855 * typemanager.cs: Move some LookupTypeReflection code
856 to namespace.cs, to have cleaner code. Added some methods
857 to help us keep track of the extern aliased references.
858 * driver.cs: Add suport for extern alias assemblies on command
859 line and check for their warnings/errors. Also keep track of the
860 extern aliased assemblies.
861 * namespace.cs: Move the global functionality of Namespace
862 to GlobalRootNamespace/RootNamespace. Now the global namespace
863 is GlobalRootNamespace.Globa. Also the code moved from
864 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
865 Finally added LocalAliasEntry (AliasEntry before) and
866 ExternAliasEntry, to handle alias statements.
867 * cs-parser.jay: Add support in the grammar for extern alias
869 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
870 Update callings to Namespace (now in GlobalRootNamespace).
872 2005-10-25 Martin Baulig <martin@ximian.com>
874 * convert.cs (ImplicitTypeParameterConversion): Make base
875 interfaces actually work; fixes #76557.
877 2005-10-25 Martin Baulig <martin@ximian.com>
880 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
881 all the type parameters; fixes #76551.
883 2005-10-25 Martin Baulig <martin@ximian.com>
888 (GenericMethod.ctor): Added `Expression return_type' and
889 `Parameters parameters' arguments.
890 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
891 parameter and return types to check their constraints if they're
894 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
897 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
898 constraints of a generic type if `ec.ResolvingGenericMethod'.
900 * class.cs (MethodCore.DoDefineParameters): Set
901 `ec.ResolvingGenericMethod' if we're a generic method.
902 (MemberBase.MemberType): Likewise.
904 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
906 * typemanager.cs (TypeManager): Added
907 TypeManager.internals_visible_attr_type to cache
908 S.R.CompilerServices.InternalsVisibleToAttribute.
910 * codegen.cs (AssemblyClass): Added checks for
911 InternalsVisibleToAttribute in new method
912 CheckInternalsVisibleAttribute () and also cache the
913 AssemblyName in AssemblyClass.Name.
915 2005-10-24 Martin Baulig <martin@ximian.com>
918 (TypeManager.ExpandInterfaces): Added overloaded version which
919 just takes a `Type[]' array.
922 (Constraints.Resolve): Don't expand the interfaces here; ie. we
923 just use the interfaces which were explicitly specified and not
924 the interfaces they inherit. Fixes #76482.
925 (TypeParameter.FindMembers): Expand the interfaces here.
927 2005-10-21 Martin Baulig <martin@ximian.com>
930 (Constraints.Resolve): Also resolve the actual types here.
931 (Constraints.ResolveTypes): Just check the constraints here.
932 Fixes #76363; see gtest-218.cs.
934 2005-10-21 Martin Baulig <martin@ximian.com>
937 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
938 instead of a `BoxedCast'; fixes gtest-217.cs.
940 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
942 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
943 1) "new()" is specified as generic parameter constraint and 2) the
944 type is TypeBuilder and 3) the type is abstract even if it has a
945 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
947 2005-10-20 Martin Baulig <martin@ximian.com>
950 (GenericConstraints.TypeParameter): New public property.
951 (TypeParameter.ctor): Also take a `DeclSpace' argument.
952 (TypeParameter.DeclSpace): New public property.
953 (TypeParameter.DefineType): Inflate the constraints if our
954 `DeclSpace' is an `Iterator'.
956 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
958 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
959 GenericMethod argument to compare methods' generic type arguments.
962 2005-10-19 Martin Baulig <martin@ximian.com>
964 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
965 not ResolveType() when resolving the base type, so we're not
966 checking the constraints here.
967 (TypeContainer.ResolveType): Call ResolveType() on our base_type
970 2005-10-19 Martin Baulig <martin@ximian.com>
972 * generic.cs (ConstructedType.CheckConstraints): Committing
973 untested fix for #76441.
975 2005-10-18 Raja R Harinath <rharinath@novell.com>
978 * class.cs (TypeContainer.DefineType): Move updating of
979 topological sort earlier in the code.
980 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
982 2005-10-18 Marek Safar <marek.safar@seznam.cz>
985 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
987 * constant.cs (Constant.TryReduce): Moved from Cast class.
988 (Reduce): Made little bit more OO and fixed missing conversions.
990 * ecore.cs (Reduce): Implemented.
991 (Binary.EnumLiftUp): New method to upgrade values to enum values.
993 * literal.cs (Reduce): Implemented.
995 * class.cs: Reverted Miguel's wrong commit.
997 2005-10-14 Miguel de Icaza <miguel@novell.com>
999 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1001 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
1003 * cs-parser.jay, expression.cs : CS0214 was missing error location
1004 for constants. Fixed bug #76404.
1006 2005-10-10 Raja R Harinath <rharinath@novell.com>
1008 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1010 (PropertyExpr.EmitCall): Likewise.
1011 * expression.cs (Invocation.EmitArguments): Handle case where
1013 (Invocation.EmitCall): Avoid allocating temporary variable if
1014 there are no arguments.
1016 2005-10-11 Marek Safar <marek.safar@seznam.cz>
1019 * convert.cs (ExplicitConversionCore): Fixed object->enum
1022 2005-10-07 Raja R Harinath <rharinath@novell.com>
1025 * convert.cs (ImplicitConversionStandard): Move conversion of
1026 void* to arbitrary pointer types ...
1027 (ExplicitConversionStandard): .. here.
1028 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1029 error to always print typenames.
1031 2005-10-07 Raja R Harinath <rharinath@novell.com>
1033 * convert.cs (GetConversionOperator): Rename from
1034 GetConversionOperators. Move operator selection code from ...
1035 (UserDefinedConversion): ... here.
1037 2005-10-06 Marek Safar <marek.safar@seznam.cz>
1039 * convert.cs (ExplicitConversionCore): Removed duplicate enum
1042 2005-10-05 Marek Safar <marek.safar@seznam.cz>
1044 * assign.cs (Assign.DoResolve): Error method changed.
1046 * cfold.cs (DoConstantNumericPromotions): Error method changed.
1048 * const.cs (ResolveValue): Reset in_transit immediately.
1050 * constant.cs: Error method changed.
1052 * convert.cs: Removed useless location parameter.
1053 (ExplicitNumericConversion): Don't do double enum check.
1054 (ExplicitConversionCore): Renamed from ExplicitConversion.
1055 (ExplicitUnsafe): Extracted from ExplicitConversion.
1056 (ExplicitConversion): Uses for error reporting.
1058 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
1060 (ResolveBoolean): Uses common error method.
1061 (CastToDecimal): Get rid of ec.
1062 (CastFromDecimal): Optimized.
1063 (ConvCast): Get rid of ec.
1065 * enum.cs (ResolveValue): Reset in_transit immediately.
1066 (Emit): Return after first error.
1068 * expression.cs: Convert changes.
1070 * literal.cs: Error method changed.
1072 * statement.cs: Error method changed.
1074 2005-10-06 Raja R Harinath <rharinath@novell.com>
1076 Fix gtest-131.cs and gtest-211.cs.
1077 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
1078 Only emit code for a label if it is used. Unreachable code can
1079 violate ECMA evaluation stack invariants.
1081 2005-09-27 Marek Safar <marek.safar@seznam.cz>
1083 * anonymous.cs: Implemented ExprClassName.
1085 * assign.cs (Assign.DoResolve): Don't chrash when type is not
1088 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
1091 * class.cs (StaticClass.DefineContainerMembers): Report protected
1094 * codegen.cs: if(ed) PRODUCTION.
1096 * convert.cs (Error_CannotImplicitConversion): Better error
1099 * cs-parser.jay: More error checks.
1101 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
1103 * driver.cs (CSCParseOption): Enabled wrong option check.
1105 * ecore.cs (Expression.ExprClassName): Turned to property.
1106 (MemberExpr.CheckIntermediateModification): For checking boxed
1107 value types modification.
1109 * statement.cs (Fixed.Resolve): Expression type must be
1110 convertible to fixed type.
1111 (CollectionForeach.GetEnumeratorFilter,TryType):
1112 Small refactoring for easier error checking.
1114 2005-09-26 Marek Safar <marek.safar@seznam.cz>
1116 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
1119 * class.cs (GeneratedBaseInitializer): New class for customization
1120 compiler generated initializers.
1121 (MemberBase.DoDefine): Check Obsolete attribute here.
1122 (FieldMember.DoDefine): Ditto.
1124 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
1127 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
1128 (MemberCore.GetObsoleteAttribute): Removed argument.
1129 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
1130 (MemberCore.CheckObsoleteType): New helper.
1134 * statement.cs: Updates after MemberCore changes.
1136 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
1137 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
1139 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
1140 obsolete attribute for compiler construct.
1141 (As.DoResolve): Cache result.
1143 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
1145 2005-10-01 Miguel de Icaza <miguel@novell.com>
1147 * expression.cs (Probe): instead of having a "Type probe_type"
1148 keep the extra information as a TypeExpr probe_type_expr since the
1149 "As" operator needs to perform some type checks.
1151 * (As.DoResolve): If the type is a type parameter, ensure that it
1152 is constrained by a class.
1154 2005-09-22 Miguel de Icaza <miguel@novell.com>
1156 * statement.cs (Lock): Use the TemporaryVariable class instead of
1157 manually using local variables as those do not work when variables
1160 * ecore.cs: Moved the TemporaryVariable class from being a nested
1161 class inside Foreach to be a public class that can be employed in
1164 2005-09-19 Marek Safar <marek.safar@seznam.cz>
1166 * cs-parser.jay: interface_accessors replaced by
1167 accessor_declarations.
1169 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
1172 * statement.cs (GotoCase.Resolve): Convert null constant to
1174 (SwitchLabel.ResolveAndReduce): Ditto.
1175 (SwitchLabel.NullStringCase): Custom null stamp.
1176 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
1178 typemanager.cs (CSharpSignature): Don't skip first argument
1181 2005-09-16 Marek Safar <marek.safar@seznam.cz>
1183 * cfold.cs, constant.cs, convert.cs, ecore.cs,
1184 expression.cs, iterators.cs, literal.cs: Store constants and
1187 * class.cs (MemberBase.ShortName): Pass location.
1189 * cs-parser.jay: Some location fixes.
1191 * ecore.cs (Expression.Location): Made virtual.
1193 2005-09-27 Marek Safar <marek.safar@seznam.cz>
1196 * const.cs (Const.ResolveValue): Check for assigning non-null
1197 value to reference type.
1199 2005-09-26 Raja R Harinath <rharinath@novell.com>
1202 * expression.cs (This.VerifyFixed): In a value type T, the type of
1203 'this' is T&, iow, 'this' is either an out or ref parameter. In a
1204 value type R, 'this' is treated as a value parameter.
1206 2005-09-05 Miguel de Icaza <miguel@novell.com>
1208 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1209 if the underlying types are the same, otherwise we need to produce
1210 code that will do the proper cast.
1212 This was exposed by Marek's constant rewrite which produced
1213 invalid code for the call site:
1216 void Method (X v) {}
1220 This fixes test-49.cs
1222 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1224 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
1225 Type/Object should be allowed as well. Fixed bug #75968.
1227 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1229 * expression.cs : (Binary.DoResolve): when one is enum constant and
1230 another is constant 0, then return enum one *as enum type*.
1233 2005-10-04 Martin Baulig <martin@ximian.com>
1235 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
1236 `SetMemberIsUsed()' work for generics, too.
1238 2005-10-04 Martin Baulig <martin@ximian.com>
1240 * expression.cs (DelegateInvocation.EmitStatement): Make this work
1241 for corlib. Fixes #75691.
1243 2005-09-28 Marek Safar <marek.safar@seznam.cz>
1246 * driver.cs: Fix compilation files with full root path.
1248 2005-09-25 Miguel de Icaza <miguel@novell.com>
1250 * report.cs (SymbolRelatedToPreviousError): Format the output so
1251 it does not use an open parenthesis that is never closed.
1253 * driver.cs: Follow coding guidelines
1255 2005-09-18 Miguel de Icaza <miguel@novell.com>
1257 * driver.cs: Set InEmacs based on the environment variable EMACS.
1259 * location.cs (InEmacs): in this mode, do not report column
1260 location as it confuses Emacs.
1262 2005-10-03 Raja R Harinath <rharinath@novell.com>
1264 * support.cs (SeekableStreamReader.Position): Don't error out when
1265 the requested position is just beyond the end of the current
1268 2005-09-28 Raja R Harinath <rharinath@novell.com>
1270 * support.cs (SeekableStreamReader): Simplify drastically. Don't
1271 try to keep in sync with the byte count of the underlying Stream.
1272 However, this limits us to a window size of 2048 characters: i.e.,
1273 the maximum lookahead of our lexer/parser can be 2048 characters.
1275 2005-09-22 Martin Baulig <martin@ximian.com>
1277 * driver.cs: Removed a debugging FIXME.
1279 2005-09-21 Raja R Harinath <rharinath@novell.com>
1281 * cs-parser.jay (type_arguments): Add CS1644 check.
1282 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
1284 2005-09-15 Raja R Harinath <rharinath@novell.com>
1286 * Makefile (PROGRAM): Make profile specific.
1287 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
1288 the current directory.
1291 * expression.cs (Invocation.EmitCall): Remove optimization on
1292 this_call since it doesn't handle 'this' being a value type.
1294 2005-09-05 Geoff Norton <gnorton@customerdna.com>
1296 * driver.cs: Ensure file handles are closed after parsing
1298 2005-09-05 Miguel de Icaza <miguel@novell.com>
1300 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1301 if the underlying types are the same, otherwise we need to produce
1302 code that will do the proper cast.
1304 This was exposed by Marek's constant rewrite which produced
1305 invalid code for the call site:
1308 void Method (X v) {}
1312 This fixes test-49.cs
1314 2005-09-05 Martin Baulig <martin@ximian.com>
1316 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
1317 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
1319 * cs-parser.jay (delegate_declaration): Small fix for #75852.
1321 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1323 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
1324 to be a pointer type due to the spec 25.2, so check if declaring
1325 type is generic type definition. Fixed bug #75772.
1327 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1330 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
1331 both types are not defined by methods.
1332 * expression.cs : (Invocation.IsApplicable): it should work when
1333 the argument type is equal to the parameter type, not only when
1334 ImplicitConversionExists() returns true.
1336 2005-09-02 Raja R Harinath <rharinath@novell.com>
1338 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
1342 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
1343 flow-branching for LocalVariableReferences in case we were invoked
1344 from a MemberAccess.
1345 * expression.cs (LocalVariableReference.VerifyAssigned): New.
1347 (LocalVariableReference.DoResolveBase): ... this.
1348 (MemberAccess.Resolve): Do the check that was disabled during
1351 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
1354 (PartialContainer.Create): check abstract/sealed/static strictly
1355 but abstract/sealed can exist only at one side. Fixed bug #75883.
1357 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
1360 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
1361 specified, don't default to UnmanagedType.I4.
1363 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
1365 * expression.cs : conditional operator should check possibly
1366 incorrect assign expression. Fixed bug #75946.
1368 2005-08-30 Raja R Harinath <rharinath@novell.com>
1371 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
1372 (ScopeInfo.EmitScopeType): Use it to construct field names from
1373 names of captured locals.
1376 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
1377 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
1378 Pass 'target_type' to BoxedCast. Don't default to 'object'.
1379 (ExplicitConversion): Remove enum cases already handled by
1380 implicit conversion. Move implicit conversion check to the beginning.
1381 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
1382 * expression.cs (ArrayCreation.EmitDynamicInitializers):
1383 Don't treat System.Enum as a struct.
1385 2005-08-30 Jb Evain <jbevain@gmail.com>
1387 * attribute.cs: handles as expression in parameters.
1389 2005-08-30 Raja R Harinath <rharinath@novell.com>
1392 * class.cs (TypeContainer.VerifyClsName): Don't use a
1393 PartialContainer when verifying CLS compliance.
1394 (AbstractPropertyEventMethod): Set Parent here, ...
1395 (PropertyMethod): ... not here.
1397 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
1399 * attribute.cs : escaped attribute name should not be allowed to be
1400 resolved (e.g. @class as classAttribute). Fixed bug #75930.
1402 2005-08-29 Raja R Harinath <rharinath@novell.com>
1405 * convert.cs (ImplicitStandardConversionExists): Allow zero also
1406 when converting a long constant to unsigned long.
1407 * expression.cs (Invocation.OverloadResolve): Add sanity check to
1408 detect where IsApplicable and VerifyArgumentsCompat disagree.
1410 2005-08-29 Raja R Harinath <rharinath@novell.com>
1411 and Carlos Alberto Cortez <carlos@unixmexico.org>
1414 * class.cs (TypeContainer.CanElideInitializer): New helper.
1415 (TypeContainer.EmitFieldInitializers): Use it to determine if we
1416 can safely emitting the initializer of a field.
1418 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1420 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
1421 allowed inside a switch (without loop). Fixed bug #75433.
1423 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
1425 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
1426 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
1428 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1430 * driver.cs : kinda reverting the default encoding changes (not exact
1431 revert since I noticed that "codepage:reset" might not work fine).
1433 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1435 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
1436 Location. Now getter and setter store location correctly.
1437 (errors/cs0111-12.cs now reports the expected location.)
1439 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1441 * driver.cs : Use default encoding on the environment.
1442 Removed (now that) extra parameter for SeekableStreamReader.
1443 * support.cs : (SeekableStreamReader) third .ctor() argument for
1444 StreamReader is not required (always true). preamble size could
1445 be acquired in simpler and safe way.
1447 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
1449 * cs-parser.jay: report CS0642 at warning level 3
1450 and report CS0642 for an if else statement also
1451 fixes bug #74745. Patch by John Luke (and a bit
1453 Removed extra CS0642 warning check for "while",
1455 * statement.cs: In Block.Resolve(), CS0642 check
1456 is reimplemented to check a sequence of an empty
1457 statement and a block.
1459 Both fix bug #66777.
1461 2005-08-24 Marek Safar <marek.safar@seznam.cz>
1463 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
1464 detection until I fix it.
1466 * cs-tokenizer.cs: Changed error message.
1468 * cs-parser.jay: Fixed 2 error locations.
1470 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
1471 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
1474 * enum.cs (GetSignatureForError): Fixed.
1476 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
1480 * typemanager.cs (RegisterProperty): Removed.
1482 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
1484 2005-08-24 Raja R Harinath <rharinath@novell.com>
1487 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
1488 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
1490 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1492 * expression.cs : tiny fix is required for not warning positive ulong.
1495 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1497 * expression.cs : add CS0652 check for constant and integral
1498 expression. Fixed bug #53974.
1500 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1502 * expression.cs : in DoNumericPromotions(), check if there is implicit
1503 conversion overload for string (to check CS0034). Fixed bug #52492.
1505 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1507 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
1509 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1511 * ecore.cs : report location when it is *not* Null.
1513 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
1519 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
1520 correctly. Fixed bug #75721.
1522 2005-08-23 Raja R Harinath <rharinath@novell.com>
1524 * support.cs (SeekableStreamReader.Position): Avoid an expensive
1525 loop that performs 'min (pos, char_count)'.
1528 * expression.cs (Unary.ResolveOperator): Don't discard implicit
1529 converted value in Operator.OnesComplement.
1531 2005-08-22 Ben Maurer <bmaurer@ximian.com>
1533 * anonymous.cs: If the anon method is pulled into a helper class,
1534 it needs to be `internal' not `private'. Fixes runtime behavior on
1537 2005-08-17 Marek Safar <marek.safar@seznam.cz>
1540 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
1543 2005-08-16 Marek Safar <marek.safar@seznam.cz>
1545 The big constants rewrite
1546 Fix #75746, #75685 and more
1547 As a side effect saved 1MB for MWF ;-)
1549 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
1550 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
1551 enum based for corlib compilation.
1553 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
1556 * class.cs (FixedField.Define): Use ResolveAsConstant.
1558 * const.cs (IConstant): Interface constants and enums.
1559 (Const.ResolveValue): New method for constant resolvning.
1560 (ExternalConstant): Constants from imported assemblies.
1562 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
1563 conversion; like enums.
1564 (Constant.ToType): Converts this constant to different type.
1565 (Constant.Increment): Adds 1.
1567 * convert.cs (ImplicitConversionRequired): Simplified.
1569 * cs-parser.jay: Create EnumMember directly.
1571 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
1573 * doc.cs (GenerateEnumDocComment): Removed.
1575 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
1576 (ConvertIntLiteral): Removed.
1577 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
1579 * enum.cs (EnumMember): Implement IConstant.
1580 (Enum.IsValidEnumConstant): Removed.
1581 (Enum.GetNextDefaultValue): Removed.
1582 (Enum.FindMembers): Updated.
1583 (Enum.GenerateDocComment): Iterate enum members.
1585 * expression.cs (Cast.TryReduce): Handle enums correctly.
1586 (New.Constantify): Made public.
1587 (MemberAccess.DoResolve): Removed contant specific if(s).
1589 * literal.cs (NullLiteral): Implement new abstract methods.
1591 * statement.cs (GotoCase.Resolve): Use new constant methods.
1592 (SwitchLabel.ResolveAndReduce): Use new constant methods.
1594 * typemanager.cs (LookupEnum): Removed.
1595 (IsEnumType): Fixed to work with corlib.
1596 (RegisterConstant): Removed.
1597 (LookupConstant): Removed.
1598 (GetConstant): Changed to work with IConstant.
1600 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
1602 * location.cs : Fixed overflown (>255) column number.
1604 2005-08-03 Raja R Harinath <rharinath@novell.com>
1606 First cut of the qualified-alias-member feature.
1607 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
1609 * cs-parser.jay (DOUBLE_COLON): New token.
1610 (namespace_or_type_name): Add rule for recognizing
1611 qualified-alias-members.
1612 (primary_expression): Likewise.
1613 (element_access): Allow QualifiedAliasMember as a possible
1614 type-bearing expression.
1615 (local_variable_type, local_variable_pointer_type): Likewise.
1616 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
1617 aliases in the current and enclosing namespace declarations.
1618 (NamespaceEntry.UsingAlias): Add CS0440 warning.
1619 * decl.cs (MemberName.is_double_colon): New.
1620 (MemberName.MemberName): Add new constructor for alias-member.
1621 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
1622 * expression.cs (QualifiedAliasMember): New expression type.
1624 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
1626 * location.cs : it borked when no argument was specified.
1628 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
1630 * location.cs : tiny ToString() format fix.
1632 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
1634 * statement.cs : oops, it was missing.
1636 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
1638 A set of fixes for precise line/column location.
1641 "token" field now holds a file/line "delta", a line number offset
1642 from the segment, and a column number. See also:
1643 http://lists.ximian.com/pipermail/mono-devel-list/2004-
1644 December/009508.html
1645 Removed static IsNull. Use instance IsNull property instead.
1647 For some tokens it stores Location. For Identifier it stores
1648 LocatedToken which is a pair of string name and location.
1649 Column numbers are adjusted only at getChar().
1651 Use Location.ToString() for reporting (it now contains column).
1653 Largely modified to use LocatedToken instead of
1654 string (IDENTIFIER), and to acquire Location from some tokens.
1655 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
1656 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
1658 Now MemberName holds Location. DeclSpace.ctor() receives Location
1659 as a parameter. Removed extra parameters to all derived classes.
1660 Replaced Location.IsNull() with instance property.
1661 * assign.cs, expression.cs :
1662 Added .ctor() overload that omits Location.
1664 Added "nameEscaped" flag that indicates the identifier was escaped
1665 in the source file. This fixes bug #57047.
1667 2005-09-02 Martin Baulig <martin@ximian.com>
1669 * class.cs: Make CS3005 a warning, not an error.
1671 2005-08-02 Marek Safar <marek.safar@seznam.cz>
1673 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
1674 New method, looking for lo-case imported cls type.
1676 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
1679 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
1681 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
1683 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
1685 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
1687 Optimized to save 3.5 MB for SWF compilation.
1689 2005-08-01 Marek Safar <marek.safar@seznam.cz>
1691 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
1692 (PartialContainer.Create): Moved logic AddToContainer.
1693 (PartialContainer.MarkForDuplicationCheck): Shares name.
1695 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
1698 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
1700 (Namespace.GetSignatureForError): New method.
1702 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
1703 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
1705 2005-08-01 Raja R Harinath <rharinath@novell.com>
1708 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
1709 member lookup rather than qualifier_type, since qualifier_type can
1712 2005-08-01 Marek Safar <marek.safar@seznam.cz>
1714 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
1717 2005-07-31 Miguel de Icaza <miguel@novell.com>
1719 * statement.cs: Copy the local exception into the exception
1720 captured local. Fixes 75674
1722 2005-07-31 Raja R Harinath <harinath@gmail.com>
1725 * expression.cs (Invocation.OverloadResolve): Don't report error
1726 CS1501 if error CS1502 has been reported.
1727 (New.DoResolve): Delegate CS1501 reporting to
1728 Invocation.OverloadResolve.
1731 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
1732 invariant-meaning-in-block property in an enclosing block if
1735 2005-07-29 Marek Safar <marek.safar@seznam.cz>
1737 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
1738 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
1739 (Switch.CheckSwitch): Just save 50kb for SWF.
1741 2005-07-27 Martin Baulig <martin@ximian.com>
1743 * anonymous.cs (CaptureContext.AddField): Added
1744 `AnonymousContainer am' argument; compute its toplevel scope if
1745 it's not already computed. Fixes #75649.
1747 2005-07-26 Raja R Harinath <rharinath@novell.com>
1750 * class.cs (Constructor.Emit): Reset block to null if the block
1753 2005-07-25 Marek Safar <marek.safar@seznam.cz>
1755 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
1757 2005-07-25 Marek Safar <marek.safar@seznam.cz>
1759 * class.cs (MethodData.Define): Check whether accessor implementing
1760 interface is public.
1762 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
1764 2005-07-22 Marek Safar <marek.safar@seznam.cz>
1767 * namespace.cs (LookupType): Moved same type check to...
1769 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
1772 2005-07-21 Raja R Harinath <rharinath@novell.com>
1774 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
1775 already found a typebuilder.
1776 * class.cs (MethodCore.IsDuplicateImplementation): Compare
1777 MemberNames, not strings.
1779 * const.cs (Error_ExpressionMustBeConst):
1780 Rename from Error_EpressionMustBeConst.
1781 * const.cs, class.cs, statement.cd: Update.
1783 2005-07-21 Marek Safar <marek.safar@seznam.cz>
1787 * const.cs (Const.LookupConstantValue): Report missing contant expression
1789 (Error_EpressionMustBeConstant): Only one error method.
1791 * class.cs, statement.c: Updated.
1793 2005-07-20 Raja R Harinath <rharinath@novell.com>
1795 * statement.cs (Block.Flags): Add back HasVarargs.
1796 (Block.flags): Make protected.
1797 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
1799 * typemanager.cs (types, typecontainers, user_types): Remove.
1800 (UserTypes, TypeContainers): Likewise.
1801 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
1802 (CleanUp, Reset): Update.
1803 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
1804 (GetNestedType): Use Type.GetNestedType.
1805 (CoreLookupType): Take two arguments, the namespace and the
1806 basename of the type. Update to use the Namespace.Lookup
1808 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
1809 (RealMemberLookup): Use IsNestedChildOf instead of playing with
1810 string concatenation and substring matches.
1811 * class.cs, enum.cs, delegate.cs: Update to changes.
1813 2005-07-20 Marek Safar <marek.safar@seznam.cz>
1815 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
1816 Expression and made virtual.
1818 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
1819 (ImplicitStandardConversionExists): Fixed `byte' typo ?
1821 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
1823 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
1826 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
1829 2005-07-18 Marek Safar <marek.safar@seznam.cz>
1832 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
1833 AssemblyCultureAttribute is not used on executable.
1836 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
1838 2005-07-16 Raja R Harinath <rharinath@novell.com>
1841 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
1842 New. Reports CS0252/CS0253.
1843 Mostly taken from preliminary patch by Duncak Mak.
1844 (Binary.DoResolveOperator): Store results of operator lookup.
1845 Use them to detect if we need to warn about unintended reference
1848 2005-07-15 Raja R Harinath <rharinath@novell.com>
1851 * namespace.cs (Namespace.Lookup): Add back location parameter.
1852 (Namespace.LookupType): Add CS0436 report. Add location parameter.
1853 * delegate.cs, ecore.cs, expression.cs: Update to changes.
1855 * codegen.cs (EmitContext.DeclSpace): Make readonly.
1856 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
1857 (Namespace.LookupType): ... this.
1858 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
1860 * typemanager.cs (LookupTypeReflection): Remove buggy code that
1861 purported to handle pointers.
1862 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
1865 2005-07-15 Marek Safar <marek.safar@seznam.cz>
1867 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1870 2005-07-15 Raja R Harinath <rharinath@novell.com>
1872 * namespace.cs (Namespace.Lookup): Drop location parameter.
1873 (NamespaceEntry.LookupAlias): Remove. Merge into ...
1874 (NamespaceEntry.Lookup): ... this.
1875 (NamespaceEntry.Error_AmbiguousTypeReference):
1876 Move here from DeclSpace.
1877 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
1879 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
1880 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
1881 Move to NamespaceEntry.
1882 * delegate.cs, expression.cs: Update to changes.
1884 2005-08-31 Martin Baulig <martin@ximian.com>
1886 Committing a patch from Atsushi Enomoto for #75850.
1888 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
1889 Prefer a generic enumerator over a non-generic one.
1891 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
1893 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
1894 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
1896 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1898 * driver.cs : reverting default encoding change as well as mcs.
1900 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1902 * driver.cs, support.cs : merged r48826.
1904 > could you integrate your mcs changes to gmcs otherwise
1905 > gmcs cannot compile some files.
1907 2005-08-20 Martin Baulig <martin@ximian.com>
1909 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1910 scope if we don't already have it.
1912 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
1913 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
1916 2005-07-31 Miguel de Icaza <miguel@novell.com>
1918 * statement.cs: Copy the local exception into the exception
1919 captured local. Fixes 75674
1921 2005-07-15 Marek Safar <marek.safar@seznam.cz>
1923 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
1926 2005-08-12 Martin Baulig <martin@ximian.com>
1928 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
1929 for nested types here to avoid hitting the cache too early.
1931 2005-08-09 Miguel de Icaza <miguel@novell.com>
1933 * enum.cs: On the new compiler CLS error 3005 is now a warning not
1936 2005-08-03 Martin Baulig <martin@ximian.com>
1938 Make iterators in generic methods work; see gtest-191.cs.
1941 (Constraints.Resolve): Protect against being called twice.
1944 (TypeContainer.GetClassBases): Make this `protected virtual'.
1946 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
1947 (Iterator.GetClassBases): Override this and compute the base
1949 (Iterator.DefineNestedTypes): If we're a generic method, all our
1950 method type parameters become class type parameters on the proxy
1954 (ToplevelBlock.Parameters): Make this a property, not a field.
1955 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
1957 2005-08-03 Martin Baulig <martin@ximian.com>
1959 * typemanager.cs (TypeManager.IsSubclassOf): Use
1960 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
1961 (TypeManager.GetFullName_recursed): Improved.
1963 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1966 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
1967 Private accessor case, using TypeManager.IsPrivateAccessible instead of
1968 invocation_type == mi.DeclaringType, since the first one also checks
1969 other condition used by generic instances.
1971 2005-07-27 Martin Baulig <martin@ximian.com>
1973 * anonymous.cs (CaptureContext.AddField): Added
1974 `AnonymousContainer am' argument; compute its toplevel scope if
1975 it's not already computed. Fixes #75649.
1977 2005-07-14 Marek Safar <marek.safar@seznam.cz>
1979 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
1980 CheckAttributeType and refactored.
1981 (Attribute.ResolvePossibleAttributeType): Changed to reuse
1982 ResolveAsTypeTerminal error handling.
1983 (ResolveAsTypeTerminal): Introduced because of global attributes extra
1985 (GetSignatureForError): Print errors in same way.
1988 * codegen.cs: Reflect attribute GetSignatureForError change.
1991 * expression.cs: Add silent parameter to ResolveAsTypeStep.
1993 * namespace.cs (UsingEntry): Refactored to make fields private.
1996 statement.cs: Error_UnexpectedKind has extra parameter.
1998 2005-07-14 Raja R Harinath <rharinath@novell.com>
2000 * ecore.cs (IAlias): Remove.
2001 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
2002 that implement the interface.
2003 * namespace.cs (Namespace): Likewise.
2004 (Namespace.declspaces): Renamed from 'defined_names'.
2005 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
2006 DeclSpace instead of an IAlias.
2007 * tree.cs (Tree.AddDecl): Update.
2009 2005-07-12 Raja R Harinath <rharinath@novell.com>
2011 * statement.cs (Block.Flags); Remove HasVarargs.
2012 (Block.HasVarargs): Move to ToplevelBlock.
2013 (Block.ThisVariable, Block.AddThisVariable): Likewise.
2014 (Block.Variables): Make protected. Initialize variable hashtable
2016 (Block.AddVariable): Update.
2017 (Block.Resolve): Update to changes.
2018 (ToplevelBlock.HasVarargs): New boolean.
2019 (ToplevelBlock.ThisVariable): Move here from Block.
2020 (ToplevelBlock.AddThisVariable): Likewise.
2021 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
2022 * expression.cs (This.ResolveBase): Update to changes.
2023 (ArglistAccess.DoResolve): Likewise.
2025 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2028 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2030 * class.cs (TypeContainer.VerifyMembers): Distinguish between
2031 not used and not used & assigned.
2032 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2034 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2037 * expression.cs (Is.DoResolve): null is never provided type.
2039 2005-07-08 Marek Safar <marek.safar@seznam.cz>
2042 * cs-parser.jay: Less strict event error rule to catch more errors.
2044 2005-07-11 Martin Baulig <martin@ximian.com>
2046 * generic.cs (ConstructedType.CheckConstraints): Improve the check
2047 for the constructor constraint: we do not only have to check
2048 whether the class has a public constructor, but also ensure that
2049 it's parameterless. Fixes #75492.
2051 2005-07-11 Martin Baulig <martin@ximian.com>
2053 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
2054 between type parameters if they either have the reference type
2055 constraint or the class constraint.
2057 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
2059 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
2061 2005-07-07 Marek Safar <marek.safar@seznam.cz>
2064 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
2065 (ExtractSecurityPermissionSet): Cope with self referencing security
2066 attributes properly.
2068 * driver.cs (SetOutputFile): Made public property OutputFile.
2070 2005-07-07 Raja R Harinath <rharinath@novell.com>
2073 * class.cs (TypeContainer.first_nonstatic_field): Rename from
2074 has_nonstatic_fields. Make into a FieldBase pointer.
2075 (TypeContainer.AddField): Add CS0282 check.
2076 (TypeContainer.EmitType): Update.
2078 2005-07-06 Miguel de Icaza <miguel@novell.com>
2080 * cs-tokenizer.cs (consume_identifier): Do not create strings to
2081 compare if they start with __.
2083 2005-07-06 Raja R Harinath <rharinath@novell.com>
2085 * statement.cs (Switch.SwitchGoverningType): Only look at
2086 UserCasts that don't need implicit standard conversions to one of
2087 the allowed switch types (Fixes test-322.cs).
2088 (LocalInfo.Resolve): Re-enable sanity-test.
2090 2005-07-06 Marek Safar <marek.safar@seznam.cz>
2092 * cs-tokenizer.cs (consume_identifier): Detect double undescores
2094 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
2096 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
2098 2005-07-06 Raja R Harinath <rharinath@novell.com>
2101 * ecore.cs (SimpleName.GetSignatureForError): Add.
2102 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
2103 (MemberAccess.GetSignatureForError): Add.
2105 2005-07-05 Marek Safar <marek.safar@seznam.cz>
2107 The big error and warning messages review.
2137 * typemanager.cs: Updated.
2139 * class.cs: (MethodCore.SetYields): Moved here to share.
2140 (PropertyMethod.Define): Moved iterator setup here.
2142 * iterators.cs: Add orig_method to have full access to parent
2145 2005-07-05 Raja R Harinath <rharinath@novell.com>
2147 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
2148 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
2149 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
2150 variable of struct type.
2151 * expression.cs (Unary.ResolveOperator): Update to change.
2152 (Indirection.VerifyFixed): Likewise.
2153 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
2154 (ParameterReference.VerifyFixed): Value parameters are fixed.
2155 (This.VerifyFixed): Treat 'this' as a value parameter.
2156 * statement.cs (LocalInfo.IsFixed): Remove.
2158 2005-07-01 Martin Baulig <martin@ximian.com>
2160 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2161 `ec.EmitThis ()' to get the correct scope.
2163 2005-07-01 Martin Baulig <martin@ximian.com>
2165 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
2166 instance is a ParameterReference; fixes #75299.
2168 2005-06-30 Raja R Harinath <rharinath@novell.com>
2171 * expression.cs (Indexers.map): Remove.
2172 (Indexers.Append): Filter out inaccessible setters and getters.
2173 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
2176 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
2178 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
2179 (FieldExpr.Emit, PropertyExpr.Emit): Update.
2180 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
2181 * expression.cs (Invocation.EmitCall): Add CS0120 check.
2183 2005-06-30 Marek Safar <marek.safar@seznam.cz>
2186 * class.cs (FieldBase.GetInitializerExpression): One more field
2189 2005-06-28 Miguel de Icaza <miguel@novell.com>
2191 * pending.cs: Do not define a proxy if the base method is virtual,
2192 it will be picked up by the runtime (bug 75270).
2194 2005-07-08 Martin Baulig <martin@ximian.com>
2196 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
2197 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
2199 2005-07-07 Martin Baulig <martin@ximian.com>
2201 * generic.cs (ConstructedType.CheckConstraint): Use
2202 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
2203 called recursively; fixes #75329.
2205 2005-07-06 Martin Baulig <martin@ximian.com>
2207 * generic.cs (TypeManager.InferTypeArguments): Added support for
2208 anonymous methods; fixes #75461.
2210 2005-07-01 Martin Baulig <martin@ximian.com>
2212 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2213 `ec.EmitThis ()' to get the correct scope.
2215 2005-07-01 Martin Baulig <martin@ximian.com>
2217 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
2218 instance is `This'; fixes #75299.
2220 2005-06-30 Martin Baulig <martin@ximian.com>
2222 * class.cs (Indexer): Implement IIteratorContainer; added support
2223 for iterators in indexers.
2226 (EmitContext.CurrentIterator): Make this a property, not a field.
2228 * anonymous.cs (AnonymousContainer.Iterator): New public property.
2230 2005-06-28 Miguel de Icaza <miguel@novell.com>
2232 * pending.cs: Do not define a proxy if the base method is virtual,
2233 it will be picked up by the runtime (bug 75270).
2235 2005-06-28 Martin Baulig <martin@ximian.com>
2237 * cs-parser.jay (interface_method_declaration): Avoid a
2238 reduce/reduce conflict by moving some of the code into a separate
2239 `interface_method_declaration_body' rule; fixes #75368.
2241 2005-06-28 Martin Baulig <martin@ximian.com>
2243 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
2244 array check after the check for TypeBuilder's.
2246 2005-06-21 Raja R Harinath <rharinath@novell.com>
2248 * convert.cs (FindMostEncompassedType): Add two trivial special
2249 cases (number_of_types == 0 || number_of_types == 1).
2250 (FindMostEncompasingType): Likewise.
2252 2005-06-17 Raja R Harinath <rharinath@novell.com>
2254 Some cleanups preparing for the fix of #75283.
2255 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
2257 (EventExpr.InstanceResolve): Likewise.
2258 (EventExpr.DoResolve): Remove redundant checks.
2260 2005-06-08 Miguel de Icaza <miguel@novell.com>
2262 * class.cs: Small fix.
2264 2005-06-08 Raja R Harinath <rharinath@novell.com>
2267 * class.cs (GetPartialBases): Fix return value check of
2270 2005-06-07 Raja R Harinath <rharinath@novell.com>
2272 Ensure that partial classes are registered in their enclosing
2273 namespace. Initial part of fix of #75160.
2274 * tree.cs (Tree.RecordDecl): Add new namespace argument.
2275 Register declspace with namespace here, not in
2276 DeclSpace.RecordDecl.
2277 * cs-parser.jay: Pass namespace to RecordDecl.
2278 * class.cs (PartialContainer.Create): Likewise.
2279 (ClassPart.DefineType): New sanity-check. Throws an exception if
2281 * decl.cs (Declspace.RecordDecl): Remove.
2282 * namespace.cs (NamespaceEntry.DefineName): Remove.
2284 2005-06-06 Marek Safar <marek.safar@seznam.cz>
2286 * rootcontext.cs: Reset TargetExt as well.
2288 2005-06-03 Raja R Harinath <rharinath@novell.com>
2290 * ecore.cs (Expression.Resolve): Emit CS0654 error when
2293 2005-06-02 Raja R Harinath <rharinath@novell.com>
2295 Fix #75080, cs0119.cs.
2296 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
2298 (Expression.Resolve): ... this. Use it. Remove bogus code
2299 allowing ExprClass.Type and ExprClass.Namespace for
2300 ResolveFlags.VariableOrValue.
2301 (Expression.Resolve) [1-argument variant]: Change default resolve
2302 flags based on language version.
2303 (Expression.Error_UnexpectedKind): Use a simple string array
2304 rather than an ArrayList.
2305 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
2307 (TypeOfVoid.DoResolve): Likewise.
2308 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
2309 flags argument -- it always has the same value.
2311 2005-05-31 Raja R Harinath <rharinath@novell.com>
2314 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
2315 Use it in the error message.
2316 * assign.cs, expression.cs, statement.cs: Update.
2318 2005-05-30 Raja R Harinath <rharinath@novell.com>
2321 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
2322 the "almostMatchedMember" case too.
2323 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
2324 that failed the accessibility checks to 'almost_match'.
2326 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
2328 * attribute.cs: Use internal MethodBuilder methods to set
2329 ExactSpelling and SetLastError on PInvoke methods, instead
2330 of passing them via charset. Fixes #75060.
2332 2005-05-27 Raja R Harinath <rharinath@novell.com>
2334 * parameter.cs (Parameter): Remove TODO comment.
2335 (Parameter.DefineParameter): Remove Location parameter.
2336 (Parameters.LabelParameters): Likewise.
2337 * class.cs (Constructor.Emit): Update to change.
2338 (MethodData.Emit): Likewise.
2339 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
2340 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
2342 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
2345 Removed Parameters.Location and added Parameter.Location instead.
2346 Removed Location parameter from Emit() and GetSignature().
2353 Modified all related calls.
2355 2005-06-21 Martin Baulig <martin@ximian.com>
2357 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
2358 left-hand side is not a nullable type; fixes #75328.
2360 2005-06-21 Martin Baulig <martin@ximian.com>
2363 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
2364 (TypeManager.GetFullNameSignature): Likewise.
2366 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
2367 `source.FullName' and `target.FullName' to check whether there are
2368 two conflicting definitions.
2370 2005-06-21 Martin Baulig <martin@ximian.com>
2372 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
2373 a BoxedCast - also for reference types - to be compatible with csc.
2375 2005-06-21 Martin Baulig <martin@ximian.com>
2377 * expression.cs (MemberAccess.DoResolve): Add support for nested
2378 types in a generic instance; fixes #75320.
2380 2005-06-20 Martin Baulig <martin@ximian.com>
2382 * generic.cs (TypeManager.InferType): Also walk the class
2383 hierarchy for generic instances; fixes #75261.
2385 2005-06-17 Martin Baulig <martin@ximian.com>
2387 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
2388 to make things work for corlib.
2390 2005-06-15 Martin Baulig <martin@ximian.com>
2392 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
2393 obsolete `SecurityAction' values.
2395 2005-06-06 Marek Safar <marek.safar@seznam.cz>
2397 * rootcontext.cs: Reset TargetExt as well.
2399 2005-06-09 Martin Baulig <martin@ximian.com>
2401 * delegate.cs (Delegate.VerifyMethod): Added
2402 `MethodGroupExpr old_mg' argument; inherit its
2403 `HasTypeParameters'; fix #75085.
2405 2005-06-09 Martin Baulig <martin@ximian.com>
2407 * expression.cs (Invocation.OverloadResolve): Correctly handle
2408 generic methods for the SetMemberIsUsed(); fix #75064.
2410 2005-06-09 Martin Baulig <martin@ximian.com>
2412 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
2415 2005-06-08 Martin Baulig <martin@ximian.com>
2417 * cs-parser.jay (nullable_type_or_conditional): If we put the
2418 nullable back and our `type' is a `ComposedCast', remove the
2419 nullable from it. Fixes #75156.
2421 * expression.cs (ComposedCast.RemoveNullable): New public method.
2423 2005-06-08 Martin Baulig <martin@ximian.com>
2425 The big Iterators rewrite :-)
2427 * iterators.cs: Rewrite this to use the anonymous methods framework.
2429 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
2430 before the TypeContainers; see 2test-21.cs.
2433 (TypeContainer.DefineType): Don't create a new EmitContext if we
2434 already have one (this only happens if we're an Iterator).
2435 (TypeContainer.Define): Also call Define() on all our iterators.
2436 (Method.CreateEmitContext): Added support for iterators.
2439 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
2440 (AnonymousContainer.CreateMethodHost): Moved here from
2441 AnonymousMethod and made abstract.
2442 (AnonymousContainer.CreateScopeType): New abstract method.
2443 (AnonymousContainer.IsIterator): New public property.
2444 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
2445 get the ScopeTypeBuilder rather than manually defining it here.
2446 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
2449 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
2450 before RootContext.DefineTypes().
2452 * codegen.cs (EmitContext.RemapToProxy): Removed.
2453 (EmitContext.CurrentAnonymousMethod): Changed type from
2454 AnonymousMethod -> AnonymousContainer.
2455 (EmitContext.ResolveTopBlock): Protect from being called twice.
2456 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
2457 (EmitContext.EmitThis): Removed the iterators hacks; use the
2458 anonymous methods framework for that.
2461 (ToplevelBlock.Container): Make this a property, not a field.
2462 (ToplevelBlock.ReParent): New public method; move the
2463 ToplevelBlock into a new container.
2464 (Foreach.TemporaryVariable): Simplify.
2466 2005-06-05 Martin Baulig <martin@ximian.com>
2468 * statement.cs (LocalInfo.CompilerGenerated): New flag.
2469 (Block.AddTemporaryVariable): New public method; creates a new
2470 `LocalInfo' for a temporary variable.
2471 (Block.EmitMeta): Create the LocalBuilders for all the temporary
2473 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
2474 non-iterator variables.
2476 2005-06-05 Martin Baulig <martin@ximian.com>
2478 * statement.cs (Foreach.TemporaryVariable): Create the
2479 LocalBuilder in the Emit phase and not in Resolve since in some
2480 situations, we don't have an ILGenerator during Resolve; see
2481 2test-19.cs for an example.
2483 2005-06-04 Martin Baulig <martin@ximian.com>
2485 The big Foreach rewrite - Part II.
2487 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
2488 with `PropertyInfo ienumerator_getcurrent'.
2490 * codegen.cs (VariableStorage): Removed.
2493 (Foreach): Derive from Statement, not ExceptionStatement.
2494 (Foreach.CollectionForeach): New nested class. Moved all the code
2495 dealing with collection foreach here.
2496 (Foreach.ForeachHelperMethods): Removed.
2497 (Foreach.TemporaryVariable): Implement IMemoryLocation.
2499 2005-05-23 Martin Baulig <martin@ximian.com>
2501 * statement.cs (Try.DoResolve): Don't create a `finally' if we
2502 don't need to. Fix #75014.
2504 2005-05-26 Raja R Harinath <rharinath@novell.com>
2506 Improve user-defined conversion handling.
2507 * convert.cs (GetConversionOperators): Rewrite. Return only the
2508 applicable operators.
2509 (AddConversionOperators): New. Helper for GetConversionOperators.
2510 (FindMostEncompassedType, FindMostEncompassingType): Verify that
2511 there is only one most encompassed/encompassing type.
2512 (FindMostSpecificSource, FindMostSpecificTarget): Remove
2513 "applicable operator" handling.
2514 (UserConversion): Move cache here from GetConversionOperators.
2515 Directly cache the chosen operator, rather than the whole
2517 (ExplicitNumericConversion): Fix buggy implementation of Decimal
2518 case. Allow conversion of decimal to sbyte and byte too.
2519 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2520 New static methods. Used to avoid allocating EmptyExpressions in
2523 2005-05-24 Duncan Mak <duncan@novell.com>
2525 * ecore.cs (CastFromDecimal): New class for casting a decimal to
2526 another class, used in Convert.ExplicitNumericConversion.
2527 (CastToDecimal): New class, similar to above, but casts to
2528 System.Decimal, used in Convert.ImplicitNumericConversion and also
2529 in explicit convesion from double/float to decimal.
2531 * convert.cs (ImplicitNumericConversion): Handle implicit
2532 conversions to System.Decimal.
2533 (ExplicitNumericConversion): handle explicit conversions to
2538 2005-05-20 Miguel de Icaza <miguel@novell.com>
2540 * typemanager.cs: Do not throw an exception in the TypeBuilder
2541 case, we take care of it on the TypeCode.
2543 2005-05-17 Marek Safar <marek.safar@seznam.cz>
2545 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
2548 * cs-parser.jay: Catch more lexical errors.
2550 * report.cs: Add one more Error method.
2553 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
2555 2005-05-20 Martin Baulig <martin@ximian.com>
2557 * class.cs (TypeContainer.CircularDepException): Removed.
2558 (TypeContainer.DefineType): Removed the `InTransit' stuff.
2559 (TypeContainer.CheckRecursiveDefinition): Check for circular class
2560 (CS0146) and interface (CS0529) dependencies here.
2562 2005-05-20 Martin Baulig <martin@ximian.com>
2564 * expression.cs (New.DoResolve): Move the CS0712 check above the
2565 CS0144 check; otherwise it can never be reached.
2567 2005-05-20 Martin Baulig <martin@ximian.com>
2569 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
2571 2005-05-20 Martin Baulig <martin@ximian.com>
2573 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
2575 * typemanager.cs (TypeManager.IsAttributeType): New public method.
2577 2005-05-19 Martin Baulig <martin@ximian.com>
2580 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
2581 to disable error reporting.
2583 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
2584 here since we don't want to report an error; see the new test-336.cs.
2586 2005-05-19 Raja R Harinath <rharinath@novell.com>
2588 * statement.cs (ToplevelBlock.GetParameterReference)
2589 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
2590 Move here from class Block.
2591 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
2592 * expression.cs (ParameterReference.DoResolveBase): Likewise.
2594 2005-05-18 Martin Baulig <martin@ximian.com>
2599 (FlowBranching.Reachability): Add non-static public And() and Or()
2601 (FlowBranchingSwitch): New class; do the `break_origins' thing
2602 like in FlowBranchingLoop.
2603 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
2604 reachability, not just locals and parameters.
2605 (FlowBranching.MergeChild): Remove some of the hacks for loop and
2606 switch; MergeBreakOrigins() now takes care of that.
2608 2005-05-18 Martin Baulig <martin@ximian.com>
2610 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2611 a loop and may leave it, reset the barrier; fixes #74974.
2613 2005-05-16 Raja R Harinath <rharinath@novell.com>
2615 Fix test-382.cs. Emit values of decimal constants.
2616 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
2618 (TypeContainer.AddField): ... this.
2619 (TypeContainer.EmitFieldInitializers): Allow the list of fields
2620 with initializers to include 'Const's.
2621 (ClassPart.RegisterFieldForInitialization): Forward to
2623 * const.cs (Const.Const): Pass initializer to base class.
2624 (Const.Define): In case of decimal constants, register them for
2625 initialization in a static constructor.
2627 2005-05-14 Martin Baulig <martin@ximian.com>
2629 * statement.cs (Block.Resolve): Correctly handle unreachable code;
2630 do not call ResolveUnreachable() on unreachable statements in
2631 here, see the comment in the source code.
2633 2005-05-13 Raja R Harinath <rharinath@novell.com>
2636 * expression.cs (BinaryResolveOperator): If one of the operands of
2637 an equality comparison is 'null' and the other is a pointer type,
2638 convert the null to a NullPointer.
2639 * convert.cs (ImplicitReferenceConversion): If the expression is a
2640 NullLiteral and the target type is a pointer type, return a
2641 NullPointer instead.
2642 (ImplicitConversionStandard): Likewise.
2644 2005-05-13 Marek Safar <marek.safar@seznam.cz>
2646 * cs-parser.jay: Set readonly context based on special constructs.
2648 * expression.cs (LocalVariableReference.DoResolveBase): Improved
2649 readonly variable error handling.
2651 * rootcontext.cs (EmitCode): Don't verify members when error
2654 * statement.cs (LocalInfo): Add reaodnly context information.
2655 (SetReadOnlyContext, GetReadOnlyContext): New methods.
2657 2005-05-17 Martin Baulig <martin@ximian.com>
2659 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
2662 2005-05-13 Martin Baulig <martin@ximian.com>
2664 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
2665 handle unreachable blocks.
2667 2005-05-13 Martin Baulig <martin@ximian.com>
2670 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
2671 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
2674 2005-05-13 Martin Baulig <martin@ximian.com>
2676 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
2677 instance variable, not a local. Fix #74873.
2678 (Block.ResolveUnreachable): Set it to true here.
2680 2005-05-12 Martin Baulig <martin@ximian.com>
2682 * cs-parser.jay (property_declaration): Pass the `current_class',
2683 not the `current_container' to Property's .ctor. Fixes #74912.
2685 2005-05-11 Martin Baulig <martin@ximian.com>
2687 * typemanager.cs (Closure): Copy this from MCS and merge all the
2688 GMCS-specific changes into it.
2690 2005-05-12 Raja R Harinath <harinath@gmail.com>
2693 * typemanager.cs (unmanaged_enclosing_types): New.
2694 (IsUnmanagedType): Avoid infloops by using
2695 'unmanaged_enclosing_types' to talk with recursive invocations.
2697 2005-05-11 Duncan Mak <duncan@novell.com>
2699 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
2700 continuing to process for 'arg'.
2701 (handle_preprocessing_directive): Check the argument of the #endif
2702 directive and report error CS1025 if there are any trailing
2705 According to the C# spec, having even whitespace after the #endif
2706 directive is illegal; however, because we call arg.TrimEnd ()
2707 beforehand, we have the same behavior as csc, allowing whitespace
2708 after the directive.
2712 2005-05-11 Marek Safar <marek.safar@seznam.cz>
2716 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
2717 (Constructor.GetObsoleteAttribute): Implemented correctly.
2719 2005-05-10 Martin Baulig <martin@ximian.com>
2721 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
2722 resolve the type; fixes #74864.
2723 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
2724 in DoResolve(); fixes #74862.
2726 2005-05-10 Martin Baulig <martin@ximian.com>
2728 * support.cs (ReflectionParameters.ParameterModifier): Use
2729 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
2730 and `ParameterAttributes.In'. Fixes #74884.
2732 2005-05-10 Martin Baulig <martin@ximian.com>
2734 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
2735 the cache if we're just looking for `MemberTypes.NestedType' in a
2738 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
2739 constraints if we're still resolving the type tree.
2740 (Expression.MemberLookup): If we're resolving the type tree, only
2741 look for `MemberTypes.NestedType' since we're only interested in
2744 * class.cs (TypeContainer.DefineType): Don't resolve the type
2745 parameters here; do this later in ResolveType() after the type
2746 tree has been resolved.
2747 (TypeContainer.ResolveType): New public method; this is called
2748 after the type tree is resolved and before the types are being
2749 populated. We resolve the generic constraints here.
2750 (TypeContainer.DoDefineMember): Check the constraints on our base
2751 class and interfaces.
2753 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
2754 set the `ResolvingTypeTree' flag on the EmitContext.
2756 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
2758 2005-05-10 Marek Safar <marek.safar@seznam.cz>
2760 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
2762 * expression.cs (Argument.GetParameterModifier): Turned to property.
2763 (Invocation.Error_InvalidArguments): Add more descriptive errors.
2765 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
2768 2005-05-09 Raja R Harinath <rharinath@novell.com>
2771 * decl.cs (MemberCache.AddMethods): Register override methods,
2772 rather than non-override methods.
2773 * typemanager.cs (RegisterOverride): New.
2774 (IsOverride): Update.
2776 2005-05-09 Marek Safar <marek.safar@seznam.cz>
2778 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
2780 2005-05-06 Martin Baulig <martin@ximian.com>
2783 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
2784 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
2786 2005-05-09 Marek Safar <marek.safar@seznam.cz>
2790 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
2791 recursive declaration.
2793 * statement.cs (Block.ResolveMeta): Report any error in resolving.
2795 2005-05-06 Marek Safar <marek.safar@seznam.cz>
2797 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
2799 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
2801 2005-05-05 Raja R Harinath <rharinath@novell.com>
2804 * decl.cs (DeclSpace.FamilyAccessible):
2805 Use TypeManager.IsNestedFamilyAccessible.
2807 Fix reopened #64812.
2808 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
2811 2005-05-04 Raja R Harinath <rharinath@novell.com>
2812 Abin Thomas <projectmonokochi@rediffmail.com>
2813 Anoob V E <projectmonokochi@rediffmail.com>
2814 Harilal P R <projectmonokochi@rediffmail.com>
2817 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
2818 allow access to all static members.
2820 2005-05-04 Martin Baulig <martin@ximian.com>
2822 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
2824 2005-05-04 Martin Baulig <martin@ximian.com>
2828 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
2829 section at the end; make things work if `default' is not the last
2832 2005-05-04 Martin Baulig <martin@ximian.com>
2836 * statement.cs (Switch): Replaced the `got_default' field with a
2837 `default_section' one.
2838 (Switch.CheckSwitch): Set `default_section' here.
2839 (Switch.Resolve): If we're a constant switch and the constant is
2840 not found, use the default section.
2842 2005-05-03 Martin Baulig <martin@ximian.com>
2844 * expression.cs (ArrayAccess.EmitGetLength): New public method.
2846 * statement.cs (Foreach.ArrayForeach): New nested class.
2847 (Foreach.TemporaryVariable): New nested class.
2848 (Foreach.EmitArrayForeach): Removed; this is now in the new
2851 2005-05-03 Raja R Harinath <rharinath@novell.com>
2853 * pending.cs (BaseImplements): Move the #74773 fix here. This is
2855 (VerifyPendingMethods): Revert change below.
2857 * typemanager.cs (IsOverride, RegisterNonOverride): New.
2858 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
2859 that used to trigger warning -28. Remove warning -28.
2860 * expression.cs (Invocation.OverloadResolve): Use
2861 TypeManager.IsOverride to distinguish override methods.
2864 * pending.cs (VerifyPendingMethods): If a base type implements the
2865 requested interface, don't bother checking individual methods of
2866 the base type. As a side-effect, this prevents the creation of
2867 unnecessary proxies.
2869 2005-05-02 Martin Baulig <martin@ximian.com>
2873 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
2874 Also `And' the locals if the old vector is null.
2875 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
2876 null; in this case we basically reset all the variables.
2878 2005-05-02 Martin Baulig <martin@ximian.com>
2882 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
2883 Added `FlowBranching branching' argument; always `and' the
2884 variables instead of `or'ing them unless we're an infinite loop.
2886 * statement.cs (While.Resolve): Create a new sibling unless we're
2889 2005-05-02 Martin Baulig <martin@ximian.com>
2893 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
2894 arguments; use it instead of creating a new TopLevelBlock.
2895 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
2896 our ConstructorInitializer.
2899 (TopLevelBlock.TopLevelBranching): New public property.
2900 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
2901 and create our `TopLevelBranching'.
2903 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
2904 anonymous method host, use `block.TopLevelBranching' rather than
2905 creating a new branching.
2907 2005-04-20 Miguel de Icaza <miguel@novell.com>
2909 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
2910 a ScopeInfo, if any of the current children is a child of the new
2911 entry, move those children there.
2913 2005-04-30 Martin Baulig <martin@ximian.com>
2915 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
2916 at the beginning of a SwitchSection. Fix #73335.
2918 2005-04-27 Marek Safar <marek.safar@seznam.cz>
2921 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
2923 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
2924 (FieldExpr.DoResolve): Obsolete members are ignored for field
2927 2005-04-26 Marek Safar <marek.safar@seznam.cz>
2929 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
2930 of arrays detection.
2932 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
2934 (Field.VerifyClsCompliance): Volatile fields are not compliant.
2936 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
2939 2005-04-25 Ben Maurer <bmaurer@ximian.com>
2941 * cs-parser.jay: Use the prefered version of -unsafe in error
2944 2005-04-22 Marek Safar <marek.safar@seznam.cz>
2946 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
2949 2005-04-20 John Luke <john.luke@gmail.com>
2951 * driver.cs: fix typo in error message, --outout to --output
2953 2005-04-30 Martin Baulig <martin@ximian.com>
2955 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
2956 handle the .NET 2.x security attributes.
2958 2005-04-30 Martin Baulig <martin@ximian.com>
2961 (TypeManager.ExpandInterfaces): Don't add things twice.
2964 (TypeContainer.VerifyClsCompliance): Allow generic instances.
2966 2005-04-29 Martin Baulig <martin@ximian.com>
2968 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
2970 * anonymous.cs: Added support for anonymous generic methods.
2972 2005-04-29 Martin Baulig <martin@ximian.com>
2974 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
2977 2005-04-29 Martin Baulig <martin@ximian.com>
2979 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
2981 * expression.cs (New.DoResolve): Fix the CS0304 check.
2983 2005-04-29 Martin Baulig <martin@ximian.com>
2985 * typemanager.cs (TypeManager.GetFullName): Updated to the new
2988 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
2989 explicit interface implementation, compare the interface types.
2990 (MethodData.Define): Use the new naming scheme from the latest
2992 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
2994 * decl.cs (MemberName.GetMemberName): Removed.
2995 (MemberName.MethodName, FullName): New properties.
2997 2005-04-25 Raja R Harinath <rharinath@novell.com>
2999 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3001 2005-04-22 Martin Baulig <martin@ximian.com>
3003 * generic.cs (GenericMethod): Create the EmitContext in the
3004 `Define()'; in `Define(MethodBuilder)', create the type parameters
3005 before calling `Define()'. Fixes #73933.
3007 2005-04-22 Martin Baulig <martin@ximian.com>
3010 (Constraints.Resolve): Make things work wrt. the new type lookup system.
3011 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3013 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3014 ConstructedType, check its constraints.
3016 2005-04-20 Marek Safar <marek.safar@seznam.cz>
3018 * codegen.cs (InRefOutArgumentResolving): New field.
3020 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3021 fields outside contructor.
3023 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3025 2005-04-19 Miguel de Icaza <miguel@novell.com>
3027 * anonymous.cs (CaptureContext.EmitParameterInstance): The
3028 parameter code was not completed ever, so it was not as up-to-date
3029 as local variables. Must finish it.
3031 The bug fix was to compare the Toplevel of the block, not the
3032 current block. Thanks for Ben for pointing this out.
3034 2005-04-19 Raja R Harinath <rharinath@novell.com>
3036 * decl.cs (AddMethods): Use the declaring type of the problem
3037 method to determine if we want to squash a warning.
3039 2005-04-19 Marek Safar <marek.safar@seznam.cz>
3041 * attribute.cs: Removed debug output.
3043 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3045 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3048 2005-04-18 Raja R Harinath <rharinath@novell.com>
3051 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
3052 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
3053 all null comparisons against reference types.
3055 2005-04-18 Marek Safar <marek.safar@seznam.cz>
3058 * class.cs (TypeContainer.CircularDepException) New nested
3060 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
3061 (TypeContainer.DefineType): Removed error, reset InTransit before
3063 (Class.DefineType): Throw exception when is in Transit.
3064 Catch exception and report error.
3065 (Struct.DefineType): Throw exception when is in Transit.
3066 Catch exception and report error.
3067 (Interface.DefineType): Throw exception when is in Transit.
3068 Catch exception and report error.
3070 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
3071 handle nested exception handlers.
3073 * flowanalysis.cs (InTryWithCatch): New method, search for try with
3076 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
3077 InFinally and InCatch storage.
3079 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
3080 (Catch.Resolve): Set and Restore ec.InCatch.
3081 (Try.Resolve): Set and Restore ec.InFinally.
3082 (Try.HasCatch): True when try has catch.
3084 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
3086 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
3087 for the same event member, so exclude such cases from warning 419.
3090 2005-04-16 Miguel de Icaza <miguel@novell.com>
3092 * expression.cs (Binary.ResolveOperator): Apply patch from John
3093 Luke to fix bug 59864: operators &, | and ^ on enumerations
3094 require that the same enum type on both sides.
3096 * driver.cs: Add warnings to old flag usage, this is to assist
3097 people who produce Makefiles and hope that the Makefiles will be
3100 * class.cs (TypeContainer.EmitType): Moved the definition of the
3101 special $PRIVATE$ field from the resolve phase to the Emit phase.
3102 During resolve we do not know if we are a struct with
3103 HasExplicitLayout, we know this only after the attributes for the
3106 Set the FieldOffset to zero on the dummy field that we create for
3107 the class. Fixes 74590.
3109 2005-04-16 Raja R Harinath <rharinath@novell.com>
3112 * ecore.cs (PropertyExpr.resolved): New.
3113 (DoResolve): Use it to handle a case of double resolution here.
3114 Handle a case of identical-name-and-type-name.
3115 * expression.cs (ArrayCreation.CheckIndices): Avoid double
3116 resolution by storing the results of expression resolution back
3117 into the "probes" array.
3119 2005-04-15 Raja R Harinath <rharinath@novell.com>
3121 Fix cs0208-7.cs and cs0208-8.cs.
3122 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
3123 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
3124 error reporting to point out the reason a struct is not unmanaged.
3126 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3128 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
3129 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
3131 2005-04-13 Raja R Harinath <rharinath@novell.com>
3134 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
3135 IdenticalNameAndTypeName here.
3136 (EventExpr.InstanceResolve): Likewise.
3138 2005-04-13 Marek Safar <marek.safar@seznam.cz>
3140 C# 2.0 DefaultCharSetAttribute implementation
3142 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
3143 which allows us to set GlobalNamespace for every resolve.
3144 (Attribute.ResolveArguments): Cut from Resolve.
3145 (Attribute.GetCharSetValue): Returns CharSet named argument.
3146 (Attribute.DefinePInvokeMethod): Gets default charset from
3148 (GlobalAttribute.ResolveAsTypeStep): Override.
3149 (GlobalAttribute.ResolveArguments): Override.
3151 * class.cs (TypeAttr): Is protected.
3153 * codegen.cs (ModuleClass.DefaultCharSet): New member.
3154 (ModuleClass.DefaultCharSetType): New memeber.
3155 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
3157 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
3158 charset from module.
3160 * delegate.cs (TypeAttr): Override.
3161 (Delegate.DefineType): Use this TypeAttr.
3163 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
3164 at very early stage (before types are defined) to resolve model
3165 module attributes. It will probably not work with corlib but it
3168 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
3169 charset from module.
3171 * typemanager.cs (default_charset_type): New type.
3173 2005-04-13 Raja R Harinath <rharinath@novell.com>
3175 * decl.cs (MemberCache.AddMethods): Don't warn if
3176 System.Object.Finalize has buggy MethodAttributes.
3178 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
3181 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3183 * doc.cs : detect ambiguous reference to overloaded members.
3184 Fixed bug #71603. MS 1.1 csc does not detect it.
3186 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3188 * doc.cs : delegates must not be referenced with parameters.
3191 2005-04-12 Miguel de Icaza <miguel@novell.com>
3193 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
3195 2005-04-10 Miguel de Icaza <miguel@novell.com>
3197 * driver.cs (MainDriver): Stop processing if the CLS stage found
3200 (CompilerCallableEntryPoint.InvokeCompiler): Always
3201 reset after execution; Take a TextWriter argument for the
3204 * report.cs: Use the error stream instead of hardcoding stderr.
3206 2005-04-09 Miguel de Icaza <miguel@novell.com>
3208 * class.cs: Reduce code paths to test, too small of an
3209 optimization to make it worth the extra testing. Always perform
3212 2005-04-08 Raja R Harinath <rharinath@novell.com>
3215 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
3216 operators that had errors reported on them.
3218 2005-04-08 Marek Safar <marek.safar@seznam.cz>
3220 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
3222 (Attribute.Resolve): Add named argument type checking.
3224 * class.cs (FixedField.Define): Use IsPrimitiveType
3226 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
3228 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
3229 unsafe parameter types.
3231 * statement.cs (Using.ResolveExpression): Add better error description.
3233 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
3235 2005-04-08 Raja R Harinath <rharinath@novell.com>
3238 * attribute.cs (Attribute.GetAttributeUsage): Resolve
3239 AttributeUsageAttribute in the emitcontext of the attribute class,
3240 not in the emitcontext of the attributable entity it was attached to.
3241 * cs-parser.jay: Use 'current_class', not 'current_container',
3242 when creating a GlobalAttribute.
3244 2005-04-08 Alp Toker <alp@atoker.com>
3246 * pending.cs: The fix to #58413 failed to compile methods implementing
3247 interfaces with/without params modifiers and vice versa, even though
3248 params modifiers aren't part of the signature. Make the modifier check
3249 less strict as in csc.
3251 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
3252 Anoob V E <projectmonokochi@rediffmail.com>
3253 Harilal P R <projectmonokochi@rediffmail.com>
3256 * pending.cs (TypeAndMethods.mods): New. Store the parameter
3257 modifiers of pending methods.
3258 (PendingImplementation.PendingImplementation): Initialize it.
3259 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
3260 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
3261 with ParameterData. Add check for modifiers.
3262 * class.cs (MethodData.Define): Update to changes.
3264 2005-04-07 Raja R Harinath <rharinath@novell.com>
3266 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
3268 2005-04-07 Marek Safar <marek.safar@seznam.cz>
3270 * class.cs (PropertyMethod.Define): Check private accessor in abstract
3273 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
3276 * typemanager.cs: Registered RequiredAttributeAttribute.
3278 2005-04-06 Marek Safar <marek.safar@seznam.cz>
3280 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
3281 Warning CS0169 is back at level 3.
3282 (IMethodData.SetMemberIsUsed): New method.
3284 * decl.cs (IsUsed): New value; moved from FieldBase.Status
3285 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
3287 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
3289 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
3291 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
3294 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
3297 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
3298 to avoid the problems with nested types.
3300 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
3301 Anoob V.E <projectmonokochi@rediffmail.com>
3302 Harilal P.R <projectmonokochi@rediffmail.com>
3303 Raja R Harinath <rharinath@novell.com>
3306 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
3308 * typemanager (GetConstructor): Make public.
3310 2005-04-05 John Luke <john.luke@gmail.com>
3311 Raja R Harinath <rharinath@novell.com>
3314 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
3315 struct too. Return false quicker in a few cases.
3316 (VerifyUnManaged): Use it.
3318 2005-04-05 Raja R Harinath <rharinath@novell.com>
3321 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
3322 not 'unreachable_seen'.
3324 2005-04-04 Marek Safar <marek.safar@seznam.cz>
3326 * attribute.cs (Attribute.GetValue): Removed unused.
3328 * codegen.cs (CodeGen.TrimExt): Removed unused.
3330 * cs-parser.jay (output): Removed unused.
3332 * cs-tokenizer.cs (hex_digits): Removed unused.
3334 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
3336 * expression.cs (Indirection.LoadExprValue): Removed unused.
3337 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
3339 * iterators.cs (Iterator.param_types): Removed unused.
3341 * statement.cs (Goto.block): Removed unused.
3342 (ToplevelBlock.did): Removed unused.
3343 (Switch.ResolveConstantSwitch): Removed unused.
3345 2005-04-01 Ben Maurer <bmaurer@ximian.com>
3347 * rootcontext.cs: Allow mcs to bootstrap with the compilation
3350 2005-04-19 Martin Baulig <martin@ximian.com>
3352 Merged r42462 from MCS and made it work for GMCS.
3354 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
3356 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
3358 2005-04-01 Raja R Harinath <rharinath@novell.com>
3360 Fix #74232 and cs0208-3.cs.
3361 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
3362 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
3363 unmanaged type. Don't use FieldBuilders when 't' is a
3364 TypeBuilder. Use ModFlags and MemberType fields.
3365 * class.cs (MemberBase.member_type): Rename from MemberType.
3366 (MemberBase.MemberType): New property. Determines member_type on
3368 (MemberBase.DoDefine): Don't initialize MemberType here.
3369 (FieldMember.Define): Likewise.
3371 2005-04-01 Marek Safar <marek.safar@seznam.cz>
3374 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
3375 Attributes are emitted there.
3377 2005-04-01 Raja R Harinath <rharinath@novell.com>
3379 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
3380 keyword in 'partial enum' too.
3381 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
3383 Report from Kamil Skalski <nazgul@omega.pl>.
3386 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
3387 have partial containers too.
3389 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
3390 in block' checks to Block.CheckInvariantMeaningInBlock.
3391 * statement.cs (Block.GetKnownVariableInfo): Make private.
3392 (Block.IsVariableUsedInChildBlock): Remove.
3393 (Block.IsVariableUsedInBlock): Likewise.
3394 (Block.CheckInvariantMeaningInBlock): New. Show location of
3395 conflicting declaration.
3396 (Block.AddVariable): Make error messages less long-winded and more
3397 specific. Show location of conflicting declaration.
3398 * parameter.cs (Parameters.Location): New readonly property.
3400 2005-03-31 Raja R Harinath <rharinath@novell.com>
3402 Clean up semantics of invoking ResolveMemberAccess.
3403 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
3404 can have an instance, ensure that we pass in a non-TypeExpression
3405 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
3406 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
3407 argument. Update to changes and simplify.
3408 (FieldExpr.Emitinstance): Remove CS0120 check.
3409 (PropertyExpr.EmitInstance): Likewise.
3410 * expression.cs (Argument.Resolve): Likewise.
3411 (Invocation.DoResolve): Update to changes in semantics of
3414 2005-03-31 Marek Safar <marek.safar@seznam.cz>
3417 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
3420 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
3422 2005-03-31 Raja R Harinath <rharinath@novell.com>
3424 Fix difference in behaviour with commandline invocation.
3425 * driver.cs (Driver.Reset): New.
3426 (CompilerCallableEntryPoint): Call it.
3428 * statement.cs (If.Resolve): Avoid spurious "uninitialized
3429 variable" warnings if the boolean expression failed to resolve.
3431 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
3433 * attribute.cs: Fix the union of several permissions when some of them
3434 are unrestricted (so the result isn't an unrestricted permission set).
3437 2005-03-30 Raja R Harinath <rharinath@novell.com>
3439 * ecore.cs (MemberExpr): New class. Convert from interface
3441 (MemberExpr.ResolveMemberAccess): Refactor and move here from
3442 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
3444 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
3445 (MethodGroupExpr.IsExplicitImpl): Remove.
3446 (Expression.GetFieldFromEvent): Remove.
3447 (SimpleName.MemberStaticCheck): Remove.
3448 (SimpleName.DoSimpleNameResolve): Update to changes.
3449 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
3450 (MemberAccess.IdenticalNameAndTypeName): Remove.
3451 (MemberAccess.error176): Move to MemberExpr.
3452 (MemberAccess.DoResolve): Update to changes.
3453 (BaseAccess.DoResolve): Likewise.
3455 2005-03-30 Marek Safar <marek.safar@seznam.cz>
3457 C# 2.0 Conditional attribute class implementation
3459 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
3460 Analyzes class whether it has attribute which has ConditionalAttribute
3461 and its condition is not defined.
3463 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
3464 (Class.IsExcluded): New method. Search for at least one defined
3465 condition in ConditionalAttribute of attribute class.
3467 2005-03-30 Raja R Harinath <rharinath@novell.com>
3469 * ecore.cs (PropertyExpr): Derive from Expression, not
3470 ExpressionStatement.
3471 (PropertyExpr.EmitStatement): Remove.
3473 2005-03-29 Raja R Harinath <rharinath@novell.com>
3476 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
3477 internal field "value__" of an enum be private. The examples for
3478 "value__" that I found on MSDN all used FieldAttributes.Private.
3480 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
3481 Don't mention IL method attribute names.
3483 Fix #47991. Remove a TODO.
3484 * statement.cs (Block.Toplevel): Make into a field.
3485 (Block.Parameters): Move into ToplevelBlock.
3486 (Block.known_variables): Rename from child_variable_names.
3487 (Block.Block): Remove variants that take Parameters. Initialize
3488 'Toplevel' with the immediately surrounding toplevel block.
3489 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
3490 LocalInfo parameter.
3491 (Block.GetKnownVariableInfo): New.
3492 (Block.IsVariableNameUsedInChildBlock): Update.
3493 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
3494 the block, even though it may not be in scope.
3495 (Block.AddVariable): Remove Parameters parameter. Use
3496 Toplevel.Parameters instead.
3497 (Block.AddConstant): Remove Parameters parameter.
3498 (Block.GetParameterReference): Update to use Toplevel.Parameters.
3499 (Block.IsParamaterReference): Likewise.
3500 (Block.IsLocalParameter): Likewise. Simplify a lot.
3501 (ToplevelBlock.Parameters): New. Moved from Block.
3502 (ToplevelBlock.ToplevelBlock): Update to changes. Always
3503 initialize Parameters to a non-null value.
3504 * cs-parser.jay: Update to changes.
3505 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
3506 simple names that mean different things in the same block. Use
3507 Block.IsVariableNameUsedInBlock.
3509 2005-03-28 Raja R Harinath <rharinath@novell.com>
3511 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
3513 2005-03-26 Raja R Harinath <harinath@acm.org>
3516 * assign.cs (Assign.DoResolve): When the RHS of an assignment
3517 fails to resolve, ensure that the LHS is still resolved as an
3520 2005-03-25 Raja R Harinath <harinath@acm.org>
3522 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
3524 (Enum.current_ec): Remove.
3525 (Enum.LookupEnumValue): Remove EmitContext argument.
3526 Just uses the one created during DefineType.
3527 (Enum.FindMembers): Update.
3528 * expression.cs (MemberAccess.DoResolve): Update.
3530 2005-03-22 Marek Safar <marek.safar@seznam.cz>
3532 * assign.cs (Assign.DoResolve): Check for CS1717 when
3533 source and target are same (uses Equals).
3535 * expression.cs (LocalVariableReference, ParameterReference,
3536 This): Implemented Equals, GetHashCode.
3538 * statement.cs (Block.GetParameterReference): Removed useless
3541 2005-03-22 Raja R Harinath <rharinath@novell.com>
3544 * statement.cs (Block.AddVariable): Ensure that we skip implicit
3545 blocks before deciding whether the error is cs0136 or cs0128.
3547 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
3548 (using_alias_directive, using_namespace_directive): Pass
3549 MemberName, not an expression to Namespace.UsingAlias and
3551 (MakeName): Use the MemberName of the namespace.
3552 * namespace.cs (Namespace.MemberName): New.
3553 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
3554 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
3556 * decl.cs (MemberName.Name): Make readonly.
3557 (MemberName.FromDotted): New "constructor".
3558 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
3559 (MemberCore.Name): Compute from MemberName on demand.
3560 (MemberCore.SetMemberName): Provide a way to change the
3562 (MemberCore.AddToContainer): Don't take a fullname parameter.
3563 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
3564 fully qualified name of the container to the member name.
3565 (TypeContainer.AddToTypeContainer): Use a fully qualified name
3566 only if the type is a member of the root container.
3567 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
3568 MemberName.Left rather than searching for an embedded ".".
3569 (PartialContainer.CreatePart): Update to changes in RootContext.
3570 (MemberBase.ShortName): Turn into a property. Use
3571 MemberCore.SetMemberName.
3572 (MemberBase.ExplicitInterfaceName): Remove.
3573 (MemberBase.UpdateMemberName): Remove.
3574 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
3575 (PropertyBase.SetMemberName): New override.
3576 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
3577 (Tree.GetDecl): New.
3578 (Tree.AllDecls): Rename from Decls.
3579 * attribute.cs, enum.cs, report.cs: Update to changes.
3580 * driver.cs (MainDriver): Use MemberName.FromDotted on
3581 RootContext.MainClass.
3583 2005-03-21 Marek Safar <marek.safar@seznam.cz>
3585 * class.cs (FixedField.Define): Check for CS1664 and more sanity
3588 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
3590 2005-03-18 Marek Safar <marek.safar@seznam.cz>
3592 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
3593 property accessor modifiers.
3595 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
3596 fixed buffer attribute (CS1716).
3597 (PropertyMethod.HasCustomAccessModifier): When property accessor
3598 has custom modifier.
3600 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
3602 (PropertyExpr.DoResolveLValue): Add CS0272.
3604 2005-03-17 Miguel de Icaza <miguel@novell.com>
3606 * convert.cs: When converting to a pointer, use the proper Conv.U
3607 or Conv.I depending on the source data type.
3609 * cs-tokenizer.cs: Make the size for large decimal constants,
3612 2005-03-17 Martin Baulig <martin@ximian.com>
3614 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3615 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
3617 2005-03-17 Martin Baulig <martin@ximian.com>
3619 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3620 to bool so we can return an error condition.
3621 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3624 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
3626 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
3629 2005-03-16 Raja R Harinath <rharinath@novell.com>
3631 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
3632 Refactor to avoid traversing the list of assemblies, and to avoid
3633 string concatenation.
3634 * typemanager.cs (guid_attr_type): Remove.
3635 (negative_hits, pointers, references): Remove hashes.
3637 (GetConstructedType): New. Uses type_hash to handle constructed
3638 types (arrays, references, pointers).
3639 (GetReferenceType, GetPointerType): Use it.
3640 (GetNestedType): New. Uses type_hash to handle nested types of
3642 (LookupType, LookupTypeDirect): Remove.
3643 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
3644 'types' hash and LookupTypeReflection directly.
3645 (params_string, params_object): Use GetConstructedType.
3646 * namespace.cs (Namespace.cached_types): New. Cache of reflected
3648 (Namespace.Lookup): Use cached_types.
3649 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
3650 provided by old TypeManager.LookupType.
3651 * rootcontext.cs (MakeFQN): Remove.
3652 * decl.cs (DeclSpace.MakeFQN): Likewise.
3653 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
3654 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
3655 TypeManager.GetConstructedType.
3656 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
3658 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
3660 * cs-parser.jay: Fix build.
3662 2005-03-15 Marek Safar <marek.safar@seznam.cz>
3664 * class.cs (TypeContainer.CircularDepException) New nested
3665 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
3667 * cs-parser.jay: Reports CS1527 for any namespace element.
3669 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
3672 * expression.cs (ParameterReference.IsAssigned): Changed error to
3674 (Error_WrongNumArguments): Moved CS0245 detection here.
3676 * statement.cs (Return.Resolve): Add CS1622 report.
3678 2005-03-11 Marek Safar <marek.safar@seznam.cz>
3680 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
3682 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
3684 * attribute.cs expression.cs: Get rid of some allocations.
3686 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
3688 * doc.cs : just eliminate the latest change.
3690 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
3692 * doc.cs : commented out the latest change. It breaks xml-030.cs
3694 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
3696 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
3697 fail. So invoke CreateType() in FindDocumentedType().
3699 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
3701 * cs-tokenizer.cs : added IsKeyword().
3702 * doc.cs : Detect keyword incorrectly used as identifier.
3703 Allow identifiers prefixed by @.
3705 2005-03-10 Marek Safar <marek.safar@seznam.cz>
3707 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
3708 It caused exception in namespace resolving (again!).
3710 * class.cs (Class.ctor): Removed exit.
3711 (PropertyMethod.ctor): ditto.
3713 * codegen.cs (Codegen.Reset): Reset static data.
3714 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
3716 * cs-tokenizer.cs (Cleanup): Removed.
3718 * driver.cs (GetSystemDir): Rewrote to one line command.
3719 It caused problem with unloaded dynamic modules.
3720 (UnixParseOption): Removed Exit.
3721 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
3722 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
3723 Now can be mcs used as library.
3725 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
3728 * location.cs (Reset): Reset static data.
3730 * namespace.cs (Reset): Reset static data.
3732 * report.cs (Report.Reset): Reset static data.
3734 * rootcontext.cs (RootContext.Reset): Reset static data.
3736 * tree.cs (RootTypes.ctor): Use Location.Null
3738 * typemanager.cs (TypeManager.Reset): Reset static data.
3739 (CoreLookupType): Removed Exit.
3740 (TypeHandle.Reset): Reset static data.
3742 2005-03-10 Raja R Harinath <rharinath@novell.com>
3745 * typemanager.cs (ComputeNamespaces): Import namespaces from
3746 referenced modules too.
3748 2005-03-09 Raja R Harinath <rharinath@novell.com>
3750 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
3753 2005-03-09 Raja R Harinath <rharinath@novell.com>
3755 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
3756 enclosing DeclSpace. This ensures that a name-lookup populates
3757 more caches and there are fewer 'TypeExpression's. Carve out
3758 nested type lookup into ...
3759 (LookupNestedTypeInHierarchy): ... this.
3761 2005-04-15 Martin Baulig <martin@ximian.com>
3763 Merged r41590 from MCS and make it work in the generics land.
3765 * generic.cs (TypeParameter.UpdateConstraints): Removed the
3768 * class.cs (PartialContainer.UpdateConstraints): Removed.
3769 (PartialContainer.CheckConstraints): Removed.
3770 (PartialContainer.SetParameterInfo): Store the constraints here.
3771 (PartialContainer.DefineTypeParameters): New public method;
3772 resolve the type parameter's constraints here. Note that the
3773 PartialContainer doesn't have an EmitContext anymore, so we must
3774 do this in the ClassPart.
3776 2005-03-09 Raja R Harinath <rharinath@novell.com>
3778 Clean up a few partial-class semantics.
3779 Fixes test-357.cs and cs1618-2.cs.
3780 * cs-parser.jay (struct_declaration): Use 'current_class' as
3781 parent of newly-created struct. Remove call to Register ().
3782 Use 'pop_current_class' to complete handing the current struct.
3783 (interface_declaration): Likewise.
3784 (class_declaration): Likewise.
3785 (enum_declaration): Use 'current_class' as parent of newly created
3787 (delegate_declaration): Likewise.
3788 (pop_current_class): New function. This is used to handle closing
3789 up the 'current_class' and 'current_container', and pointing them
3790 to the enclosing class/container.
3791 (CSharpParser): Initialize 'current_class' too.
3792 * decl.cs (MemberCore): Add check for invariant: a partial
3793 container is not a parsed entity, and thus does not enclose any
3795 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
3796 (DeclSpace.BaseTypeExpr): Use it.
3797 (DeclSpace.LookupType): Add check for invariant.
3798 * class.cs (TypeContainer): Add check for invariant: a nested
3799 class should have the same NamespaceEntry as its enclosing class.
3800 (TypeContainer.EmitFieldInitializers): Make virtual.
3801 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
3803 (TypeContainer.Register): Remove.
3804 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
3805 null. Use TypeResolveEmitContext for resolving base types and
3806 interfaces. Move initialization of Parts.TypeBuilder here from
3808 (TypeContainer.DefineNestedTypes): ... here.
3809 (PartialContainer): Take a Namespace not a NamespaceEntry.
3810 (PartialContainer.Create): Don't use Register. Call the
3811 appropriate Add... function directly.
3812 (ClassPart): Take both the PartialContainer and the enclosing
3813 class as constructor arguments.
3814 (ClassPart.EmitFieldInitializers): Override.
3815 (ClassPart.PartFindNestedTypes): Remove.
3816 (FieldBase.GetInitializerExpression): Resolve the initializer
3817 expression in the emit context of the enclosing class.
3818 * tree.cs (RootTypes): Remove Register ().
3820 2005-03-08 Marek Safar <marek.safar@seznam.cz>
3822 * cs-parser.jay: Removed CS0134.
3824 * driver.cs: Removed CS1901.
3826 * expression.cs (SizeOf.DoResolve): Don't report CS0233
3827 for predefined types.
3829 2005-03-07 Duncan Mak <duncan@novell.com>
3831 * codegen.cs (Save): Catch UnauthorizedAccessException as
3832 well. Fixes bug #73454.
3834 2005-03-07 Marek Safar <marek.safar@seznam.cz>
3836 * cs-tokenizer.cs (xtoken): Add CS1035.
3838 * class.cs (MethodData.Define): Add CS0683.
3839 (FieldMember.ctor): Add CS0681.
3841 2005-03-07 Raja R Harinath <rharinath@novell.com>
3843 * ecore.cs (SimpleName.DoResolve): Rename from
3844 SimpleName.DoResolveAllowStatic.
3845 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
3846 Pass 'intermediate' flag to MemberStaticCheck.
3847 (SimpleName.MemberStaticCheck): Skip "static check" only in case
3848 of "intermediate" lookups via MemberAccess.
3849 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
3850 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
3852 2005-03-07 Raja R Harinath <rharinath@novell.com>
3855 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
3856 slipped in because of variable names that are identical to a
3857 builtin type's BCL equivalent ('string String;', 'int Int32;').
3858 (PropertyExpr.EmitInstance): Likewise.
3860 2005-03-04 Marek Safar <marek.safar@seznam.cz>
3862 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
3864 * report.cs (warning_ignore_table): Made public.
3866 2005-03-04 Raja R Harinath <rharinath@novell.com>
3869 * class.cs (MethodData.Emit): Pass 'container' to
3870 container.GetObsoleteAttribute instead of 'container.Parent'.
3872 2005-03-03 Marek Safar <marek.safar@seznam.cz>
3874 * cs-parser.jay: Add 1534 error test.
3876 * iterators.cs (Yield.CheckContext): Add error 1629.
3877 (Iterator.ctor): Save unsafe modifier.
3878 (MoveNextMethod.DoEmit): Restore unsafe context.
3880 * namespace.cs (UsingAlias): Better error message.
3882 2005-03-03 Dan Winship <danw@novell.com>
3884 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
3885 the warning message [#73219]
3887 2005-03-03 Raja R Harinath <rharinath@novell.com>
3889 Fix compile with MCS 1.0.0.0.
3890 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
3891 w_restore to not depend on string constant folding.
3893 2005-03-03 Raja R Harinath <rharinath@novell.com>
3895 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
3896 CS0246 check to users who passed 'silent = false'.
3897 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
3899 (SimpleName.SimpleNameResolve): Update.
3900 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
3901 (MemberAccess.IdenticalNameAndTypeName): Update.
3902 * doc.cs (FindDocumentedTypeNonArray): Update.
3904 2005-03-03 Raja R Harinath <rharinath@novell.com>
3906 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
3907 * parameters.cs (ComputeAndDefineParameters): Remove.
3908 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
3909 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
3910 Use GetParameterInfo.
3912 2005-03-02 Marek Safar <marek.safar@seznam.cz>
3914 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
3916 2005-03-02 Raja R Harinath <rharinath@novell.com>
3918 Unify DeclSpace.LookupType and DeclSpace.FindType.
3919 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
3920 is in charge of defining nested types on demand.
3921 (DeclSpace.LookupType): Use it when the current_type is a
3922 TypeBuilder. Use LookupTypeDirect for reflected types.
3923 (DeclSpace.FindType): Remove.
3924 (DeclSpace.LookupInterfaceOrClass): Likewise.
3925 (DeclSpace.DefineTypeAndParents): Likewise.
3926 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
3927 DeclSpace.LookupType.
3928 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
3929 * typemanager.cs (LookupType): Simplify.
3930 (AddUserType): Remove type from negative_hits.
3931 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
3932 * class.cs (TypeContainer.FindMembers): Move handling of nested
3934 (TypeContainer.FindMembers_NestedTypes): ... here.
3935 (TypeContainer.FindNestedType): Implement override.
3936 (ClassPart.FindNestedType): Delegate to PartialContainer.
3937 (ClassPart.PartFindNestedType): Looks up the nested types of the
3940 2005-04-14 Martin Baulig <martin@ximian.com>
3942 * generic.cs (ConstructedType): Moved all the type lookup and
3943 nested class logic into SimpleName.
3944 (ConstructedType.ResolveConstructedType): Our underlying type is
3945 already fully resolved; all the type lookup stuff is in
3948 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
3949 constructed types here instead of in ConstructedType.
3951 * decl.cs (MemberName.GetTypeExpression): Always create a
3952 SimpleName, not a ConstructedType.
3953 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
3955 2005-03-02 Martin Baulig <martin@ximian.com>
3957 * class.cs (TypeContainer.DoDefineMembers): We also need a default
3958 static constructor in static classes.
3960 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
3962 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
3963 sizeParamIndex is not specified.
3965 2005-03-01 Marek Safar <marek.safar@seznam.cz>
3968 * report.cs (WarningMessage.IsEnabled): Missing null check.
3970 2005-02-28 Marek Safar <marek.safar@seznam.cz>
3972 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
3973 in the fields and not in the properties.
3975 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
3977 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
3980 2005-02-28 Marek Safar <marek.safar@seznam.cz>
3982 * attribute.cs: Small refactoring (improved robustness).
3983 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
3984 (ValidateGuid): Removed.
3985 (Resolve): Removed referenced to above mentioned.
3986 (GetAttributeUsage): Made private and changed to work without
3988 (GetIndexerAttributeValue): Don't crash.
3989 (GetConditionalAttributeValue): Ditto.
3990 (GetClsCompliantAttributeValue): Ditto.
3991 (ExtractSecurityPermissionSet): All attributes exceptions are
3993 (GetPropertyValue): New helper.
3994 (GetMethodImplOptions): New method.
3995 (DefinePInvokeMethod): Reuse common code. Implemented handling of
3996 some missing properties.
3998 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
3999 (Method.ApplyAttributeBuilder): Updated.
4001 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4004 2005-02-28 Raja R Harinath <rharinath@novell.com>
4007 * report.cs (Report.SymbolRelatedToPreviousError): Handle
4008 non-simple types (array, pointer, reference).
4010 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4012 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4014 * class.cs (MethodCore.IsDuplicateImplementation): Special error
4016 (Method.CheckBase): Catch wrong destructor here.
4017 (MethodData.Define): Add errors 550, 668.
4019 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4021 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4023 * pending.cs (VerifyPendingMethods): Add error 551.
4025 * typemanager.cs (CSharpName): Next error report helper.
4027 2005-02-25 Marek Safar <marek.safar@seznam.cz>
4029 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4030 attributes. Removed useless attribute double check.
4031 It saves almost 2MBs for corlib.
4033 2005-02-25 Raja R Harinath <rharinath@novell.com>
4036 * statement.cs (ExpressionStatement.Resolve): Make robust to being
4037 called twice in case of error.
4039 2005-02-23 Chris Toshok <toshok@ximian.com>
4041 Fix compiler portions of #72827.
4042 * statement.cs (Block.Emit): call Begin/EndScope on the
4043 EmitContext instead of the ILGenerator.
4045 * codegen.cs (EmitContext.BeginScope): new method, call
4046 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4048 (EmitContext.BeginScope): same, but EndScope and CloseScope
4050 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
4051 offset and call the superclass's OpenScope(int) with it.
4052 (SymbolWriter.CloseScope): get the current il
4053 offset and call superclass's CloseScope(int) with it.
4055 2005-02-23 Marek Safar <marek.safar@seznam.cz>
4057 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
4058 CS1677 for out and ref as well.
4060 * class.cs (Method.Define): Add error CS1599 detection.
4062 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
4064 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
4066 * delegate.cs (Delegate.Define): Add error CS1599 detection.
4068 * support.cs.cs (ModifierDesc): New helper method.
4070 2005-02-23 Raja R Harinath <rharinath@novell.com>
4071 Abin Thomas <projectmonokochi@rediffmail.com>
4072 Anoob V E <projectmonokochi@rediffmail.com>
4073 Harilal P R <projectmonokochi@rediffmail.com>
4076 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
4077 MemberLookup (used for error reporting) actually returns a result.
4078 Fix error report number (122, not 112).
4080 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
4081 Anoob V E <projectmonokochi@rediffmail.com>
4082 Harilal P R <projectmonokochi@rediffmail.com>
4085 * pending.cs (PendingImplementation.GetAbstractMethods):
4086 Find NonPublic members too.
4088 2005-02-22 Marek Safar <marek.safar@seznam.cz>
4090 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
4093 * class.cs (MethodCore.CheckMethodAgainstBase):
4094 Add error 239 report.
4096 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4098 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4100 * class.cs (Operator.Define): Add error 217 report.
4102 2005-02-21 Raja R Harinath <rharinath@novell.com>
4105 * expression.cs (Invocation.IsApplicable): Make public.
4106 (Invocation.IsParamsMethodApplicable): Likewise.
4107 * delegate.cs (Delegate.VerifyApplicability): Don't use
4108 Invocation.VerifyArgumentCompat for parameter applicability
4109 testing. Use Invocation.IsApplicable and
4110 Invocation.IsParamsMethodApplicable.
4112 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4114 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4116 * class.cs (Operator.Define): Add error 217 report.
4118 2005-02-21 Raja R Harinath <rharinath@novell.com>
4120 * namespace.cs (UsingEntry.Resolve): Undo change below.
4122 2005-02-21 Raja R Harinath <rharinath@novell.com>
4125 * ecore.cs (Expression.MemberLookupFailed): Add argument to
4126 disable the error message when the extended MemberLookup also
4128 (Expression.MemberLookupFinal): Update.
4129 (SimpleName.DoSimpleNameResolve): Update.
4130 * expression.cs (MemberAccess.ResolveNamespaceOrType):
4131 Don't use MemberLookupFinal.
4132 (New.DoResolve): Update.
4133 (BaseAccess.CommonResolve): Update.
4135 2005-02-21 Raja R Harinath <rharinath@novell.com>
4138 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
4139 occured previously, don't resolve again.
4141 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4144 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
4145 argument. Call ResolveAttributeUsage for unresolved.
4146 when types doesn't match ctor arguments.
4148 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
4149 for nested attribute classes.
4150 (Class.attribute_usage): Removed.
4151 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
4152 for attribute class.
4154 * ecore.cs (IsAttribute): Removed.
4156 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
4158 * rootcontext.cs (RegisterAttribute): Removed, attributes are
4160 (attribute_types): Removed.
4161 (EmitCode): Global attributes are emited as the latest.
4163 2005-02-18 Marek Safar <marek.safar@seznam.cz>
4165 * class.cs (EmitFieldInitializers): Don't emit field initializer
4166 for default values when optimilization is on.
4168 * constant.cs (Constant.IsDefaultValue): New property.
4170 * driver.cs: Add /optimize handling.
4174 * literal.cs: Implement new IsDefaultValue property.
4176 * rootcontext.cs (Optimize): New field, holds /optimize option.
4178 2005-02-18 Raja R Harinath <rharinath@novell.com>
4180 Fix crasher in re-opened #72347.
4181 * namespace.cs (Namespace.Lookup): Return null if
4182 DeclSpace.DefineType returns null.
4185 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
4187 2005-02-18 Raja R Harinath <rharinath@novell.com>
4189 Fix remainder of #63202. Change semantics of DoResolveLValue: it
4190 now returns null if it cannot resolve to an lvalue.
4191 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
4192 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
4193 returned null. Remove check for SimpleName.
4194 (EventExpr.DoResolveLValue): New.
4195 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
4196 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
4198 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
4200 (Unary.ResolveOperator): Move CS0211 check ...
4201 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
4203 (Unary.DoResolveLValue): Simplify.
4204 (AddressOf.DoResolveLValue): New.
4205 (ArrayAccess.DoResolveLValue): New.
4207 2005-02-16 Marek Safar <marek.safar@seznam.cz>
4209 * attribute.cs (Attribute.Resolve): Add arguments casting for
4210 when types doesn't match ctor arguments.
4212 2005-02-16 Raja R Harinath <rharinath@novell.com>
4214 Fix parts of #63202.
4215 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
4216 lookup of operator in base type. Ensure that all checks happen
4217 when the operator resolves to an "op_..." method.
4219 2005-02-15 Raja R Harinath <rharinath@novell.com>
4222 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
4223 'ignore_cs0104' parameter. Pass it to ...
4224 (NamespaceEntry.Lookup): ... this.
4225 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
4226 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
4227 (TypeLookupExpression.DoResolveAsTypeStep): Update.
4228 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
4229 Update. Request that cs0104 errors be ignored.
4230 (ComposedCast.ResolveAsTypeStep): Update.
4232 2005-02-14 Raja R Harinath <rharinath@novell.com>
4235 * expression.cs (Invocation.BetterFunction): Remove support for
4236 comparing virtual functions and their overrides.
4237 (Invocation.IsOverride): New.
4238 (Invocation.OverloadResolve): Don't consider 'override' functions
4239 during candidate selection. Store them in a lookaside list.
4240 If the selected method is a 'virtual' function, use the list to
4241 find any overrides that are closer to the LHS type.
4243 2005-02-14 Marek Safar <marek.safar@seznam.cz>
4245 * expression.cs (New.DoResolve): Add complex core type reduction.
4246 (New.Constantify): Converts complex core type syntax like 'new int ()'
4249 2005-02-14 Raja R Harinath <rharinath@novell.com>
4251 * decl.cs (EntryType.EntryType): New constructor to create an
4252 updated copy of a cache entry.
4253 (MemberCache.AddMethods): Use it.
4254 (MemberCache.ClearDeclaredOnly): Remove.
4255 (MemberCache.MemberCache): Update.
4257 2005-02-11 Miguel de Icaza <miguel@novell.com>
4259 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
4260 variable. This one is represents the actual low-level declaration
4261 of the method, as opposed to the semantic level `IsStatic'.
4263 An anonymous method which is hosted into a static method might be
4264 actually an instance method. IsStatic would reflect the
4265 container, while MethodIsStatic represents the actual code
4268 * expression.cs (ParameterReference): Use the new MethodIsStatic
4269 instead of IsStatic.
4271 * anonymous.cs (AnonymousMethod.Compatible): Pass the
4272 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
4273 set on the current EmitContext.
4275 * expression.cs (Cast): Overload DoResolveLValue so we can pass
4276 resolve our casted expression as an LValue. This triggers the
4277 proper LValue processing that is later required by Assign.
4281 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
4283 2005-02-11 Marek Safar <marek.safar@seznam.cz>
4285 C# 2.0 Fixed buffer implementation
4287 * anonymous.cs: Update after RegisterHelperClass renaming.
4289 * attribute.cs (AttributeTester.fixed_buffer_cache):
4290 Cache of external fixed buffers.
4291 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
4292 implementation if field is fixed buffer else null.
4295 (TypeContainer.AddField): Accept FieldMember instead of Field.
4296 (FieldBase.IsFieldClsCompliant): Extracted code from
4297 VerifyClsCompliance descendant customization.
4298 (FixedField): New class handles fixed buffer fields.
4299 (FixedFieldExternal): Keeps information about imported fixed
4301 (IFixedField): Make access to internal or external fixed buffer
4304 * cs-parser.jay: Add fixed buffer parsing.
4306 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
4309 * expression.cs (Indirection): Extended implementation to accept
4311 (PointerArithmetic.Emit): Get element from fixed buffer as well.
4312 (ElementAccess.MakePointerAccess): Get type as parameter.
4313 (DoResolve): Add fixed buffer field expression conversion.
4314 (DoResolveLValue): Ditto.
4315 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
4316 (ArrayPtr): Derives from FixedBufferPtr.
4317 (ArrayPtr.Emit): Add extra emit for array elements.
4319 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
4321 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
4322 for compiler generated types.
4323 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
4325 * statement.cs (Fixed): Refactored to be easier add fixed buffer
4326 and consume less memory.
4327 (Fixed.Resolve): Add fixed buffer case.
4329 * typemanager.cs (compiler_generated_attr_ctor,
4330 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
4331 (HasElementType): Add our own implementation to work on every
4334 2005-02-11 Miguel de Icaza <miguel@novell.com>
4336 * anonymous.cs (CaptureContext): Track whether `this' has been
4339 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
4340 only captured `this' if it was implicitly done (instance
4341 methods/variables were used).
4343 * codegen.cs (EmitContext.CaptureThis): New method to flag that
4344 `this' must be captured.
4346 2005-01-30 Miguel de Icaza <miguel@novell.com>
4348 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
4349 is null it means that there has been no need to capture anything,
4350 so we just create a sibling.
4352 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
4354 Just a partial fix. The other half is fairly elusive.
4356 2005-02-10 Raja R Harinath <rharinath@novell.com>
4358 Fix #52586, cs0121-4.cs.
4359 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
4360 and return a hashtable.
4361 (MemberCache.ClearDeclaredOnly): New.
4362 (MemberCache.MemberCache): Update to change. Make a deep copy of
4363 the method_hash of a base type too.
4364 (MemberCache.AddMethods): Adapt to having a deep copy of the base
4365 type methods. Overwrite entries with the same MethodHandle so
4366 that the ReflectedType is correct. The process leaves in base
4367 virtual functions and their overrides as distinct entries.
4368 (CacheEntry): Now a class instead of a struct. It shouldn't alter
4369 matters since it was boxed in a ArrayList before.
4370 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
4372 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
4373 case of a virtual function and its override (choose the overload
4375 (Invocation.OverloadResolve): Avoid 'override' members during
4376 'applicable_type' calculation.
4378 2005-03-28 Raja R Harinath <rharinath@novell.com>
4380 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4381 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4382 GetTypeHandle. It is possible for a reflected type to derive from
4383 a TypeBuilder (e.g., int[] derives from the TypeBuilder
4384 System.Array during mscorlib compilation).
4385 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4386 contain a method_hash, don't create one either. Don't create a
4387 deep copy of the base cache's method_hash.
4388 (MemberCache.SetupCache): Rename back from DeepCopy.
4389 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4390 already initialized. If we see an override function, add its
4391 underlying base virtual function to the member_hash too.
4393 2005-02-09 Raja R Harinath <rharinath@novell.com>
4395 Combine two near-redundant caches.
4396 * typemanager.cs (method_params): Rename from method_internal_params.
4397 (TypeManager.GetParameterData): New. Replace
4398 Invocation.GetParameterData.
4399 (TypeManager.LookupParametersByBuilder): Remove.
4400 * expression.cs (Invocation.method_parameter_cache): Remove.
4401 (Invocation.GetParameterData): Remove.
4403 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
4406 2005-02-08 Raja R Harinath <rharinath@novell.com>
4409 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
4410 TypeManager.multicast_delegate_type is null, resolve it by looking
4411 up "System.MulticastDelegate".
4412 * rootcontext.cs (RootContext.ResolveCore): Simplify.
4414 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
4415 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
4416 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
4419 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
4420 (LabeledStatement.AddReference): New. Set 'referenced'.
4421 (Goto.Resolve): Use it.
4423 2005-02-05 John Luke <john.luke@gmail.com>
4425 * driver.cs: remove duplicate -doc line in Usage ()
4427 2005-02-04 Raja R Harinath <rharinath@novell.com>
4429 * location.cs (Location.AddFile): Fix CS2002 error report.
4431 2005-02-02 Martin Baulig <martin@ximian.com>
4433 * delegate.cs (Delegate.DefineType): Report an internal error if
4434 TypeManager.multicast_delegate_type is null. See bug #72015 for
4437 2005-02-02 Raja R Harinath <rharinath@novell.com>
4439 Fix a crasher in a variant of #31984.
4440 * const.cs (Constant.CheckBase): New override that defers the
4441 new-or-override check in case the base type hasn't been populated
4443 (Constant.Define): Ensure the new-or-override check is performed.
4445 2005-02-01 Duncan Mak <duncan@ximian.com>
4447 * const.cs (LookupConstantValue): Check that `ce' is not null
4448 before calling GetValue ().
4450 2005-02-01 Raja R Harinath <rharinath@novell.com>
4452 Fix test-334.cs (#69519).
4453 * cs-parser.jay (using_alias_directive): Pass in an expression to
4454 NamespaceEntry.UsingAlias.
4455 (using_namespace_directive): Pass in an expression to
4456 NamespaceEntry.Using.
4457 (namespace_name): Don't flatten to a string.
4458 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
4459 (NamespaceEntry.AliasEntry.Resolve): Lookup using
4461 (NamespaceEntry.UsingEntry): Likewise.
4462 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
4464 (NamespaceEntry.LookupForUsing): Remove.
4465 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
4467 (NamespaceEntry.Lookup): Remove support for dotted names.
4469 2005-02-01 Raja R Harinath <rharinath@novell.com>
4471 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
4473 (NamespaceEntry.ImplicitParent): Compute on demand.
4474 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
4475 parallels the current.
4476 (NamespaceEntry.LookupForUsing): Use it.
4477 (NamespaceEntry.Lookup): If the current namespace-entry is
4478 implicit, don't search aliases and using tables.
4480 2005-02-01 Raja R Harinath <rharinath@novell.com>
4483 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
4485 (TypeContainer.BaseCache): Compute on demand.
4486 (TypeContainer.FindMembers): Define constants and types if they're
4487 not already created.
4488 (FieldMember.Define): Move resetting of ec.InUnsafe before error
4490 * const.cs (Constant.Define): Make idempotent.
4492 2005-01-29 Miguel de Icaza <miguel@novell.com>
4494 * pending.cs: Produce better code (no nops produced by using Ldarg
4497 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
4498 i - 1' it should be arg + 1.
4502 2005-01-28 Raja R Harinath <rharinath@novell.com>
4504 * attribute.cs (Attribute.CheckAttributeType): Make private
4506 (Attribute.ResolveType): Make virtual.
4507 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
4508 handling of RootContext.Tree.Types.
4510 2005-01-27 Raja R Harinath <rharinath@novell.com>
4512 Update attribute-handling to use the SimpleName/MemberAccess
4514 * cs-parser.jay (attribute): Pass in an expression to the
4515 constructors of Attribute and GlobalAttribute.
4516 * attribute.cs (Attribute): Take an expression for the name.
4517 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
4518 passed in attribute name expression.
4519 (Attribute.CheckAttributeType): Use it.
4520 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
4521 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
4522 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
4523 argument to prevent error messages if the lookup fails.
4525 2005-01-27 Marek Safar <marek.safar@seznam.cz>
4527 * expression.cs (Indirection): Implemented IVariable interface
4528 to support indirection in AddressOf operator.
4529 (PointerArithmetic.Emit): Add optimalization for case where
4530 result can be precomputed.
4532 2005-01-26 Martin Baulig <martin@ximian.com>
4534 * class.cs (TypeContainer.AttributeTargets): Return the correct
4535 AttributeTargets depending on our `Kind' instead of throwing an
4536 exception; fixes #71632.
4538 2005-01-26 Marek Safar <marek.safar@seznam.cz>
4541 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
4544 2005-03-17 Martin Baulig <martin@ximian.com>
4546 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4547 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
4549 2005-03-17 Martin Baulig <martin@ximian.com>
4551 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4552 to bool so we can return an error condition.
4553 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4556 2005-03-17 Martin Baulig <martin@ximian.com>
4558 * generic.cs (TypeMananager.IsIEnumerable): New public method.
4560 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
4561 converting from an array-type of T to `IEnumerable<T>'.
4563 2005-03-16 Martin Baulig <martin@ximian.com>
4565 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
4566 (Nullable.LiftedUnaryMutator): New public class.
4568 * expression.cs (UnaryMutator.DoResolve): Added support for
4571 2005-03-14 Martin Baulig <martin@ximian.com>
4573 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
4575 2005-03-14 Martin Baulig <martin@ximian.com>
4577 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
4578 the comparision operators `<', `>', `<=' and `>='.
4580 2005-03-13 Martin Baulig <martin@ximian.com>
4583 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
4584 avoid confusion with the `NullLiteral'.
4585 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
4587 2005-03-13 Martin Baulig <martin@ximian.com>
4589 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
4590 comparing arbitrary types with the null literal.
4592 2005-03-13 Martin Baulig <martin@ximian.com>
4594 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
4595 boolean operators '&&', '||', '&' and '|'.
4596 (Nullable.OperatorTrueOrFalse): New public class.
4598 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
4599 instead of a `StaticCallExpr'; added support for nullables.
4601 2005-03-10 Martin Baulig <martin@ximian.com>
4604 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
4605 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
4607 2005-03-07 Martin Baulig <martin@ximian.com>
4609 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
4610 it work if `expr' is not an IMemoryLocation.
4611 (Nullable.Lifted): Implement IMemoryLocation.
4612 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
4615 2005-03-05 Martin Baulig <martin@ximian.com>
4617 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
4618 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
4619 (Nullable): Added support for lifted unary and binary operators.
4621 * expression.cs (Unary.DoResolve): Added support for nullable types.
4622 (Binary.DoResolve): Likewise.
4623 (Conditional.DoResolve): Likewise.
4625 2005-03-02 Martin Baulig <martin@ximian.com>
4627 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
4629 * class.cs (ClassPart.SetParameterInfo): Override this.
4630 (PartialContainer.SetParameterInfo): Override this.
4631 (TypeContainer.CheckConstraints): New protected method.
4632 (PartialContainer.CheckConstraints): Override this and check
4633 whether the same contraints were specified in all parts of a
4634 partial generic type definition.
4635 (PartialContainer.UpdateConstraints): New public method.
4637 * generic.cs (TypeParameter.UpdateConstraints): New public method.
4639 2005-03-02 Martin Baulig <martin@ximian.com>
4641 Committing a patch from Carlos Alberto Cortez to fix #72887.
4643 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
4644 casts from `T []' to `int []'.
4646 2005-03-02 Martin Baulig <martin@ximian.com>
4648 * generic.cs (TypeManager.IsEqual): Make this symmetric.
4650 * expression.cs (Binary.ResolveOperator): When resolving a
4651 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
4652 `=='. Fixes #71866. See gen-127.cs.
4654 2005-03-02 Martin Baulig <martin@ximian.com>
4656 * class.cs (TypeContainer.DoDefineMembers): We also need a default
4657 static constructor in static classes.
4659 2005-03-02 Martin Baulig <martin@ximian.com>
4662 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
4663 (Nullable.LiftedConversion): Added support for user-defined
4666 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
4668 * cs-parser.jay: Use ComposedCast everywhere instead of
4669 NullableType, so we don't need to check for NullableType
4671 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
4672 case where we'll be resolved into a `parenthesized_expression_0'
4676 (Convert.UserDefinedConversion): Added nullable conversions.
4678 2005-02-28 Martin Baulig <martin@ximian.com>
4680 * generic.cs (TypeManager.IsNullableType): New static method.
4681 (Nullable): New abstract class.
4682 (Nullable.NullLiteral): New public class.
4683 (Nullable.LiftedConversion): New public class.
4685 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
4686 `builtin_types opt_nullable'.
4689 (Convert.ImplicitConversionStandard): Added nullable conversions.
4690 (Convert.ExplicitConversionStandard): Likewise.
4691 (Convert.ExplicitConversion): Likewise.
4693 2005-02-26 Martin Baulig <martin@ximian.com>
4695 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
4696 begin with a "?", for instance "?[]". Don't do a type lookup if
4699 2005-02-25 Martin Baulig <martin@ximian.com>
4701 The first part of Nullable Types :-)
4703 * generic.cs (NullableType): New public class.
4704 (NullCoalescingOperator): New public class.
4705 (TypeArguments.Resolve): Add a CS0306 check.
4707 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
4708 (opt_nullable): New rule.
4709 (type): Added `opt_nullable' to `namespace_or_type_name',
4710 `builtin_types' and `pointer_type'.
4711 (array_type): Added `opt_nullable'.
4712 (opt_rank_specifier_or_nullable): New rule; this is the
4713 combination of `opt_rank_specifier' and `opt_nullable'.
4714 (opt_error): New rule; catch errors here.
4715 (nullable_type_or_conditional): New rule; we use this to check for
4716 nullable and still detect the conditional operator.
4717 (local_variable_type): Use `opt_rank_specifier_or_nullable'
4718 instead `opt_rank_specifier'.
4720 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
4723 2005-02-24 Martin Baulig <martin@ximian.com>
4725 * README, README.Changes: Removed; they're old and obsolete.
4727 2005-02-22 Martin Baulig <martin@ximian.com>
4729 * generic.cs (TypeParameter.Resolve): If resolving the constraints
4730 returned an error, set `constraints' to null to avoid a crash
4732 (TypeParameter.ResolveType): Likewise.
4734 2005-02-22 Martin Baulig <martin@ximian.com>
4737 (Constraints.ResolveTypes): Protect against being called twice.
4738 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
4739 (TypeParameter.ResolveType): New public method; calls
4740 constraints.ResolveTypes().
4741 (TypeParameter.DefineType): Moved constraints.ResolveType() out
4742 into the new ResolveType().
4743 (GenericMethod.Define): Call ResolveType() on all our
4746 2005-02-21 Martin Baulig <martin@ximian.com>
4749 (TypeManager.generic_nullable_type): New static public field.
4750 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
4753 (RootContext.ResolveCore): Resolve "System.Nullable`1".
4755 2005-02-15 Martin Baulig <martin@ximian.com>
4757 * generic.cs (ConstructedType.Constraints): Correctly check
4758 constraints if the argument type is a type parameter; fixes
4761 2005-02-02 Martin Baulig <martin@ximian.com>
4763 * delegate.cs (Delegate.DefineType): Report an internal error if
4764 TypeManager.multicast_delegate_type is null. See bug #72015 for
4767 2005-01-29 Miguel de Icaza <miguel@novell.com>
4769 * pending.cs: Produce better code (no nops produced by using Ldarg
4772 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
4773 i - 1' it should be arg + 1.
4777 2005-01-26 Martin Baulig <martin@ximian.com>
4779 * cs-parser.jay (indexer_declarator): Don't report an error if we
4780 have type parameters since we can be an explicit interface
4781 implementation; fixes #71449.
4783 2005-01-26 Martin Baulig <martin@ximian.com>
4785 * class.cs (TypeContainer.AttributeTargets): Return the correct
4786 AttributeTargets depending on our `Kind' instead of throwing an
4787 exception; fixes #71632.
4789 2005-01-26 Martin Baulig <martin@ximian.com>
4791 * delegate.cs (Delegate.DefineType): Correctly define our type
4792 parameters. Fixes #71483.
4794 2005-01-25 Raja R Harinath <rharinath@novell.com>
4797 * expression.cs (MemberAccess.DoResolve): Don't complain with
4798 cs0572 when the LHS of a member access has identical name and type
4801 2005-01-25 Marek Safar <marek.safar@seznam.cz>
4804 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
4806 Create custom PermissionSet only for PermissionSetAttribute.
4808 2005-01-24 Marek Safar <marek.safar@seznam.cz>
4811 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
4812 delegates in static class.
4814 2005-01-24 Martin Baulig <martin@ximian.com>
4816 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4817 merging an implicit block, just use its reachability.
4819 * statement.cs (Block.Resolve): Make the unreachable code check
4820 work wrt. implicit blocks; see test-337 from #63842.
4822 2005-01-21 Alp Toker <alp@atoker.com>
4824 * cs-parser.jay: destructor_declaration's container is PartialContainer
4825 not Class when partial types are used, so use Kind prop instead of
4828 2005-01-22 Miguel de Icaza <miguel@ximian.com>
4830 * cs-parser.jay: Improve error reporting when an interface
4833 2005-01-20 Dick Porter <dick@ximian.com>
4835 * support.cs: SeekableStreamReader fix from Sandor Dobos
4836 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
4837 chars are read. Fixes bug 70369.
4839 2005-01-20 Raja R Harinath <rharinath@novell.com>
4841 * cs-parser.jay (catch_clause): Simplify current_block handling
4844 2005-01-17 Miguel de Icaza <miguel@ximian.com>
4846 * convert.cs (ImplicitStandardConversionExists): Synchronize the
4847 code with ImplicitStandardConversion to handle the implicit
4848 conversion of method groups into valid delegate invocations.
4850 The problem is that in parameter handling we were using this code
4851 path. Fixes bug #64698
4853 2005-01-19 Raja R Harinath <rharinath@novell.com>
4855 * cs-parser.jay: Fix several infelicities.
4856 - Avoid assigning to the parser value stack. Code like
4857 '$3 = null' is unclean. Synthesize a value for the code block
4859 - Avoid using oob_stack for storing location information. Use ...
4860 (_mark_): ... this. New (empty) rule. Saves the current location
4862 (foreach_statement): Avoid using oob_stack for current_block
4863 handling. Use technique used in for_statement and
4864 using_statement. Synthesize a value for the code block to store
4865 additional intermediate information.
4867 2005-01-13 Miguel de Icaza <miguel@ximian.com>
4869 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
4870 of a different type is only allowed to private fields of a
4871 containing type, not on fields of a base class.
4873 See test-174.cs and error cs0122-9.cs
4875 2005-01-13 Raja R Harinath <rharinath@novell.com>
4877 Fix test-335.cs (bug #58126).
4878 * cs-parser.jay (argument): Split out non-expression parts of the
4879 rule into 'non_simple_argument'.
4880 (invocation_expression): Support parenthesized invocations with
4881 multiple arguments, and with single non-simple arguments.
4883 2005-01-13 Raja R Harinath <rharinath@novell.com>
4885 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
4888 2005-01-12 Raja R Harinath <rharinath@novell.com>
4890 Fix cs0038-1.cs, cs1640-6.cs.
4891 * ecore.cs (Expression.Resolve): Remove special-case for
4892 SimpleName in error-handling.
4893 (Expression.almostMatchedMembers): Relax access permission to
4895 (Expression.MemberLookupFailed): Handle duplicates in
4896 almostMatchedMembers list.
4897 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
4898 * expression.cs (New.DoResolve): Report CS1540 for more cases.
4899 * typemanager.cs (GetFullNameSignature): Use the MethodBase
4900 overload if the passed in MemberInfo is a MethodBase.
4902 2005-01-25 Martin Baulig <martin@ximian.com>
4905 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
4907 2005-01-12 Marek Safar <marek.safar@seznam.cz>
4910 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
4911 for non-CAS & merge permission sets properly.
4913 2005-01-11 Raja R Harinath <rharinath@novell.com>
4915 Improve standard-compliance of simple name and member access
4916 resolution. Fixes bugs #52697, #57200, #67520, #69519.
4917 * ecore.cs (FullNamedExpression): New abstract base class
4918 for Namespaces and TypeExpressions.
4919 (ResolveFlags.SimpleName): Remove.
4920 (SimpleName): Remove support for dotted names.
4921 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
4922 DeclSpace.FindType and DeclSpace.LookupType.
4923 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
4924 (Expression.ExprClassName): Make member function.
4925 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
4926 a namespace. Remove creation of dotted "SimpleName"s.
4927 (MemberAccess.DoResolve): Likewise.
4928 * decl.cs (DeclSpace.Cache): Make private.
4929 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
4930 (DeclSpace.FindType): Update.
4931 (DeclSpace.LookupType): Move here from RootContext. Return a
4932 FullNamedExpression.
4933 * namespace.cs (Namespace): Derive from FullNamedExpression
4934 so that it can be part of expression resolution.
4935 (Namespace.Lookup): Return an FullNamedExpression.
4936 (NamespaceEntry.LookupAlias): Lookup aliases only in current
4938 * rootcontext.cs (NamespaceLookup): Remove.
4939 (LookupType): Move to DeclSpace.
4940 * attribute.cs (CheckAttributeType): Update.
4941 * doc.cs (FindDocumentedType): Remove allowAlias argument.
4942 (FindDocumentedTypeNonArray): Likewise.
4944 2005-01-11 Raja R Harinath <rharinath@novell.com>
4946 Fix cs0509.cs, cs1632.cs.
4947 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
4948 is the same as IsInterface.
4949 (TypeContainer.GetClassBases): Likewise.
4950 * statement.cs (LabeledStatement.ig): New field.
4951 (LabeledStatement.LabelTarget): Save ILGenerator which created the
4953 (LabeledStatement.DoEmit): Check that the label was created with
4954 the same ILGenerator.
4956 2005-01-10 Marek Safar <marek.safar@seznam.cz>
4959 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
4960 accessors to its properties.
4962 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
4963 from accessors to property.
4965 2005-01-10 Marek Safar <marek.safar@seznam.cz>
4968 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
4971 2005-01-08 Miguel de Icaza <miguel@ximian.com>
4973 * attribute.cs: Check for null and empty strings.
4975 I have lost another battle to Paolo.
4977 2005-01-07 Marek Safar <marek.safar@seznam.cz>
4980 * class.cs (PropertyMethod): Set Parent field in ctors.
4981 (SetMethod.InternalParameters): Add unsafe switch hack.
4982 Override MarkForDuplicationCheck where it is appropriate.
4984 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
4985 It says whether container allows members with the same name.
4987 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
4988 Removed is_method parameter.
4990 2005-01-06 Duncan Mak <duncan@ximian.com>
4992 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
4993 because the previous change led to incorrect reporting of CS1032
4994 ("Cannot define/undefine preprocessor symbols after first token in
4995 file"). Instead of using `tokens_seen' as the only flag that
4996 triggers CS1040, introduce `comments_seen'. This new flag is used
4997 to signify having seen comments on the current line, so it is
4998 unset after a newline.
5000 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5002 * doc.cs : When searching for a type, find nested type too.
5003 This fixes bug #71040.
5005 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5008 - Warn missing member comment on those classes which also does not
5009 have doc comments. Fixed bug #71041.
5010 - Don't warn missing doc comment on default constructor.
5013 2005-01-06 Duncan Mak <duncan@ximian.com>
5015 * cs-tokenizer.cs (xtoken): After handling traditional C-style
5016 comments, set `tokens_seen' to true. This allows us to detect
5017 misplaced preprocessor directives (i.e. not at the beginning of
5018 the a line, nor after whitespaces). In that case, report error
5019 CS1040. This fixes bug #56460.
5021 * cs-parser.jay (interface_member_declaration): Add checks for
5022 IsExplicitImpl, and report CS0541 error if an interface member is
5023 defined as an explicit interface declaration.
5025 2005-01-06 Marek Safar <marek.safar@seznam.cz>
5028 * class.cs (PropertyMethod): Set Parent field in ctors.
5029 (SetMethod.InternalParameters): Add unsafe switch hack.
5031 * decl.cs (MemberCore.Parent): Cannot be readonly.
5033 2005-01-06 Raja R Harinath <rharinath@novell.com>
5035 * decl.cs (DeclSpace.ResolveType): Remove.
5036 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5037 Merge in code from ...
5038 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
5039 * class.cs, enum.cs: Update to changes.
5041 2005-01-06 Miguel de Icaza <miguel@ximian.com>
5043 * anonymous.cs: Ensure that we init the scope of our parent if it
5044 has not been initialized yet.
5046 2004-12-30 Duncan Mak <duncan@ximian.com>
5048 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5049 if field.FieldBuilder is null. Fixes #70758.
5051 * convert.cs: Fixed some typos and updated some of the comments.
5052 (ImplicitStandardConversionExists):
5053 (TryImplicitIntConversion): If `target_type' is an interface and
5054 the type of `ic' implements this interface, return true or a new
5055 BoxedCast instead of null. This fixes #70468.
5057 2004-12-29 Duncan Mak <duncan@ximian.com>
5059 * expression.cs (Argument.Emit): Check that Expr is
5060 IMemoryLocation before casting to it, and report CS1510 otherwise.
5064 2004-12-21 Ben Maurer <bmaurer@ximian.com>
5066 * statement.cs (Block.ThisVariable): remove the recursion here, to
5067 make the --profile more sane.
5069 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
5071 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5072 assembly, by JB Evain.
5074 2004-12-17 Raja R Harinath <rharinath@novell.com>
5076 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
5077 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5078 "parent" refers to enclosing type/class. "base" refers to superclass.
5080 2004-12-17 Raja R Harinath <rharinath@novell.com>
5082 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5083 Ensure that we only have GlobalAttributes.
5084 * attribute.cs (Attribute.Emit): Make non-virtual.
5085 (GlobalAttribute.Emit): Remove.
5086 (Attribute.Resolve): Make virtual.
5087 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
5088 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5089 the argument. Don't create one.
5090 (Attribute.GetObsoleteAttribute): Likewise.
5091 (Attribute.GetClsCompliantAttributeValue): Likewise.
5092 * class.cs, decl.cs: Update to changes.
5094 2004-12-17 Marek Safar <marek.safar@seznam.cz>
5096 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5098 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5100 * statement.cs (Foreach.Resolve): Add error 186 report.
5102 2004-12-16 Marek Safar <marek.safar@seznam.cz>
5104 * expression.cs (Conditional.DoResolve): Add warning 429.
5106 * statement.cs (If.Resolve): Add warning 665.
5108 2004-12-16 Raja R Harinath <rharinath@novell.com>
5110 New invariant: RootContext.Tree.Types.NamespaceEntry == null
5111 except when in the parser, and in GlobalAttribute.
5112 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5113 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5114 RootContext.Tree.Types.NamespaceEntry once work is done.
5115 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
5116 and resets RootContext.Tree.Types.NamespaceEntry.
5118 2004-12-15 Marek Safar <marek.safar@seznam.cz>
5120 * cs-parser.jay: Don't create a block for every variable.
5122 2004-12-14 Miguel de Icaza <miguel@ximian.com>
5124 * location.cs: Provide extra information.
5126 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5127 variables from the captured environment, it is the ldarg_0.
5129 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5131 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5134 * class.cs: Changed warning level for 169 to avoid developer
5135 displeasure from warning flooding. It will be changed back when they
5136 fix most of current BCL warnings.
5138 * RootContext.cs: Pushed default WarningLevel to 3.
5140 * statement.cs: Removed unused variable.
5142 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5144 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5145 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5146 Add error 502 report.
5147 (StaticClass.DefineType): Add error 441 report.
5148 (Class.AllowedModifiersProp): New virtual property as temporary
5149 extension to AllowedModifiers.
5150 (Class.DefineType): Add error 418 report. Moved ModFlags check here
5151 to share implementation with StaticClass and don't call virtual
5154 * driver.cs (MainDriver): Add error 1558 test.
5156 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5157 report. Moved error 36 test here.
5159 * statement.cs (Throw.Resolve): Add error 724 report.
5161 * typemanager.cs: Add out_attribute_type core type.
5163 2004-12-13 Marek Safar <marek.safar@seznam.cz>
5165 * class.cs (TypeContainer.VerifyClsCompliance): Add error
5167 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5169 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5172 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5174 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
5175 Add error 3023 report.
5176 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5178 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5181 2004-12-12 John Luke <john.luke@gmail.com>
5183 * driver.cs (AddArgs): take -- into account when
5184 adding arguments, fixes bug 65710
5186 2004-12-12 Martin Baulig <martin@ximian.com>
5188 * expression.cs (Unary.TryReduceNegative): Added support for
5189 SByteConstant and ByteConstant.
5190 (Unary.Reduce): Check error values from TryReduceNegative().
5192 2004-12-10 Marek Safar <marek.safar@seznam.cz>
5194 * attributes.cs (Attribute.Resolve): Avoid multiple error report
5195 and report exception as error 182.
5197 2004-12-10 Raja R Harinath <rharinath@novell.com>
5199 * driver.cs (Main): Fix message when there are warnings.
5201 2004-12-09 Miguel de Icaza <miguel@ximian.com>
5203 * delegate.cs: Fixed my fix from yesterday, sorry about that.
5205 2004-12-09 Marek Safar <marek.safar@seznam.cz>
5207 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
5208 Reduced number of warnings.
5210 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5212 2004-12-08 Miguel de Icaza <miguel@ximian.com>
5214 * driver.cs: Removed message.
5216 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5218 2004-12-08 <vargaz@freemail.hu>
5220 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5222 2004-12-08 Martin Baulig <martin@ximian.com>
5224 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5225 instead of a CS3002 for properties and indexer.
5227 2004-12-08 Martin Baulig <martin@ximian.com>
5229 * decl.cs (MemberName.ToString): Make this work again.
5231 2004-12-08 Marek Safar <marek.safar@seznam.cz>
5233 * attribute.cs (Resolve): Add error 591 detection.
5235 * class.cs (FieldMember.Define): Add error 1547 detection.
5236 (Indexer.Define): Add error 620 detection.
5237 (Operator.Define): Add error 590 detection.
5239 * ecore.cs: Missing argument for error 79.
5241 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5244 2004-12-07 Marek Safar <marek.safar@seznam.cz>
5247 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5250 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
5252 * cs-parser.jay : handle doc comments on implicit/explicit operators.
5253 Some operator comments were suppressed.
5254 * doc.cs : Implicit/explicit operator name in doc comments are like
5255 "op_Explicit(type)~returnType", so added suffix handling.
5257 2005-01-21 Alp Toker <alp@atoker.com>
5259 * cs-parser.jay: destructor_declaration's container is PartialContainer
5260 not Class when partial types are used, so use Kind prop instead of 'is'.
5262 2004-12-12 Martin Baulig <martin@ximian.com>
5264 * expression.cs (Unary.TryReduceNegative): Added support for
5265 SByteConstant and ByteConstant.
5266 (Unary.Reduce): Check error values from TryReduceNegative().
5268 2004-12-11 Martin Baulig <martin@ximian.com>
5270 * support.cs (ReflectionParameters.ParameterName): If we have a
5271 `gpd', call `ParameterName' on it.
5273 * parameter.cs (Parameter.GetParameterAttributes): New static method.
5275 * pending.cs (PendingImplementation.DefineProxy): Call
5276 DefineParameter() for all of the MethodBuilder's arguments.
5278 2004-12-09 Martin Baulig <martin@ximian.com>
5280 * doc.cs (DocUtil): Make this a static class.
5282 2004-12-09 Martin Baulig <martin@ximian.com>
5284 * expression.cs (Invocation.InferType): Moved the type inference
5285 implementation into TypeManager.
5287 * generics.cs (TypeManager): Moved the type inference
5288 implementation here.
5290 2004-12-09 Martin Baulig <martin@ximian.com>
5292 * typemanager.cs (TypeManager): Make this a partial class.
5295 (TypeManager): Move the generics part of `TypeManager' here.
5297 2004-12-08 Martin Baulig <martin@ximian.com>
5299 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5300 instead of a CS3002 for properties and indexer. Added CS3024
5301 check for generic interfaces.
5303 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
5304 instances are not CLS-compliant.
5306 2004-12-08 Martin Baulig <martin@ximian.com>
5309 (void_pointer_expression): New rule for `void*', `void**' etc.
5310 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
5312 2004-12-08 Martin Baulig <martin@ximian.com>
5314 * expression.cs (Invocation.InferType): Removed the hack for
5315 MethodCore.MayUnify().
5317 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
5320 * class.cs (MethodCore.MayUnify): Use
5321 TypeManager.MayBecomeEqualGenericTypes().
5323 2004-12-08 Martin Baulig <martin@ximian.com>
5325 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
5326 parameter, box it. Fixes #69233.
5328 2004-12-08 Martin Baulig <martin@ximian.com>
5330 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
5331 have the ctor constraint. Fixes #68326.
5333 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
5335 * cs-parser.jay : interface comment was not consumed because of
5336 extra opt_semicolon before doc handling.
5338 2004-12-03 Raja R Harinath <rharinath@novell.com>
5340 Fix test-327.cs, test-328.cs, and put in early infrastructure
5341 for eventually fixing #52697.
5342 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
5343 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
5345 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
5346 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
5347 (VerifyUsing, error246): Update.
5348 * rootcontext.cs (RootContext.NamespaceLookup): Just use
5349 'NamespaceEntry.LookupNamespaceOrType'.
5351 2004-12-07 Martin Baulig <martin@ximian.com>
5353 * driver.cs: Call it "BETA SOFTWARE" :-)
5355 2004-12-06 Raja R Harinath <rharinath@novell.com>
5357 Fix crash on cs0657-17.cs.
5358 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5359 Use RootContext.Tree.Types, not 'new RootTypes ()'.
5360 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5361 the case where the NamespaceEntry gets overwritten.
5363 2004-12-06 Marek Safar <marek.safar@seznam.cz>
5365 Fixed #69195, #56821
5366 * ecore.cs (ResolveBoolean): Tiny refactoring.
5368 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
5369 of right expression resolving when left is false constant and
5370 operator is LogicalAnd OR true constant and operator is LogicalOr.
5372 * statement.cs (ResolveUnreachable): Always reports warning.
5374 2004-12-05 Miguel de Icaza <miguel@ximian.com>
5376 * class.cs: Distinguish between 1721 and 1722 (just a little help
5377 for the programmer).
5379 2004-12-03 Miguel de Icaza <miguel@ximian.com>
5381 * delegate.cs: Only allow this on new versions of the language.
5383 2004-12-02 Duncan Mak <duncan@ximian.com>
5385 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
5387 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
5388 here as a static method. Take an additional bool out parameter
5389 `must_do_cs1540_check' for signaling to InstanceResolve.
5390 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
5391 member field from PropertyExpr class and made it an argument of
5393 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
5394 check for MarshalByRefObject, and report CS0122 instead of CS1540.
5395 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
5396 and `remove_accessor' as well as InstanceResolve: report CS0122
5401 2004-12-07 Martin Baulig <martin@ximian.com>
5403 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
5404 and CS0692 where appropriate.
5406 2004-12-06 Martin Baulig <martin@ximian.com>
5408 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
5409 IsDuplicateImplementation() and improved it.
5411 * expression.cs (Invocation.InferTypeArguments): Added
5412 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
5413 and removed the "ref" modifier from `infered_types'.
5415 * decl.cs (MemberName.ToString): Removed the exception.
5417 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
5419 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
5420 comments are allowed.
5422 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
5424 * delegate.cs: Add checks for subtypes in paramaters and return values
5425 in VerifyMethod () to add support for Covariance/Contravariance
5428 2004-12-02 Miguel de Icaza <miguel@ximian.com>
5430 * report.cs: Remove extra closing parenthesis.
5432 * convert.cs (Error_CannotImplicitConversion): If the name of the
5433 types are the same, provide some extra information.
5435 2004-12-02 Marek Safar <marek.safar@seznam.cz>
5438 * attribute.cs (Resolve): Improved implementation of params
5439 attribute arguments.
5441 * support.cs (ParameterData): Add HasParams to be faster.
5443 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
5445 all things are for /doc support:
5447 * doc.cs: new file that supports XML documentation generation.
5448 * mcs.exe.sources: added doc.cs.
5450 Handle /doc command line option.
5451 Report error 2006 instead of 5 for missing file name for /doc.
5452 Generate XML documentation when required, after type resolution.
5454 Added support for picking up documentation (/// and /** ... */),
5455 including a new XmlCommentState enumeration.
5457 Added lines to fill Documentation element for field, constant,
5458 property, indexer, method, constructor, destructor, operator, event
5459 and class, struct, interface, delegate, enum.
5460 Added lines to warn incorrect comment.
5462 Added Documentation field (passed only when /doc was specified).
5464 Added DocComment, DocCommentHeader, GenerateDocComment() and
5465 OnGenerateDocComment() and some supporting private members for
5466 /doc feature to MemberCore.
5468 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
5470 Added overriden DocCommentHeader.
5472 Added overriden DocCommentHeader and GenerateDocComment().
5474 2004-12-01 Miguel de Icaza <miguel@ximian.com>
5476 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
5477 unwrapping the enumeration values, chain to
5478 DoConstantNumericPromotions again, so we can promote things to the
5479 fundamental types (takes care of enums that are bytes, sbytes).
5483 2004-12-01 Raja R Harinath <rharinath@novell.com>
5485 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
5486 Fix long-standing bug in type-lookup. Use FindType instead of
5487 LookupType when ec.ResolvingTypeTree.
5488 (Attribute.ResolveType, Attribute.Resolve)
5489 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
5491 (Attributes.Search): Remove internal version. Update.
5492 (Attributes.SearchMulti): Update.
5493 (Attributes.GetClsCompliantAttribute): Remove.
5494 (Attributes.GetIndexerNameAttribute): Remove.
5495 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
5496 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
5497 * class.cs (Indexer.Define): Likewise.
5499 2004-12-01 Marek Safar <marek.safar@seznam.cz>
5502 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
5503 MarshallByReference members access.
5505 * expression.cs: Use CheckMarshallByRefAccess;
5506 Better error CS0197 message.
5508 * report.cs: Print whole related error message.
5510 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5512 * class (GetClassBases): Better error 60 report.
5513 (EventProperty): Disabled warning 67 detection.
5515 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5518 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
5520 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
5523 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5526 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
5528 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
5530 2004-11-26 Miguel de Icaza <miguel@ximian.com>
5532 * attribute.cs (Attribute.Resolve): Refine error reporting and
5533 report a cs0117 if the identifier does not exist, to distinguish
5534 from 0617 which is a miss-use of the actual identifier.
5536 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
5537 between cs0070 and cs0079.
5539 * class.cs (MemberBase.DoDefine): When reporting a wrong
5540 accessibility level, we use MethodCore to compare instead of
5541 Method (this was a regression in some refactoring effort).
5543 So now we correctly report cs0056 again.
5545 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
5546 testing the target_type (which was known to be object_type) and
5547 not the source type (which is anonymous_method).
5549 Fixed reporting of error cs1660.
5551 * expression.cs (UserCast.Source): Expose the underlying cast.
5553 * statement.cs (Switch.SwitchGoverningType): Sort the list of
5554 allowed types to find a match to int32 first (most common).
5556 In addition, it ignores any ImplicitUserConversions that did an
5557 internal implicit conversion (as the switch statement allows only
5558 one integral conversion to exist).
5560 * class.cs (PartialContainer.Create): rename `name' to
5561 `member_name' for clarity. Then replace the string calls with a
5562 call to MemberName.GetPartialName, as now using
5563 MemberName.ToString is an error (this is due to the side effects
5564 it had, that were fixed in the past).
5566 This will restore the error reporting on a number of partial class
5567 errors that were missusing this (and getting an exception as a
5568 results, which is now just a plain textual warning, because
5569 yyparse debug output would crash otherwise).
5571 2004-11-26 Raja R Harinath <rharinath@novell.com>
5573 * Makefile (PROGRAM_INSTALL_DIR): Remove.
5575 2004-11-25 Ben Maurer <bmaurer@ximian.com>
5577 * rootcontext.cs (LookupType): Make sure to cache lookups that
5578 don't give us a negative result. This saves about 5% of corlib
5581 2004-11-25 Miguel de Icaza <miguel@ximian.com>
5583 * report.cs (AbstractMessage.Print): messages are sent to stderr
5585 * class.cs (TypeContainer.GetClassBases): It is an error to have a
5586 non-interface in the list of interfaces (at this point, either
5587 parent was properly set, or a base class is being listed in the
5588 interfaces section).
5590 This flags error 1722, and resolves the crash from bug 69259.
5592 2004-11-25 Ben Maurer <bmaurer@ximian.com>
5594 * statement.cs (Using.EmitExpressionFinally): make this work right
5595 for valuetypes. Fixes 69926.
5597 2004-11-25 Miguel de Icaza <miguel@ximian.com>
5599 * const.cs (Const.ChangeType): Cope with the "0 literal can be
5600 converted to an enum" here, before we try to change the underlying
5601 type. This code exists, but it is a different code path than the
5602 one used while encoding constants.
5604 (ImplicitReferenceConversionExists): In addition, resynchronized
5605 the code here, so it matches the same code in
5606 ImplicitReferenceConversionExists for the `from any class-type S
5607 to any interface-type T'.
5609 2004-11-25 Marek Safar <marek.safar@seznam.cz>
5611 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
5613 2004-11-24 Miguel de Icaza <miguel@ximian.com>
5615 * cs-parser.jay: Use verbosity accordingly.
5617 2004-11-24 Marek Safar <marek.safar@seznam.cz>
5619 * expression.cs (Unary.ResolveOperator): Do not report warning;
5620 AddressOf reads from variable.
5622 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
5624 2004-11-24 Marek Safar <marek.safar@seznam.cz>
5628 * attribute.cs (Attributable): Removed CheckTargets.
5629 (Attributes.Emit): Explicit attribute targets are tested here.
5631 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
5632 not enabled for interfaces.
5634 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
5635 (GetAssemblyName): Ouch next bug there.
5637 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
5639 * expression.cs: Error 275 added.
5641 2004-11-23 Marek Safar <marek.safar@seznam.cz>
5643 Fix bug #69177 (Implemented decimal constant support)
5645 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
5646 (BinaryFold): Add DecimalConstant.
5648 * const.cs (Define): Decimal constant
5650 (ChangeType): Add decimal type handling.
5651 (LookupConstantValue): Don't set value for decimal type but
5652 emit DecimalConstantAttribute. Needed for constant optimization.
5654 * constant.cs (ToDecimal): New method.
5655 (ConvertToDecimal): New method.
5656 (IntConstant): Implemented ConvertToDecimal.
5657 (DecimalConstant.Emit): Emit optimized version for decimals in
5660 * expression.cs (ResolveOperator): Changed order of constant
5661 reduction to work correctly with native types which have
5662 overloaded operators.
5663 (ResolveMemberAccess): Extract constant value from attribute
5666 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
5668 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
5669 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
5670 (ChangeType): Decimal is special.
5671 (TypeToCoreType): Add decimal type.
5673 2004-11-22 Marek Safar <marek.safar@seznam.cz>
5675 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
5678 2004-11-22 Marek Safar <marek.safar@seznam.cz>
5680 * class.cs (EventField.ApplyAttributeBuilder): Fix error
5683 2004-11-19 Marek Safar <marek.safar@seznam.cz>
5685 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
5687 * pending.cs (PendingImplementation): Grab only interfaces.
5689 2004-11-19 Marek Safar <marek.safar@seznam.cz>
5691 * statement.cs (ForeachHelperMethods): Add location member and
5692 error 202 detection.
5694 2004-11-18 Marek Safar <marek.safar@seznam.cz>
5696 * expression.cs (DoResolveBase): Fixed wrong warning for out
5699 2004-12-04 Martin Baulig <martin@ximian.com>
5701 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
5702 to check whether the conversion is ok.
5704 * typemanager.cs (TypeManager.GetTypeArguments): Just return
5705 `Type.EmptyTypes' if we're not a generic TypeContainer.
5707 2004-11-25 Miguel de Icaza <miguel@ximian.com>
5709 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
5710 old bug: when converting from the null literal to a pointer,
5711 return an EmptyCast, not the NullLiteral.
5713 This fixes #69921, the recent null_type changes probably made this
5716 2004-12-03 Martin Baulig <martin@ximian.com>
5718 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
5719 method as our child, call AnonymousMethod.Compatible() on it.
5721 2004-12-02 Miguel de Icaza <miguel@ximian.com>
5723 * class.cs (FieldBase): Use an unused bit field from the field to
5724 encode the `has_offset' property from the FieldMember. This saves
5725 a couple of Ks on bootstrap compilation.
5727 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
5728 method as our child, return the AnonymousMethod resolved
5731 * expression.cs (New.DoResolve): Allow return values from
5732 NewDelegate to also include AnonymousMethods.
5736 2004-11-29 Raja R Harinath <rharinath@novell.com>
5738 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
5740 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
5741 System.Runtime.InteropServices._Exception, since it's a base
5742 interface of the core type System.Exception in the net_2_0 profile.
5744 2004-11-27 Martin Baulig <martin@ximian.com>
5746 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
5748 2004-11-26 Raja R Harinath <rharinath@novell.com>
5750 * Makefile: Convert to use executable.make.
5751 * gmcs.exe.sources: New.
5753 2004-11-25 Martin Baulig <martin@ximian.com>
5755 * expression.cs (Invocation.InferType): Added support for byref types.
5757 2004-11-25 Martin Baulig <martin@ximian.com>
5759 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
5760 in TypeManager.TypeToCoreType().
5762 2004-11-25 Martin Baulig <martin@ximian.com>
5764 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
5765 "Dispose" method from the `current_type'.
5766 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
5767 DoDefineMembers() instead of using the MethodBuilder; this is
5768 required for generic iterators.
5770 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
5772 2004-11-24 Martin Baulig <martin@ximian.com>
5774 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
5776 2004-11-20 Martin Baulig <martin@ximian.com>
5778 * expression.cs (Invocation.InferType): Correctly infer generic
5779 instances; see gen-103.cs.
5780 (Invocation.InferTypeArguments): If a generic method doesn't have
5781 any unbound type parameters, we don't need to infer anything.
5783 2004-11-19 Raja R Harinath <rharinath@novell.com>
5785 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
5787 2004-11-17 Raja R Harinath <rharinath@novell.com>
5789 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
5790 (TypeHandle.GetMemberCache): New.
5791 (TypeHandle.TypeHandle): Update.
5792 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
5793 (TypeManager.LookupParentInterfacesCache):
5794 Rename from LookupInterfaceCache. Optimize slightly.
5795 (TypeManager.MemberLookup_FindMembers): Update.
5796 * decl.cs (MemberCache.MemberCache): Set Container to null in the
5798 (AddCacheContents): Rename from AddHashtable.
5799 * class.cs (TypeContainer.parent_container): Remove.
5800 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
5801 (TypeContainer.DoDefineMembers): Don't initialize it.
5802 Update to name changes.
5804 2004-11-17 Miguel de Icaza <miguel@ximian.com>
5806 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
5807 that factors the code to check access modifiers on override.
5809 (PropertyBase): Use the code here.
5811 Patch from Lluis S'anchez, fixes bug #69361.
5813 2004-11-15 Miguel de Icaza <miguel@ximian.com>
5815 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
5816 routine that is used to report the use of a captured variable
5817 whose address has been taken.
5819 There are two checks: one when variables are being captured and
5820 the other check is when the address of a variable is taken.
5822 (because an anonymous methods might be resolved before *or* after
5823 the address has been taken) and
5825 * expression.cs (Conditional.DoResolve): Remove the special
5826 casing that Martin added to trueExpr and falseExpr being both
5827 NullLiteral. We get the right behavior now just by introducing
5828 the null_type into the compiler.
5830 * convert.cs (ExplicitConversion): Change the code to use
5831 null_type instead of testing `expr is NullLiteral'.
5832 (ImplicitConversionStandard): use null_type too.
5833 (ImplicitReferenceConversionExists): use null_type too.
5834 (ImplicitReferenceConversion): use null_type too.
5836 * literal.cs: The type of `NullLiteral' is now null_type instead
5838 (Resolve): Set the type here.
5840 * typemanager.cs: Introduce null_type.
5842 2004-11-18 Martin Baulig <martin@ximian.com>
5845 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
5847 2004-11-18 Martin Baulig <martin@ximian.com>
5849 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
5851 2004-11-18 Martin Baulig <martin@ximian.com>
5853 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
5854 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
5855 call ResolveConstructedType() on it to resolve it without checking
5857 (Constraints.ResolveTypes): Check them here.
5858 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
5859 but don't check constraints.
5860 (ConstructedType.ResolveAsTypeTerminal): Override this and also
5861 check constraints here.
5862 (ConstructedType.ResolveConstructedType): New public method. This
5863 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
5864 resolve ourselves without checking constraints.
5866 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
5868 2004-11-18 Martin Baulig <martin@ximian.com>
5871 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
5873 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
5875 2004-11-18 Martin Baulig <martin@ximian.com>
5877 * ecore.cs (TypeExpr.ResolveType): Removed.
5878 (Expression.ResolveAsTypeTerminal): We always return a fully
5879 resolved `TypeExpr', so we can just access its `Type'.
5881 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
5883 2004-11-17 Martin Baulig <martin@ximian.com>
5885 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
5886 sure we don't return any unresolved TypeExpr's.
5887 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
5889 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
5891 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
5892 unresolved `ConstructedType's.
5894 2004-11-17 Martin Baulig <martin@ximian.com>
5896 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
5898 2004-11-17 Martin Baulig <martin@ximian.com>
5901 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
5903 * decl.cs (DeclSpace.ResolveType): Removed.
5904 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
5906 2004-11-17 Martin Baulig <martin@ximian.com>
5908 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
5909 direction, like FindMembers() does. Fixes #69546, testcase is in
5912 2004-11-16 Martin Baulig <martin@ximian.com>
5914 This is based on a patch from Marek Safar, see bug #69082.
5915 Fixes bugs #63705 and #67130.
5917 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
5918 method; create a MemberCache for an interface type and cache the
5921 * decl.cs (IMemberContainer.ParentContainer): Removed.
5922 (IMemberContainer.ParentCache): New property.
5923 (MemberCache.SetupCacheForInterface): Removed.
5924 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
5925 to create a cache for an interface's "parent".
5927 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
5930 2004-11-14 Ben Maurer <bmaurer@ximian.com>
5932 * statement.cs: Avoid adding bools to a hashtable.
5934 2004-11-15 Martin Baulig <martin@ximian.com>
5936 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
5938 2004-11-11 Martin Baulig <martin@ximian.com>
5940 * typemanager.cs (TypeManager.GetMethodName): New method.
5942 * class.cs (MethodData.Define): Include the generic arity in the
5943 name of an explicit interface; also add it to the method name.
5945 * pending.cs (PendingImplementation.InterfaceMethod): The method
5946 name now includes the generic arity.
5948 2004-11-07 Miguel de Icaza <miguel@ximian.com>
5950 * expression.cs (Invocation.OverloadResolve): Flag error if we are
5951 calling an unsafe method from a safe location.
5953 2004-11-06 Marek Safar <marek.safar@seznam.cz>
5956 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
5958 2004-11-06 Miguel de Icaza <miguel@ximian.com>
5960 * namespace.cs (VerifyUsing): use GetPartialName instead of
5963 2004-11-05 Miguel de Icaza <miguel@ximian.com>
5965 * statement.cs (Return.Resolve): Fix regression in typo: if
5966 `in_exc', we have to request a NeedReturnLabel, this was a typo
5967 introduced in the anonymous method check-in. Fixes #69131.
5969 * Indexers were using the ShortName when defining themselves,
5970 causing a regression in the compiler bootstrap when applying the
5971 patch from 2004-11-02 (first part), now they use their full name
5972 and the bug is gone.
5974 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
5976 * driver.cs: Strip the path from the names of embedded resources. Fixes
5979 2004-11-04 Raja R Harinath <rharinath@novell.com>
5981 Fix error message regression: cs0104-2.cs.
5982 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
5983 (AliasEntry.Resolve): Update.
5984 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
5986 (RootContext.LookupType): Update.
5988 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
5990 * cs-parser.jay: Add support for handling accessor modifiers
5991 * class: Add support port accessor modifiers and error checking,
5992 define PropertyMethod.Define as virtual (not abstract anymore)
5993 * ecore.cs: Add checking for proeprties access with access modifiers
5994 * iterators.cs: Modify Accessor constructor call based in the modified
5996 2004-11-02 Ben Maurer <bmaurer@ximian.com>
5998 * expression.cs (StringConcat): Handle being called twice,
5999 as when we have a concat in a field init with more than two
6002 2004-11-02 Miguel de Icaza <miguel@ximian.com>
6004 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6005 special case explicit implementations, we should always produce
6006 the .property or .event declaration.
6008 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6009 since it will not return correct data if people use this
6010 unresolved in the presence of using statements (see test-313).
6012 * class.cs (MethodData.Define): If we are an explicit interface
6013 implementation, set the method name to the full name of the
6014 interface plus the name of the method.
6016 Notice that using the method.MethodName.GetFullName() does not
6017 work, as it will only contain the name as declared on the source
6018 file (it can be a shorthand in the presence of using statements)
6019 and not the fully qualifed type name, for example:
6023 class D : ICloneable {
6024 object ICloneable.Clone () {
6028 Would produce a method called `ICloneable.Clone' instead of
6029 `System.ICloneable.Clone'.
6031 * namespace.cs (Alias.Resolve): Use GetPartialName.
6033 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6035 * cs-parser.jay: Add error 1055 report.
6037 2004-11-01 Miguel de Icaza <miguel@ximian.com>
6039 * assign.cs (Assign.DoResolve): Only do the transform of
6040 assignment into a New if the types are compatible, if not, fall
6041 through and let the implicit code deal with the errors and with
6042 the necessary conversions.
6044 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6046 * cs-parser.jay: Add error 1031 report.
6048 * cs-tokenizer.cs: Add location for error 1038.
6050 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6052 * cs-parser.jay: Add error 1016 report.
6054 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6056 * cs-parser.jay: Add errors 1575,1611 report.
6058 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6060 * cs-parser.jay: Add error 1001 report.
6062 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6065 * attribute.cs (GetMarshal): Add method argument for
6066 caller identification.
6068 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6069 agument for GetMarshal and RuntimeMissingSupport.
6071 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6073 * attribute.cs (ExtractSecurityPermissionSet): Removed
6074 TypeManager.code_access_permission_type.
6076 * typemanager.cs: Removed TypeManager.code_access_permission_type.
6078 2004-10-27 Miguel de Icaza <miguel@ximian.com>
6080 * expression.cs (LocalVariableReference.DoResolveLValue): Check
6081 for obsolete use of a variable here. Fixes regression on errors
6082 cs0619-25 and cs0619-26.
6084 2004-10-27 Marek Safar <marek.safar@seznam.cz>
6086 Fix #62358, implemented security attribute encoding.
6088 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6089 Tests permitted SecurityAction for assembly or other types.
6090 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6091 data from SecurityPermissionAttribute to PermisionSet class.
6093 * class.cs (ApplyAttributeBuilder): Added special handling
6094 for System.Security.Permissions.SecurityAttribute based types.
6096 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6097 special handling for System.Security.Permissions.SecurityAttribute
6100 * enum.cs (ApplyAttributeBuilder): Added special handling
6101 for System.Security.Permissions.SecurityAttribute based types.
6103 * parameter.cs (ApplyAttributeBuilder): Added special handling
6104 for System.Security.Permissions.SecurityAttribute based types.
6106 * rootcontext.cs: Next 2 core types.
6108 * typemanager.cs (TypeManager.security_permission_attr_type):
6109 Built in type for the SecurityPermission Attribute.
6110 (code_access_permission_type): Build in type.
6112 2004-10-17 Miguel de Icaza <miguel@ximian.com>
6114 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6115 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6116 all of this information into
6117 EmitContext.EmitCapturedVariableInstance.
6119 * codegen.cs (EmitCapturedVariableInstance): move here the
6120 funcionality of emitting an ldarg.0 in the presence of a
6121 remapping. This centralizes the instance emit code.
6123 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6124 then emit a load of this: it means that we have reached the
6125 topmost ScopeInfo: the one that contains the pointer to the
6126 instance of the class hosting the anonymous method.
6128 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6129 captures to the topmost CaptureContext.
6131 2004-10-12 Miguel de Icaza <miguel@ximian.com>
6133 * expression.cs (LocalVariableReference): Move the knowledge about
6134 the iterators into codegen's EmitCapturedVariableInstance.
6136 2004-10-11 Miguel de Icaza <miguel@ximian.com>
6138 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6139 all code paths return a value from an anonymous method (it is the
6140 same as the 161 error, but for anonymous methods).
6142 2004-10-08 Miguel de Icaza <miguel@ximian.com>
6144 The introduction of anonymous methods in the compiler changed
6145 various ways of doing things in the compiler. The most
6146 significant one is the hard split between the resolution phase
6147 and the emission phases of the compiler.
6149 For instance, routines that referenced local variables no
6150 longer can safely create temporary variables during the
6151 resolution phase: they must do so from the emission phase,
6152 since the variable might have been "captured", hence access to
6153 it can not be done with the local-variable operations from the runtime.
6157 (Block.Flags): New flag `IsTopLevel' to indicate that this block
6158 is a toplevel block.
6160 (ToplevelBlock): A new kind of Block, these are the blocks that
6161 are created by the parser for all toplevel method bodies. These
6162 include methods, accessors and anonymous methods.
6164 These contain some extra information not found in regular blocks:
6165 A pointer to an optional CaptureContext (for tracking captured
6166 local variables and parameters). A pointer to the parent
6169 (Return.Resolve): Catch missmatches when returning a value from an
6170 anonymous method (error 1662).
6171 Invoke NeedReturnLabel from the Resolve phase instead of the emit
6174 (Break.Resolve): ditto.
6176 (SwitchLabel): instead of defining the labels during the
6177 resolution phase, we now turned the public ILLabel and ILLabelCode
6178 labels into methods called GetILLabelCode() and GetILLabel() that
6179 only define the label during the Emit phase.
6181 (GotoCase): Track the SwitchLabel instead of the computed label
6182 (its contained therein). Emit the code by using
6183 SwitchLabel.GetILLabelCode ().
6185 (LocalInfo.Flags.Captured): A new flag has been introduce to track
6186 whether the Local has been captured or not.
6188 (LocalInfo.IsCaptured): New property, used to tell whether the
6189 local has been captured.
6191 * anonymous.cs: Vastly updated to contain the anonymous method
6194 The main classes here are: CaptureContext which tracks any
6195 captured information for a toplevel block and ScopeInfo used to
6196 track the activation frames for various local variables.
6198 Each toplevel block has an optional capture context associated
6199 with it. When a method contains an anonymous method both the
6200 toplevel method and the anonymous method will create a capture
6201 context. When variables or parameters are captured, they are
6202 recorded on the CaptureContext that owns them, for example:
6206 MyDelegate d = delegate {
6211 Here `a' will be recorded as captured on the toplevel
6212 CapturedContext, the inner captured context will not have anything
6213 (it will only have data if local variables or parameters from it
6214 are captured in a nested anonymous method.
6216 The ScopeInfo is used to track the activation frames for local
6217 variables, for example:
6219 for (int i = 0; i < 10; i++)
6220 for (int j = 0; j < 10; j++){
6221 MyDelegate d = delegate {
6226 At runtime this captures a single captured variable `i', but it
6227 captures 10 different versions of the variable `j'. The variable
6228 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6229 recorded on a child.
6231 The toplevel ScopeInfo will also track information like the `this'
6232 pointer if instance variables were referenced (this is necessary
6233 as the anonymous method lives inside a nested class in the host
6234 type of the method).
6236 (AnonymousMethod): Expanded to track the Toplevel, implement
6237 `AnonymousMethod.Compatible' to tell whether an anonymous method
6238 can be converted to a target delegate type.
6240 The routine now also produces the anonymous method content
6242 (AnonymousDelegate): A helper class that derives from
6243 DelegateCreation, this is used to generate the code necessary to
6244 produce the delegate for the anonymous method that was created.
6246 * assign.cs: API adjustments for new changes in
6247 Convert.ImplicitStandardConversionExists.
6249 * class.cs: Adjustments to cope with the fact that now toplevel
6250 blocks are of type `ToplevelBlock'.
6252 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6253 insteda of standard blocks.
6255 Flag errors if params arguments are passed to anonymous methods.
6257 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6258 `CurrentAnonymousMethod' which points to the current Anonymous
6259 Method. The variable points to the AnonymousMethod class that
6260 holds the code being compiled. It is set in the new EmitContext
6261 created for the anonymous method.
6263 (EmitContext.Phase): Introduce a variable and an enumeration to
6264 assist in enforcing some rules about when and where we are allowed
6265 to invoke certain methods (EmitContext.NeedsReturnLabel is the
6266 only one that enfonces this right now).
6268 (EmitContext.HaveCaptureInfo): new helper method that returns
6269 whether we have a CapturedContext initialized.
6271 (EmitContext.CaptureVariable): New method used to register that a
6272 LocalInfo must be flagged for capturing.
6274 (EmitContext.CapturedParameter): New method used to register that a
6275 parameters must be flagged for capturing.
6277 (EmitContext.CapturedField): New method used to register that a
6278 field must be flagged for capturing.
6280 (EmitContext.HaveCapturedVariables,
6281 EmitContext.HaveCapturedFields): Return whether there are captured
6282 variables or fields.
6284 (EmitContext.EmitMethodHostInstance): This is used to emit the
6285 instance for the anonymous method. The instance might be null
6286 (static methods), this (for anonymous methods that capture nothing
6287 and happen to live side-by-side with the current method body) or a
6288 more complicated expression if the method has a CaptureContext.
6290 (EmitContext.EmitTopBlock): Routine that drives the emission of
6291 code: it will first resolve the top block, then emit any metadata
6292 and then emit the code. The split is done so that we can extract
6293 any anonymous methods and flag any captured variables/parameters.
6295 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6296 during this phase, the ILGenerator should not be used as labels
6297 and local variables declared here might not be accessible to any
6298 code that is part of an anonymous method.
6300 Exceptions to this include the temporary variables that are
6301 created by some statements internally for holding temporary
6304 (EmitContext.EmitMeta): New routine, in charge of emitting all the
6307 (EmitContext.TemporaryReturn): This method is typically called
6308 from the Emit phase, and its the only place where we allow the
6309 ReturnLabel to be defined other than the EmitMeta. The reason is
6310 that otherwise we would have to duplicate a lot of logic in the
6311 Resolve phases of various methods that today is on the Emit
6314 (EmitContext.NeedReturnLabel): This no longer creates the label,
6315 as the ILGenerator is not valid during the resolve phase.
6317 (EmitContext.EmitThis): Extended the knowledge in this class to
6318 work in anonymous methods in addition to iterators.
6320 (EmitContext.EmitCapturedVariableInstance): This emits whatever
6321 code is necessary on the stack to access the instance to a local
6322 variable (the variable will be accessed as a field).
6324 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6325 EmitContext.EmitAddressOfParameter): Routines to support
6326 parameters (not completed at this point).
6328 Removals: Removed RemapLocal and RemapLocalLValue. We probably
6329 will also remove the parameters.
6331 * convert.cs (Convert): Define a `ConstantEC' which points to a
6332 null. This is just to prefity some code that uses
6333 ImplicitStandardConversion code and do not have an EmitContext
6336 The idea is to flag explicitly that at that point in time, it is
6337 known that the conversion will not trigger the delegate checking
6338 code in implicit conversions (which requires a valid
6341 Everywhere: pass new EmitContext parameter since
6342 ImplicitStandardConversionExists now requires it to check for
6343 anonymous method conversions.
6345 (Convert.ImplicitStandardConversionExists): If the type of an
6346 expression is the anonymous_method_type, and the type is a
6347 delegate, we invoke the AnonymousMethod.Compatible method to check
6348 whether an implicit conversion is possible.
6350 (Convert.ImplicitConversionStandard): Only do implicit method
6351 group conversions if the language level is not ISO_1.
6353 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6354 MethodInfo for the Invoke method. used by Delegate and
6357 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6358 method conversions if the target type is a delegate.
6360 Removed extra debugging nops.
6362 (LocalVariableReference): Turn the `local_info' into a public
6365 Add `prepared' field, the same hack used for FieldExprs to cope
6366 with composed assignments, as Local variables do not necessarily
6367 operate purely on the stack as they used to: they can be captured
6370 Add `temp' for a temporary result, like fields.
6372 Refactor DoResolve and DoResolveLValue into DoResolveBase.
6374 It now copes with Local variables that are captured and emits the
6375 proper instance variable to load it from a field in the captured
6378 (ParameterReference.DoResolveBase): During the resolve phase,
6379 capture parameters if we are in an anonymous method.
6381 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
6382 anonymous method, use the EmitContext helper routines to emit the
6383 parameter reference.
6385 * iterators.cs: Set RemapToProxy to true/false during the
6388 * parameters.cs (GetParameterByName): New helper method.
6390 * typemanager.cs (anonymous_method_type) a new type that
6391 represents an anonyous method. This is always an internal type,
6392 used as a fencepost to test against the anonymous-methodness of an
6395 2004-10-20 Marek Safar <marek.safar@seznam.cz>
6397 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
6399 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
6401 2004-11-10 Martin Baulig <martin@ximian.com>
6403 * expression.cs (Invocation.BetterFunction): If two methods have
6404 equal parameter types, but only one of them is generic, the
6405 non-generic one wins.
6406 (New.DoResolve): Don't set `is_struct' to false if we're a generic
6407 instance; just use `Type.IsValueType' to determine whether
6408 something is a struct or not.
6409 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
6410 so we can be called multiple times.
6412 2004-11-10 Martin Baulig <martin@ximian.com>
6414 * generic.cs (TypeParameter.DefineConstraints): New public method.
6415 (TypeParameter.CheckAccessLevel): Override this and return true.
6416 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
6417 override ResolveType() anymore.
6418 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
6420 2004-11-10 Martin Baulig <martin@ximian.com>
6422 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
6423 call DeclSpace.ResolveNestedType() on it.
6425 2004-11-10 Martin Baulig <martin@ximian.com>
6427 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
6428 non-null, call ParameterModifier() on it.
6430 2004-11-10 Martin Baulig <martin@ximian.com>
6433 (Iterators): Added `current_type' and `this_type' fields.
6434 (Iterators.DefineIterator): Create a new EmitContext and store it
6435 in `ec'; compute `this_type'.
6437 2004-11-10 Martin Baulig <martin@ximian.com>
6440 (TypeManager.IsPrivateAccessible): New public method.
6441 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
6443 2004-11-10 Martin Baulig <martin@ximian.com>
6445 * class.cs (TypeContainer.DefineType): Call
6446 TypeBuilder.DefineGenericParameters() before resolving the type
6448 (MethodData.parent_method): New protected field.
6449 (MethodData..ctor): Added `MethodInfo parent_method' argument.
6450 (MethodData.Define): Compute `parent_method'.
6453 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6454 (MemberCore.GetClsCompliantAttributeValue): Likewise.
6455 (DeclSpace.ec): New protected field; store the EmitContext here.
6456 (DeclSpace.EmitContext): New public property.
6457 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
6458 (DeclSpace.ResolveNestedType): New public method.
6459 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
6460 (DeclSpace.NestedAccessible): Added `Type tb' argument.
6461 (DeclSpace.FamilyAccessible): Likewise.
6462 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
6463 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6466 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
6469 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6470 (Enum.Emit): Don't create a new EmitContext.
6472 2004-10-18 Martin Baulig <martin@ximian.com>
6474 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
6475 `Type' directly, but call ResolveType() on it.
6476 (Catch.Resolve): Likewise.
6477 (Foreach.Resolve): Likewise.
6479 2004-10-18 Martin Baulig <martin@ximian.com>
6481 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
6482 `Type' directly, but call ResolveType() on it.
6483 (Probe.DoResolve): Likewise.
6484 (ArrayCreation.LookupType): Likewise.
6485 (TypeOf.DoResolve): Likewise.
6486 (SizeOf.DoResolve): Likewise.
6488 2004-10-18 Raja R Harinath <rharinath@novell.com>
6490 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6493 2004-10-17 John Luke <john.luke@gmail.com>
6495 * class.cs (Operator.GetSignatureForError): use CSharpName
6497 * parameter.cs (Parameter.GetSignatureForError): Returns
6498 correct name even if was not defined.
6500 2004-10-13 Raja R Harinath <rharinath@novell.com>
6503 * class.cs (TypeContainer.EmitContext): New property.
6504 (DefineNestedTypes): Create an emitcontext for each part.
6505 (MethodCore.DoDefineParameters): Use container's emitcontext.
6506 Pass type array to InternalParameters.
6507 (MemberBase.DoDefine): Use container's emitcontext.
6508 (FieldMember.Define): Likewise.
6509 (Event.Define): Likewise.
6510 (SetMethod.GetParameterInfo): Change argument to EmitContext.
6511 Pass type array to InternalParameters.
6512 (SetIndexerMethod.GetParameterInfo): Likewise.
6513 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6514 * delegate.cs (Define): Pass emitcontext to
6515 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
6516 array to InternalParameters.
6517 * expression.cs (ParameterReference.DoResolveBase): Pass
6518 emitcontext to GetParameterInfo.
6519 (ComposedCast.DoResolveAsTypeStep): Remove check on
6520 ec.ResolvingTypeTree.
6521 * parameter.cs (Parameter.Resolve): Change argument to
6522 EmitContext. Use ResolveAsTypeTerminal.
6523 (Parameter.GetSignature): Change argument to EmitContext.
6524 (Parameters.ComputeSignature): Likewise.
6525 (Parameters.ComputeParameterTypes): Likewise.
6526 (Parameters.GetParameterInfo): Likewise.
6527 (Parameters.ComputeAndDefineParameterTypes): Likewise.
6528 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
6529 * support.cs (InternalParameters..ctor): Remove variant that takes
6531 * typemanager.cs (system_intptr_expr): New.
6532 (InitExpressionTypes): Initialize it.
6534 2004-10-12 Chris Toshok <toshok@ximian.com>
6536 * cs-parser.jay: fix location for try_statement and catch_clause.
6538 2004-10-18 Martin Baulig <martin@ximian.com>
6540 * class.cs (FieldMember.Define): Don't access the TypeExpr's
6541 `Type' directly, but call ResolveType() on it.
6542 (MemberBase.DoDefine): Likewise.
6544 * expression.cs (New.DoResolve): Don't access the TypeExpr's
6545 `Type' directly, but call ResolveType() on it.
6546 (ComposedCast.DoResolveAsTypeStep): Likewise.
6548 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6549 `Type' directly, but call ResolveType() on it.
6551 2004-10-17 John Luke <john.luke@gmail.com>
6553 * class.cs (Operator.GetSignatureForError): use CSharpName
6555 * parameter.cs (Parameter.GetSignatureForError): Returns
6556 correct name even if was not defined.
6558 2004-10-13 Raja R Harinath <rharinath@novell.com>
6561 * class.cs (TypeContainer.EmitContext): New property.
6562 (DefineNestedTypes): Create an emitcontext for each part.
6563 (MethodCore.DoDefineParameters): Use container's emitcontext.
6564 Pass type array to InternalParameters.
6565 (MemberBase.DoDefine): Use container's emitcontext.
6566 (FieldMember.Define): Likewise.
6567 (Event.Define): Likewise.
6568 (SetMethod.GetParameterInfo): Change argument to EmitContext.
6569 Pass type array to InternalParameters.
6570 (SetIndexerMethod.GetParameterInfo): Likewise.
6571 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6572 * delegate.cs (Define): Pass emitcontext to
6573 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
6574 array to InternalParameters.
6575 * expression.cs (ParameterReference.DoResolveBase): Pass
6576 emitcontext to GetParameterInfo.
6577 (ComposedCast.DoResolveAsTypeStep): Remove check on
6578 ec.ResolvingTypeTree.
6579 * parameter.cs (Parameter.Resolve): Change argument to
6580 EmitContext. Use ResolveAsTypeTerminal.
6581 (Parameter.GetSignature): Change argument to EmitContext.
6582 (Parameters.ComputeSignature): Likewise.
6583 (Parameters.ComputeParameterTypes): Likewise.
6584 (Parameters.GetParameterInfo): Likewise.
6585 (Parameters.ComputeAndDefineParameterTypes): Likewise.
6586 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
6587 * support.cs (InternalParameters..ctor): Remove variant that takes
6589 * typemanager.cs (system_intptr_expr): New.
6590 (InitExpressionTypes): Initialize it.
6592 2004-10-12 Chris Toshok <toshok@ximian.com>
6594 * cs-parser.jay: fix location for try_statement and catch_clause.
6596 2004-10-07 Raja R Harinath <rharinath@novell.com>
6598 More DeclSpace.ResolveType avoidance.
6599 * decl.cs (MemberCore.InUnsafe): New property.
6600 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
6601 with newly created EmitContext.
6602 (FieldMember.Define): Likewise.
6603 * delegate.cs (Delegate.Define): Likewise.
6604 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
6605 only if normal name-lookup fails.
6606 (TypeExpr.DoResolve): Enable error-checking.
6607 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
6608 (SizeOf.DoResolve): Likewise.
6609 (ComposedCast.DoResolveAsTypeStep): Likewise.
6610 (StackAlloc.DoResolve): Likewise.
6611 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
6612 (Block.Unsafe): New property.
6613 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
6614 (Unsafe): Set 'unsafe' flag of contained block.
6615 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
6616 (Fixed.Resolve): Likewise.
6617 (Catch.Resolve): Likewise.
6618 (Using.ResolveLocalVariableDecls): Likewise.
6619 (Foreach.Resolve): Likewise.
6621 2004-10-05 John Luke <john.luke@gmail.com>
6623 * cs-parser.jay: add location to error CS0175
6625 2004-10-04 Miguel de Icaza <miguel@ximian.com>
6627 * ecore.cs (Expression.Constantity): Add support for turning null
6630 * const.cs (Const.Define): Allow constants to be reference types
6631 as long as the value is Null.
6633 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
6635 * namespace.cs (NamespaceEntry.Using): No matter which warning
6636 level is set, check if this namespace name has already been added.
6638 2004-10-03 Ben Maurer <bmaurer@ximian.com>
6640 * expression.cs: reftype [!=]= null should always use br[true,false].
6643 2004-10-03 Marek Safar <marek.safar@seznam.cz>
6646 * attribute.cs: Enum conversion moved to
6647 GetAttributeArgumentExpression to be applied to the all
6650 2004-10-01 Raja R Harinath <rharinath@novell.com>
6652 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
6653 * class.c (TypeContainer.DefineType): Flag error if
6654 base types aren't accessible due to access permissions.
6655 * decl.cs (DeclSpace.ResolveType): Move logic to
6656 Expression.ResolveAsTypeTerminal.
6657 (DeclSpace.ResolveTypeExpr): Thin layer over
6658 Expression.ResolveAsTypeTerminal.
6659 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
6660 Refactor code into NestedAccess. Use it.
6661 (DeclSpace.NestedAccess): New.
6662 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
6663 argument to silence errors. Check access permissions.
6664 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
6665 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
6666 (Cast.DoResolve): Likewise.
6667 (New.DoResolve): Likewise.
6668 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
6669 (TypeOf.DoResolve): Likewise.
6671 * expression.cs (Invocation.BetterConversion): Return the Type of
6672 the better conversion. Implement section 14.4.2.3 more faithfully.
6673 (Invocation.BetterFunction): Make boolean. Make correspondence to
6674 section 14.4.2.2 explicit.
6675 (Invocation.OverloadResolve): Update.
6676 (Invocation): Remove is_base field.
6677 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
6678 (Invocation.Emit): Likewise.
6680 2004-09-24 Marek Safar <marek.safar@seznam.cz>
6682 * cs-parser.jay: Reverted 642 warning fix.
6684 2004-09-23 Marek Safar <marek.safar@seznam.cz>
6687 * decl.cs (FindMemberWithSameName): Indexer can have more than
6690 2004-09-23 Marek Safar <marek.safar@seznam.cz>
6692 * expression.cs (LocalVariableReference.DoResolveLValue):
6693 Do not report warning 219 for out values.
6694 (EmptyExpression.Null): New member to avoid extra allocations.
6696 2004-09-23 Marek Safar <marek.safar@seznam.cz>
6698 * cs-parser.jay: Fix wrong warning 642 report.
6700 * cs-tokenizer.cs (CheckNextToken): New helper;
6701 Inspect next character if is same as expected.
6703 2004-09-23 Martin Baulig <martin@ximian.com>
6705 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
6706 (Convert.ImplicitReferenceConversionExists): Likewise.
6708 2004-11-09 Raja R Harinath <rharinath@novell.com>
6710 * Makefile (DISTFILES): Comment out a few missing files.
6712 2004-10-29 Raja R Harinath <rharinath@novell.com>
6714 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
6715 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
6716 (gmcs.exe): Invoke bootstrap-libs.
6717 (clean-local): Clean the net_2_0_bootstrap profile too.
6718 (PROGRAM_INSTALL_DIR): New.
6719 (install-local): Use it.
6721 2004-10-13 Martin Baulig <martin@ximian.com>
6723 * generic.cs (TypeManager.InflatedConstraints): New nested class.
6724 (TypeParameter.DefineType): If we're a method type parameter and
6725 that method is overriding something, "inflate" its constraints.
6727 2004-10-12 Martin Baulig <martin@ximian.com>
6729 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
6730 and have type arguments, create and resolve a ConstructedType.
6732 2004-10-12 Martin Baulig <martin@ximian.com>
6734 * decl.cs (MemberCache.FindMemberToOverride): Use
6735 TypeManager.IsEqual() to compare the parameters and Type.Equals()
6736 to compare the invocationType.
6738 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
6739 When comparing two type parameters, only do the signature-only
6740 comparision for method type parameters.
6742 2004-10-11 Martin Baulig <martin@ximian.com>
6744 * report.cs: Don't make --fatal abort on warnings, we have
6745 -warnaserror for that.
6747 2004-10-11 Martin Baulig <martin@ximian.com>
6750 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
6751 (TypeManager.IsEqual): Call ourself recursively instead of using
6754 2004-10-11 Martin Baulig <martin@ximian.com>
6756 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
6757 on our own type parameters, not on the ones we inherit from a containing
6760 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
6763 * generic.cs (TypeParameter.Define): We may only be called once.
6765 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
6766 instead of TypeManager.IsEqual().
6768 2004-09-28 Martin Baulig <martin@ximian.com>
6771 (GenericConstraints.EffectiveBaseClass): New public property.
6772 (TypeParameter.GenericConstraints): New public property.
6773 (ConstructedType.CheckConstraints): Improved.
6775 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
6776 (Convert.TypeParameterConversion): New private method; use this in
6777 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
6778 for all conversions related to type parameters.
6780 2004-09-24 Martin Baulig <martin@ximian.com>
6782 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
6783 type parameter conversions for type parameters which are known to
6786 2004-09-24 Martin Baulig <martin@ximian.com>
6788 * generic.cs (GenericConstraints): Added `IsReferenceType' and
6789 `IsValueType' properties.
6791 * support.cs (ReflectionConstraints): Use
6792 Type.GetGenericParameterConstraints() instead of the old hack.
6794 2004-09-24 Martin Baulig <martin@ximian.com>
6796 * generic.cs (GenericConstraints): Moved here and made it an
6799 * support.cs (GenericConstraints): Moved to generic.cs.
6801 2004-09-24 Martin Baulig <martin@ximian.com>
6804 (ReflectionConstraints): Un-nested this class and made it public.
6807 (TypeManager.GetTypeParameterConstraints): New public method.
6808 (TypeManager.HasConstructorConstraint): Use the attributes.
6810 2004-09-24 Martin Baulig <martin@ximian.com>
6812 * support.cs (GenericConstraints): Replaced `HasConstructor',
6813 `IsReferenceType' and `IsValueType' with `Attributes'.
6814 (ReflectionParameters.ReflectionConstraints): Removed the Create()
6815 method and made the .ctor public.
6817 * generic.cs (Constraints.Attributes): New public property.
6818 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
6819 `IsReferenceType' -> `HasReferenceTypeConstraint' and
6820 `IsValueType' -> `HasValueTypeConstraint'.
6822 2004-09-23 Martin Baulig <martin@ximian.com>
6824 * generic.cs (Constraints): Reflect latest runtime changes.
6826 2004-09-23 Martin Baulig <martin@ximian.com>
6828 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
6829 (Convert.ImplicitReferenceConversionExists): Likewise.
6831 2004-09-23 Marek Safar <marek.safar@seznam.cz>
6833 * class.cs (Operator.Define): Add error 448 and 559 report.
6835 2004-09-22 Marek Safar <marek.safar@seznam.cz>
6837 * class.cs (MemberBase.IsTypePermitted): New protected
6838 method for checking error CS0610.
6840 2004-09-22 Marek Safar <marek.safar@seznam.cz>
6842 * class.cs (TypeContainer.HasExplicitLayout): New property
6843 Returns whether container has StructLayout attribute set Explicit.
6844 (FieldMember): New abstract class for consts and fields.
6845 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
6846 (Field): Reuse FieldMember.
6848 * const.cs (Const): Reuse FieldMember.
6850 * rootcontext.cs: EmitConstants call moved to class.
6852 2004-09-22 Martin Baulig <martin@ximian.com>
6854 Marek and me just fixed one of our oldest bugs: #28562 :-)
6856 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
6858 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
6859 we're an EnumConstant, just return that.
6860 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
6861 an EnumConstant. In this case, we need to use GetValueAsEnumType()
6862 to get the value which'll actually be written into the attribute.
6863 However, we have to use GetValue() to access the attribute's value
6866 2004-09-22 Marek Safar <marek.safar@seznam.cz>
6868 * constant.cs (Constant.IsNegative): New abstract property
6871 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
6872 (StackAlloc.DoResolve): Reused IsNegative.
6874 2004-09-22 Martin Baulig <martin@ximian.com>
6876 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
6877 public method; like LookupTypeContainer, but also works for
6880 * report.cs (Report.SymbolRelatedToPreviousError): Use
6881 TypeManager.LookupGenericTypeContainer().
6883 2004-09-22 Martin Baulig <martin@ximian.com>
6885 Thanks to Peter Sestoft for this bug report.
6887 * expression.cs (Conditional): If both the `trueExpr' and the
6888 `falseExpr' is a NullLiteral, return a NullLiteral.
6890 2004-09-22 Martin Baulig <martin@ximian.com>
6892 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
6893 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
6894 for the "get_Current" call.
6896 2004-09-21 Martin Baulig <martin@ximian.com>
6898 * convert.cs (Convert.ImplicitReferenceConversion): When
6899 converting to an interface type, first check whether we're
6900 converting from a reference type.
6902 2004-09-14 Martin Baulig <martin@ximian.com>
6904 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
6906 2004-09-14 Marek Safar <marek.safar@seznam.cz>
6909 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
6910 called and is obsolete then this member suppress message
6911 when call is inside next [Obsolete] method or type.
6913 * expression.cs: Use TestObsoleteMethodUsage member.
6915 2004-09-14 Martin Baulig <martin@ximian.com>
6917 * genericparser.cs: Removed.
6919 2004-09-13 Marek Safar <marek.safar@seznam.cz>
6921 * class.cs (MethodCore.CheckBase): Fix bug #65757.
6923 2004-09-12 Marek Safar <marek.safar@seznam.cz>
6925 * attribute.cs (Attribute.Resolve): Add error 653 report.
6927 * class.cs (Class.ApplyAttributeBuilder): Add error 641
6929 (Method.ApplyAttributeBuilder): Add error 685 report.
6930 (Operator.Define): Add error 564 report.
6932 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
6934 * expression.cs (Invocation.DoResolve): Add error
6937 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
6940 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6942 * class.cs (ConstructorInitializer.Resolve):
6943 Wrong error number (515->516).
6945 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6947 * class.cs (Indexer.Define): Add error 631 report.
6949 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6951 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
6953 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6955 * expression.cs (Probe.DoResolve): Add error CS0241 report.
6957 2004-09-10 Marek Safar <marek.safar@seznam.cz>
6959 * cs-parser.jay: Added error CS0241 report.
6961 2004-09-10 Raja R Harinath <rharinath@novell.com>
6963 * cs-parser.jay (fixed_statement): Introduce a scope for the
6964 declaration in the 'fixed' statement.
6966 2004-09-09 Marek Safar <marek.safar@seznam.cz>
6968 * cs-parser.jay: Added CS0230 error report.
6970 2004-09-09 Marek Safar <marek.safar@seznam.cz>
6972 * cs-parser.jay: Added errors CS0231 and CS0257 report.
6974 2004-09-09 Marek Safar <marek.safar@seznam.cz>
6976 * expression.cs (Argument.Resolve): Added error CS0192 and
6979 2004-09-09 Marek Safar <marek.safar@seznam.cz>
6981 C# 2.0 #pragma warning feature
6983 * cs-tokenizer.cs (PreProcessPragma): New method;
6984 Handles #pragma directive.
6986 * report.cs (WarningRegions): New class; Support
6987 class for #pragma warning directive. It tests whether
6988 warning is enabled for a given line.
6990 2004-09-08 Miguel de Icaza <miguel@ximian.com>
6992 * const.cs: Add more descriptive error report, tahnks to
6995 2004-09-08 Marek Safar <marek.safar@seznam.cz>
6997 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
6999 2004-09-07 Miguel de Icaza <miguel@ximian.com>
7001 * expression.cs: Apply patch from Ben: Remove dead code from
7002 ArrayCreation, and remove the TurnintoConstant call in const.cs,
7003 as that code just threw an exception anwyays.
7005 * const.cs: Remove the call to the turnintoconstant, for details
7008 * literal.cs: The type of the null-literal is the null type; So
7009 we use a placeholder type (literal.cs:System.Null, defined here)
7012 * expression.cs (Conditional.DoResolve): Remove some old code that
7013 is no longer needed, conversions have been fixed.
7015 (ArrayCreationExpression.DoResolve): Return false if we fail to
7016 resolve the inner expression.
7018 2004-09-07 Raja R Harinath <rharinath@novell.com>
7021 * cs-parser.jay (delegate_declaration): Record a delegate
7022 declaration as a type declaration.
7023 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7025 2004-09-06 Miguel de Icaza <miguel@ximian.com>
7027 * parameter.cs: Do not crash if the type can not be resolved.
7029 * expression.cs: Report errors with unsafe pointers, fixes #64896
7031 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
7033 * expression.cs: Pointer arith always needs to do a conv.i
7034 if the operand is a long. fix 65320
7036 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7038 Fixed cs0619-37.cs, cs0619-38.cs
7040 * enum.cs (GetObsoleteAttribute): Removed.
7042 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7043 on Enum member is double staged. The first is tested member
7046 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7048 Fixed #56986, #63631, #65231
7050 * class.cs: (TypeContainer.AddToMemberContainer): New method,
7051 adds member to name container.
7052 (TypeContainer.AddToTypeContainer): New method, adds type to
7054 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7055 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7056 AddOperator): Simplified by reusing AddToMemberContainer.
7057 (TypeContainer.UserDefinedStaticConstructor): Changed to property
7059 (Method.CheckForDuplications): Fixed implementation to test all
7061 (MemberBase): Detection whether member is explicit interface
7062 implementation is now in constructor.
7063 (MemberBase.UpdateMemberName): Handles IndexerName.
7064 (Accessor): Changed to keep also location information.
7065 (AbstractPropertyEventMethod): Is derived from MemberCore.
7066 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7067 will be emited or not.
7068 (PropertyBase.AreAccessorsDuplicateImplementation):
7069 Tests whether accessors are not in collision with some method.
7070 (Operator): Is derived from MethodCore to simplify common
7073 * decl.cs (Flags.TestMethodDuplication): Test for duplication
7075 (DeclSpace.AddToContainer): Adds the member to defined_names
7076 table. It tests for duplications and enclosing name conflicts.
7078 * enum.cs (EnumMember): Clean up to reuse the base structures
7080 2004-09-03 Martin Baulig <martin@ximian.com>
7082 Merged latest changes into gmcs. Please keep this comment in
7083 here, it makes it easier for me to see what changed in MCS since
7084 the last time I merged.
7086 2004-09-03 Martin Baulig <martin@ximian.com>
7088 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7089 into TypeContainer, to make partial classes work again.
7091 2004-09-03 Martin Baulig <martin@ximian.com>
7093 * rootcontext.cs (RootContext.V2): Removed.
7095 2004-03-23 Martin Baulig <martin@ximian.com>
7097 * expression.cs (Invocation.OverloadResolve): Added `bool
7098 may_fail' argument and use it instead of the Location.IsNull() hack.
7100 2004-09-09 Martin Baulig <martin@ximian.com>
7102 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
7104 2004-09-09 Martin Baulig <martin@ximian.com>
7106 * generic.cs (TypeParameter.DefineType): Added support for
7107 explicit interface methods.
7109 2004-09-09 Martin Baulig <martin@ximian.com>
7111 * README.Changes: New document. Started to list important changes
7112 between MCS and GMCS here.
7114 2004-09-08 Martin Baulig <martin@ximian.com>
7117 (TypeContainer.CheckRecursiveDefinition): New protected method.
7118 (TypeContainer.DefineType): Move the CS0146 check into
7119 CheckRecursiveDefinition().
7121 2004-09-06 Martin Baulig <martin@ximian.com>
7123 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
7124 types for the constructor constraint.
7126 2004-09-03 Martin Baulig <martin@ximian.com>
7128 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7129 into TypeContainer, to make partial classes work again.
7131 2004-09-03 Martin Baulig <martin@ximian.com>
7133 * rootcontext.cs (RootContext.V2): Removed.
7135 2004-03-23 Martin Baulig <martin@ximian.com>
7137 * expression.cs (Invocation.OverloadResolve): Added `bool
7138 may_fail' argument and use it instead of the Location.IsNull() hack.
7140 2004-09-03 Martin Baulig <martin@ximian.com>
7142 Merged latest changes into gmcs. Please keep this comment in
7143 here, it makes it easier for me to see what changed in MCS since
7144 the last time I merged.
7146 2004-09-03 Raja R Harinath <rharinath@novell.com>
7149 * expression.cs (BetterConversion): Don't allow either conversion
7150 to be null. Remove redundant implicit conversion test when 'q ==
7151 null' -- when this function is invoked, we already know that the
7152 implicit conversion exists.
7153 (BetterFunction): Assume that 'best' is non-null. Remove
7154 redundant reimplementation of IsApplicable when 'best' is null.
7155 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7156 number of arguments.
7157 (IsAncestralType): Extract from OverloadResolve.
7158 (OverloadResolve): Make robust to the MethodGroupExpr being
7159 unsorted. Implement all the logic of Section 14.5.5.1, and
7160 support overloading of methods from multiple applicable types.
7161 Clean up logic somewhat. Don't pass null methods to BetterFunction.
7163 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7164 (RealError, Warning): Append type of report to related symbol.
7166 2004-09-03 Marek Safar <marek.safar@seznam.cz>
7168 * enum.cs: Fixed CLS-Compliance checks for enum members.
7169 Error tests cs3008-8.cs, cs3014-8.cs
7171 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7173 Fixed bug #62342, #63102
7174 * class.cs: ImplementIndexer uses member.IsExplicitImpl
7175 like ImplementMethod.
7177 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7179 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7182 2004-09-02 Martin Baulig <martin@ximian.com>
7184 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7185 TypeManager.GetArgumentTypes() rather than calling GetParameters()
7188 2004-09-01 Marek Safar <marek.safar@seznam.cz>
7190 C# 2.0 Static classes implemented
7192 * class.cs (TypeContainer): instance_constructors,
7193 initialized_fields, initialized_static_fields,
7194 default_constructor, base_inteface_types are protected to be
7195 accessible from StaticClass.
7196 (TypeContainer.DefineDefaultConstructor): New virtual method
7197 for custom default constructor generating
7198 (StaticClass): New class to handle "Static classes" feature.
7200 * cs-parser.jay: Handle static keyword on class like instance
7203 * driver.cs: Added "/langversion" command line switch with two
7204 options (iso-1, default).
7206 2004-08-31 Marek Safar <marek.safar@seznam.cz>
7208 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7210 2004-08-31 Miguel de Icaza <miguel@ximian.com>
7212 * delegate.cs: Style.
7214 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
7216 * delegate.cs: Add seperate instance expr field for miguel.
7218 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7220 * PointerArithmetic (Resolve): make sure we are not doing
7221 pointer arith on void*. Also, make sure we are resolved
7222 by not setting eclass until resolve.
7224 All callers: Make sure that PointerArithmetic gets resolved.
7226 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7228 * ArrayCreation (LookupType): If the type does not resolve
7229 to an array, give an error.
7231 2004-08-27 Marek Safar <marek.safar@seznam.cz>
7233 * statement.cs (Try.Resolve): Fixed bug #64222
7235 2004-08-27 Martin Baulig <martin@ximian.com>
7238 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7241 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7243 * ecore.cs (Constantify): Get underlying type via
7244 System.Enum.GetUnderlyingType to avoid StackOverflow on the
7245 Windows in special cases.
7247 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7249 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7250 for obtaining also private methods.
7251 (GetRemoveMethod): Used GetRemoveMethod (true)
7252 for obtaining also private methods.
7254 2004-09-02 Martin Baulig <martin@ximian.com>
7256 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7257 TypeManager.GetArgumentTypes() rather than calling GetParameters()
7260 2004-08-27 Martin Baulig <martin@ximian.com>
7263 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7266 2004-08-25 Martin Baulig <martin@ximian.com>
7268 * support.cs (ReflectionParameters..ctor): If this is a generic
7269 method, retrieve and store its type parameters.
7270 (InternalParameters..ctor): Added `TypeParameter[]' argument.
7271 (ReflectionParameters.GenericConstraints): The argument specifies
7272 the type parameter, not the method parameter.
7273 (InternalParameters.GenericConstraints): Likewise.
7275 * generic.cs (TypeParameter.DefineType): Correctly handle
7276 constraints wrt. generic methods in interfaces and their
7279 2004-08-24 Martin Baulig <martin@ximian.com>
7281 * generic.cs (TypeParameter.IsSubclassOf): New public method.
7282 (Constraints.IsSubclassOf): New internal method.
7284 * typemanager.cs (TypeManager.FindMembers): Added special support
7285 for GenericTypeParameterBuilder's.
7286 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
7289 2004-08-24 Martin Baulig <martin@ximian.com>
7292 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
7293 this for accessibility checks.
7294 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
7295 IsNestedFamilyAccessible.
7296 (TypeManager.IsSubclassOf): New method, do what the name actually
7299 2004-08-24 Martin Baulig <martin@ximian.com>
7301 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
7302 as a SimpleName, include the generic arity.
7304 2004-08-24 Martin Baulig <martin@ximian.com>
7306 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7307 MethodAttributes.HideBySig for operators.
7309 2004-08-23 Martin Baulig <martin@ximian.com>
7311 Back to the old error reporting system :-)
7313 * report.cs (Message): Removed.
7314 (Report.MessageData, ErrorData, WarningData): Removed.
7315 (Report.Error, Warning): Back to the old system.
7317 2004-08-23 Martin Baulig <martin@ximian.com>
7319 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7321 * class.cs (TypeContainer.ParentContainer): New public virtual
7322 method; replaces the explicit interface implementation.
7323 (ClassPart.ParentContainer): Override.
7325 2004-08-23 Martin Baulig <martin@ximian.com>
7327 * statement.cs (Switch): Added support for constant switches; see
7328 #59428 or test-285.cs.
7330 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7333 * statement.cs (GetEnumeratorFilter): Removed useless
7334 logic because C# specs is strict. GetEnumerator must be
7337 2004-08-22 Martin Baulig <martin@ximian.com>
7339 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7340 a switch and may break, reset the barrier. Fixes #59867.
7342 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7344 CLS-Compliance speed up (~5% for corlib)
7346 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7347 New method. Tests container for CLS-Compliant names
7349 * class.cs (TypeContainer.VerifyClsName): New method.
7350 Checks whether container name is CLS Compliant.
7351 (Constructor): Implements IMethodData.
7353 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7354 low-case table for CLS Compliance test.
7355 (MemberCache.VerifyClsParameterConflict): New method.
7356 Checks method parameters for CS3006 error.
7358 * enum.cs (EnumMember): Is derived from MemberCore.
7359 (Enum.VerifyClsName): Optimized for better performance.
7361 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7363 * report.cs: Renamed Error_T to Error and changed all
7366 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7368 * class.cs (TypeContainer.IndexerArrayList): New inner class
7369 container for indexers.
7370 (TypeContainer.DefaultIndexerName): New constant for default
7371 indexer name. Replaced all "Item" with this constant.
7372 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7374 * typemanager.cs (TypeManager.default_member_ctor): Cache here
7375 DefaultMemberAttribute constructor.
7377 2004-08-05 Martin Baulig <martin@ximian.com>
7379 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7382 2004-08-05 Marek Safar <marek.safar@seznam.cz>
7384 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7385 multi platforms problem.
7387 * compiler.csproj: Included shared files.
7389 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7391 Fix bug 60333, 55971 in the more general way
7392 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7393 Added arg_type argument for constant conversion.
7394 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7396 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7399 * class.cs (TypeContainer ): New inner classes MethodArrayList,
7400 OperatorArrayList, MethodCoreArrayList for typecontainer
7401 containers. Changed class member types to these new types.
7402 (MethodArrayList.DefineMembers): Added test for CS0659.
7404 2004-08-04 Miguel de Icaza <miguel@ximian.com>
7406 * cfold.cs: Synchronize the folding with the code in expression.cs
7407 Binary.DoNumericPromotions for uint operands.
7409 * attribute.cs: Revert patch from Raja, it introduced a regression
7410 while building Blam-1.2.1 (hard to isolate a test case).
7412 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7416 (TypeContainer.Define): Renamed to DefineContainerMembers because of
7418 (MethodCore.parent_method): New member. The method we're overriding
7419 if this is an override method.
7420 (MethodCore.CheckBase): Moved from Method class and made common.
7421 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7423 (MethodCore.CheckForDuplications): New abstract method. For custom
7424 member duplication search in a container
7425 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7426 method and its return type.
7427 (Event.conflict_symbol): New member. Symbol with same name in the
7431 (MemberCache.FindMemberWithSameName): New method. The method
7432 is looking for conflict with inherited symbols.
7434 2004-08-04 Martin Baulig <martin@ximian.com>
7436 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7438 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7440 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7442 * report.cs (Message): New enum for better error, warning reference in
7444 (MessageData): New inner abstract class. It generally handles printing of
7445 error and warning messages.
7446 Removed unused Error, Warning, Message methods.
7448 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7450 Fix for cs0592-8.cs test
7452 (Attributable.ValidAttributeTargets): Made public.
7453 (Attribute.ExplicitTarget): New member for explicit target value.
7454 (Attribute.CheckTargets): Now we translate explicit attribute
7455 target to Target here.
7457 2004-08-03 Ben Maurer <bmaurer@ximian.com>
7459 * ecore.cs (MethodGroupExpr): new IsBase property.
7461 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7463 * delegate.cs (DelegateCreation): store a MethodGroupExpr
7464 rather than an instance expr.
7466 (DelegateCreation.Emit): Use the method group rather than
7467 the instance expression. Also, if you have base.Foo as the
7468 method for a delegate, make sure to emit ldftn, not ldftnvirt.
7470 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
7472 (NewDelegate.DoResolve): Only check for the existance of Invoke
7473 if the method is going to be needed. Use MethodGroupExpr.
7475 (NewDelegate.Emit): Remove, DelegateCreation implements this.
7477 * expression.cs: For pointer arith., make sure to use
7478 the size of the type, not the size of the pointer to
7481 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7484 * class.cs (Class): Added error CS0502 test.
7486 2004-08-03 John Luke <jluke@cfl.rr.com>
7487 Raja R Harinath <rharinath@novell.com>
7490 * attribute.cs (Attribute.complained_before): New flag.
7491 (Attribute.ResolveType, Attribute.Resolve),
7492 (Attribute.DefinePInvokeMethod): Set it.
7493 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7495 2004-08-03 Martin Baulig <martin@ximian.com>
7497 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7498 use a user-defined operator; we still need to do numeric
7499 promotions in case one argument is a builtin type and the other
7500 one has an implicit conversion to that type. Fixes #62322.
7502 2004-08-18 Martin Baulig <martin@ximian.com>
7504 * class.cs (Method.Define): Use the correct method name when
7505 creating the MethodBuilder for a generic method.
7507 2004-08-17 Martin Baulig <martin@ximian.com>
7509 * generic.cs (Constraints): Support type parameter constraints.
7511 2004-08-16 Martin Baulig <martin@ximian.com>
7513 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
7514 (Token.GENERIC_DIMENSION): New token; this is returned if we
7515 encounter an unbound generic type in a typeof() expression.
7517 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
7518 this token is only generated while parsing a typeof() expression.
7519 (typeof_expression): Removed the old unbound_type hack.
7521 * generic.cs (TypeArguments.IsUnbound): New public property.
7523 * decl.cs (MemberName): Added support for unbound types.
7525 2004-08-14 Martin Baulig <martin@ximian.com>
7528 (TypeManager.IsEqualGenericInstance): New static method.
7529 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
7530 just used to check accessibility, so follow the rules of 26.1.6.
7532 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
7533 ConstructedType instead of a TypeExpression if we have type arguments.
7535 * cs-parser.jay (typeof_expression): Support unbound generic types.
7537 * ecore.cs (UnboundTypeExpression): New public class.
7539 2004-08-12 Martin Baulig <martin@ximian.com>
7541 * typemanager.cs (TypeManager.IsNestedChildOf): Use
7542 TypeManager.IsEqual() rather than `=='.
7544 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
7545 generic instances as well.
7547 2004-08-12 Martin Baulig <martin@ximian.com>
7549 * expression.cs (Invocation.InferType): We can only infer method
7550 type parameters. Fixes #62647.
7552 2004-08-11 Martin Baulig <martin@ximian.com>
7554 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
7555 before resolving the base classes.
7557 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7559 * Makefile: install .mdb file too.
7561 2004-08-05 Martin Baulig <martin@ximian.com>
7563 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
7564 initializer, the current type is just the TypeBuilder, not the
7565 instantiated generic type.
7566 (FieldExpr.IsFieldInitializer): New public property.
7568 2004-08-04 Martin Baulig <martin@ximian.com>
7570 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7572 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7574 2004-08-03 Martin Baulig <martin@ximian.com>
7576 * class.cs (MethodData.Define): If we're an explicit
7577 implementation, remove the generic arity from the type name.
7579 2004-08-03 Martin Baulig <martin@ximian.com>
7581 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7582 use a user-defined operator; we still need to do numeric
7583 promotions in case one argument is a builtin type and the other
7584 one has an implicit conversion to that type. Fixes #62322.
7586 2004-08-02 Martin Baulig <martin@ximian.com>
7588 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
7590 (TypeContainer.GetClassBases): Return the unexpanded list of
7591 interfaces; we expand them later.
7592 (TypeContainer.DefineType): After creating the TypeBuilder, call
7593 TypeManager.ExpandInterfaces() to get an expanded and resolved
7596 * ecore.cs (TypeExpr.GetInterfaces): Removed
7598 * generics.cs (Constraints.InterfaceConstraints): Remove.
7599 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
7600 register the interface constraints.
7603 (TypeManager.AddUserType): Removed the `ifaces' argument.
7604 (TypeManager.AddTypeParameter): Likewise.
7605 (TypeManager.AddUserInterface): Removed, was unused.
7606 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
7607 `TypeExpr[]' array for the interfaces.
7608 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
7609 has been defined, returns a list of the resolved interfaces types.
7610 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
7611 (TypeManager.GetExplicitInterfaces): Likewise.
7613 2004-08-02 Martin Baulig <martin@ximian.com>
7615 * expression.cs (Invocation.EmitCall): If we're invoking a method
7616 on a type parameter, use the new `Constrained' prefix opcode.
7618 2004-08-02 Martin Baulig <martin@ximian.com>
7620 * statement.cs (LocalInfo.Flags): Added `IsThis'.
7621 (LocalInfo.IsThis): New public property.
7622 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
7624 2004-08-01 Martin Baulig <martin@ximian.com>
7626 * class.cs (TypeContainer.GetClassBases): Don't set the default
7627 here since we may get called from GetPartialBases().
7628 (TypeContainer.DefineType): If GetClassBases() didn't return a
7629 parent, use the default one.
7631 2004-07-30 Martin Baulig <martin@ximian.com>
7633 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
7635 * class.cs (SourceMethod): New public class, derive from the
7636 symbol writer's ISourceMethod.
7637 (Method): Use the new symbol writer API.
7639 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
7640 as argument and use the new symbol writer.
7643 (SourceFile): Implement the symbol writer's ISourceFile.
7644 (Location.SymbolDocument): Removed.
7645 (Location.SourceFile): New public property.
7647 * symbolwriter.cs: Use the new symbol writer API.
7649 2004-07-30 Raja R Harinath <rharinath@novell.com>
7651 * Makefile (install-local): Remove. Functionality moved to
7654 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
7656 * Makefile: Install mcs.exe.config file together with mcs.exe.
7657 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
7658 correct runtime version.
7660 2004-07-25 Martin Baulig <martin@ximian.com>
7663 (TypeContainer.RegisterOrder): Removed, this was unused.
7664 (TypeContainer, interface_order): Removed.
7665 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
7666 TypeContainer as argument since we can also be called with a
7667 `PartialContainer' for a partial class/struct/interface.
7668 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
7669 of checking whether we're an `Interface' - we could be a
7671 (PartialContainer.Register): Override; call
7672 AddClass()/AddStruct()/AddInterface() on our parent.
7674 * cs-parser.jay (interface_member_declaration): Add things to the
7675 `current_container', not the `current_class'.
7677 * rootcontext.cs (RegisterOrder): The overloaded version which
7678 takes an `Interface' was unused, removed.
7680 * typemanager.cs (TypeManager.LookupInterface): Return a
7681 `TypeContainer', not an `Interface'.
7682 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
7683 contain a `PartialContainer' for an interface, so check it's
7684 `Kind' to figure out what it is.
7686 2004-07-25 Martin Baulig <martin@ximian.com>
7688 * class.cs (Class.DefaultTypeAttributes): New public constant.
7689 (Struct.DefaultTypeAttributes): Likewise.
7690 (Interface.DefaultTypeAttributes): Likewise.
7691 (PartialContainer.TypeAttr): Override this and add the
7692 DefaultTypeAttributes.
7694 2004-07-25 Martin Baulig <martin@ximian.com>
7696 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
7697 we can just use the `Parent' field instead.
7699 2004-07-25 Martin Baulig <martin@ximian.com>
7701 * class.cs (TypeContainer.Emit): Renamed to EmitType().
7703 2004-07-25 Martin Baulig <martin@ximian.com>
7705 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
7706 our parts before defining any methods.
7707 (TypeContainer.VerifyImplements): Make this virtual.
7708 (ClassPart.VerifyImplements): Override and call VerifyImplements()
7709 on our PartialContainer.
7711 2004-07-25 Martin Baulig <martin@ximian.com>
7713 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
7715 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
7716 argument, we can just use the `Parent' field instead.
7719 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
7720 (MemberBase.DoDefine): Likewise.
7722 2004-07-24 Martin Baulig <martin@ximian.com>
7724 * decl.cs (MemberCore.Parent): New public field.
7725 (DeclSpace.Parent): Moved to MemberCore.
7727 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
7728 (MemberBase.ctor): Added TypeContainer argument, pass it to our
7730 (FieldBase, Field, Operator): Likewise.
7731 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
7732 (EventField, Event): Likewise.
7734 2004-07-23 Martin Baulig <martin@ximian.com>
7736 * class.cs (PartialContainer): New public class.
7737 (ClassPart): New public class.
7738 (TypeContainer): Added support for partial classes.
7739 (TypeContainer.GetClassBases): Splitted some of the functionality
7740 out into GetNormalBases() and GetPartialBases().
7742 * cs-tokenizer.cs (Token.PARTIAL): New token.
7743 (Tokenizer.consume_identifier): Added some hacks to recognize
7744 `partial', but only if it's immediately followed by `class',
7745 `struct' or `interface'.
7747 * cs-parser.jay: Added support for partial clases.
7749 2004-07-23 Martin Baulig <martin@ximian.com>
7751 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
7752 a `DeclSpace' and also made it readonly.
7753 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
7754 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
7755 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
7757 * cs-parser.jay: Pass the `current_class', not the
7758 `current_container' (at the moment, this is still the same thing)
7759 to a new Method, Property, Event, Indexer or Constructor.
7761 2004-07-23 Martin Baulig <martin@ximian.com>
7763 * cs-parser.jay (CSharpParser): Added a new `current_class' field
7764 and removed the `current_interface' one.
7765 (struct_declaration, class_declaration, interface_declaration):
7766 Set `current_class' to the newly created class/struct/interface;
7767 set their `Bases' and call Register() before parsing their body.
7769 2004-07-23 Martin Baulig <martin@ximian.com>
7771 * class.cs (Kind): New public enum.
7772 (TypeContainer): Made this class abstract.
7773 (TypeContainer.Kind): New public readonly field.
7774 (TypeContainer.CheckDef): New public method; moved here from
7776 (TypeContainer.Register): New public abstract method.
7777 (TypeContainer.GetPendingImplementations): New public abstract
7779 (TypeContainer.GetClassBases): Removed the `is_class' and
7780 `is_iface' parameters.
7781 (TypeContainer.DefineNestedTypes): Formerly known as
7783 (ClassOrStruct): Made this class abstract.
7785 * tree.cs (RootTypes): New public type.
7787 2004-07-20 Martin Baulig <martin@ximian.com>
7789 * tree.cs (Tree.RecordNamespace): Removed.
7790 (Tree.Namespaces): Removed.
7792 * rootcontext.cs (RootContext.IsNamespace): Removed.
7794 * cs-parser.jay (namespace_declaration): Just create a new
7795 NamespaceEntry here.
7797 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
7799 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
7800 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
7801 entry to make sure it runs in the correct runtime version.
7803 2004-07-18 Martin Baulig <martin@ximian.com>
7805 * generic.cs (ConstructedType.CheckConstraints): Improved
7806 constraints checking.
7808 2004-07-18 Martin Baulig <martin@ximian.com>
7810 * expression.cs (Invocation.BetterMethod): Call
7811 TypeManager.TypeToCoreType() on all types and removed my previous
7812 hack; we're already doig the right thing here.
7814 2004-07-17 Martin Baulig <martin@ximian.com>
7816 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
7818 2004-07-16 Martin Baulig <martin@ximian.com>
7820 * iterators.cs: Added generics support.
7822 2004-07-16 Martin Baulig <martin@ximian.com>
7824 * iterators.cs: Rewrote this. We're now using one single Proxy
7825 class for both the IEnumerable and the IEnumerator interface and
7826 `Iterator' derives from Class so we can use the high-level API.
7828 * class.cs (TypeContainer.AddIterator): New method.
7829 (TypeContainer.DoDefineType): New protected virtual method, which
7830 is called from DefineType().
7831 (TypeContainer.DoDefineMembers): Call DefineType() and
7832 DefineMembers() on all our iterators.
7833 (TypeContainer.Emit): Call Emit() on all our iterators.
7834 (TypeContainer.CloseType): Call CloseType() on all our iterators.
7836 * codegen.cs (EmitContext.CurrentIterator): New public field.
7838 2004-07-15 Martin Baulig <martin@ximian.com>
7841 (TypeManager.not_supported_exception_type): New type.
7843 2004-07-14 Martin Baulig <martin@ximian.com>
7846 (TypeManager.generic_ienumerable_type): New type.
7847 (TypeManager.generic_ienumerator_type): New type.
7850 (RootContext.interfaces_first_stage): Added
7851 "System.Collections.Generic.IEnumerator`1" and
7852 "System.Collections.Generic.IEnumerable`1".
7854 2004-07-14 Martin Baulig <martin@ximian.com>
7856 * iterators.cs: Use real error numbers.
7858 2004-07-14 Martin Baulig <martin@ximian.com>
7860 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
7861 requires this to be a System.Collection.IEnumerable and not a
7862 class implementing that interface.
7863 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
7865 2004-07-13 Marek Safar <marek.safar@seznam.cz>
7867 * class.cs: Fixed previous fix, it broke some error tests.
7869 2004-07-12 Martin Baulig <martin@ximian.com>
7871 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
7874 2004-07-14 Martin Baulig <martin@ximian.com>
7876 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
7877 an exclamation mark (!) for the generic arity to reflect the
7878 latest spec changes; ie. use "System.Collections.Generic.IList`1".
7880 2004-07-13 Martin Baulig <martin@ximian.com>
7882 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
7883 specifiers being part of a type argument.
7885 2004-07-13 Martin Baulig <martin@ximian.com>
7887 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
7888 name for generic types.
7890 2004-07-13 Martin Baulig <martin@ximian.com>
7892 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
7895 2004-07-09 Miguel de Icaza <miguel@ximian.com>
7897 * assign.cs (LocalTemporary): Add new argument: is_address,If
7898 `is_address' is true, then the value that we store is the address
7899 to the real value, and not the value itself.
7901 * ecore.cs (PropertyExpr): use the new local temporary
7902 stuff to allow us to handle X.Y += z (where X is a struct)
7904 2004-07-08 Martin Baulig <martin@ximian.com>
7906 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
7907 not always return, just like we're doing in Using.Resolve().
7909 2004-07-07 Miguel de Icaza <miguel@ximian.com>
7911 * cs-parser.jay (fixed_statement): flag this as Pinned.
7913 2004-07-06 Miguel de Icaza <miguel@ximian.com>
7915 * typemanager.cs (TypeManager): Removed MakePinned method, this
7916 mechanism is replaced with the .NET 2.x compatible mechanism of
7917 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
7919 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
7920 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
7921 `IsFixed' property which has a different meaning.
7923 2004-07-02 Raja R Harinath <rharinath@novell.com>
7925 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
7926 visible from inside a nested class, not just the names of the
7927 immediately enclosing class.
7930 2004-06-24 Raja R Harinath <rharinath@novell.com>
7932 * expression.cs (BetterConversion): Remove buggy special-case
7933 handling of "implicit constant expression conversions". At this
7934 point, we already know that the conversion is possible -- we're
7935 only checking to see which is better.
7937 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7939 * cs-parser.jay: Added error CS0210 test.
7941 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7943 * cs-parser.jay: Added error CS0134 test.
7945 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7948 * cs-parser.jay: Added error CS0145 test.
7950 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7952 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
7954 2004-06-23 Ben Maurer <bmaurer@ximian.com>
7956 * expression.cs (StackAlloc.Resolve): The argument may not
7957 be a constant; deal with this case.
7959 2004-06-23 Marek Safar <marek.safar@seznam.cz>
7961 * attribute.cs (IndexerName_GetIndexerName): Renamed to
7962 GetIndexerAttributeValue.
7963 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
7965 * class.cs (Indexer.Define): Added error tests for CS0415,
7968 2004-06-23 Miguel de Icaza <miguel@ximian.com>
7970 * attribute.cs (Attribute.Resolve): Keep field code in sync with
7973 2004-06-23 Martin Baulig <martin@ximian.com>
7975 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
7976 neither return nor throw, reset the barrier as well. Fixes #60457.
7978 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
7980 * class.cs : EventAttributes is now set to None by default.
7981 This fixes bug #60459.
7983 2004-06-18 Marek Safar <marek.safar@seznam.cz>
7986 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7987 Don't throw exception but return null (it's sufficient now).
7989 2004-06-18 Marek Safar <marek.safar@seznam.cz>
7991 * typemanager.cs (GetArgumentTypes): Faster implementation.
7993 2004-06-18 Martin Baulig <martin@ximian.com>
7995 * attribute.cs (Attribute.Resolve): Check whether we're an
7996 EmptyCast which a Constant child. Fixes #60333.
7998 2004-06-17 Ben Maurer <bmaurer@ximian.com>
8000 * statement.cs (EmitCollectionForeach): Account for the fact that
8001 not all valuetypes are in areas which we can take the address of.
8002 For these variables, we store to a temporary variable. Also, make
8003 sure that we dont emit a `callvirt' on a valuetype method.
8005 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8007 * expression.cs (StackAlloc.DoReSolve): Added test for
8008 negative parameter (CS0247).
8010 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8013 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8015 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8018 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8021 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8023 Fix bug #58254 & cs1555.cs, cs1556.cs
8024 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8026 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8028 * cs-parser.jay: Added error CS1669 test for indexers.
8030 2004-06-18 Martin Baulig <martin@ximian.com>
8032 * generics.cs (GenericMethod.ctor): Don't take an Attributes
8033 argument. Fixes #60441.
8035 2004-06-16 Ben Maurer <bmaurer@ximian.com>
8036 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
8037 The name needs to have the actual name of the method in order
8038 for other tests (such as the one in OverloadResolve for Invoke
8039 on a delegate) to work. As well, it does not really help
8040 error reporting because the method group had multiple methods.
8041 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
8042 Make profiling work.
8044 2004-06-13 Martin Baulig <martin@ximian.com>
8046 * cs-parser.jay: Don't allow generic attributes.
8048 2004-06-13 Martin Baulig <martin@ximian.com>
8050 * class.cs (MemberBase.DoDefineBase): New protected method.
8051 (MemberBase.DoDefine): Compute the `flags' in the new
8052 DoDefineBase() which must be called first.
8053 (Method.Define): Call DoDefineBase() first so we have the flags
8054 when defining the generic method.
8056 * cs-parser.jay (interface_method_declaration): Support generic methods.
8058 2004-06-13 Martin Baulig <martin@ximian.com>
8060 * decl.cs (TypeName): Removed.
8061 (MemberName): Removed TypeName and MemberNow; now we just have
8064 * cs-parser.jay: Don't distinguish between type arguments and type
8065 parameters in the grammar and simplified the rules a bit. The
8066 reduce/reduce conflicts are now gone (except the one we inherited
8069 2004-06-11 Martin Baulig <martin@ximian.com>
8071 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8072 call this twice: for params and varargs methods.
8074 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8077 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8079 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8081 * attribute.cs (Attribute.GetValidTargets): Made public.
8084 (AbstractPropertyEventMethod): New class for better code sharing.
8085 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8087 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8089 2004-06-09 Martin Baulig <martin@ximian.com>
8091 * cs-parser.jay: Removed a reduce/reduce conflict.
8093 2004-06-03 Martin Baulig <martin@ximian.com>
8095 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
8096 GetSimpleName() and return a SimpleName.
8098 * ecore.cs (SimpleName.Arguments): New public field.
8099 (SimpleName): Added overloaded ctor which takes an additional
8100 TypeArguments argument.
8101 (SimpleName.SimpleNameResolve): Added support for generic methods.
8102 (MethodGroupExpr.ResolveGeneric): New public method. The code was
8103 formerly in MemberAccess.DoResolve(), but we also need it in
8104 SimpleNameResolve().
8106 * expression.cs (MemberAccess.DoResolve): Use the new
8107 MethodGroupExpr.ResolveGeneric().
8109 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8111 * decl.cs: If possible, use lookuptypedirect here. We can only do
8112 this if there is no `.' after the namespace. Avoids using
8113 LookupType, which does lots of slow processing.
8114 (FindNestedType) New method, does what it says :-).
8115 * namespace.cs: use LookupTypeDirect.
8116 * rootcontext.cs: use membercache, if possible.
8117 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8119 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8122 According to the spec,
8124 In a member access of the form E.I, if E is a single identifier,
8125 and if the meaning of E as a simple-name (§7.5.2) is a constant,
8126 field, property, localvariable, or parameter with the same type as
8127 the meaning of E as a type-name (§3.8), then both possible
8128 meanings of E are permitted.
8130 We did not check that E as a simple-name had the same type as E as
8133 This trivial check gives us 5-7% on bootstrap time.
8135 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8137 * expression.cs (Invocation.OverloadResolve): Avoid the
8138 use of hashtables and boxing here by allocating on demand.
8140 2004-05-30 Martin Baulig <martin@ximian.com>
8142 * rootcontext.cs (RootContext.LookupType): Don't cache things if
8143 we're doing a silent lookup. Don't try to lookup nested types in
8144 TypeManager.object_type (thanks to Ben Maurer).
8146 2004-05-30 Martin Baulig <martin@ximian.com>
8148 Committing a patch from Ben Maurer.
8150 * rootcontext.cs (RootContext.LookupType): Cache negative results.
8152 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8154 * convert.cs: add a trivial cache for overload operator resolution.
8156 2004-05-31 Marek Safar <marek.safar@seznam.cz>
8159 (AttributeTester.GetObsoleteAttribute): Returns instance of
8160 ObsoleteAttribute when type is obsolete.
8163 (TypeContainer.VerifyObsoleteAttribute): Override.
8164 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8165 (MethodCode.VerifyObsoleteAttribute): Override.
8166 (MemberBase.VerifyObsoleteAttribute): Override.
8169 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8170 and report proper error.
8173 (Delegate.VerifyObsoleteAttribute): Override.
8176 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8177 and report proper error.
8178 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8181 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8185 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8186 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8187 Added test for ObsoleteAttribute.
8190 (Catch): Derived from Statement.
8192 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8194 * decl.cs: If possible, use lookuptypedirect here. We can only do
8195 this if there is no `.' after the namespace. Avoids using
8196 LookupType, which does lots of slow processing.
8197 (FindNestedType) New method, does what it says :-).
8198 * namespace.cs: use LookupTypeDirect.
8199 * rootcontext.cs: use membercache, if possible.
8200 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8202 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8205 According to the spec,
8207 In a member access of the form E.I, if E is a single identifier,
8208 and if the meaning of E as a simple-name (§7.5.2) is a constant,
8209 field, property, localvariable, or parameter with the same type as
8210 the meaning of E as a type-name (§3.8), then both possible
8211 meanings of E are permitted.
8213 We did not check that E as a simple-name had the same type as E as
8216 This trivial check gives us 5-7% on bootstrap time.
8218 2004-05-30 Marek Safar <marek.safar@seznam.cz>
8220 Fixed bug #59071 & cs0160.cs
8221 * statement.cs (Try.Resolve): Check here whether order of catch
8222 clauses matches their dependencies.
8224 2004-05-30 Marek Safar <marek.safar@seznam.cz>
8227 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
8230 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8232 * expression.cs (Invocation.OverloadResolve): Avoid the
8233 use of hashtables and boxing here by allocating on demand.
8235 2004-05-30 Martin Baulig <martin@ximian.com>
8237 * rootcontext.cs (RootContext.LookupType): Don't cache things if
8238 we're doing a silent lookup. Don't try to lookup nested types in
8239 TypeManager.object_type (thanks to Ben Maurer).
8241 2004-05-30 Martin Baulig <martin@ximian.com>
8243 Committing a patch from Ben Maurer.
8245 * rootcontext.cs (RootContext.LookupType): Cache negative results.
8247 2004-05-29 Martin Baulig <martin@ximian.com>
8249 * class.cs (IMethodData.ShouldIgnore): New method.
8251 * typemanager.cs (TypeManager.MethodFlags): Don't take a
8252 `Location' argument, we don't need it anywhere. Use
8253 `IMethodData.ShouldIgnore ()' instead of
8254 `MethodData.GetMethodFlags ()'.
8255 (TypeManager.AddMethod): Removed.
8256 (TypeManager.AddMethod2): Renamed to AddMethod.
8258 2004-05-29 Martin Baulig <martin@ximian.com>
8260 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8262 * convert.cs (Convert.ImplicitReferenceConversion): If we're
8263 converting from a class type S to an interface type and we already
8264 have an object on the stack, don't box it again. Fixes #52578.
8266 2004-05-29 Martin Baulig <martin@ximian.com>
8268 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8269 Added support for `params' parameters. Fixes #59267.
8271 2004-05-29 Martin Baulig <martin@ximian.com>
8273 * literal.cs (NullPointer): Provide a private .ctor which sets
8274 `type' to TypeManager.object_type. Fixes #59048.
8276 2004-05-29 Martin Baulig <martin@ximian.com>
8278 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8279 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
8281 * ecore.cs (EventExpr.instance_expr): Make the field private.
8283 2004-05-26 Marek Safar <marek.safar@seznam.cz>
8285 Fixed bug #50080 & cs0214-2.cs
8286 * expression.cs (Cast.DoResolve): Check unsafe context here.
8288 * statement.cs (Resolve.DoResolve): Likewise.
8290 2004-05-26 Martin Baulig <martin@ximian.com>
8292 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8294 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8295 (RootContext.LookupType): Pass down the `silent' flag.
8297 2004-05-25 Martin Baulig <martin@ximian.com>
8300 (MethodGroupExpr.IdenticalTypeName): New public property.
8301 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8302 expression actually refers to a type.
8304 2004-05-25 Martin Baulig <martin@ximian.com>
8306 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8307 for #56176 and made it actually work.
8309 2004-05-25 Martin Baulig <martin@ximian.com>
8311 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8312 (FieldExpr, PropertyExpr): Override and implement
8313 CacheTemporaries. Fixes #52279.
8315 2004-05-25 Miguel de Icaza <miguel@ximian.com>
8317 * location.cs: In the new compiler listing a file twice is a
8318 warning, not an error.
8320 2004-05-24 Martin Baulig <martin@ximian.com>
8322 * enum.cs (Enum.DefineType): For the `BaseType' to be a
8323 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
8325 2004-05-24 Martin Baulig <martin@ximian.com>
8327 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8328 walking the `using' list. Fixes #53921.
8330 2004-05-24 Martin Baulig <martin@ximian.com>
8332 * const.cs (Const.LookupConstantValue): Added support for
8333 EmptyCast's; fixes #55251.
8335 2004-05-24 Martin Baulig <martin@ximian.com>
8337 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8338 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8339 which does the CS0135 check. The reason is that we first need to
8340 check whether the variable actually exists.
8342 2004-05-24 Martin Baulig <martin@ximian.com>
8344 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8345 than RootContext.LookupType() to find the explicit interface
8348 2004-05-24 Raja R Harinath <rharinath@novell.com>
8350 * Makefile: Simplify. Use executable.make.
8351 * mcs.exe.sources: New file. List of sources of mcs.exe.
8353 2004-05-24 Anders Carlsson <andersca@gnome.org>
8357 Use the invariant culture when doing String.Compare for CLS case
8360 2004-05-23 Martin Baulig <martin@ximian.com>
8362 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8363 don't have any dots. Fixes #52622, added cs0246-8.cs.
8365 * namespace.cs (NamespaceEntry.Lookup): Likewise.
8367 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8369 * class.cs (MemberBase.Define): Reuse MemberType member for
8370 resolved type. Other methods can use it too.
8372 2004-05-23 Martin Baulig <martin@ximian.com>
8374 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8375 the variable also exists in the current block (otherwise, we need
8376 to report a CS0103). Fixes #58670.
8378 2004-05-23 Martin Baulig <martin@ximian.com>
8380 * flowanalysis.cs (Reachability.Reachable): Compute this
8381 on-the-fly rather than storing it as a field.
8383 2004-05-23 Martin Baulig <martin@ximian.com>
8385 * flowanalysis.cs (Reachability.And): Manually compute the
8386 resulting `barrier' from the reachability.
8388 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8391 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8392 instance of ObsoleteAttribute when symbol is obsolete.
8395 (IMethodData): Extended interface for ObsoleteAttribute support.
8397 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8399 * attribute.cs: Fix bug #55970
8401 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8405 (GetObsoleteAttribute): New method. Creates the instance of
8407 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8408 ObsoleteAttribute when member is obsolete.
8409 (AttributeTester.Report_ObsoleteMessage): Common method for
8410 Obsolete error/warning reporting.
8413 (TypeContainer.base_classs_type): New member for storing parent type.
8416 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8417 for this MemberCore.
8419 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8421 * attribute.cs, const.cs: Fix bug #58590
8423 2004-05-21 Martin Baulig <martin@ximian.com>
8425 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8426 out parameters if the end of the method is unreachable. Fixes
8429 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8431 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8432 Hari was right, why extra method.
8434 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8436 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8438 2004-05-20 Martin Baulig <martin@ximian.com>
8440 * delegate.cs: Convert this file to Unix mode - like the original
8443 2004-05-20 Martin Baulig <martin@ximian.com>
8445 * attribute.cs: Convert this file to Unix mode - like the original
8448 2004-05-19 Marek Safar <marek.safar@seznam.cz>
8450 Fix bug #58688 (MCS does not report error when the same attribute
8453 * attribute.cs (Attribute.Emit): Distinction between null and default.
8455 2004-05-19 Raja R Harinath <rharinath@novell.com>
8457 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8458 of a top-level attribute without an attribute target.
8459 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
8461 (Attribute.Conditional_GetConditionName),
8462 (Attribute.Obsolete_GetObsoleteMessage): Update.
8463 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
8464 part of ScanForIndexerName.
8465 (Attribute.CanIgnoreInvalidAttribute): New function.
8466 (Attribute.ScanForIndexerName): Move to ...
8467 (Attributes.ScanForIndexerName): ... here.
8468 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8469 (Attributes.Search): New internal variant that can choose not to
8470 complain if types aren't resolved. The original signature now
8472 (Attributes.GetClsCompliantAttribute): Use internal variant, with
8473 complaints suppressed.
8474 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8475 only if it not useful.
8476 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8477 top-level for attributes that are shared between the assembly
8478 and a top-level class.
8479 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8480 * class.cs: Update to reflect changes.
8481 (DefineIndexers): Fuse loops.
8482 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
8483 a couple more variants of attribute names.
8485 2004-05-18 Marek Safar <marek.safar@seznam.cz>
8487 Fix bug #52585 (Implemented explicit attribute declaration)
8490 (Attributable.ValidAttributeTargets): New abstract method. It gets
8491 list of valid attribute targets for explicit target declaration.
8492 (Attribute.Target): It holds target itself.
8493 (AttributeSection): Removed.
8494 (Attribute.CheckTargets): New method. It checks whether attribute
8495 target is valid for the current element.
8498 (EventProperty): New class. For events that are declared like
8499 property (with add and remove accessors).
8500 (EventField): New class. For events that are declared like field.
8503 * cs-parser.jay: Implemented explicit attribute target declaration.
8505 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
8506 Override ValidAttributeTargets.
8509 (ReturnParameter): Class for applying custom attributes on
8511 (ParameterAtribute): New class. Class for applying custom
8512 attributes on the parameter type.
8514 2004-05-17 Miguel de Icaza <miguel@ximian.com>
8516 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8519 (Method): Allow UNSAFE here.
8521 * modifiers.cs: Support unsafe reporting.
8523 2004-05-17 Marek Safar <marek.safar@seznam.cz>
8525 * decl.cs: Fix bug #58478.
8527 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8529 * statement.cs: When checking for unreachable code on an EmptyStatement,
8530 set the location. Fixes bug #58488.
8532 2004-05-13 Miguel de Icaza <miguel@ximian.com>
8534 * driver.cs: Add -pkg handling.
8536 From Gonzalo: UseShelLExecute=false
8538 2004-05-12 Marek Safar <marek.safar@seznam.cz>
8541 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8543 (Attribute.IsClsCompliaceRequired): Moved to base for better
8545 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8546 when attribute is AttributeUsageAttribute.
8547 (Attribute.GetValidTargets): Simplified.
8548 (Attribute.GetAttributeUsage): New method returns AttributeUsage
8549 attribute for this type.
8550 (Attribute.ApplyAttributes): Method renamed to Emit and make
8552 (GlobalAttributeSection): New class for special handling of global
8553 attributes (assembly, module).
8554 (AttributeSection.Emit): New method.
8556 * class.cs: Implemented Attributable abstract methods.
8557 (MethodCore.LabelParameters): Moved to Parameter class.
8558 (Accessor): Is back simple class.
8559 (PropertyMethod): Implemented Attributable abstract class.
8560 (DelegateMethod): Implemented Attributable abstract class.
8561 (Event): New constructor for disctintion between normal Event
8562 and Event with accessors.
8564 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8566 * codegen.cs, const.cs, decl.cs, delegate.cs:
8567 (CommonAssemblyModulClass): Implemented Attributable abstract class
8570 * enum.cs: Implement IAttributeSupport interface.
8571 (EnumMember): New class for emum members. Implemented Attributable
8575 (ParameterBase): Is abstract.
8576 (ReturnParameter): New class for easier [return:] attribute handling.
8578 * typemanager.cs: Removed builder_to_attr.
8580 2004-05-11 Raja R Harinath <rharinath@novell.com>
8583 * attribute.cs (Attribute.GetPositionalValue): New function.
8584 * class.cs (TypeContainer.VerifyMembers): New function.
8585 (TypeContainer.Emit): Use it.
8586 (ClassOrStruct): New base class for Class and Struct.
8587 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
8588 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8590 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8591 then each non-static field should have a FieldOffset attribute.
8592 Otherwise, none of the fields should have a FieldOffset attribute.
8593 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
8594 and FieldOffset attributes.
8595 * typemanager.cs (TypeManager.struct_layout_attribute_type)
8596 (TypeManager.field_offset_attribute_type): New core types.
8597 (TypeManager.InitCoreTypes): Initialize them.
8599 2004-05-11 Michal Moskal <malekith@pld-linux.org>
8601 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8602 Return correct type.
8605 2004-05-09 Miguel de Icaza <miguel@ximian.com>
8607 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8608 be implicitly converted to ulong.
8610 * expression.cs: The logic for allowing operator &, | and ^ worked
8611 was wrong, it worked before because we did not report an error in
8612 an else branch. Fixes 57895.
8614 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8615 allow volatile fields to be reference types.
8617 2004-05-07 Miguel de Icaza <miguel@ximian.com>
8619 * driver.cs: Add support for /debug-
8621 2004-05-07 Raja R Harinath <rharinath@novell.com>
8623 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
8624 Add a 'complain' parameter to silence errors.
8625 (Attribute.Resolve): Update to changes. Put in sanity check to catch
8626 silently overlooked type-resolutions.
8627 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
8629 (Attributes.Search): New function.
8630 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
8631 (Attributes.GetAttributeFullName): Remove hack.
8632 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
8633 Update to reflect changes.
8634 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8635 Use Attributes.Search instead of nested loops.
8637 2004-05-07 Marek Safar <marek.safar@seznam.cz>
8640 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
8641 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
8642 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
8644 * report.cs: (Report.Warning): Renamed to Warning_T because of
8645 parameter collision.
8647 2004-05-05 Raja R Harinath <rharinath@novell.com>
8649 * expression.cs (MemberAccess.ResolveMemberAccess):
8650 Exit with non-zero status after Report.Error.
8651 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
8653 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
8655 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
8657 * support.cs: Don't hang when the file is empty.
8659 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
8661 * support.cs: In SeekableStreamReader, compute the preamble size of the
8662 underlying stream. Position changes should take into account that initial
8665 2004-05-03 Todd Berman <tberman@sevenl.net>
8667 * driver.cs: remove unused GetSysVersion function.
8669 2004-05-03 Todd Berman <tberman@sevenl.net>
8671 * driver.cs: Remove the hack from saturday, as well as the hack
8672 from jackson (LoadAssemblyFromGac), also adds the CWD to the
8673 link_paths to get that bit proper.
8675 2004-05-01 Todd Berman <tberman@sevenl.net>
8677 * driver.cs: Try a LoadFrom before a Load, this checks the current
8678 path. This is currently a bug in mono that is be fixed, however, this
8679 provides a workaround for now. This will be removed when the bug
8682 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
8684 * CryptoConvert.cs: Updated to latest version. Fix issue with
8685 incomplete key pairs (#57941).
8687 2004-05-01 Todd Berman <tberman@sevenl.net>
8689 * driver.cs: Remove '.' from path_chars, now System.* loads properly
8692 2004-04-30 Jackson Harper <jackson@ximian.com>
8694 * codegen.cs: Open keys readonly.
8696 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8698 * typemanager.cs: don't report cyclic struct layout when a struct
8699 contains 2 or more fields of the same type. Failed for Pango.AttrShape
8700 which has 2 Pango.Rectangle fields.
8702 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
8704 * expression.cs: Handle IntPtr comparisons with IL code
8705 rather than a method call.
8707 2004-04-29 Martin Baulig <martin@ximian.com>
8709 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
8710 the list of PropertyInfo's in class hierarchy and find the
8711 accessor. Fixes #56013.
8713 2004-04-29 Martin Baulig <martin@ximian.com>
8715 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
8717 2004-04-29 Martin Baulig <martin@ximian.com>
8719 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
8721 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
8723 2004-04-29 Martin Baulig <martin@ximian.com>
8725 * class.cs (ConstructorInitializer.Resolve): Check whether the
8726 parent .ctor is accessible. Fixes #52146.
8728 2004-04-29 Martin Baulig <martin@ximian.com>
8730 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
8732 * statement.cs (Using.EmitLocalVariableDecls): Use
8733 TypeManager.idisposable_type, not typeof (IDisposable).
8734 (Foreach.EmitCollectionForeach): Added support for valuetypes.
8736 2004-04-29 Martin Baulig <martin@ximian.com>
8738 * class.cs (Event.Define): Don't emit the field and don't set
8739 RTSpecialName and SpecialName for events on interfaces. Fixes
8742 2004-04-29 Raja R Harinath <rharinath@novell.com>
8744 Refactor Attribute.ApplyAttributes.
8745 * attribute.cs (Attributable): New base class for objects that can
8746 have Attributes applied on them.
8747 (Attribute): Make AttributeUsage fields public.
8748 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
8749 (Attribute.IsInternalCall): New property.
8750 (Attribute.UsageAttr): Convert to a public read-only property.
8751 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
8752 (Attribute.ResolveType, Attribute.Resolve)
8753 (Attribute.ScanForIndexerName): Update to reflect changes.
8754 (Attribute.CheckAttributeTarget): Re-format.
8755 (Attribute.ApplyAttributes): Refactor, to various
8756 Attributable.ApplyAttributeBuilder methods.
8757 * decl.cs (MemberCore): Make Attributable.
8758 * class.cs (Accessor): Make Attributable.
8759 (MethodData.ApplyAttributes): Use proper attribute types, not
8761 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
8762 (TypeContainer.ApplyAttributeBuilder)
8763 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
8764 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
8765 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
8766 (Operator.ApplyAttributeBuilder): New factored-out methods.
8767 * const.cs (Const.ApplyAttributeBuilder): Likewise.
8768 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
8769 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
8770 * parameter.cs (ParameterBase): New Attributable base class
8771 that can also represent Return types.
8772 (Parameter): Update to the changes.
8774 2004-04-29 Jackson Harper <jackson@ximian.com>
8776 * driver.cs: Prefer the corlib system version when looking for
8777 assemblies in the GAC. This is still a hack, but its a better hack
8780 2004-04-29 Marek Safar <marek.safar@seznam.cz>
8782 * decl.cs, enum.cs: Improved error 3005 reporting.
8784 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
8785 (related_symbols): New private member for list of symbols
8786 related to reported error/warning.
8788 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
8790 2004-04-29 Martin Baulig <martin@ximian.com>
8792 * ecore.cs (Expression.Constantify): If we're an enum and
8793 TypeManager.TypeToCoreType() doesn't give us another type, use
8794 t.UnderlyingSystemType. Fixes #56178.
8796 2004-04-29 Martin Baulig <martin@ximian.com>
8798 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
8799 interfaces and for each interface, only add members directly
8800 declared in that interface. Fixes #53255.
8802 2004-04-28 Martin Baulig <martin@ximian.com>
8804 * expression.cs (ConditionalLogicalOperator): Use a temporary
8805 variable for `left' to avoid that we evaluate it more than once;
8808 2004-04-28 Martin Baulig <martin@ximian.com>
8810 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
8813 2004-04-28 Martin Baulig <martin@ximian.com>
8815 * statement.cs (LocalInfo.Resolve): Check whether the type is not
8818 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
8819 whether the type is not void (CS1547).
8821 2004-04-28 Martin Baulig <martin@ximian.com>
8823 * expression.cs (Unary.DoResolveLValue): Override this and report
8824 CS0131 for anything but Operator.Indirection.
8826 2004-04-28 Martin Baulig <martin@ximian.com>
8828 Committing a patch from Ben Maurer; see bug #50820.
8830 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
8833 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8836 2004-04-28 Martin Baulig <martin@ximian.com>
8838 Committing a patch from Ben Maurer; see bug #50820.
8840 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
8843 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8846 2004-04-28 Martin Baulig <martin@ximian.com>
8848 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
8849 (Block.AddLabel): Call DoLookupLabel() to only search in the
8852 2004-04-28 Martin Baulig <martin@ximian.com>
8854 * cfold.cs (ConstantFold.BinaryFold): Added special support for
8855 comparing StringConstants and NullLiterals in Equality and Inequality.
8857 2004-04-28 Jackson Harper <jackson@ximian.com>
8859 * driver.cs: Attempt to load referenced assemblies from the
8860 GAC. This is the quick and dirty version of this method that
8861 doesnt take into account versions and just takes the first
8862 canidate found. Will be good enough for now as we will not have more
8863 then one version installed into the GAC until I update this method.
8865 2004-04-28 Martin Baulig <martin@ximian.com>
8867 * typemanager.cs (TypeManager.CheckStructCycles): New public
8868 static method to check for cycles in the struct layout.
8870 * rootcontext.cs (RootContext.PopulateTypes): Call
8871 TypeManager.CheckStructCycles() for each TypeContainer.
8872 [Note: We only need to visit each type once.]
8874 2004-04-28 Martin Baulig <martin@ximian.com>
8876 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
8878 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
8879 success and added `out object value'. Use a `bool resolved' field
8880 to check whether we've already been called rather than
8881 `ConstantValue != null' since this breaks for NullLiterals.
8883 2004-04-28 Raja R Harinath <rharinath@novell.com>
8885 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
8886 setting of this flag, since the 'set' method may be non-public.
8888 2004-04-28 Raja R Harinath <rharinath@novell.com>
8890 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
8891 check on current_vector.Block.
8893 2004-04-27 Martin Baulig <martin@ximian.com>
8895 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
8896 a field initializer. Fixes #56459.
8898 2004-04-27 Martin Baulig <martin@ximian.com>
8900 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
8901 we're not attempting to use an indexer. Fixes #52154.
8903 2004-04-27 Martin Baulig <martin@ximian.com>
8905 * statement.cs (Return): Don't create a return label if we don't
8906 need it; reverts my change from January 20th. Thanks to Ben
8909 2004-04-27 Martin Baulig <martin@ximian.com>
8911 According to the spec, `goto' can only leave a nested scope, but
8914 * statement.cs (Block.LookupLabel): Only lookup in the current
8915 block, don't recurse into parent or child blocks.
8916 (Block.AddLabel): Check in parent and child blocks, report
8917 CS0140/CS0158 if we find a duplicate.
8918 (Block): Removed this indexer for label lookups.
8919 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
8920 this already does the error reporting for us.
8923 (FlowBranching.UsageVector.Block): New public variable; may be null.
8924 (FlowBranching.CreateSibling): Added `Block' argument.
8925 (FlowBranching.LookupLabel): New public virtual method. Lookup a
8926 label for the target of a `goto' and check whether we're not
8927 leaving a `finally'.
8929 2004-04-27 Martin Baulig <martin@ximian.com>
8931 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8932 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
8935 2004-04-27 Martin Baulig <martin@ximian.com>
8937 * statement.cs (Block.AddLabel): Also check for implicit blocks
8938 and added a CS0158 check.
8940 2004-04-27 Martin Baulig <martin@ximian.com>
8942 * flowanalysis.cs (FlowBranchingLoop): New class.
8943 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
8944 UsageVector's instead of an ArrayList.
8945 (FlowBranching.Label): Likewise.
8946 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
8947 (FlowBranching.AddBreakVector): New method.
8949 2004-04-27 Miguel de Icaza <miguel@ximian.com>
8951 * attribute.cs: Small regression fix: only convert the type if we
8952 the type is different, fixes System.Drawing build.
8954 2004-04-27 Martin Baulig <martin@ximian.com>
8956 * attribute.cs (Attribute.Resolve): If we have a constant value
8957 for a named field or property, implicity convert it to the correct
8960 2004-04-27 Raja R Harinath <rharinath@novell.com>
8962 * statement.cs (Block.Block): Implicit blocks share
8963 'child_variable_names' fields with parent blocks.
8964 (Block.AddChildVariableNames): Remove.
8965 (Block.AddVariable): Mark variable as "used by a child block" in
8966 every surrounding block.
8967 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
8968 been used in a child block, complain about violation of "Invariant
8969 meaning in blocks" rule.
8970 * cs-parser.jay (declare_local_variables): Don't use
8971 AddChildVariableNames.
8972 (foreach_statement): Don't create an implicit block: 'foreach'
8975 2004-04-23 Miguel de Icaza <miguel@ximian.com>
8977 * convert.cs (ImplicitNumericConversion): 0 is also positive when
8978 converting from 0L to ulong. Fixes 57522.
8980 2004-04-22 Marek Safar <marek.safar@seznam.cz>
8982 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
8983 derived class hides via 'new' keyword field from base class (test-242.cs).
8984 TODO: Handle this in the more general way.
8986 * class.cs (CheckBase): Ditto.
8988 2004-04-22 Marek Safar <marek.safar@seznam.cz>
8990 * decl.cs (caching_flags): New member for storing cached values
8992 (MemberCore.Flags): New enum where bit flags for caching_flags
8994 (MemberCore.cls_compliance): Moved to caching_flags.
8995 (DeclSpace.Created): Moved to caching_flags.
8997 * class.cs: Use caching_flags instead of DeclSpace.Created
8999 2004-04-21 Miguel de Icaza <miguel@ximian.com>
9001 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9002 if we are only a derived class, not a nested class.
9004 * typemanager.cs: Same as above, but do this at the MemberLookup
9005 level (used by field and methods, properties are handled in
9006 PropertyExpr). Allow for the qualified access if we are a nested
9009 2004-04-21 Marek Safar <marek.safar@seznam.cz>
9011 * class.cs: Refactoring.
9012 (IMethodData): New inteface; Holds links to parent members
9013 to avoid member duplication (reduced memory allocation).
9014 (Method): Implemented IMethodData interface.
9015 (PropertyBase): New inner classes for get/set methods.
9016 (PropertyBase.PropertyMethod): Implemented IMethodData interface
9017 (Event): New inner classes for add/remove methods.
9018 (Event.DelegateMethod): Implemented IMethodData interface.
9020 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9021 EmitContext (related to class.cs refactoring).
9023 2004-04-21 Raja R Harinath <rharinath@novell.com>
9025 * delegate.cs (Delegate.VerifyApplicability): If the number of
9026 arguments are the same as the number of parameters, first try to
9027 verify applicability ignoring any 'params' modifier on the last
9031 2004-04-08 Martin Baulig <martin@ximian.com>
9033 Merged latest changes into gmcs. Please keep this comment in
9034 here, it makes it easier for me to see what changed in MCS since
9035 the last time I merged.
9037 2004-04-16 Raja R Harinath <rharinath@novell.com>
9039 * class.cs (TypeContainer.AddIndexer): Use
9040 'ExplicitInterfaceName' to determine if interface name was
9041 explicitly specified. 'InterfaceType' is not initialized at this time.
9042 (TypeContainer.DefineIndexers): Remove use of temporary list. The
9043 Indexers array is already in the required order. Initialize
9044 'IndexerName' only if there are normal indexers.
9045 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9046 (TypeContainer.Emit): Emit DefaultMember attribute only if
9047 IndexerName is initialized.
9050 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
9052 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9055 2004-04-15 Raja R Harinath <rharinath@novell.com>
9057 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9061 * attribute.cs (Attribute.Resolve): Check for duplicate named
9065 2004-04-15 Miguel de Icaza <miguel@ximian.com>
9067 * iterators.cs (MarkYield): track whether we are in an exception,
9068 and generate code accordingly. Use a temporary value to store the
9069 result for our state.
9071 I had ignored a bit the interaction of try/catch with iterators
9072 since their behavior was not entirely obvious, but now it is
9073 possible to verify that our behavior is the same as MS .NET 2.0
9077 2004-04-14 Miguel de Icaza <miguel@ximian.com>
9079 * iterators.cs: Avoid creating temporaries if there is no work to
9082 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9083 Enumerations, use TypeManager.EnumToUnderlying and call
9086 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9089 (This.Emit): Use EmitContext.EmitThis to emit our
9092 (This.EmitAssign): Ditto.
9094 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9095 codepaths, we will move all the functionality into
9098 (FieldExpr.EmitAssign): Ditto.
9100 This fixes several hidden bugs that I uncovered while doing a code
9101 review of this today.
9103 * codegen.cs (EmitThis): reworked so the semantics are more clear
9104 and also support value types "this" instances.
9106 * iterators.cs: Changed so that for iterators in value types, we
9107 do not pass the value type as a parameter.
9109 Initialization of the enumerator helpers is now done in the caller
9110 instead of passing the parameters to the constructors and having
9111 the constructor set the fields.
9113 The fields have now `assembly' visibility instead of private.
9115 2004-04-11 Miguel de Icaza <miguel@ximian.com>
9117 * expression.cs (Argument.Resolve): Check if fields passed as ref
9118 or out are contained in a MarshalByRefObject.
9120 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9121 another compiler type.
9123 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
9125 * class.cs (Indexer.Define): use the new name checking method.
9126 Also, return false on an error.
9127 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9128 (is_identifier_[start/part]_character): make static.
9130 2004-04-10 Miguel de Icaza <miguel@ximian.com>
9132 * expression.cs (Binary.ResolveOperator): Do no append strings
9133 twice: since we can be invoked more than once (array evaluation)
9134 on the same concatenation, take care of this here. Based on a fix
9135 from Ben (bug #56454)
9137 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
9139 * codegen.cs: Fix another case where CS1548 must be reported (when
9140 delay-sign isn't specified and no private is available #56564). Fix
9141 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
9142 error when MCS is used on the MS runtime and we need to delay-sign
9143 (which seems unsupported by AssemblyBuilder - see #56621).
9145 2004-04-08 Marek Safar <marek.safar@seznam.cz>
9147 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9148 (TypeManager.ComputeNamespaces): Faster implementation for
9151 * compiler.csproj: Updated AssemblyName to mcs.
9153 2004-05-11 Jackson Harper <jackson@ximian.com>
9155 * Makefile: Preserve MONO_PATH
9157 2004-05-11 Jackson Harper <jackson@ximian.com>
9159 * Makefile: Use mono and mcs to build gmcs
9161 2004-05-03 Miguel de Icaza <miguel@ximian.com>
9163 * codegen.cs: Add patch from Robert Shade
9164 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
9167 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
9169 * CryptoConvert.cs: Updated to latest version. Fix issue with
9170 incomplete key pairs (#57941).
9172 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
9174 * codegen.cs: Fix another case where CS1548 must be reported (when
9175 delay-sign isn't specified and no private is available #56564). Fix
9176 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
9177 error when MCS is used on the MS runtime and we need to delay-sign
9178 (which seems unsupported by AssemblyBuilder - see #56621).
9180 2004-04-29 Jackson Harper <jackson@ximian.com>
9182 * Makefile: Set MONO_PATH to use the bootstrap corlib
9183 * driver.cs: Check the GAC for referenced assemblies.
9185 2004-04-29 Martin Baulig <martin@ximian.com>
9187 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
9189 2004-04-07 Martin Baulig <martin@ximian.com>
9191 * expression.cs (Binary.ResolveOperator): Added special case for
9192 Equality/Inequality between a type parameter and a null literal.
9194 2004-04-07 Martin Baulig <martin@ximian.com>
9196 * convert.cs: Check null literal -> type parameter conversions.
9198 2004-04-07 Martin Baulig <martin@ximian.com>
9200 * generic.cs (ConstructedType.CheckConstraints): Enforce the
9201 `class' and `struct' constraints.
9203 2004-04-07 Martin Baulig <martin@ximian.com>
9205 * generic.cs (SpecialConstraint): New public enum.
9206 (Constraints.Resolve): Added support for the `class' and `struct'
9209 * cs-parser.jay (type_parameter_constraint): Added support for the
9210 `class' and `struct' constraints.
9212 2004-04-07 Martin Baulig <martin@ximian.com>
9214 * support.cs (GenericConstraints): Replaced `Types' by
9215 `ClassConstraint' and `InterfaceConstraints'; added
9216 `HasClassConstraint'.
9218 2004-04-07 Martin Baulig <martin@ximian.com>
9221 (Constraints.InterfaceConstraints): New public property.
9222 (Constraints.Types): Make this property public
9223 (TypeParameter): Implement IMemberContainer.
9224 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
9225 instead of a TypeBuilder/MethodBuilder; pass the interface
9226 constraints to TypeManager.AddTypeParameter().
9227 (TypeParameter.DefineType): Just take an EmitContext and no
9228 TypeBuilder/MethodBuilder. Use the new public API.
9230 * typemanager.cs (TypeManager.AddTypeParameter): Added
9231 `TypeExpr[]' argument; add the interfaces to the
9232 `builder_to_ifaces' hash.
9233 (TypeManager.LookupMemberContainer): For
9234 GenericTypeParameterBuilders, get the TypeParameter from the
9235 `builder_to_type_param'.
9236 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
9237 the TypeParameter and call FindMembers on it.
9239 2004-04-07 Martin Baulig <martin@ximian.com>
9242 (MethodCore.GenericMethod): Moved this field here from Method.
9243 (MethodCore.IsDuplicateImplementation): Take the number of type
9244 parameters into account if we're a generic method.
9246 * expression.cs (Invocation.InferTypeArguments): Don't return true
9247 if `arguments' is null; we still need to check whether we actually
9248 don't need to infer anything in this case.
9249 (MemberAccess): Merged the functionality from GenericMemberAccess
9252 * generic.cs (GenericMemberAccess): Removed.
9254 2004-04-05 Martin Baulig <martin@ximian.com>
9256 * decl.cs (MemberCore): For generic classes, interfaces and
9257 structs, `Name' now includes the number of type parameters
9259 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
9260 encode the number of type arguments in the type name.
9262 * expression.cs (Expression.MemberLookup): Removed the
9263 `num_type_args' argument; we now encode the number of type
9264 arguments in the type name.
9266 * ecore.cs (SimpleName): Encode the number of type arguments in
9267 the type name itself.
9269 * generic.cs (ConstructedType): Likewise.
9271 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
9272 `MemberName'; we now include the number of type parameters in the
9275 * typemanager.cs (TypeManager.CheckGeneric): Removed.
9276 (TypeManager.MemberLookup): Removed the
9277 `num_type_args' argument; we now encode the number of type
9278 arguments in the type name.
9280 2004-04-03 Martin Baulig <martin@ximian.com>
9282 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
9283 (MemberCore.MemberName): Moved here from MemberBase.
9284 (DeclSpace.SetParameterInfo): Just take the constraints as an
9285 ArrayList; we already have the type parameters in our
9286 `MemberName'; also do the CS0080 reporting here.
9288 * cs-parser.jay (struct_declaration): Use `member_name' instead of
9289 `IDENTIFIER opt_type_parameter_list'; when constructing our
9290 `MemberName', it'll already include our type parameters.
9291 (class_declaration, interface_declaration): Likewise.
9292 (delegate_declaration): Likewise.
9293 (MakeName): Take a MemberName and return a MemberName.
9294 The following two changes are required to avoid shift/reduce conflicts:
9295 (member_name): Don't include a TypeName anymore; ie. this is now
9296 just 'IDENTIFIER opt_type_parameter_list'.
9297 (property_declaration, event_declaration): Use a
9298 `namespace_or_type_name' instead of a `member_name'.
9300 2004-04-03 Martin Baulig <martin@ximian.com>
9302 * decl.cs (MemberName): Renamed to `TypeName' and created a new
9304 (TypeName): Formerly known as MemberName.
9306 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
9307 instead of a `MemberName'.
9309 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
9310 (member_name): New rule; create a MemberName.
9312 2004-04-02 Martin Baulig <martin@ximian.com>
9314 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
9315 (CS0305 and CS0308).
9317 2004-04-02 Martin Baulig <martin@ximian.com>
9319 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
9320 support for nested types.
9322 2004-04-02 Martin Baulig <martin@ximian.com>
9324 * ecore.cs (IAlias): New public interface.
9325 (TypeExpr, TypeExpression): Implement IAlias.
9326 (TypeAliasExpression): New public class.
9328 * namespace.cs (Namespace): Implement IAlias.
9329 (Namespace.Lookup): Return an IAlias instead on an object.
9330 (Namespace.DefineName): Take an IAlias instead of an object.
9331 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
9333 (NamespaceEntry.UsingAlias): Take a Membername instead of an
9335 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
9337 (NamespaceEntry.Lookup): Likewise.
9339 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
9342 * decl.cs (DeclSpace): Implement IAlias.
9343 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
9345 * generic.cs (ConstructedType): Improved error checking.
9347 2004-04-02 Martin Baulig <martin@ximian.com>
9349 * convert.cs: Added type parameter conversions.
9352 (UnboxCast.Emit): Emit an `unbox.any' for type params.
9353 (ClassCast.Emit): If the source type is a type parameter, box it.
9354 If the target type is a type parameter, emit an `unbox.any'
9355 instead of a `classcast'.1
9357 2004-04-01 Martin Baulig <martin@ximian.com>
9359 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
9361 2004-04-01 Martin Baulig <martin@ximian.com>
9363 * generic.cs (ConstructedType.CheckConstraints): Use
9364 Convert.ImplicitStandardConversionExists(); user-defined implicit
9365 conversions are not allowed according to the spec.
9367 2004-03-30 Martin Baulig <martin@ximian.com>
9369 * expression.cs (New): Added support for type parameters.
9372 (TypeManager.activator_type): New public static field.
9373 (TypeManager.activator_create_instance): Likewise.
9375 2004-03-30 Martin Baulig <martin@ximian.com>
9377 * typemanager.cs (TypeManager.HasConstructorConstraint): New
9380 2004-03-30 Martin Baulig <martin@ximian.com>
9382 * generic.cs (ConstructedType.CheckConstraints): Actually follow
9383 the spec here: the argument type must be convertible to the
9386 2004-03-30 Martin Baulig <martin@ximian.com>
9389 (TypeParameter.Define, TypeParameter.DefineMethod): Call
9390 TypeManager.AddTypeParameter().
9391 (ConstructedType.CheckConstraints): Re-enable this and actually
9392 check whether we have a constructor constraint.
9395 (TypeManager.builder_to_type_param): New static field.
9396 (TypeManager.AddTypeParameter): New static method.
9397 (TypeManager.LookupTypeParameter): New public method.
9399 2004-03-30 Martin Baulig <martin@ximian.com>
9401 * generic.cs (TypeParameter.DefineType): Return a boolean and use
9402 the new API to actually define the constructor constraint.
9405 (TypeManager.new_constraint_attr_type): New static field.
9406 (TypeManager.InitCoreTypes): Initialize it.
9408 2004-03-30 Martin Baulig <martin@ximian.com>
9410 * generic.cs (Constraints): Completed error checking, use correct
9413 2004-03-29 Martin Baulig <martin@ximian.com>
9415 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
9417 * expression.cs (Invocation.InferTypeArguments): Added overloaded
9418 public version which takes a `ParameterData pd' instead of an
9421 2004-03-29 Martin Baulig <martin@ximian.com>
9423 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
9426 2004-03-29 Martin Baulig <martin@ximian.com>
9428 * expression.cs (Argument.ResolveMethodGroup): If we're a
9429 ConstructedType, call GetMemberAccess() on it.
9431 2004-03-29 Martin Baulig <martin@ximian.com>
9433 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
9434 (MethodCore.CheckGenericOverride): When overriding a generic
9435 method, check whether the constraints match.
9437 * support.cs (GenericConstraints): New public interface.
9438 (ParameterData.GenericConstraints): New public method.
9440 * parameter.cs (Parameter.Resolve): Check whether we're a generic
9441 method parameter and compute our constraints if appropriate.
9442 (Parameter.GenericConstraints): New public property.
9444 * generic.cs (Constraints): Implement GenericConstraints.
9446 2004-03-29 Martin Baulig <martin@ximian.com>
9448 * decl.cs (MemberCache.FindMemberToOverride): Use
9449 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
9451 2004-03-29 Martin Baulig <martin@ximian.com>
9453 * generic.cs (GenericMethod.Define): Resolve our type parameters.
9455 2004-03-29 Martin Baulig <martin@ximian.com>
9457 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
9458 not allowed on non-generic declarations").
9460 2004-03-29 Martin Baulig <martin@ximian.com>
9462 * expression.cs (Invocation.InferTypeArguments): Added overloaded
9463 public version of this method.
9465 * class.cs (MethodCore.IsDuplicateImplementation): Use
9466 Invocation.InferTypeArguments() to check this.
9468 2004-03-29 Martin Baulig <martin@ximian.com>
9470 * convert.cs: Use TypeManager.IsDelegateType() instead of
9471 comparing types correctly.
9473 2004-03-29 Martin Baulig <martin@ximian.com>
9475 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
9476 types directly to make it work for generic instances.
9478 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
9480 2004-03-29 Martin Baulig <martin@ximian.com>
9482 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
9485 2004-03-24 Martin Baulig <martin@ximian.com>
9487 * decl.cs (DeclSpace.FindType): Also use
9488 TypeManager.CheckGeneric() for types from the using clauses.
9490 2004-03-23 Martin Baulig <martin@ximian.com>
9492 * expression.cs (Invocation.OverloadResolve): Added `bool
9493 may_fail' argument and use it instead of the Location.IsNull() hack.
9495 2004-03-23 Martin Baulig <martin@ximian.com>
9497 * expression.cs (Invocation.InferType): Use correct type inference
9500 2004-03-23 Martin Baulig <martin@ximian.com>
9502 * ecore.cs (MethodGroupExpr.Name): Use
9503 TypeManager.CSharpSignature() instead of just the name.
9505 * expression.cs (Invocation.OverloadResolve): Provide better error
9507 (Invocation.DoResolve): OverloadResolve() never returns null
9508 without reporting an error, so removed the error -6 reporting here.
9510 2004-03-23 Martin Baulig <martin@ximian.com>
9512 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
9515 * cs-parser.jay (delegate_declaration): Support generic delegates.
9517 * delegate.cs: Support generic delegates.
9519 2004-03-22 Martin Baulig <martin@ximian.com>
9521 * expression.cs (Invocation.InferParamsTypeArguments): New static
9522 method; does type inference for params arguments.
9524 2004-03-21 Martin Baulig <martin@ximian.com>
9526 * typemanager.cs (TypeManager.IsGenericMethod): New public static
9527 method; checks whether a method is a generic method.
9529 * expression.cs (Invocation.InferTypeArguments): New static method;
9530 infer type arguments for generic method invocation.
9532 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
9533 property; we set this to true if we're resolving a generic method
9534 invocation and the user specified type arguments, ie. we're not
9535 doing type inference.
9537 2004-03-20 Martin Baulig <martin@ximian.com>
9539 * class.cs (MethodData.DeclaringType): New public property.
9540 (MethodData.Define): Set DeclaringType here.
9541 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
9542 instead of OperatorMethodBuilder.DeclaringType.
9544 2004-03-20 Martin Baulig <martin@ximian.com>
9546 * cs-tokenizer.cs (xtoken): Return a special
9547 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
9549 * cs-parser.jay (default_value_expression): Switch to the new
9552 2004-03-19 Martin Baulig <martin@ximian.com>
9554 * decl.cs (MemberName): New class. We use this to "construct"
9555 namespace_or_type_name's.
9557 * generics.cs (TypeArguments.GetDeclarations): New public method;
9558 returns the type arguments as a string[] and reports a CS0081 if
9559 one of them is not an identifier.
9561 * class.cs (MemberBase): The .ctor now takes the name as a
9562 MemberName instead of a string.
9563 (MemberBase.ExplicitInterfaceName): Changed type from string to
9565 (MemberBase.DoDefine): If we're an explicit implementation, the
9566 InterfaceType may be a generic instance.
9568 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
9569 (namespace_name): Call MemberName.GetName () to transform the
9570 MemberName into a string and ensure we don't have any type
9572 (type_name): Call MemberName.GetTypeExpression() to transfrom the
9573 MemberName into an expression.
9574 (method_header): Use namespace_or_type_name instead of member_name.
9576 2004-04-07 Miguel de Icaza <miguel@ximian.com>
9578 * rootcontext.cs: Add new types to the boot resolution.
9580 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9581 MulticastDelegate is not allowed.
9583 * typemanager.cs: Add new types to lookup: System.TypedReference
9586 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9587 check for TypedReference or ArgIterator, they are not allowed.
9589 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9590 makes us properly catch 1510 in some conditions (see bug 56016 for
9593 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
9595 * CryptoConvert.cs: update from corlib version
9598 2004-04-05 Miguel de Icaza <miguel@ximian.com>
9600 * class.cs (Indexer.Define): Check indexername declaration
9602 2004-04-05 Marek Safar <marek.safar@seznam.cz>
9604 * attribute.cs (IsClsCompliant): Fixed problem with handling
9605 all three states (compliant, not-compliant, undetected).
9607 2004-03-30 Marek Safar <marek.safar@seznam.cz>
9609 * attribute.cs (Attribute): Location is now public.
9610 (Resolve): Store resolved arguments (pos_values) in attribute class.
9611 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9612 (GetClsCompliantAttributeValue): New method that gets
9613 CLSCompliantAttribute value.
9614 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9615 if exists else null.
9616 (AttributeTester): New class for CLS-Compliant verification routines.
9618 * class.cs (Emit): Add CLS-Compliant verification.
9619 (Method.GetSignatureForError): Implemented.
9620 (Constructor.GetSignatureForError): Implemented
9621 (Constructor.HasCompliantArgs): Returns if constructor has
9622 CLS-Compliant arguments.
9623 (Constructor.Emit): Override.
9624 (Construcor.IsIdentifierClsCompliant): New method; For constructors
9625 is needed to test only parameters.
9626 (FieldBase.GetSignatureForError): Implemented.
9627 (TypeContainer): New member for storing base interfaces.
9628 (TypeContainer.FindMembers): Search in base interfaces too.
9630 * codegen.cs (GetClsComplianceAttribute): New method that gets
9631 assembly or module CLSCompliantAttribute value.
9632 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9634 (ModuleClass.Emit): Add error 3012 test.
9636 * const.cs (Emit): Override and call base for CLS-Compliant tests.
9638 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9639 state for all decl types.
9640 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9641 if CLS-Compliant tests are required.
9642 (IsClsCompliaceRequired): New method. Analyze whether code
9643 must be CLS-Compliant.
9644 (IsExposedFromAssembly): New method. Returns true when MemberCore
9645 is exposed from assembly.
9646 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9647 value or gets cached value.
9648 (HasClsCompliantAttribute): New method. Returns true if MemberCore
9649 is explicitly marked with CLSCompliantAttribute.
9650 (IsIdentifierClsCompliant): New abstract method. This method is
9651 used to testing error 3005.
9652 (IsIdentifierAndParamClsCompliant): New method. Common helper method
9653 for identifier and parameters CLS-Compliant testing.
9654 (VerifyClsCompliance): New method. The main virtual method for
9655 CLS-Compliant verifications.
9656 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9657 null. I don't know why is null (too many public members !).
9658 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
9659 and get value of first CLSCompliantAttribute that found.
9661 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
9662 (VerifyClsCompliance): Override and add extra tests.
9664 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
9665 clscheck- disable CLS-Compliant verification event if assembly is has
9666 CLSCompliantAttribute(true).
9668 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
9669 ApllyAttribute is now called in emit section as in the other cases.
9670 Possible future Emit integration.
9671 (IsIdentifierClsCompliant): New override.
9672 (VerifyClsCompliance): New override.
9673 (GetEnumeratorName): Returns full enum name.
9675 * parameter.cs (GetSignatureForError): Implemented.
9677 * report.cs (WarningData): New struct for Warning message information.
9678 (LocationOfPreviousError): New method.
9679 (Warning): New method. Reports warning based on the warning table.
9680 (Error_T): New method. Reports error based on the error table.
9682 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
9683 verifications are done here.
9685 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
9687 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
9688 CLSCompliantAttribute.
9689 (all_imported_types): New member holds all imported types from other
9691 (LoadAllImportedTypes): New method fills static table with exported types
9692 from all referenced assemblies.
9693 (Modules): New property returns all assembly modules.
9695 2004-03-30 Miguel de Icaza <miguel@ximian.com>
9697 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
9698 throwing a parser error.
9700 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
9701 which removes the hardcoded get_/set_ prefixes for properties, as
9702 IL allows for the properties to be named something else.
9706 * expression.cs: Do not override operand before we know if it is
9709 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9711 * typemanager.cs: support for pinned variables.
9713 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9715 * decl.cs, typemanager.cs: Avoid using an arraylist
9716 as a buffer if there is only one result set.
9718 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9720 * expression.cs: Make sure you cant call a static method
9721 with an instance expression, bug #56174.
9723 2004-03-29 Miguel de Icaza <miguel@ximian.com>
9725 * class.cs (IsDuplicateImplementation): Improve error reporting to
9726 flag 663 (method only differs in parameter modifier).
9728 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
9729 in preprocessor directives.
9731 * location.cs (LookupFile): Allow for the empty path.
9733 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
9734 better approach for some of that patch, but its failing with the
9735 CharSet enumeration. For now try/catch will do.
9737 * typemanager.cs: Do not crash if a struct does not have fields.
9740 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9742 * expression.cs: cs0213, cant fix a fixed expression.
9745 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9747 * cs-parser.jay: detect invalid embeded statements gracefully.
9750 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9752 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
9755 the invocation type may not be a subclass of the tye of the item/
9756 The type of the item must be a subclass of the invocation item.
9761 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
9763 * attribute.cs: Added methods to get a string and a bool from an
9764 attribute. Required to information from AssemblyKeyFileAttribute,
9765 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
9766 * codegen.cs: Modified AssemblyName creation to include support for
9767 strongnames. Catch additional exceptions to report them as CS1548.
9768 * compiler.csproj: Updated include CryptoConvert.cs.
9769 * compiler.csproj.user: Removed file - user specific configuration.
9770 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
9771 Mono.Security assembly. The original class is maintained and tested in
9772 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
9773 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
9774 like CSC 8.0 (C# v2) supports.
9775 * Makefile: Added CryptoConvert.cs to mcs sources.
9776 * rootcontext.cs: Added new options for strongnames.
9778 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
9780 * driver.cs: For --expect-error, report error code `2'
9781 if the program compiled with no errors, error code `1' if
9782 it compiled with an error other than the one expected.
9784 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
9786 * compiler.csproj: Updated for Visual Studio .NET 2003.
9787 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
9788 * compiler.sln: Updated for Visual Studio .NET 2003.
9790 2004-03-24 Ravi Pratap M <ravi@ximian.com>
9792 * expression.cs: Fix bug #47234. We basically need to apply the
9793 rule that we prefer the conversion of null to a reference type
9794 when faced with a conversion to 'object' (csc behaviour).
9796 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9798 * statement.cs: Shorter form for foreach, eliminates
9799 a local variable. r=Martin.
9801 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9803 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
9804 checks if we can use brtrue/brfalse to test for 0.
9805 * expression.cs: use the above in the test for using brtrue/brfalse.
9808 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9810 * expression.cs: Rewrite string concat stuff. Benefits:
9812 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
9813 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
9814 rather than a concat chain.
9816 * typemanager.cs: Add lookups for more concat overloads.
9818 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9820 * expression.cs: Emit shorter il code for array init.
9837 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
9839 * statement.cs: Before, two switch blocks would be merged if the
9840 total size of the blocks (end_item - begin_item + 1) was less than
9841 two times the combined sizes of the blocks.
9843 Now, it will only merge if after the merge at least half of the
9848 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
9850 * class.cs : csc build fix for GetMethods(). See bug #52503.
9852 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
9854 * expression.cs: Make sure fp comparisons work with NaN.
9855 This fixes bug #54303. Mig approved this patch a long
9856 time ago, but we were not able to test b/c the runtime
9859 2004-03-19 Miguel de Icaza <miguel@ximian.com>
9861 * ecore.cs (TypExpr.GetHashCode): implement this overload.
9863 2004-03-19 Martin Baulig <martin@ximian.com>
9865 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
9866 two overloads may unify for some type parameter substitutions and
9867 report a CS0408 if appropriate.
9869 2004-03-19 Martin Baulig <martin@ximian.com>
9871 * class.cs (MemberCore.IsDuplicateImplementation): Report the
9872 error here and not in our caller.
9874 2004-03-19 Martin Baulig <martin@ximian.com>
9876 * interface.cs: Completely killed this file.
9877 (Interface): We're now a TypeContainer and live in class.cs.
9879 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9880 argument; we're now also called for interfaces.
9881 (TypeContainer.DefineMembers): Allow this method being called
9883 (TypeContainer.GetMethods): New public method; formerly known as
9884 Interface.GetMethod(). This is used by PendingImplementation.
9885 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9886 it's now private and non-static.
9887 (Interface): Moved this here; it's now implemented similar to
9889 (Method, Property, Event, Indexer): Added `bool is_interface'
9890 argument to their .ctor's.
9891 (MemberBase.IsInterface): New public field.
9893 * cs-parser.jay: Create normal Method, Property, Event, Indexer
9894 instances instead of InterfaceMethod, InterfaceProperty, etc.
9895 (opt_interface_base): Removed; we now use `opt_class_base' instead.
9896 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9898 2004-03-19 Martin Baulig <martin@ximian.com>
9900 * class.cs (MethodCore.IsDuplicateImplementation): New private
9901 method which does the CS0111 checking.
9902 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9903 Use IsDuplicateImplementation().
9905 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
9907 * decl.cs (FindMemberToOverride): New method to find the correct
9908 method or property to override in the base class.
9910 - Make Method/Property use the above method to find the
9911 version in the base class.
9912 - Remove the InheritableMemberSignatureCompare as it is now
9915 This patch makes large code bases much faster to compile, as it is
9916 O(n) rather than O(n^2) to do this validation.
9918 Also, it fixes bug 52458 which is that nested classes are not
9919 taken into account when finding the base class member.
9921 Reviewed/Approved by Martin.
9923 2004-03-17 Martin Baulig <martin@ximian.com>
9925 * expression.cs (MemberAccess.DoResolve): Take the parent's number
9926 of type arguments into account; use the `real_num_type_args'
9927 approach like in DoResolveAsTypeStep().
9929 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
9932 2004-03-17 Marek Safar <marek.safar@seznam.cz>
9934 * interface.cs: In all interface classes removed redundant
9935 member initialization.
9937 2004-03-16 Martin Baulig <martin@ximian.com>
9939 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9941 2004-03-15 Miguel de Icaza <miguel@ximian.com>
9943 * decl.cs (DefineTypeAndParents): New helper method to define a
9944 type's containers before the type itself is defined; This is a
9945 bug exposed by the recent changes to Windows.Forms when an
9946 implemented interface was defined inside a class that had not been
9949 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
9951 (Check): Loop correctly to report errors modifiers
9952 (UNSAFE was not in the loop, since it was the same as TOP).
9954 * interface.cs: Every interface member now takes a ModFlags,
9955 instead of a "is_new" bool, which we set on the base MemberCore.
9957 Every place where we called "UnsafeOk" in the interface, now we
9958 call the proper member (InterfaceMethod.UnsafeOK) instead to get
9959 the unsafe settings from the member declaration instead of the
9960 container interface.
9962 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
9964 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9965 `set_indexer_name' to the pending bits (one per type).
9967 We fixed a bug today that was picking the wrong method to
9968 override, since for properties the existing InterfaceMethod code
9969 basically ignored the method name. Now we make sure that the
9970 method name is one of the valid indexer names.
9972 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
9974 * support.cs (SeekableStreamReader): Keep track of stream byte
9975 positions and don't mix them with character offsets to the buffer.
9977 Patch from Gustavo Giráldez
9979 2004-03-15 Marek Safar <marek.safar@seznam.cz>
9981 * interface.cs (InterfaceSetGetBase): Removed double member
9982 initialization, base class does it as well.
9984 2004-03-13 Martin Baulig <martin@ximian.com>
9986 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
9987 when compiling corlib.
9989 2004-03-13 Miguel de Icaza <miguel@ximian.com>
9991 * convert.cs (ExplicitConversion): We were reporting an error on
9992 certain conversions (object_type source to a value type, when the
9993 expression was `null') before we had a chance to pass it through
9994 the user defined conversions.
9996 * driver.cs: Replace / and \ in resource specifications to dots.
9999 * class.cs: Add check for duplicate operators. Fixes 52477
10001 2004-03-11 Miguel de Icaza <miguel@ximian.com>
10003 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10004 that are in the middle of the statements, not only at the end.
10007 * class.cs (TypeContainer.AddField): No longer set the
10008 `HaveStaticConstructor' flag, now we call it
10009 `UserDefineStaticConstructor' to diferentiate the slightly
10010 semantic difference.
10012 The situation is that we were not adding BeforeFieldInit (from
10013 Modifiers.TypeAttr) to classes that could have it.
10014 BeforeFieldInit should be set to classes that have no static
10019 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10021 And most importantly Zoltan's comment:
10023 http://bugzilla.ximian.com/show_bug.cgi?id=44229
10025 "I think beforefieldinit means 'it's ok to initialize the type sometime
10026 before its static fields are used', i.e. initialization does not need
10027 to be triggered by the first access to the type. Setting this flag
10028 helps the JIT to compile better code, since it can run the static
10029 constructor at JIT time, and does not need to generate code to call it
10030 (possibly lots of times) at runtime. Unfortunately, mcs does not set
10031 this flag for lots of classes like String.
10033 csc sets this flag if the type does not have an explicit static
10034 constructor. The reasoning seems to be that if there are only static
10035 initalizers for a type, and no static constructor, then the programmer
10036 does not care when this initialization happens, so beforefieldinit
10039 This bug prevents the AOT compiler from being usable, since it
10040 generates so many calls to mono_runtime_class_init that the AOT code
10041 is much slower than the JITted code. The JITted code is faster,
10042 because it does not generate these calls if the vtable is type is
10043 already initialized, which is true in the majority of cases. But the
10044 AOT compiler can't do this."
10046 2004-03-10 Miguel de Icaza <miguel@ximian.com>
10048 * class.cs (MethodData.Emit): Refactor the code so symbolic
10049 information is generated for destructors; For some reasons we
10050 were taking a code path that did not generate symbolic information
10053 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
10055 * class.cs: Create a Constructor.CheckBase method that
10056 takes care of all validation type code. The method
10057 contains some code that was moved from Define.
10059 It also includes new code that checks for duplicate ctors.
10060 This fixes bug #55148.
10062 2004-03-09 Joshua Tauberer <tauberer@for.net>
10064 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10065 a { ... }-style array creation invokes EmitStaticInitializers
10066 which is not good for reference-type arrays. String, decimal
10067 and now null constants (NullCast) are not counted toward
10068 static initializers.
10070 2004-03-05 Martin Baulig <martin@ximian.com>
10072 * location.cs (SourceFile.HasLineDirective): New public field;
10073 specifies whether the file contains or is referenced by a "#line"
10075 (Location.DefineSymbolDocuments): Ignore source files which
10076 either contain or are referenced by a "#line" directive.
10078 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
10080 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10081 direct access to our parent, so check the method inline there.
10083 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
10085 * expression.cs (Invocation.EmitCall): Miguel's last commit
10086 caused a regression. If you had:
10091 In Foo the implict this would be null.
10093 2004-02-27 Miguel de Icaza <miguel@ximian.com>
10095 * expression.cs (Invocation.EmitCall): If the method is not
10096 virtual, do not emit a CallVirt to it, use Call.
10098 * typemanager.cs (GetFullNameSignature): Improve the method to
10099 cope with ".ctor" and replace it with the type name.
10101 * class.cs (ConstructorInitializer.Resolve): Now the method takes
10102 as an argument the ConstructorBuilder where it is being defined,
10103 to catch the recursive constructor invocations.
10105 2004-03-16 Martin Baulig <martin@ximian.com>
10107 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
10108 ConstructedType, call ResolveType() on it to get the type rather
10109 than just using `expr.Type'.
10111 2004-03-16 Martin Baulig <martin@ximian.com>
10113 * generics.cs (ConstructedType.GetMemberAccess): Take the
10114 EmitContext instead on the TypeExpr and use
10115 ec.TypeContainer.CurrentType/ec.ContainerType.
10117 2004-03-16 Martin Baulig <martin@ximian.com>
10119 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
10120 parameters before aliases.
10122 2004-03-16 Martin Baulig <martin@ximian.com>
10124 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
10125 New oublic function; checks whether two generic instances may become
10126 equal under some instantiations (26.3.1).
10128 * class.cs (TypeContainer.Define): Call
10129 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
10132 2004-03-16 Martin Baulig <martin@ximian.com>
10134 * class.cs (TypeContainer.GetClassBases): Moved
10135 Error_TypeParameterAsBase() here and also check whether the base
10136 class is not an attribute.
10138 2004-03-16 Martin Baulig <martin@ximian.com>
10140 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10142 2004-03-16 Martin Baulig <martin@ximian.com>
10144 * class.cs (Error_TypeParameterAsBase): Use correct error number
10147 2004-03-16 Martin Baulig <martin@ximian.com>
10149 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
10152 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
10155 2004-03-15 Martin Baulig <martin@ximian.com>
10157 * typemanager.cs (TypeManager.GetFullName): New public method.
10158 (TypeManager.MemberLookup): Added `int_num_type_arguments'
10159 argument; only return members with the correct number of type
10161 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
10162 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
10163 whether the number of type arguments matches.
10165 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
10166 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
10168 * expression.cs (MemberAccess): Added public `NumTypeArguments'
10169 field; it's set by the protected .ctor when we're actually a
10170 GenericMemberAccess.
10171 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
10172 arguments and pass it to MemberLookupFinal ().
10174 * ecore.cs (Expression.MemberLookup): Added `int
10175 num_type_arguments' argument; only return members with the correct
10176 number of type arguments.
10177 (Expression.MemberLookupFailed): Check whether the MemberLookup
10178 failed because we did not have the correct number of type
10179 arguments; report CS0305 in this case.
10181 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
10182 `e.ResolveAsTypeTerminal()' already did so.
10184 2004-03-15 Martin Baulig <martin@ximian.com>
10186 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
10187 we're a ConstructedType; in this case, the caller must report an
10188 error (for instance CS0131).
10190 * generic.cs (TypeArguments): Added Location argument to the .ctor.
10191 (TypeArguments.Resolve): Actually report errors here.
10193 2004-03-15 Miguel de Icaza <miguel@ximian.com>
10195 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10196 `set_indexer_name' to the pending bits (one per type).
10198 We fixed a bug today that was picking the wrong method to
10199 override, since for properties the existing InterfaceMethod code
10200 basically ignored the method name. Now we make sure that the
10201 method name is one of the valid indexer names.
10203 2004-03-15 Martin Baulig <martin@ximian.com>
10205 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
10206 for generic instances.
10208 2004-03-13 Martin Baulig <martin@ximian.com>
10210 * class.cs (TypeContainer.DefineType): Call
10211 TypeManager.AddUserType() immediately after creating the
10212 TypeBuilder; pass all type parameters when creating the
10215 * decl.cs (DeclSpace.FindNestedType): New public method.
10216 (DeclSpace.FindType): Added `int num_type_args' argument; only
10217 return types with the correct number of type parameters.
10218 (DeclSpace.CountTypeParams): New public property.
10220 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
10221 the number of type parameters; defaults to zero.
10223 * generic.cs (TypeArguments.Count): New public property.
10224 (ConstructedType.DoResolveAsTypeStep): First call
10225 ds.FindNestedType() to find out whether we're nested in the
10226 current generic type; in this case, we inherit all type parameters
10227 from the current class.
10229 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
10230 num_type_args' argument.
10231 (RootContext.LookupType): Added overloaded version which takes the
10232 number of type arguments; only return types with the correct
10233 number of type arguments.
10235 * typemanager.cs (TypeManager.CheckGeneric): New public function;
10236 checks whether `Type t' has `int num_type_args'.
10238 2004-03-13 Martin Baulig <martin@ximian.com>
10240 * generic.cs (GenericMethod.DefineType): New method; calls
10241 DefineType() on all the type parameters.
10243 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
10244 (MethodData.Define): If we're a generic method, call
10245 GenericMethod.DefineType() to define the type parameters.
10247 2004-03-10 Martin Baulig <martin@ximian.com>
10249 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
10250 instead of IsAssignableFrom.
10252 2004-03-10 Martin Baulig <martin@ximian.com>
10254 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
10256 * support.cs (ParameterData.HasArrayParameter): New property.
10257 (ReflectionParameters.ctor): Take a MethodBase instead of a
10258 ParameterInfo[]. If we have any type parameters, get the generic
10259 method definition and ask it whether we have variable arguments.
10261 2004-02-26 Miguel de Icaza <miguel@ximian.com>
10263 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10264 routines to check if a type is an enumerable/enumerator allow
10265 classes that implement the IEnumerable or IEnumerator interfaces.
10267 * class.cs (Property, Operator): Implement IIteratorContainer, and
10268 implement SetYields.
10270 (Property.Define): Do the block swapping for get_methods in the
10271 context of iterators. We need to check if Properties also
10272 include indexers or not.
10274 (Operator): Assign the Block before invoking the
10275 OperatorMethod.Define, so we can trigger the Iterator code
10278 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
10279 Property and Operator classes are not created when we parse the
10280 declarator but until we have the block completed, so we use a
10281 singleton SimpleIteratorContainer.Simple to flag whether the
10282 SetYields has been invoked.
10284 We propagate this setting then to the Property or the Operator to
10285 allow the `yield' to function.
10287 2004-02-25 Marek Safar <marek.safar@seznam.cz>
10289 * codegen.cs: Implemented attribute support for modules.
10290 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10291 Assembly/Module functionality.
10293 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10294 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10295 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10297 2004-02-16 Marek Safar <marek.safar@seznam.cz>
10299 * interface.cs (FindMembers): The operation is performed on all base
10300 interfaces and not only on the first. It is required for future CLS Compliance patch.
10302 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
10304 * statement.cs, codegen.cs:
10305 This patch deals with patterns such as:
10307 public class List : IEnumerable {
10309 public MyEnumerator GetEnumerator () {
10310 return new MyEnumerator(this);
10313 IEnumerator IEnumerable.GetEnumerator () {
10317 public struct MyEnumerator : IEnumerator {
10322 Before, there were a few things we did wrong:
10323 1) we would emit callvirt on a struct, which is illegal
10324 2) we emited ldarg when we needed to emit ldarga
10325 3) we would mistakenly call the interface methods on an enumerator
10326 type that derived from IEnumerator and was in another assembly. For example:
10328 public class MyEnumerator : IEnumerator
10330 Would have the interface methods called, even if there were public impls of the
10331 method. In a struct, this lead to invalid IL code.
10333 2004-02-11 Marek Safar <marek.safar@seznam.cz>
10335 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10338 * delegate.cs (Define): Fixed crash when delegate type is undefined.
10340 2004-02-11 Miguel de Icaza <miguel@ximian.com>
10342 * cs-parser.jay: Fix small regression: we were not testing V2
10343 compiler features correctly.
10345 * interface.cs: If the emit context is null, then create one
10347 2004-02-09 Marek Safar <marek.safar@seznam.cz>
10349 * decl.cs (GetSignatureForError): New virtual method to get full name
10350 for error messages.
10352 * attribute.cs (IAttributeSupport): New interface for attribute setting.
10353 Now it is possible to rewrite ApplyAttributes method to be less if/else.
10355 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10356 Duplicated members and code in these classes has been removed.
10357 Better encapsulation in these classes.
10359 2004-02-07 Miguel de Icaza <miguel@ximian.com>
10361 * assign.cs (Assign.DoResolve): When dealing with compound
10362 assignments, there is a new rule in ECMA C# 2.4 (might have been
10363 there before, but it is documented here) that states that in:
10367 If b is of type int, and the `op' is a shift-operator, then the
10368 above is evaluated as:
10372 * expression.cs (Binary.ResolveOperator): Instead of testing for
10373 int/uint/long/ulong, try to implicitly convert to any of those
10374 types and use that in pointer arithmetic.
10376 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10377 method to print information for from the type, not from the
10378 null-method we were given.
10380 2004-02-01 Duncan Mak <duncan@ximian.com>
10382 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10383 parsing for cmd, fixes bug #53694.
10385 2004-02-04 Marek Safar <marek.safar@seznam.cz>
10387 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10388 in the member name duplication tests. Property and operator name duplication
10389 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10391 2004-02-03 Marek Safar <marek.safar@seznam.cz>
10393 * interface.cs (PopulateMethod): Fixed crash when interface method
10394 returns not existing type (error test cs0246-3.cs).
10396 2004-02-02 Ravi Pratap M <ravi@ximian.com>
10398 * cs-parser.jay (interface_accessors): Re-write actions to also
10399 store attributes attached to get and set methods. Fix spelling
10402 (inteface_property_declaration): Modify accordingly.
10404 (InterfaceAccessorInfo): New helper class to store information to pass
10405 around between rules that use interface_accessors.
10407 * interface.cs (Emit): Apply attributes on the get and set
10408 accessors of properties and indexers too.
10410 * attribute.cs (ApplyAttributes): Modify accordingly to use the
10411 right MethodBuilder when applying attributes to the get and set accessors.
10413 2004-01-31 Miguel de Icaza <miguel@ximian.com>
10415 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10417 2004-01-26 Miguel de Icaza <miguel@ximian.com>
10419 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10421 2004-01-25 Miguel de Icaza <miguel@ximian.com>
10423 * cs-parser.jay: Remove YIELD token, instead use the new grammar
10424 changes that treat `yield' specially when present before `break'
10425 or `return' tokens.
10427 * cs-tokenizer.cs: yield is no longer a keyword.
10429 2004-01-23 Marek Safar <marek.safar@seznam.cz>
10431 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10432 setting for default constructors.
10433 For default constructors are almost every time set wrong Modifier. The
10434 generated IL code has been alright. But inside mcs this values was
10435 wrong and this was reason why several of my CLS Compliance tests
10438 2004-02-27 Martin Baulig <martin@ximian.com>
10440 * generics.cs (ConstructedType.ResolveType): Make the nested type
10441 stuff actually work.
10443 2004-02-25 Martin Baulig <martin@ximian.com>
10445 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
10446 property; returns the type parameters just from the current type,
10447 ie. with the ones from outer classes.
10448 (DeclSpace.LookupGeneric): First search in the current class, then
10450 (DeclSpace.initialize_type_params): When hiding a type parameter
10451 from an outer class, put it into the `type_param_list' anyways.
10453 * expression.cs (MemberAccess.expr): Made this field protected.
10455 * class.cs (TypeContainer.Define): The `CurrentType' just contains
10456 the type parameters from the current class.
10458 * generic.cs (ConstructedType.ResolveType): Support nested generic
10459 types by taking the type parameters which we inherit from outer
10460 classes into account.
10461 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
10462 support for nested generic types.
10464 2004-02-23 Martin Baulig <martin@ximian.com>
10466 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
10467 field and check whether we're nested inside a generic type.
10468 (DeclSpace.ResolveType): If we're resolving to a generic type
10469 definition, create a ConstructedType and return its resolved type.
10470 (DeclSpace.initialize_type_params): New private method;
10471 initializes the `type_param_list' field from the type parameters
10472 from this and all enclosing classes.
10473 (DeclSpace.TypeParameters): Call initialize_type_params() unless
10474 we're already initialized.
10476 2004-02-23 Martin Baulig <martin@ximian.com>
10478 * class.cs (Method.Define): Create the generic method before
10479 calling DoDefine().
10480 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
10481 the TypeContainer one); we use this for generic methods.
10483 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
10484 parent's TypeBuilder.
10486 2004-02-18 Martin Baulig <martin@ximian.com>
10488 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
10489 to check for equality.
10491 2004-02-05 Martin Baulig <martin@ximian.com>
10493 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
10494 `ec.TypeContainer.CurrentType', use it instead of
10495 `ec.ContainerType' to check whether we're in the type's ctor.
10497 2004-01-29 Martin Baulig <martin@ximian.com>
10499 * expression.cs (Invocation.DoResolve): If we're a
10500 `ConstructedType', then we're actually a generic method, so
10501 rewrite the expr as a GenericMemberAccess.
10503 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
10504 here; manually parse it into a string.
10506 2004-01-28 Martin Baulig <martin@ximian.com>
10508 * typemanager.cs (TypeManager.IsEqual): New static method.
10509 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
10510 check for equality instead of using `=='.
10512 2004-01-26 Martin Baulig <martin@ximian.com>
10514 * decl.cs (DeclSpace.CurrentType): New public field.
10516 * expression.cs (This.ResolveBase): If we have an
10517 `ec.TypeContainer.CurrentType', use it instead of
10518 `ec.ContainerType'.
10520 * class.cs (TypeContainer.DefineType): If we're a generic type,
10521 create the `CurrentType' (unresolved).
10522 (TypeContainer.GenericType): New private field.
10523 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
10524 it and store it in `GenericType' before creating the MemberCache.
10525 (TypeContainer.GetMembers): If we have a `GenericType', call
10526 TypeManager.FindMembers() on it.
10528 * interface.cs (Interface.GenericType): New private field.
10529 (Interface.DefineType): If we're a generic type, create the
10530 `CurrentType' (unresolved).
10531 (Interface.DefineMembers): If we have a `CurrentType', resolve it
10532 and store it in `GenericType' before creating the MemberCache.
10533 (Interface.GetMembers): If we have a `GenericType', call
10534 TypeManager.FindMembers() on it.
10536 2004-01-22 Martin Baulig <martin@ximian.com>
10538 * cs-parser.jay (namespace_or_type_name): Return an Expression,
10539 not a QualifiedIdentifier. This is what `type_name_expression'
10540 was previously doing.
10541 (type_name_expression): Removed; the code is now in
10542 `namespace_or_type_name'.
10543 (qualified_identifier): Removed, use `namespace_or_type_name'
10545 (QualifiedIdentifier): Removed this class.
10547 2004-01-22 Martin Baulig <martin@ximian.com>
10549 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10550 not a string as alias name.
10552 2004-01-21 Miguel de Icaza <miguel@ximian.com>
10554 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10555 #52730 bug, and instead compute correctly the need to use a
10556 temporary variable when requesting an address based on the
10557 static/instace modified of the field and the constructor.
10559 2004-01-21 Martin Baulig <martin@ximian.com>
10561 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10562 class and namespace before looking up aliases. Fixes #52517.
10564 2004-01-21 Martin Baulig <martin@ximian.com>
10566 * flowanalysis.cs (UsageVector.Merge): Allow variables being
10567 assinged in a 'try'; fixes exception4.cs.
10569 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10570 * class.cs : Implemented parameter-less constructor for TypeContainer
10572 * decl.cs: Attributes are now stored here. New property OptAttributes
10574 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10576 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10578 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10580 * typemanager.cs (CSharpSignature): Now reports also inner class name.
10581 (CSharpSignature): New method for indexer and property signature.
10583 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10585 * pending.cs (IsVirtualFilter): Faster implementation.
10587 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10589 * typemanager.cs: Avoid inclusion of same assembly more than once.
10591 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10593 * cs-parser.jay: Fixed problem where the last assembly attribute
10594 has been applied also to following declaration (class, struct, etc.)
10596 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10598 * class.cs: Added error CS0538, CS0539 reporting.
10599 Fixed crash on Microsoft runtime when field type is void.
10601 * cs-parser.jay: Added error CS0537 reporting.
10603 * pending.cs: Added error CS0535 reporting.
10604 Improved error report for errors CS0536, CS0534.
10606 2004-01-20 Miguel de Icaza <miguel@ximian.com>
10608 Merge a few bits from the Anonymous Method MCS tree.
10610 * statement.cs (ToplevelBlock): New class for toplevel methods,
10611 will hold anonymous methods, lifted variables.
10613 * cs-parser.jay: Create toplevel blocks for delegates and for
10614 regular blocks of code.
10616 2004-01-20 Martin Baulig <martin@ximian.com>
10618 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10619 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10620 and `NeedExplicitReturn'; added `IsLastStatement'.
10621 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10622 have a `ReturnLabel' or we're not unreachable.
10624 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10625 child's reachability; don't just override ours with it. Fixes
10626 #58058 (lluis's example).
10627 (FlowBranching): Added public InTryOrCatch(), InCatch(),
10628 InFinally(), InLoop(), InSwitch() and
10629 BreakCrossesTryCatchBoundary() methods.
10631 * statement.cs (Return): Do all error checking in Resolve().
10632 Unless we are the last statement in a top-level block, always
10633 create a return label and jump to it.
10634 (Break, Continue): Do all error checking in Resolve(); also make
10635 sure we aren't leaving a `finally'.
10636 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10637 statement in a top-level block.
10638 (Block.Flags): Added `IsDestructor'.
10639 (Block.IsDestructor): New public property.
10641 2004-01-20 Martin Baulig <martin@ximian.com>
10643 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10645 2004-01-20 Martin Baulig <martin@ximian.com>
10647 * statement.cs (Statement.ResolveUnreachable): New public method.
10648 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10649 (Block.Resolve): Resolve unreachable statements.
10651 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
10653 * expression.cs: We need to fix the case where we do
10654 not have a temp variable here.
10656 * assign.cs: Only expression compound assignments need
10657 temporary variables.
10659 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
10661 * flowanalysis.cs: Reduce memory allocation in a few ways:
10662 - A block with no variables should not allocate a bit
10664 - A method with no out parameters does not need any tracking
10665 for assignment of the parameters, so we need not allocate
10668 public readonly Type[] VariableTypes;
10669 public readonly string[] VariableNames;
10670 Are redundant. The data is already stored in the variable
10671 map, so we need not allocate another array for it.
10672 - We need to add alot of checks for if (params | locals) == null
10673 due to the first two changes.
10675 2004-01-18 Miguel de Icaza <miguel@ximian.com>
10677 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10678 implement IMemoryLocation, we store a copy on a local variable and
10679 take the address of it. Patch from Benjamin Jemlich
10681 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
10682 to use a special "type_name_expression" rule which reduces the
10683 number of "QualifiedIdentifier" classes created, and instead
10684 directly creates MemberAccess expressions.
10686 2004-01-17 Miguel de Icaza <miguel@ximian.com>
10688 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
10689 that fixes #52853. Null literal assignment to ValueType
10691 * class.cs (MethodData.Emit): Instead of checking the name of the
10692 method to determine if its a destructor, create a new derived
10693 class from Method called Destructor, and test for that.
10695 * cs-parser.jay: Create a Destructor object instead of a Method.
10697 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10701 2004-01-16 Miguel de Icaza <miguel@ximian.com>
10703 * expression.cs (Binary.ResolveOperator): Perform an implicit
10704 conversion from MethodGroups to their delegate types on the
10705 Addition operation.
10707 * delegate.cs: Introduce a new class DelegateCreation that is the
10708 base class for `NewDelegate' and `ImplicitDelegateCreation',
10709 factor some code in here.
10711 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
10712 conversion from MethodGroups to compatible delegate types.
10714 * ecore.cs (Expression.Resolve): Do not flag error 654
10715 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
10716 we allow conversions from MethodGroups to delegate types now.
10718 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
10719 assignments in v2 either.
10721 2004-01-10 Miguel de Icaza <miguel@ximian.com>
10723 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
10724 static read-only fields in ctors.
10726 Applied patch from Benjamin Jemlich
10728 * expression.cs (UnaryMutator): Avoid leaking local variables.
10730 2004-01-09 Miguel de Icaza <miguel@ximian.com>
10732 * cs-tokenizer.cs (IsCastToken): Allow the various native types
10733 here to return true, as they can be used like this:
10735 (XXX) int.MEMBER ()
10737 Fixed 49836 and all the other dups
10739 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
10741 * driver.cs: Implement /win32res and /win32icon.
10743 2004-01-08 Miguel de Icaza <miguel@ximian.com>
10745 * cs-parser.jay: Add a rule to improve error handling for the
10746 common mistake of placing modifiers after the type.
10748 2004-01-07 Miguel de Icaza <miguel@ximian.com>
10750 * cs-parser.jay (interface_event_declaration): Catch
10751 initialization of events on interfaces, and report cs0068
10753 * cs-parser.jay (interface_event_declaration): Catch
10754 initialization of events.
10756 * ecore.cs: Better report missing constructors.
10758 * expression.cs (Binary.ResolveOperator): My previous bug fix had
10759 the error reporting done in the wrong place. Fix.
10761 * expression.cs (Binary.ResolveOperator): Catch the
10762 operator + (E x, E y) error earlier, and later allow for implicit
10763 conversions in operator +/- (E e, U x) from U to the underlying
10766 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10767 52596, if the container class is abstract, the default constructor
10768 is protected otherwise its public (before, we were always public).
10770 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10773 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10774 Jemlich that fixes bug #52597, MCS was generating invalid code for
10775 idisposable structs. Thanks to Ben for following up with this
10778 2004-01-06 Miguel de Icaza <miguel@ximian.com>
10780 * driver.cs: Allow assemblies without code to be generated, fixes
10783 2004-01-07 Nick Drochak <ndrochak@gol.com>
10785 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10787 2004-01-05 Miguel de Icaza <miguel@ximian.com>
10789 * cs-parser.jay: Add rules to improve error reporting if fields or
10790 methods are declared at the namespace level (error 116)
10792 * Add rules to catch event add/remove
10794 2004-01-04 David Sheldon <dave-mono@earth.li>
10796 * expression.cs: Added matching ")" to error message for
10799 2004-01-03 Todd Berman <tberman@gentoo.org>
10801 * ecore.cs, attribute.cs:
10802 Applying fix from #52429.
10804 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10806 * ecore.cs, expression.cs, statement.cs:
10807 Total rewrite of how we handle branching. We
10808 now handle complex boolean expressions with fewer
10809 jumps. As well if (x == 0) no longer emits a ceq.
10811 if (x is Foo) is much faster now, because we generate
10814 Overall, we get a pretty big improvement on our benchmark
10815 tests. The code we generate is smaller and more readable.
10817 I did a full two-stage bootstrap. The patch was reviewed
10818 by Martin and Miguel.
10820 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10822 * cs-parser.jay: Make primary_expression not take a QI.
10823 we dont need this because the member_access rule covers
10824 us here. So we replace the rule with just IDENTIFIER.
10826 This has two good effects. First, we remove a s/r conflict.
10827 Second, we allocate many fewer QualifiedIdentifier objects.
10829 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10831 * attribute.cs: Handle MarshalAs attributes as pseudo, and
10832 set the correct information via SRE. This prevents
10833 hanging on the MS runtime. Fixes #29374.
10835 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10837 * convert.cs: correctly handle conversions to value types
10838 from Enum and ValueType as unboxing conversions.
10840 Fixes bug #52569. Patch by Benjamin Jemlich.
10842 2004-01-02 Ravi Pratap <ravi@ximian.com>
10844 * expression.cs (BetterConversion): Prefer int -> uint
10845 over int -> ulong (csc's behaviour). This fixed bug #52046.
10847 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
10849 * decl.cs (MemberCache.FindMembers): now returns a
10852 * typemanager.cs: In general, go with with ^^.
10853 (CopyNewMethods): take an IList.
10854 (RealMemberLookup): Only allocate an arraylist
10855 if we copy from two sets of methods.
10857 This change basically does two things:
10858 1) Fewer array lists allocated due to CopyNewMethods.
10859 2) the explicit cast in MemberList costed ALOT.
10861 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
10863 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10864 a hashtable to avoid needless string allocations when an identifier is
10865 used more than once (the common case).
10867 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10869 * pending.cs: MS's TypeBuilder.GetInterfaces ()
10870 is broken, it will not return anything. So, we
10871 have to use the information we have in mcs to
10874 * typemanager.cs: Add a cache for GetInterfaces,
10875 since this will now be used more often (due to ^^)
10877 (GetExplicitInterfaces) New method that gets the
10878 declared, not effective, interfaces on a type
10879 builder (eg, if you have interface IFoo, interface
10880 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10883 This patch makes MCS able to bootstrap itself on
10886 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10888 * expression.cs: Remove the Nop's that Miguel put
10891 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10893 * report.cs, codegen.cs: Give the real stack trace to
10894 the error when an exception is thrown.
10896 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10898 * decl.cs: only allocate hashtables for ifaces if
10901 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10903 * expression.cs: fix the error from cs0121-2.cs
10904 (a parent interface has two child interfaces that
10905 have a function with the same name and 0 params
10906 and the function is called through the parent).
10908 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
10910 * class.cs, rootcontext.cs, typmanager.cs: do not
10913 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
10915 * codegen.cs: remove stack for the ec flow branching.
10916 It is already a linked list, so no need.
10918 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
10920 * Makefile: Allow custom profiler here.
10922 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10924 * typemanager.cs (LookupType):
10925 - Use a static char [], because split takes
10926 a param array for args, so it was allocating
10928 - Do not store true in a hashtable, it boxes.
10930 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10932 * flowanalysis.cs: bytify common enums.
10934 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10936 * modifiers.cs: Add a new set of flags for the
10937 flags allowed on explicit interface impls.
10938 * cs-parser.jay: catch the use of modifiers in
10939 interfaces correctly.
10940 * class.cs: catch private void IFoo.Blah ().
10942 All related to bug #50572.
10944 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10946 * decl.cs: Rewrite the consistant accessability checking.
10947 Accessability is not linear, it must be implemented in
10948 a tableish way. Fixes #49704.
10950 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10952 * expression.cs: Handle negation in a checked context.
10953 We must use subtraction from zero. Fixes #38674.
10955 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10957 * class.cs: Ignore static void main in DLLs.
10958 * rootcontext.cs: Handle the target type here,
10959 since we are have to access it from class.cs
10960 * driver.cs: account for the above.
10962 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10964 * report.cs: Give line numbers and files if available.
10966 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
10968 * driver.cs: Implement /addmodule.
10970 * typemanager.cs: Change 'modules' field so it now contains Modules not
10973 2003-12-20 Martin Baulig <martin@ximian.com>
10975 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10976 (FieldBase.IsAssigned): Removed this field.
10977 (FieldBase.SetAssigned): New public method.
10978 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10980 2003-12-20 Martin Baulig <martin@ximian.com>
10982 * expression.cs (LocalVariableReference.DoResolve): Don't set
10983 `vi.Used' if we're called from DoResolveLValue().
10985 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10986 returns the usage vector it just merged into the current one -
10987 pass this one to UsageWarning().
10988 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10989 of the `EmitContext', don't call this recursively on our children.
10991 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
10993 * driver.cs: Implement /target:module.
10995 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
10997 * support.cs (CharArrayHashtable): New helper class.
10999 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
11000 char arrays, not strings, so we can avoid creating a string in
11001 consume_identifier if the identifier is a keyword.
11003 2003-12-16 Martin Baulig <martin@ximian.com>
11005 * statement.cs (LocalInfo.Assigned): Removed this property.
11006 (LocalInfo.Flags): Removed `Assigned'.
11007 (LocalInfo.IsAssigned): New public method; takes the EmitContext
11008 and uses flow analysis.
11009 (Block.UsageWarning): Made this method private.
11010 (Block.Resolve): Call UsageWarning() if appropriate.
11012 * expression.cs (LocalVariableReference.DoResolve): Always set
11013 LocalInfo.Used here.
11015 2003-12-13 Martin Baulig <martin@ximian.com>
11017 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11018 any value here; we're now using flow analysis to figure out
11019 whether a statement/block returns a value.
11021 2003-12-13 Martin Baulig <martin@ximian.com>
11023 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11025 (FlowBranching.MergeFinally): Don't call
11026 `branching.CheckOutParameters()' here, this is called in
11028 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11029 when adding the `finally' vector.
11031 2003-12-13 Martin Baulig <martin@ximian.com>
11034 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11035 actually work and also fix #48962.
11037 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
11039 * decl.cs: Do not check System.Object for nested types,
11040 since we know it does not have any. Big bang for buck:
11043 Run 1: 8.35 seconds
11044 Run 2: 8.32 seconds
11045 corlib: 17.99 seconds
11047 Run 1: 8.17 seconds
11048 Run 2: 8.17 seconds
11049 corlib: 17.39 seconds
11051 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
11053 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11054 time we are returning 0 members, so we save alot here.
11056 2003-12-11 Martin Baulig <martin@ximian.com>
11058 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11059 `MergeChild()', also just take the `FlowBranching' as argument;
11060 call Merge() on it and return the result.
11061 (FlowBranching.Merge): We don't need to do anything if we just
11064 2003-12-11 Martin Baulig <martin@ximian.com>
11066 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11067 them in an `ArrayList' to reduce memory usage. Thanks to Ben
11068 Maurer for this idea.
11070 2003-12-11 Martin Baulig <martin@ximian.com>
11072 * flowanalysis.cs (MergeResult): This class is now gone; we now
11073 use the `UsageVector' for this. The reason for this is that if a
11074 branching just has one sibling, we don't need to "merge" them at
11075 all - that's the next step to do.
11076 (FlowBranching.Merge): We now return a `UsageVector' instead of a
11079 2003-12-11 Martin Baulig <martin@ximian.com>
11081 Reworked flow analyis and made it more precise and bug-free. The
11082 most important change is that we're now using a special `Reachability'
11083 class instead of having "magic" meanings of `FlowReturns'. I'll
11084 do some more cleanups and optimizations and also add some more
11085 documentation this week.
11087 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11088 largely reworked this class.
11089 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11090 the new `Reachability' class instead of having "magic" values here.
11091 (FlowBranching): We're now using an instance of `Reachability'
11092 instead of having separate `Returns', `Breaks' etc. fields.
11094 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11095 based on flow analysis; ignore the return value of block.Emit ().
11097 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
11099 * driver.cs typemanager.cs: Find the mono extensions to corlib even
11100 if they are private.
11102 2003-12-09 Martin Baulig <martin@ximian.com>
11104 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11105 call them directly on the UsageVector.
11107 2003-12-09 Martin Baulig <martin@ximian.com>
11109 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11110 Changed return type from `FlowReturns' to `Reachability'.
11112 2003-12-09 Martin Baulig <martin@ximian.com>
11114 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11115 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11116 `Reachable' fields with a single `Reachability' one.
11118 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11120 * class.cs (FindMembers): Remove foreach's.
11125 Run 1: 8.74 seconds
11126 Run 2: 8.71 seconds
11129 Run 1: 8.64 seconds
11130 Run 2: 8.58 seconds
11133 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11138 This patch does a few things:
11139 1. EmptyStatement is now a singleton, so it is never reallocated.
11140 2. All blah is EmptyStatement constructs have been changed to
11141 blah == EmptyStatement.Value, which is much faster and valid
11142 now that EmptyStatement is a singleton.
11143 3. When resolving a block, rather than allocating a new array for
11144 the non-empty statements, empty statements are replaced with
11145 EmptyStatement.Value
11146 4. Some recursive functions have been made non-recursive.
11147 Mainly the performance impact is from (3), however (1) and (2) are needed for
11148 this to work. (4) does not make a big difference in normal situations, however
11149 it makes the profile look saner.
11154 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11155 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11156 Total memory allocated: 56397 KB
11159 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11160 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11161 Total memory allocated: 55666 KB
11163 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11165 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11166 than the hashtable in a hashtable version
11168 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11169 we always end up concating a string. This results in a huge perf
11170 loss, because many strings have to be tracked by the GC. In this
11171 patch, we first use a hashtable that works with two keys, so that
11172 the strings do not need to be concat'ed.
11176 Run 1: 8.74 seconds
11177 Run 2: 8.71 seconds
11180 Run 1: 8.65 seconds
11181 Run 2: 8.56 seconds
11183 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11185 * Makefile: Add a new target `do-time' that does a quick and simple
11186 profile, leaving easy to parse output.
11188 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
11190 * codegen.cs (Init): Create the dynamic assembly with
11191 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11193 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
11195 * support.cs: Make the PtrHashtable use only one
11196 instance of its comparer.
11198 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
11200 * typemanager.cs: Fix lookup of GetNamespaces.
11202 2003-11-29 Miguel de Icaza <miguel@ximian.com>
11204 * expression.cs: Removed redundant line.
11206 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11207 ArrayLists, use for loops with bounds.
11209 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11212 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11213 arraylists, use for loop with bounds.
11215 The above three changes give us a 0.071 second performance
11216 improvement out of 3.294 seconds down to 3.223. On my machine
11217 the above changes reduced the memory usage by 1,387 KB during
11218 compiler bootstrap.
11220 * cs-parser.jay (QualifiedIdentifier): New class used to represent
11221 QualifiedIdentifiers. Before we created a new string through
11222 concatenation, and mostly later on, the result would be
11223 manipulated by DecomposeQI through string manipulation.
11225 This reduced the compiler memory usage for bootstrapping from
11226 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11227 compile times in 0.05 seconds.
11229 2003-11-28 Dick Porter <dick@ximian.com>
11231 * support.cs: Do string compares with the Invariant culture.
11239 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11240 the comparison is done with the Invariant culture.
11242 2003-11-27 Miguel de Icaza <miguel@ximian.com>
11244 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11245 GetEnumerator method.
11247 (ProbeCollectionType): Iterate starting at the most specific type
11248 upwards looking for a GetEnumerator
11250 * expression.cs: Shift count can be up to 31 for int/uint and 63
11253 2003-11-26 Miguel de Icaza <miguel@ximian.com>
11255 * statement.cs (Block.LookupLabel): Also look for the label on the
11256 children blocks. Use a hash table to keep track of visited
11259 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11260 we actually did transform the other operand, otherwise fall back
11261 to the common codepath that casts to long.
11263 * cs-tokenizer.cs: Use the same code pattern as the int case.
11264 Maybe I should do the parsing myself, and avoid depending on the
11265 Parse routines to get this done.
11267 2003-11-25 Miguel de Icaza <miguel@ximian.com>
11269 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11270 which fixes bug 51347. This time test it.
11272 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11273 attributes for example can not tell the difference between these.
11274 The difference was only a syntax feature of the language.
11276 * attribute.cs: Apply attributes to delegates.
11278 * delegate.cs: Call the apply attributes method.
11280 2003-11-24 Miguel de Icaza <miguel@ximian.com>
11282 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11283 comparing 0 vs Byte.MinValue, not the value
11285 (ImplicitConversionRequired): When reporting a conversion error,
11286 use error 31 to print out the constant error instead of the
11289 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11290 which fixes bug 51347.
11292 2003-11-22 Miguel de Icaza <miguel@ximian.com>
11294 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
11295 which fixes the -warnaserror command line option.
11297 2003-11-21 Miguel de Icaza <miguel@ximian.com>
11299 * cfold.cs (DoNumericPromotions): During constant folding of
11300 additions on UIntConstant, special case intconstants with
11301 IntConstants like we do on the expression binary operator.
11303 2003-11-12 Miguel de Icaza <miguel@ximian.com>
11305 * convert.cs (ImplicitReferenceConversion): We were missing a case
11306 (System.Enum are not value types or class types, so we need to
11307 classify them separatedly).
11309 * driver.cs: We do not support error 2007.
11311 2003-11-12 Jackson Harper <jackson@ximian.com>
11313 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11314 system directory. Also use the full file name so users can
11315 libraries names mscorlib-o-tron.dll in a non system dir.
11317 2004-01-04 David Sheldon <dave-mono@earth.li>
11319 * expression.cs: Added matching ")" to error message for CS0077.
11321 2003-12-19 Martin Baulig <martin@ximian.com>
11323 * typemanager.cs (TypeManager.IsEqualGenericType): New public
11324 static method; see documentation in the method.
11325 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
11327 * convert.cs (Convert.ImplicitReferenceConversion,
11328 Convert.ImplicitReferenceConversionExists): Add support for
11329 generic type declarations; see gen-36.cs.
11331 2003-12-19 Martin Baulig <martin@ximian.com>
11333 * pending.cs (Pending.InterfaceMethod): Use
11334 `Type.IsAssignableFrom()' instead of `=='.
11336 2003-12-18 Martin Baulig <martin@ximian.com>
11338 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
11341 * convert.cs (Convert.ImplicitStandardConversionExists): Use
11342 `expr_type.Equals (target_type)' instead of `=='.
11344 2003-12-08 Martin Baulig <martin@ximian.com>
11346 * generics.cs (Constraints.Types): Removed.
11347 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
11349 (Constraints.ResolveTypes): New public method; resolves the
11350 TypeExpr's to Type's.
11351 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
11352 longer takes the constraints.
11353 (TypeParameter.DefineMethod): Likewise.
11354 (TypeParameter.DefineType): New public method. Calls
11355 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
11358 2003-12-08 Martin Baulig <martin@ximian.com>
11360 * convert.cs (Convert.ImplicitConversionStandard): Use
11361 `expr_type.Equals (target_type)' instead of `=='.
11363 2003-12-08 Martin Baulig <martin@ximian.com>
11365 * typemanager.cs (TypeManager.GetReferenceType): Call
11366 `Type.MakeByRefType ()'.
11368 2003-12-08 Martin Baulig <martin@ximian.com>
11370 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
11371 just has some special meaning in some situations. For instance,
11372 it is allowed to use `where' as the name of a variable etc.
11374 2003-12-04 Martin Baulig <martin@ximian.com>
11376 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
11377 `Type.MakeArrayType()' for array types.
11379 2003-11-18 Miguel de Icaza <miguel@ximian.com>
11381 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
11384 (SizeOf.DoResolve): assign the `type_queried' field. This gets
11387 2003-11-16 Martin Baulig <martin@ximian.com>
11389 * codegen.cs (EmitContext.IsGeneric): Removed.
11391 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
11392 ResolveGeneric() on the DeclSpace.
11394 2003-11-16 Martin Baulig <martin@ximian.com>
11396 * generic.cs (TypeArguments.Resolve):
11397 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
11398 `ResolveType()' on it to get the Type.
11400 2003-11-15 Martin Baulig <martin@ximian.com>
11402 * generic.cs (ConstructedType.GetInterfaces): Override this.
11404 2003-11-14 Martin Baulig <martin@ximian.com>
11406 * interface.cs (Interface.DefineType): Define all type parameters
11407 before adding the interfaces we inherit.
11409 2003-11-11 Martin Baulig <martin@ximian.com>
11411 * generic.cs (ConstructedType.ResolveType): Always call
11412 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
11414 2003-11-10 Martin Baulig <martin@ximian.com>
11416 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11417 (TypeManager.InitCoreTypes): Initialize them here, but instead of
11418 calling `ResolveType()' on them, directly assign their `Type'.
11420 2003-11-08 Martin Baulig <martin@ximian.com>
11422 * generic.cs (ConstructedType): Override `IsClass' etc.
11424 2003-11-08 Martin Baulig <martin@ximian.com>
11426 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11427 return value and the `out parent' parameter.
11428 (TypeContainer.DefineType): Moved the CS0644 check into
11429 GetClassBases(). Don't pass the interface types to the
11430 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11431 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11433 * ecore.cs (TypeExpr.IsAttribute): New property.
11434 (TypeExpr.GetInterfaces): New method.
11436 * interface.cs (Interface.GetInterfaceTypeByName): Return a
11437 TypeExpr instead of a Type.
11438 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11439 (Interface.DefineType): Don't pass the interface types to the
11440 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11441 them later and then call `TypeBulider.AddInterfaceImplementation()'.
11443 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11444 instead of a `Type[]'.
11445 (TypeManager.RegisterBuilder): Likewise.
11446 (TypeManager.AddUserInterface): Likewise.
11447 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11448 `Type[]' and also return a `TypeExpr[]'.
11449 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11451 2003-11-08 Martin Baulig <martin@ximian.com>
11453 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11456 2003-11-08 Martin Baulig <martin@ximian.com>
11458 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11459 TypeManager.ResolveExpressionTypes().
11461 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11462 instead of an Expression.
11463 (TypeExpr): This is now an abstract base class for `TypeExpression'.
11464 (TypeExpression): New public class; formerly known as `TypeExpr'.
11466 * expression.cs (ComposedCast): Derive from TypeExpr.
11468 * typemanager.cs (TypeManager.system_*_expr): These are now
11469 TypExpr's instead of Expression's.
11470 (TypeManager.ResolveExpressionTypes): New public static function;
11471 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11474 2003-11-06 Miguel de Icaza <miguel@ximian.com>
11476 * expression.cs (New.DoResolve): Do not dereference value that
11477 might be a null return.
11479 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11480 sure that the constant value has the right type. Fixes an
11481 unreported bug, similar to 50425.
11483 * const.cs (Const.LookupConstantValue): Call
11484 ImplicitStandardConversionExists before doing a conversion to
11485 avoid havng the TypeManager.ChangeType do conversions.
11487 Reduced the number of casts used
11489 (Const.ChangeType): New routine to enable reuse of the constant
11490 type changing code from statement.
11492 * typemanager.cs (ChangeType): Move common initialization to
11493 static global variables.
11497 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11498 every value type to go through, even if it was void. Fix that.
11500 * cs-tokenizer.cs: Use is_identifier_start_character on the start
11501 character of the define, and the is_identifier_part_character for
11502 the rest of the string.
11504 2003-11-05 Miguel de Icaza <miguel@ximian.com>
11506 * expression.cs (UnaryMutator.EmitCode): When I updated
11507 LocalVariableReference.DoResolve, I overdid it, and dropped an
11508 optimization done on local variable references.
11510 2003-11-04 Miguel de Icaza <miguel@ximian.com>
11512 * ecore.cs: Convert the return from Ldlen into an int.
11514 2003-10-20 Miguel de Icaza <miguel@ximian.com>
11516 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11517 the accessibility, this is a special case for toplevel non-public
11518 classes (internal for instance).
11520 2003-10-20 Nick Drochak <ndrochak@gol.com>
11522 * ecore.cs: Fix typo and build. Needed another right paren.
11524 2003-10-19 Miguel de Icaza <miguel@ximian.com>
11526 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
11527 `internal' case regular and protected, but not allowing protected
11528 to be evaluated later. Bug 49840
11530 2003-10-15 Miguel de Icaza <miguel@ximian.com>
11532 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11533 to kb.Nlast, and not the kb.nFirst to isolate the switch
11536 Extract the underlying type, so enumerations of long/ulong are
11537 treated like long/ulong.
11539 2003-10-14 Miguel de Icaza <miguel@ximian.com>
11541 * expression.cs (New): Overload the meaning of RequestedType to
11542 track the possible creation of the NewDelegate type, since
11543 DoResolve is invoked more than once for new constructors on field
11546 See bugs: #48800 and #37014
11548 * cs-parser.jay (declare_local_constants): Take an arraylist
11549 instead of a single constant.
11551 (local_constant_declaration): It should take a
11552 constant_declarators, not a constant_declarator. Fixes 49487
11554 * convert.cs: Fix error report.
11556 2003-10-13 Jackson Harper <jackson@ximian.com>
11558 * typemanager.cs (TypeToCoreType): Add float and double this fixes
11561 2003-11-03 Martin Baulig <martin@ximian.com>
11563 * expression.cs (ArrayAccess.GetStoreOpcode): Added
11564 `out bool has_type_arg'; if set, we need to pass the type to
11566 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
11567 Stelem_Any/Ldelem_Any for generic parameters.
11569 2003-11-02 Martin Baulig <martin@ximian.com>
11571 * expression.cs (Invocation.EmitCall): Use
11572 `TypeManager.IsValueType()' to check whether it's a value type.
11573 Don't set `struct_call' when calling a method on a type parameter.
11575 2003-11-02 Martin Baulig <martin@ximian.com>
11577 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
11578 and removed the TypeBuilder argument.
11580 * typemanager.cs (TypeManager.IsValueType): Return
11581 `t.IsGenericParameter || t.IsValueType'.
11583 2003-10-25 Martin Baulig <martin@ximian.com>
11585 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
11586 call ConstructedType.Resolve() on it.
11588 * generic.cs (ConstructedType.Resolve): Set `type' on success.
11590 2003-10-25 Martin Baulig <martin@ximian.com>
11592 * class.cs (TypeContainer.GetClassBases): Changed
11593 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
11594 CS8214 reporting here.
11595 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
11596 instead of a `Type' for our parent. In case of a recursive
11597 declaration (see tests/gen-23.cs for an example), our parent is a
11598 ConstructedType and it doesn't have its type set. So, first
11599 create our own TypeBuilder, then call constructed.Resolve() to get
11600 the parent's type and finally TypeBuilder.SetParent() it.
11602 * ecore.cs (TypeExpr.Name): New public virtual property.
11605 (ConstructedType): We're now a TypeExpr and not just an Expression.
11606 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
11607 arguments here; this is done later.
11608 (ConstructedType.Resolve): New public method to resolve the type
11609 arguments and bind them.
11611 2003-10-21 Martin Baulig <martin@ximian.com>
11613 * convert.cs: Use `TypeManager.IsValueType' instead of
11614 'type.IsValueType' everywhere.
11616 * typemanager.cs (TypeManager.IsValueType): Return true for type
11617 parameters. The reason for this is that we need to box a type
11618 parameter when converting it to a reference type.
11620 * cs-parser.jay: Added support for default value expressions.
11622 * generics.cs (DefaultValueExpression): New public class.
11624 2003-10-17 Martin Baulig <martin@ximian.com>
11626 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
11627 TypeContainer so we can also use this for Interfaces.
11628 (TypeParameter.Resolve): Likewise.
11630 * interface.cs (Interface.DefineType): Added support for generic
11633 * cs-parser.jay: Added support for generic structs and interfaces.
11635 2003-10-17 Martin Baulig <martin@ximian.com>
11637 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
11638 call generic methods :-)
11640 2003-10-16 Martin Baulig <martin@ximian.com>
11642 * cs-parser.jay (namespace_or_type_name): Only create a
11643 GenericMemberAccess if we actually have type arguments.
11645 2003-10-13 Martin Baulig <martin@ximian.com>
11647 * class.cs (Method.Define): If we're a generic method, call
11648 TypeBuilder.DefineGenericMethod () before resolving
11650 (MethodData): Added .ctor which takes an additional MethodBuilder
11651 argument; this is used for generic methods.
11652 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
11653 we already have a MethodBuilder.
11655 2003-10-10 Martin Baulig <martin@ximian.com>
11657 * class.cs (Method): Added .ctor which takes a `GenericMethod'
11658 instead of a `DeclSpace'. This is used for generic methods.
11660 * cs-parser.jay (method_header): Added support for generic
11661 methods; create a `GenericMethod' instance and pass it to the
11662 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
11663 parameters and locals.
11665 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
11666 since we already have the location. Check whether we're a generic
11667 type declaration or a generic method and create the correct type
11670 * generic.cs (TypeParameter.DefineMethod): New public method.
11671 (GenericMethod): New public class; derives from DeclSpace and is
11672 used for generic methods.
11674 2003-10-09 Martin Baulig <martin@ximian.com>
11676 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11678 (MethodCore.DoDefineParameters): Removed the TypeContainer
11679 argument; use the DeclSpace which was passed to the .ctor instead.
11680 (MethodCore.CheckParameter): Take a DeclSpace instead of a
11681 TypeContainer; we only need a DeclSpace here.
11683 2003-10-09 Martin Baulig <martin@ximian.com>
11685 * class.cs (MethodData): Added additional `DeclSpace ds' argument
11687 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11688 EmitContext's .ctor.
11690 2003-10-09 Martin Baulig <martin@ximian.com>
11692 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11693 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11694 AsAccessible(), moved them as well.
11696 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11698 2003-10-07 Miguel de Icaza <miguel@ximian.com>
11700 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11701 generation for >=, as spotted by Paolo, bug 48679.
11702 Patch from David Waite.
11704 * cs-tokenizer.cs: Add handling for #pragma.
11706 * cs-parser.jay: Allow for both yield and yield return in the
11707 syntax. The anti-cobolization of C# fight will go on!
11709 * class.cs (TypeBuilder.DefineType): Catch error condition here
11710 (Parent.DefineType erroring out and returning null).
11712 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11713 coping with enumerations variables, we were mistakenly processing
11714 them as a regular value type instead of built-in types. Fixes the
11717 * typemanager.cs (IsBuiltinOrEnum): New method.
11719 2003-09-30 Miguel de Icaza <miguel@ximian.com>
11721 * cs-parser.jay: Upgrade: yield now needs the return clause.
11723 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11725 * cs-parser.jay : Renamed yyName to yyNames related to jay.
11727 2003-09-29 Martin Baulig <martin@ximian.com>
11729 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
11730 inflated generic methods.
11732 * generics.cs (ConstructedType): Distinguish between open and
11733 closed constructed types; correctly resolve the arguments.
11735 2003-09-22 Martin Baulig <martin@ximian.com>
11737 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
11738 all type arguments meet their constraints.
11740 2003-09-19 Martin Baulig <martin@ximian.com>
11742 * decl.cs (MemberCache.SetupCacheForInterface): Take a
11743 `MemberCache parent' argument. Normally, an interface doesn't
11744 have a parent type except System.Object, but we use this in gmcs
11745 for generic type parameters.
11747 2003-09-18 Martin Baulig <martin@ximian.com>
11749 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11750 on `type.IsInterface'; don't check whether the type has a parent
11751 to determine whether it's an interface.
11753 2003-09-17 Martin Baulig <martin@ximian.com>
11755 * generic.cs (ConstructedType.ToString): Always use `name' as the
11758 2003-09-15 Martin Baulig <martin@ximian.com>
11760 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
11762 * generic.cs (Constraints.Resolve): New public method; this is
11763 called to resolve the constraint types and to check whether all
11764 the constraints are correct.
11765 (Constraints.Types): New public property.
11766 (TypeParameter.Resolve): New public method; resolves all the
11767 type's constraints.
11769 * class.cs (TypeContainer.DefineType): Call
11770 TypeParameter.Resolve() before actually defining the type.
11772 2003-09-15 Martin Baulig <martin@ximian.com>
11774 * class.cs (TypeContainer.DefineType): Added an error flag to
11775 avoid reporting duplicate CS0146's ("class definition is
11778 * driver.cs (Driver.MainDriver): Abort if
11779 RootContext.ResolveTree() reported any errors.
11781 2003-09-07 Martin Baulig <martin@ximian.com>
11783 * report.cs (Error, Warning): Added overloaded versions which take
11784 a `params object[] args' and call String.Format().
11786 2003-09-07 Martin Baulig <martin@ximian.com>
11788 * decl.cs (DeclSpace..ctor): Don't call
11789 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11790 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
11791 (DeclSpace.RecordDecl): New method.
11793 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11795 2003-09-02 Ravi Pratap <ravi@ximian.com>
11797 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11798 value attributes to be applied to ParameterBuilders.
11800 * class.cs (MethodCore.LabelParameters): Make static and more
11801 generic so that it can be used from other places - like interface
11802 methods, for instance.
11804 * interface.cs (Interface.Emit): Call LabelParameters before
11805 emitting attributes on the InterfaceMethod.
11807 2003-09-07 Martin Baulig <martin@ximian.com>
11809 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
11810 if the number of type parameters doesn't match.
11812 2003-09-04 Martin Baulig <martin@ximian.com>
11814 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
11815 for arrays of generic type params (ie. `!0[]').
11817 2003-09-04 Martin Baulig <martin@ximian.com>
11819 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
11822 2003-09-04 Martin Baulig <martin@ximian.com>
11824 * decl.cs (DeclSpace.LookupGeneric): New method.
11825 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
11828 * generic.cs (TypeParameterExpr): Take a TypeParameter as
11829 argument, not just a string.
11830 (TypeParameter.Define): New public method; this is called to
11831 actually define the generic parameter; after this, you can use the
11832 new `Type' property to get the type.
11834 2003-09-04 Martin Baulig <martin@ximian.com>
11836 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
11837 is now an ArrayList; initialize the result of the `TypeParameters'
11839 (DeclSpace.GetGenericData): Removed.
11840 (DeclSpace.LookupGeneric): Temporarily removed; we need to
11841 implement this in a different way.
11842 (DeclSpace.GetTypeParameters): Removed; there's now a
11843 `TypeParameters' property.
11844 (DeclSpace.TypeParameters): New public property.
11846 * generic.cs (Constraints): Make this class public.
11847 (TypeParameter): New public class.
11849 2003-09-04 Martin Baulig <martin@ximian.com>
11851 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
11852 generic parameters.
11854 * class.cs (TypeContainer.DefineType): Call
11855 TypeBuilder.DefineGenericParameter () on all generic parameters if
11856 this is a generic type.
11858 2003-08-28 Martin Baulig <martin@ximian.com>
11860 * sample-stack.il: Compile this with ilasm: "ilasm /dll
11863 * sample-hello.cs: Compile this with gmcs: "gmcs
11864 /r:sample-stack.dll sample-hello.cs".
11866 2003-08-28 Martin Baulig <martin@ximian.com>
11868 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
11869 the parameters to the generic type.
11871 2003-08-28 Martin Baulig <martin@ximian.com>
11873 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
11875 2003-08-28 Martin Baulig <martin@ximian.com>
11877 * cs-parser.jay (opt_type_argument_list): Use
11878 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
11879 (primary_expression): Replace `qualified_identifier' with `type_name'.
11880 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
11882 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
11883 parser to check whether it is syntactically a type parameter list;
11884 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
11887 2003-08-26 Martin Baulig <martin@ximian.com>
11889 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11890 resolving aliases; fixes #47927.
11892 2003-08-26 Martin Baulig <martin@ximian.com>
11894 * statement.cs (Using.DoResolve): This is internally emitting a
11895 try/finally clause, so we need to set ec.NeedExplicitReturn if we
11896 do not always return. Fixes #47681.
11898 2003-08-26 Martin Baulig <martin@ximian.com>
11900 * decl.cs (MemberCore): Moved WarningNotHiding(),
11901 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11903 (AdditionResult): Make this nested in DeclSpace.
11904 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11905 argument; call NamespaceEntry.Define() unless we're nested in a
11908 * namespace.cs (Namespace.DefineName): New public function. This
11909 is called from DeclSpace's .ctor to add
11910 (Namespace.Lookup): Include DeclSpaces in the lookup.
11912 * class.cs (Operator): Derive from MemberBase, not MemberCore.
11914 * const.cs (Const): Derive from MemberBase, not MemberCore.
11916 2003-08-25 Martin Baulig <martin@ximian.com>
11918 * convert.cs (Convert.ExplicitReferenceConversion): When
11919 converting from an interface type to a class, unbox if the target
11920 type is a struct type. Fixes #47822.
11922 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11924 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11927 2003-08-22 Martin Baulig <martin@ximian.com>
11929 * class.cs (TypeManager.DefineType): When defining a nested type,
11930 call DefineType() on our parent; fixes #47801.
11932 2003-08-22 Martin Baulig <martin@ximian.com>
11934 * class.cs (MethodData.Define): While checking if a method is an
11935 interface implementation, improve the test a bit more to fix #47654.
11937 2003-08-22 Martin Baulig <martin@ximian.com>
11939 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11940 correctly; fixes #47722.
11942 2003-08-22 Martin Baulig <martin@ximian.com>
11944 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11945 LocalVariableReference, ensure it's not read-only. Fixes #47536.
11947 * statement.cs (Fixed.DoResolve): Make all variables read-only.
11949 2003-08-22 Martin Baulig <martin@ximian.com>
11951 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11952 can only be assigned in static constructors. Fixes #47161.
11954 2003-08-22 Martin Baulig <martin@ximian.com>
11956 Rewrote and improved the flow analysis code.
11958 * flowbranching.cs (FlowBranching): Make this class abstract.
11959 (FlowBranching.CreateBranching): New static function to create a
11960 new flow branching.
11961 (FlowBranchingBlock, FlowBranchingException): New classes.
11962 (FlowBranching.UsageVector.Type): New public readonly field.
11963 (FlowBranching.UsageVector.Breaks): Removed the setter.
11964 (FlowBranching.UsageVector.Returns): Removed the setter.
11965 (FlowBranching.UsageVector): Added Break(), Return(),
11966 NeverReachable() and Throw() methods to modify the reachability.
11967 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11968 done by FlowBranching.Merge().
11969 (FlowBranching.UsageVector.MergeChild): New method; merges the
11970 merge result into the current vector.
11971 (FlowBranching.Merge): New abstract method to merge a branching.
11973 2003-08-12 Martin Baulig <martin@ximian.com>
11975 * expression.cs (Indirection.CacheTemporaries): Create the
11976 LocalTemporary with the pointer type, not its element type.
11978 2003-08-10 Miguel de Icaza <miguel@ximian.com>
11980 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11981 token was a keyword or not.
11983 Add `error' options where an IDENTIFIER was expected; Provide
11984 CheckToken and CheckIdentifierToken convenience error reporting
11987 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11989 * decl.cs: Rename `NamespaceEntry Namespace' public field into
11990 NameSpaceEntry NameSpaceEntry.
11992 (LookupInterfaceOrClass): Avoid creating a full qualified name
11993 from namespace and name: avoid doing lookups when we know the
11994 namespace is non-existant. Use new Tree.LookupByNamespace which
11995 looks up DeclSpaces based on their namespace, name pair.
11997 * driver.cs: Provide a new `parser verbose' to display the
11998 exception thrown during parsing. This is turned off by default
11999 now, so the output of a failure from mcs is more graceful.
12001 * namespace.cs: Track all the namespaces defined in a hashtable
12004 (IsNamespace): New method
12006 2003-08-09 Miguel de Icaza <miguel@ximian.com>
12008 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
12009 we know that we need to concatenate (full typename can never be
12014 * statement.cs: Use a bitfield; Do not initialize to null things
12015 which are done by the constructor by default.
12017 * cs-parser.jay: bug fix, parameter was 4, not 3.
12019 * expression.cs: Just use the property;
12021 * statement.cs: No need for GetVariableInfo method.
12023 2003-08-08 Martin Baulig <martin@ximian.com>
12025 * flowanalysis.cs (FlowReturns): This is now nested in the
12026 `FlowBranching' class.
12027 (MyBitVector): Moved this here from statement.cs.
12028 (FlowBranching.SiblingType): New enum type.
12029 (FlowBranching.CreateSibling): Added `SiblingType' argument.
12031 2003-08-07 Martin Baulig <martin@ximian.com>
12033 * flowanalysis.cs (FlowBranchingType): This is now nested in the
12034 `FlowBranching' class and called `BranchingType'.
12036 2003-08-07 Martin Baulig <martin@ximian.com>
12038 * flowanalysis.cs: Moved all the control flow analysis code into
12041 2003-08-07 Martin Baulig <martin@ximian.com>
12043 * assign.cs (Assign.DoResolve): `target' must either be an
12044 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
12047 2003-08-07 Miguel de Icaza <miguel@ximian.com>
12049 * expression.cs (BinaryMethod): This kind of expression is created by the
12050 Binary class if it determines that the operator has to be handled
12053 (BinaryDelegate): This kind of expression is created if we are
12054 dealing with a + or - operator on delegates.
12056 (Binary): remove method, argumetns, and DelegateOperator: when
12057 dealing with methods,
12059 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12061 * statement.cs (Block): use bitfields for the three extra booleans
12062 we had in use. Remove unused topblock parameter.
12064 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12066 * assign.cs: Drop extra unneeded tests.
12068 2003-08-06 Miguel de Icaza <miguel@ximian.com>
12070 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12072 * statement.cs (Foreach): Use VariableStorage instead of
12075 * codegen.cs (VariableStorage): New class used by clients that
12076 require a variable stored: locals or fields for variables that
12077 need to live across yield.
12079 Maybe provide a convenience api for EmitThis+EmitLoad?
12081 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12084 2003-08-05 Miguel de Icaza <miguel@ximian.com>
12086 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12087 RemapParameterLValue): New methods that are used to turn a
12088 precomputed FieldInfo into an expression like this:
12092 The idea is to use this instead of making LocalVariableReference
12093 have more than one meaning.
12095 * cs-parser.jay: Add error production to BASE.
12097 * ecore.cs: Deal with TypeManager.GetField returning null, which
12098 is now a valid return value.
12100 (FieldExprNoAddress): New expression for Fields whose address can
12103 * expression.cs (LocalVariableReference): During the resolve
12104 phases, create new expressions if we are in a remapping context.
12105 Remove code that dealt with remapping here.
12107 (ParameterReference): same.
12109 (ProxyInstance): New expression, like the `This' expression, but
12110 it is born fully resolved. We know what we are doing, so remove
12111 the errors that are targeted to user-provided uses of `this'.
12113 * statement.cs (Foreach): our variable is now stored as an
12114 Expression; During resolution, follow the protocol, dont just
12115 assume it will return this.
12117 2003-08-06 Martin Baulig <martin@ximian.com>
12119 * support.cs (SeekableStreamReader.cs): New public class.
12121 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12122 SeekableStreamReader instead of the normal StreamReader.
12124 2003-08-04 Martin Baulig <martin@ximian.com>
12126 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12127 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12128 deambiguate casts and delegate invocations.
12129 (parenthesized_expression): Use the new tokens to ensure this is
12130 not a cast of method invocation.
12132 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12133 when reading a `)' and Deambiguate_CloseParens () was previously
12136 * expression.cs (ParenthesizedExpression): New class. This is
12137 just used for the CS0075 test.
12138 (Binary.DoResolve): Check for CS0075.
12140 2003-07-29 Ravi Pratap <ravi@ximian.com>
12142 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12143 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12144 reference comparison.
12146 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12147 examine the ReturnType for equality - this is necessary in the
12148 cases of implicit and explicit operators whose signature also
12149 includes the return type.
12151 2003-07-26 Miguel de Icaza <miguel@ximian.com>
12153 * namespace.cs: Cache the result of the namespace computation,
12154 instead of computing it every time.
12156 2003-07-24 Miguel de Icaza <miguel@ximian.com>
12158 * decl.cs: Use a global arraylist that we reuse over invocations
12159 to avoid excesive memory consumption. Reduces memory usage on an
12160 mcs compile by one meg (45 average).
12162 * typemanager.cs (LookupTypeReflection): In .NET pointers are
12163 private, work around that.
12165 2003-07-23 Miguel de Icaza <miguel@ximian.com>
12167 * literal.cs (IntLiteral): Define Zero and One static literals.
12169 * cs-parser.jay (integer_literal): use static literals to reduce
12170 memory usage for the most used literals (0, 1 and -1). 211kb
12171 reduced in memory usage.
12173 Replace all calls to `new ArrayList' with `new
12174 ArrayList(4)' which is a good average number for most allocations,
12175 and also requires only 16 bytes of memory for its buffer by
12178 This reduced MCS memory usage in seven megabytes for the RSS after
12181 2003-07-28 Ravi Pratap <ravi@ximian.com>
12183 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12184 handle params methods the correct way by forming only one
12185 applicable set with params and normal methods in them. Earlier we
12186 were looking at params methods only if we found no normal methods
12187 which was not the correct thing to do.
12189 (Invocation.BetterFunction): Take separate arguments indicating
12190 when candidate and the best method are params methods in their
12193 This fixes bugs #43367 and #46199.
12195 * attribute.cs: Documentation updates.
12197 (CheckAttribute): Rename to CheckAttributeTarget.
12198 (GetValidPlaces): Rename to GetValidTargets.
12200 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12201 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12205 2003-07-28 Miguel de Icaza <miguel@ximian.com>
12207 * codegen.cs: Compute IsGeneric correctly.
12209 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
12212 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
12213 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
12214 regressions, and I was chasing more bugs than I required.
12216 * interface.cs: Use expressions for base type names (like classes
12217 and structs have been doing for a while now), and resolve that.
12218 This patch should probably go into head as well.
12220 This makes it one less user of FindType.
12222 2003-07-24 Miguel de Icaza <miguel@ximian.com>
12224 This compiler can not self host currently. Need to fix that.
12226 * Makefile: compile to `gmcs.exe'
12228 * driver.cs: Turn on v2 by default on gmcs.
12230 * generic.cs (ConstructedType): Does no longer take a container
12231 type argument; That will be taken care of later.
12233 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
12234 Use SimpleName to resolve for now, so we can continue the work on
12235 the parser, until we get Type.GetType that understands generics.
12237 (ConstructedType.ToString): Implement
12239 (TypeArguments.Resolve): Resolve the child expressions as types.
12241 * cs-parser.jay: Rename interface_constraints to
12242 type_parameter_constraints
12244 (namespace_or_type_name): Only use constructed types for the basic
12245 construction, we will deal with identifier<...> later.
12247 (type/type_name): No longer call DecomposeQI, as
12248 namespace_or_type_name is always decoded now.
12250 2003-07-22 Ravi Pratap <ravi@ximian.com>
12252 * expression.cs (Invocation.OverloadResolve): Follow the spec more
12253 closely: we eliminate methods in base types when we have an
12254 applicable method in a top-level type.
12256 Please see section 14.5.5.1 for an exact description of what goes
12259 This fixes bug #45127 and a host of other related to corlib compilation.
12261 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12262 array is the method corresponding to the top-level type (this is
12263 because of the changes made to icall.c) so we change this
12266 (MethodGroupExpr.Name): This too.
12268 * typemanager.cs (GetElementType): New method which does the right
12269 thing when compiling corlib.
12271 * everywhere: Make use of the above in the relevant places.
12273 2003-07-22 Martin Baulig <martin@ximian.com>
12275 * cs-parser.jay (invocation_expression): Moved
12276 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12277 `cast_expression', but create a InvocationOrCast which later
12278 resolves to either an Invocation or a Cast.
12280 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12281 method; call this before EmitStatement() to make sure that this
12282 expression can be used as a statement.
12284 * expression.cs (InvocationOrCast): New class; resolves to either
12285 an Invocation or a Cast.
12287 * statement.cs (StatementExpression): Call ResolveStatement() on
12288 the ExpressionStatement before emitting it.
12290 2003-07-21 Martin Baulig <martin@ximian.com>
12292 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12293 `ref' and `out' attributes match; fixes #46220.
12294 (MemberAccess.ResolveMemberAccess): You can't reference a type
12295 through an expression; fixes #33180.
12296 (Indexers.GetIndexersForType): Don't return the indexers from
12297 interfaces the class implements; fixes #46502.
12299 2003-07-21 Martin Baulig <martin@ximian.com>
12301 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12302 CS0661 checks; fixes bug #30442.
12304 2003-07-21 Martin Baulig <martin@ximian.com>
12306 * decl.cs (AdditionResult): Added `Error'.
12308 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12310 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
12311 cs0031.cs actually work.
12313 2003-07-20 Miguel de Icaza <miguel@ximian.com>
12315 * cs-parser.jay (namespace_name): do not use
12316 namespace_or_type_name, use qualified_identifier, because
12317 namespace_or_type_name will soon return a composed expression
12318 instead of a string.
12320 (namespace_or_type_name): Instead of returning a string, now this
12321 production returns an expression.
12323 * codegen.cs (EmitContext): Setup IsGeneric property based on
12324 whether our DeclSpace is generic, our the method is generic.
12326 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
12327 the method is generic.
12329 * cs-parser.jay (type_arguments, opt_type_argument_list,
12330 type_parameters, type_parameter_list, opt_type_parameter_list,
12331 type_parameter,, opt_type_parameter_constraints_clauses,
12332 type_parameter_constraints_clauses,
12333 type_parameter_constraint_clause, type_parameter_constraint,
12334 interface_constraints): Add new production
12336 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
12337 DeclSpace is generic or not.
12339 (DeclSpace.SetParameterInfo): New routine, used to set the
12340 parameter info for a type.
12342 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
12343 returns a GenericTypeExpr
12345 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
12346 generic, lookup the generic argument.
12348 * attribute.cs: Do not allow TypeParameterExpressions in
12351 * class.cs: Do not allow the Main method to be defined in a
12354 * expression.cs (SizeOf): Do not allow generic types to be used as
12355 arguments to sizeof.
12357 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
12358 it: whether a type is generic or not. Only works for types we are
12359 currently building for now.
12361 2003-07-20 Martin Baulig <martin@ximian.com>
12363 * namespace.cs: Fixed that bug which caused a crash when compiling
12364 the debugger's GUI.
12366 2003-07-20 Miguel de Icaza <miguel@ximian.com>
12368 * typemanager.cs (LookupTypeReflection): Never expose types which
12369 are NotPublic, NestedPrivate, NestedAssembly, or
12370 NestedFamANDAssem. We used to return these, and later do a check
12371 that would report a meaningful error, but the problem is that we
12372 would not get the real match, if there was a name override.
12374 2003-07-18 Miguel de Icaza <miguel@ximian.com>
12376 * namespace.cs (Namespace, Name): Do not compute the namespace
12377 name dynamically, compute it in the constructor. This reduced
12378 memory usage by 1697 KB.
12380 * driver.cs: Use --pause to pause at the end.
12382 2003-07-17 Peter Williams <peter@newton.cx>
12384 * Makefile: Change the name of the test target so that it doesn't
12385 conflict with the recursive test target.
12387 2003-07-17 Miguel de Icaza <miguel@ximian.com>
12389 * expression.cs (LocalVariableReference.Emit, EmitAssign,
12390 AddressOf): Do not use EmitThis, that was wrong, use the actual
12393 2003-07-15 Miguel de Icaza <miguel@ximian.com>
12395 * class.cs (MethodData.Define): While checking if a method is an
12396 interface implementation, improve the test: If we are not public
12397 (use new test here: use the computed MethodAttributes directly,
12398 instead of the parsed modifier flags) check if the `implementing'
12399 method comes from an interface or not.
12401 * pending.cs (VerifyPendingMethods): Slightly better error
12404 * makefile: add test target that does the mcs bootstrap.
12406 2003-07-16 Ravi Pratap <ravi@ximian.com>
12408 * interface.cs (Define): Do nothing here since there are no
12409 members to populate etc. Move the attribute emission out of here
12410 since this was just totally the wrong place to put it. Attribute
12411 application happens during the 'Emit' phase, not in the 'Define'
12414 (Emit): Add this method and move the attribute emission here
12416 * rootcontext.cs (EmitCode): Call the Emit method on interface
12419 2003-07-14 Ravi Pratap M <ravi@ximian.com>
12421 * expression.cs (OverloadResolve): Report error only if Location
12422 is not 'Null' which means that there was a probe going on.
12424 2003-07-14 Martin Baulig <martin@ximian.com>
12426 * expression.cs (ConditionalLogicalOperator): New public class to
12427 implement user defined conditional logical operators.
12428 This is section 14.11.2 in the spec and bug #40505.
12430 2003-07-14 Martin Baulig <martin@ximian.com>
12432 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12434 2003-07-14 Martin Baulig <martin@ximian.com>
12436 * codegen.cs (EmitContext.InFixedInitializer): New public field.
12438 * ecore.cs (IVariable.VerifyFixed): New interface method.
12440 * expression.cs (Unary.ResolveOperator): When resolving the `&'
12441 operator, check whether the variable is actually fixed. Fixes bug
12442 #36055. Set a variable definitely assigned when taking its
12443 address as required by the spec.
12445 * statement.cs (LocalInfo.IsFixed): New field.
12446 (LocalInfo.MakePinned): Set `IsFixed' to true.
12448 2003-07-14 Ravi Pratap M <ravi@ximian.com>
12450 * attribute.cs (Attribute.Resolve): While doing a Member lookup
12451 for .ctors, ensure that we only ask for members declared in the
12452 attribute type (BindingFlags.DeclaredOnly).
12456 * expression.cs (Error_WrongNumArguments): Report error 1501
12457 correctly the way CSC does.
12459 2003-07-13 Martin Baulig <martin@ximian.com>
12461 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12462 lookup on the fully qualified name, to make things like "X.X" work
12463 where "X.X" is a fully qualified type name, but we also have a
12464 namespace "X" in the using list. Fixes #41975.
12466 2003-07-13 Martin Baulig <martin@ximian.com>
12468 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12469 function. If we're a CompoundAssign, we need to create an embedded
12470 CompoundAssign, not an embedded Assign.
12471 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12474 2003-07-13 Martin Baulig <martin@ximian.com>
12476 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12477 work to fix bug #46088.
12479 2003-07-13 Ravi Pratap <ravi@ximian.com>
12481 * class.cs (Operator.Emit): Do not emit attributes here - it is
12482 taken care of by the Method class that we delegate too. This takes
12483 care of bug #45876.
12485 2003-07-10 Martin Baulig <martin@ximian.com>
12487 * expression.cs (TypeOfVoid): New class.
12488 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
12490 2003-07-10 Martin Baulig <martin@ximian.com>
12492 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12495 2003-07-10 Martin Baulig <martin@ximian.com>
12497 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12498 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12500 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12502 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12504 2003-07-10 Martin Baulig <martin@ximian.com>
12506 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12507 of decimal. Fixes #42850.
12509 NOTE: I also fixed the created byte blob, but this doesn't work on
12510 the MS runtime and csc never produces any byte blobs for decimal
12513 2003-07-10 Martin Baulig <martin@ximian.com>
12515 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12516 structs; fixes #32068.
12517 (Block.AddChildVariableNames): Fixed #44302.
12519 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12521 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12523 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12525 * attribute.cs: And this test is onger needed.
12527 2003-07-08 Martin Baulig <martin@ximian.com>
12529 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12530 inaccessible types. Fixes #36313.
12532 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12534 * namespace.cs (NamespaceEntry): Create implicit entries for all
12535 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12536 implicit entries for N1.N2 and N1.
12538 2003-07-08 Martin Baulig <martin@ximian.com>
12540 Rewrote the handling of namespaces to fix a lot of the issues
12541 wrt. `using' aliases etc.
12543 * namespace.cs (Namespace): Splitted this class into a
12544 per-assembly `Namespace' and a per-file `NamespaceEntry'.
12546 * typemanager.cs (TypeManager.IsNamespace): Removed.
12547 (TypeManager.ComputeNamespaces): Only compute namespaces from
12548 loaded assemblies here, not the namespaces from the assembly we're
12549 currently compiling.
12551 2003-07-08 Martin Baulig <martin@ximian.com>
12553 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12555 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12557 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12560 I thought about the memory savings here, but LookupTypeReflection
12561 is used under already very constrained scenarios. Compiling
12562 corlib or mcs only exposes one hit, so it would not really reduce
12563 any memory consumption.
12565 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12567 * typemanager.cs: fixes bug #45889 by only adding public types from
12568 other assemblies to the list of known types.
12570 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12572 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12573 on the type we resolved.
12575 2003-07-05 Martin Baulig <martin@ximian.com>
12577 * pending.cs (PendingImplementation.ParentImplements): Don't
12578 create the proxy if the parent is abstract.
12580 * class.cs (TypeContainer.DefineIndexers): Process explicit
12581 interface implementations first. Fixes #37714.
12583 2003-07-04 Miguel de Icaza <miguel@ximian.com>
12585 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12586 defined recursively; but since we modify the input parameters
12587 (left is set to `this' temporarily), we reset this value if the
12588 left_is_explicit is false, which gives the original semantics to
12591 * literal.cs (NullPointer): new class used to represent a null
12592 literal in a pointer context.
12594 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12595 type is a pointer, use a NullPointer object instead of a
12596 NullLiteral. Closes 43687
12598 (ExplicitConversion): Convert pointer values using
12599 the conv opcode to the proper type.
12601 * ecore.cs (New): change ValueTypeVariable property into a method,
12602 that returns whether the valuetype is suitable for being used.
12604 * expression.cs (Binary.DoNumericPromotions): Only return if we
12605 the int constant was a valid uint, and we can return both left and
12606 right as uints. If not, we continue processing, to trigger the
12607 type conversion. This fixes 39018.
12609 * statement.cs (Block.EmitMeta): During constant resolution, set
12610 the CurrentBlock property on the emitcontext, so that we resolve
12611 constants propertly.
12613 2003-07-02 Martin Baulig <martin@ximian.com>
12615 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12616 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12618 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12619 than emitting it here.
12621 * statement.cs: Fixed some more flow analysis bugs.
12623 2003-07-02 Martin Baulig <martin@ximian.com>
12625 * class.cs (MethodData.Define): When implementing interface
12626 methods, set Final unless we're Virtual.
12628 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12629 check work for interface methods.
12631 2003-07-01 Martin Baulig <martin@ximian.com>
12633 * ecore.cs (EmitContext.This): Replaced this property with a
12634 GetThis() method which takes a Location argument. This ensures
12635 that we get the correct error location for a CS0188.
12637 2003-07-01 Miguel de Icaza <miguel@ximian.com>
12639 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
12640 ImplicitStandardConversion.
12642 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
12644 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
12646 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
12649 2003-06-30 Miguel de Icaza <miguel@ximian.com>
12651 * class.cs (Constructor.Define): Turn off initlocals for unsafe
12654 (MethodData.Define): Turn off initlocals for unsafe methods.
12656 2003-06-29 Miguel de Icaza <miguel@ximian.com>
12658 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12659 complete; Fixes #37521.
12661 * delegate.cs: Use Modifiers.TypeAttr to compute the
12662 TypeAttributes, instead of rolling our own. This makes the flags
12663 correct for the delegates.
12665 2003-06-28 Miguel de Icaza <miguel@ximian.com>
12667 * class.cs (Constructor.Define): Set the private flag for static
12668 constructors as well.
12670 * cs-parser.jay (statement_expression): Set the return value to
12671 null, to avoid a crash when we catch an error.
12673 2003-06-24 Miguel de Icaza <miguel@ximian.com>
12675 * cs-parser.jay: Applied patch from Jackson that adds support for
12676 extern and unsafe modifiers to destructor declarations.
12678 * expression.cs: Report error 21 if the user is trying to index a
12681 * driver.cs: Add an error message, suggested by the bug report.
12683 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12684 if we do not have a ": this ()" constructor initializer. Fixes 45149
12686 2003-06-14 Miguel de Icaza <miguel@ximian.com>
12688 * namespace.cs: Add some information to reduce FAQs.
12690 2003-06-13 Miguel de Icaza <miguel@ximian.com>
12692 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12693 underlying enumeration types. Fixes #43915.
12695 * expression.cs: Treat ushort/short as legal values to be used in
12696 bitwise operations.
12698 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12700 * delegate.cs: transfer custom attributes for paramenters from
12701 the delegate declaration to Invoke and BeginInvoke.
12703 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12705 * attribute.cs: handle custom marshalers and emit marshal info
12708 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
12710 * makefile.gnu: Added anonymous.cs to the compiler sources.
12712 2003-05-28 Miguel de Icaza <miguel@ximian.com>
12714 * iterators.cs: Change the name of the proxy class to include two
12717 * cs-parser.jay: Update grammar to include anonymous methods.
12719 * anonymous.cs: new file.
12721 2003-05-27 Miguel de Icaza <miguel@ximian.com>
12723 * class.cs (Field.Define): Add missing test for pointers and
12726 2003-05-27 Ravi Pratap <ravi@ximian.com>
12728 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12729 we use the stobj opcode.
12731 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12732 since it wasn't the correct fix.
12734 It still is puzzling that we are required to use stobj for IntPtr
12735 which seems to be a ValueType.
12737 2003-05-26 Miguel de Icaza <miguel@ximian.com>
12739 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12740 during regular simple name resolution. Now, the trick is that
12741 instead of returning for processing the simplename, we do a
12742 TypeManager.LookupType (ie, a rooted lookup as opposed to a
12743 contextual lookup type). If a match is found, return that, if
12744 not, return for further composition.
12746 This fixes long-standing 30485.
12748 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12749 using the address to initialize an object, do an Stobj instead of
12750 using the regular Stelem.
12752 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12753 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12754 Because if we are a BaseIndexerAccess that value will be true.
12757 * statement.cs (GotoCase.Resolve): Return after reporting an
12758 error, do not attempt to continue.
12760 * expression.cs (PointerArithmetic.Emit): If our operand is a
12761 long, convert our constants to match the operand before
12762 multiplying. Convert to I type before adding. Fixes 43670.
12764 2003-05-14 Ravi Pratap <ravi@ximian.com>
12766 * enum.cs (ImplicitConversionExists) : Rename to
12767 ImplicitEnumConversionExists to remove ambiguity.
12769 * ecore.cs (NullCast): New type of cast expression class which
12770 basically is very similar to EmptyCast with the difference being
12771 it still is a constant since it is used only to cast a null to
12773 (eg. (string) null)
12775 * convert.cs (ImplicitReferenceConversion): When casting a null
12776 literal, we return a NullCast.
12778 * literal.cs (NullLiteralTyped): Remove - I don't see why this
12779 should be around anymore.
12781 The renaming (reported was slightly wrong). Corrections:
12783 ConvertImplicitStandard -> ImplicitConversionStandard
12784 ConvertExplicitStandard -> ExplicitConversionStandard
12786 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12787 before passing them in !
12789 * convert.cs (ImplicitConversionStandard): When comparing for
12790 equal expr and target types, ensure that expr is not a
12793 In general, we must not be checking (expr_type ==
12794 target_type) in the top level conversion methods
12795 (ImplicitConversion, ExplicitConversion etc). This checking is
12796 done in the methods that they delegate to.
12798 2003-05-20 Miguel de Icaza <miguel@ximian.com>
12800 * convert.cs: Move Error_CannotConvertType,
12801 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12802 ImplicitNumericConversion, ImplicitConversionExists,
12803 ImplicitUserConversionExists, StandardConversionExists,
12804 FindMostEncompassedType, FindMostSpecificSource,
12805 FindMostSpecificTarget, ImplicitUserConversion,
12806 ExplicitUserConversion, GetConversionOperators,
12807 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12808 TryImplicitIntConversion, Error_CannotConvertImplicit,
12809 ConvertImplicitRequired, ConvertNumericExplicit,
12810 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12811 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12814 Perform the following renames:
12816 StandardConversionExists -> ImplicitStandardConversionExists
12817 ConvertImplicit -> ImplicitConversion
12818 ConvertImplicitStandard -> ImplicitStandardConversion
12819 TryImplicitIntConversion -> ImplicitIntConversion
12820 ConvertImplicitRequired -> ImplicitConversionRequired
12821 ConvertNumericExplicit -> ExplicitNumericConversion
12822 ConvertReferenceExplicit -> ExplicitReferenceConversion
12823 ConvertExplicit -> ExplicitConversion
12824 ConvertExplicitStandard -> ExplicitStandardConversion
12826 2003-05-19 Martin Baulig <martin@ximian.com>
12828 * statement.cs (TypeInfo.StructInfo): Made this type protected.
12829 (TypeInfo): Added support for structs having structs as fields.
12831 * ecore.cs (FieldExpr): Implement IVariable.
12832 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12833 VariableInfo for the field.
12835 2003-05-18 Martin Baulig <martin@ximian.com>
12837 * expression.cs (This.DoResolve): Report a CS0027 if we're
12838 emitting a field initializer.
12840 2003-05-18 Martin Baulig <martin@ximian.com>
12842 * expression.cs (This.ResolveBase): New public function.
12843 (This.DoResolve): Check for CS0188.
12845 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12848 * ecore.cs (MethodGroupExpr.DoResolve): Set the
12849 `instance_expression' to null if we don't have any non-static
12852 2003-05-18 Martin Baulig <martin@ximian.com>
12854 Reworked the way how local variables and parameters are handled by
12855 the flow analysis code.
12857 * statement.cs (TypeInfo, VariableMap): New public classes.
12858 (VariableInfo): New public class. This is now responsible for
12859 checking whether a variable has been assigned. It is used for
12860 parameters and local variables.
12861 (Block.EmitMeta): Take the InternalParameters as argument; compute
12862 the layout of the flow vectors here.
12863 (Block.LocalMap, Block.ParameterMap): New public properties.
12864 (FlowBranching): The .ctor doesn't get the InternalParameters
12865 anymore since Block.EmitMeta() now computes the layout of the flow
12867 (MyStructInfo): This class is now known as `StructInfo' and nested
12868 in `TypeInfo'; we don't access this directly anymore.
12870 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12871 property and removed IsAssigned(), IsFieldAssigned(),
12872 SetAssigned() and SetFieldAssigned(); we now call them on the
12873 VariableInfo so we don't need to duplicate this code everywhere.
12875 * expression.cs (ParameterReference): Added `Block block' argument
12877 (LocalVariableReference, ParameterReference, This): The new
12878 VariableInfo class is now responsible for all the definite
12881 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12882 IsParameterAssigned, SetParameterAssigned): Removed.
12884 2003-05-18 Martin Baulig <martin@ximian.com>
12886 * typemanager.cs (InitCoreTypes): Try calling
12887 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12888 the 3-args-version. Corlib now also needs our `void_type'.
12889 (GetMethod): Added overloaded version which takes an optional
12890 `bool report_errors' to allow lookups of optional methods.
12892 2003-05-12 Martin Baulig <martin@ximian.com>
12894 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12895 only used for locals and not for parameters.
12897 2003-05-12 Miguel de Icaza <miguel@ximian.com>
12899 * support.cs (InternalParameters.ParameterType): Return the
12900 ExternalType of the parameter.
12902 * parameter.cs (Parameter.ExternalType): drop the two arguments,
12905 2003-05-11 Miguel de Icaza <miguel@ximian.com>
12907 * class.cs (MethodData.Define): Do not set the `newslot' on
12908 interface members, if they are also flagged as "override".
12910 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12911 better code for ++i and i++. This only works for static fields
12912 and local variables.
12914 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12915 want to pull the DeclSpace out of the builder_to_declspace instead
12916 of the TypeBuilder (like in TypeContainer.FindMembers).
12918 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12919 instead of LookupTypeContainer. Fixes the crash on .NET for
12920 looking up interface members.
12922 * const.cs: Create our own emit context during the Definition
12923 stage, so that constants are evaluated in the proper context, when
12924 a recursive definition happens.
12926 2003-05-11 Martin Baulig <martin@ximian.com>
12928 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
12929 new block for a switch section.
12930 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12931 the adding/lookup in the switch block. Fixes #39828.
12933 2003-05-09 Miguel de Icaza <miguel@ximian.com>
12935 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12936 functionality: I needed to convert the data after I had performed
12937 the add/sub operation into the operands type size.
12939 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12940 pass the type for the box operation, otherwise the resulting
12941 object would have been of type object.
12943 (BoxedCast): Add constructor to specify the type to box as.
12945 2003-05-07 Miguel de Icaza <miguel@ximian.com>
12947 * iterators.cs: I was reusing the `count' variable inadvertently,
12948 take steps to not allow this to happen.
12950 2003-05-06 Miguel de Icaza <miguel@ximian.com>
12952 * attribute.cs (Attribute.Resolve): Params attributes are encoded
12953 by creating an array at the point where the params starts and
12954 putting all those arguments there, then adjusting the size of the
12957 2003-05-05 Miguel de Icaza <miguel@ximian.com>
12959 * expression.cs (New.AddressOf): Implement interface
12960 IMemoryLocation. This is used when the `new' operator is used in
12961 the context of an invocation to a method on a value type.
12963 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12966 * namespace.cs: Also check the using aliases here.
12968 * driver.cs: Move the test for using validity after the types have
12969 been entered, so we do a single pass that also includes the using
12972 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12973 in the regular case. CreateSiblingForFinally is doing extra
12976 * attribute.cs (GetAttributeArgumentExpression): Store the result
12977 on an out value, and use the return value to indicate failure
12978 instead of using null (which is a valid return for Constant.GetValue).
12980 * statement.cs: Perform the analysis flow for the increment
12981 portion after the statement, because this will be the real flow of
12982 execution. Fixes #42385
12984 * codegen.cs (EmitContext.EmitArgument,
12985 EmitContext.EmitStoreArgument): New helper functions when the
12986 RemapToProxy flag is set.
12988 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12991 Add support for remapping parameters.
12993 * iterators.cs: Propagate parameter values; Store parameter
12994 values in the proxy classes.
12996 2003-05-04 Miguel de Icaza <miguel@ximian.com>
12998 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
12999 need a proxy reference; I do not know what I was thinking
13001 * cs-parser.jay (constructor_initializer): catch another error,
13002 and display nice message.
13004 (field_declaration): catch void field declaration
13005 to flag a better error.
13007 * class.cs (MemberBase.CheckBase): Report an error instead of a
13008 warning if a new protected member is declared in a struct.
13009 (Field.Define): catch the error of readonly/volatile.
13011 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13013 (FieldExpr.AddressOf): ditto. Catch error where the address of a
13014 volatile variable is taken
13016 2003-05-02 Miguel de Icaza <miguel@ximian.com>
13018 * statement.cs (Fixed.Resolve): Report an error if we are not in
13021 2003-05-01 Miguel de Icaza <miguel@ximian.com>
13023 * typemanager.cs: reuse the code that handles type clashes for
13024 delegates and enumerations.
13026 * class.cs (Report28): Always report.
13028 * expression.cs (EncodeAsAttribute): Allow nulls here.
13030 2003-04-28 Miguel de Icaza <miguel@ximian.com>
13032 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13033 the functionality for testing whether an expression is valid for
13034 an attribute here. Also handle the case of arrays of elements
13037 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13038 encoding a linear array into an array of objects that are suitable
13039 to be passed to an CustomAttributeBuilder.
13041 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13043 * ecore.cs: (FieldExpr): Handle field remapping here.
13045 * iteratators.cs: Pass the instance variable (if the method is an
13046 instance method) to the constructors, so we can access the field
13047 variables on the class.
13049 TODO: Test this with structs. I think the THIS variable on
13050 structs might have to be a pointer, and not a refenrece
13052 2003-04-27 Miguel de Icaza <miguel@ximian.com>
13054 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13055 local variables to fields in a proxy class.
13057 * iterators.cs (PopulateProxy): Rename our internal fields to
13059 Create a <THIS> field if we are an instance method, so we can
13060 reference our parent container variables.
13061 (MapVariable): Called back from the EmitContext code to enter a
13062 new variable to field mapping into the proxy class (we just create
13066 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13067 for using the remapped locals to fields.
13069 I placed the code here, because that gives the same semantics to
13070 local variables, and only changes the Emit code.
13072 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13073 statements inside iterators.
13074 (VariableInfo): Add a FieldBuilder for the cases when we are
13075 remapping local variables to fields in a proxy class
13077 * ecore.cs (SimpleNameResolve): Avoid testing two times for
13078 current_block != null.
13080 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13081 not cope with strings, as it has been moved to the
13082 TableSwitchEmit. Fixed bug in switch generation.
13084 * expression.cs (New.DoResolve): Provide more context for the user
13085 when reporting an error.
13087 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13090 * expression.cs (MemberAccess.DoResolve): When we get a type back,
13091 check the permissions for it. Note than in a type-resolution
13092 context the check was already present in DeclSpace.ResolveType,
13093 but was missing from the MemberAccess.
13095 (ArrayCreation.CheckIndices): warn if the user has
13096 more nested levels of expressions, but there are no more
13097 dimensions specified. Avoids crash on bug 41906.
13099 2003-04-26 Miguel de Icaza <miguel@ximian.com>
13101 * statement.cs (Block): replace Implicit bool, for a generic
13103 New flag: `Unchecked'. This is used during the EmitMeta phase
13104 (which is out-of-line with the regular Resolve/Emit process for a
13105 statement, as this is done ahead of time, but still gets a chance
13106 to call constant resolve).
13108 (Block.Flags): new enum for adding a new flag.
13110 (Block.EmitMeta): track the state of unchecked.
13112 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13113 to enable constant resolution to work there as well.
13115 2003-04-22 Miguel de Icaza <miguel@ximian.com>
13117 * typemanager.cs (ienumerable_type): Also look up
13118 System.Collections.IEnumerable.
13120 2003-04-21 Miguel de Icaza <miguel@ximian.com>
13122 TODO: Test more than one conditional per method.
13124 * class.cs (Indexer.Define): Report the location where the user is
13125 referencing the unsupported feature.
13127 (MethodData): Overload the use of `conditionals' to
13128 minimize the creation of needless ArrayLists. This saves roughly
13129 212kb on my machine.
13131 (Method): Implement the new IIteratorContainer interface.
13132 (Method.SetYields): Implement the method by setting the ModFlags
13133 to contain METHOD_YIELDS.
13135 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13136 which just got set to null.
13138 * iterators.cs: New file.
13140 (Yield, YieldBreak): New statements.
13142 * statement.cs (Return.Resolve): Flag an error if we are used in
13143 an iterator method.
13145 * codegen.cs (InIterator): New flag set if the code is being
13146 compiled in an iterator method.
13148 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
13149 internal modifier, and we just use it to avoid adding extra
13150 fields, as this is seldom used.
13152 * cs-parser.jay: Add yield_statement (yield and yield break).
13154 * driver.cs: New flag -v2 to turn on version 2 features.
13156 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13157 hashtable when v2 is enabled.
13159 2003-04-20 Miguel de Icaza <miguel@ximian.com>
13161 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13162 there is already a namespace defined with this name.
13164 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13165 people upgraded their corlibs.
13167 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13168 always use fully qualified types, no need to use the compiler
13171 (TypeManager.IsNamespace): Use binarysearch.
13173 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13174 AddDelegate): I did not quite use the new IsValid API properly: I
13175 have to pass the short-name and the fullname. I was passing only
13176 the basename instead of the fullname sometimes.
13178 (TypeContainer.DefineType): call NamespaceClash.
13180 * interface.cs (Interface.DefineType): use NamespaceClash before
13183 * delegate.cs (Delegate.DefineType): use NamespaceClash before
13186 * enum.cs: (Enum.DefineType): use NamespaceClash before
13189 * typemanager.cs (: 3-line patch that gives us some tasty 11%
13190 speed increase. First, use the negative_hits cache when we get a
13191 negative. Second, add the type with its full original name
13192 instead of the new . and + encoded name (reflection uses + to
13193 separate type from a nested type). Use LookupTypeReflection
13194 directly which bypasses the type->name hashtable (that we already
13195 know does not contain the type.
13197 * decl.cs (DeclSpace.ResolveTypeExpr): track the
13198 location/container type.
13200 * driver.cs: When passing utf8, use directly the UTF8Encoding.
13202 2003-04-19 Miguel de Icaza <miguel@ximian.com>
13204 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13206 * delegate.cs (NewDelegate.Resolve): Test whether an instance
13207 method is being referenced in the method group from a static
13208 context, and report error 120 if so.
13210 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13213 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13214 is created, we create the A namespace).
13216 * cs-parser.jay: A namespace also introduces a DeclarationFound.
13219 2003-04-18 Miguel de Icaza <miguel@ximian.com>
13221 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13222 invocation to ModuleBuilder.GetType with the same values will
13223 return a new type instance, so we need to cache its return
13226 * expression.cs (Binary.ResolveOperator): Only allow the compare
13227 operators on enums if they are of the same type.
13229 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13230 types of ValueType on their own case. Before we were giving them
13231 the same treatment as objects.
13233 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13234 fullname. Short name is used to compare against container name.
13235 Fullname is used to check against defined namespace names.
13237 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13238 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13240 (Method.CheckBase): Call parent.
13241 (MemberBase.CheckBase): Check for protected members on sealed
13243 (PropertyBase.CheckBase): Call parent.
13244 (Field.Define): Call parent.
13246 * report.cs: Negative error codes are now mapped to 8000 - code,
13247 so that the display is render more nicely.
13249 * typemanager.cs: Do not use try/catch, instead report a regular
13252 (GetPointerType, GetReferenceType): These methods provide
13253 mechanisms to obtain the T* and T& from a T. We had the code
13254 previously scattered around the code base, and it also used
13255 TypeManager.LookupType that would go through plenty of caches.
13256 This one goes directly to the type source.
13258 In some places we did the Type.GetType followed by
13259 ModuleBuilder.GetType, but not in others, so this unifies the
13260 processing as well.
13262 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13263 statements now that we have namespace information.
13265 * typemanager.cs (IsNamespace): New method, returns whether the
13266 string presented is a namespace or not.
13268 (ComputeNamespaces): New public entry point, computes the list of
13269 available namespaces, using the GetNamespaces API call in Mono, or
13270 the slower version in MS.NET.
13272 Now before we start the semantic analysis phase, we have a
13273 complete list of namespaces including everything that the user has
13276 Deleted old code to cache namespaces in .nsc files.
13278 2003-04-17 Miguel de Icaza <miguel@ximian.com>
13280 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13281 class/struct location definition Location for the implicit
13282 constructor location.
13284 (Operator.Define): Use the location of the operator for the
13285 implicit Method definition.
13287 (Constructor.Emit): use the constructor location for the implicit
13288 base initializer constructor.
13290 * ecore.cs: Remove ITypeExpression. This interface is now gone,
13291 and the Expression class now contains two new methods:
13293 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
13294 isolate type lookup from the rest of the resolution process.
13296 Since we use Expressions to hold type definitions due to the way
13297 we parse the input we have historically overloaded Resolve to
13298 perform the Type lookups if a special flag is passed. Now this is
13299 eliminated and two methods take their place.
13301 The differences in the two methods between xStep and xTerminal is
13302 that xStep is involved in our current lookup system that uses
13303 SimpleNames to compose a name, while xTerminal is used just to
13304 catch the case where the simplename lookup failed.
13306 2003-04-16 Miguel de Icaza <miguel@ximian.com>
13308 * expression.cs (ResolveMemberAccess): Remove redundant code.
13309 TypeExpr expressions are always born fully resolved.
13311 * interface.cs (PopulateMethod): Do not lookup the types twice.
13312 We were doing it once during SemanticAnalysis and once during
13315 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13316 in local variable type definitions, were being returned as a
13317 SimpleName (we decomposed everything into a string), that is
13318 because primary_expression was being used instead of a type in the
13319 grammar (reduce/reduce conflicts).
13321 The part that was wrong is that we converted the expression into a
13322 string (an oversimplification in one hand, compounded with primary
13323 expressions doing string concatenation).
13329 Would return "A.B.C[]" as a SimpleName. This stopped things like
13330 using clauses from working on this particular context. And a type
13331 was being matched directly against "A.B.C[]".
13333 We now use the correct approach, and allow for ComposedCast to be
13334 part of the unary expression. So the "A.B.C []" become a composed
13335 cast of "A.B.C" (as a nested group of MemberAccess with a
13336 SimpleName at the end) plus the rank composition "[]".
13340 2003-04-10 Miguel de Icaza <miguel@ximian.com>
13342 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13343 for the access level checking.
13345 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
13346 `TypeContainer container', because I kept getting confused when I
13347 was debugging this code.
13349 * expression.cs (Indexers): Instead of tracking getters/setters,
13350 we now track them in parallel. We create one arraylist less, but
13351 most importantly it is possible now for the LValue code to find a
13352 matching get for a set.
13354 (IndexerAccess.DoResolveLValue): Update the code.
13355 GetIndexersForType has been modified already to extract all the
13356 indexers from a type. The code assumed it did not.
13358 Also make the code set the correct return type for the indexer.
13359 This was fixed a long time ago for properties, but was missing for
13360 indexers. It used to be void_type.
13362 (Binary.Emit): Test first for doubles instead of
13363 floats, as they are more common.
13365 (Binary.EmitBranchable): Use the .un version of the branch opcodes
13366 when dealing with floats and the <=, >= operators. This fixes bug
13369 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13370 to load the array value by emitting a load on the foreach variable
13371 type. This was incorrect.
13373 We now emit the code to load an element using the the array
13374 variable type, and then we emit the conversion operator.
13378 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
13380 * attribute.cs: Avoid allocation of ArrayLists in the common case.
13382 2003-04-09 Miguel de Icaza <miguel@ximian.com>
13384 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13385 test for protection before we test for signatures.
13387 (MethodSignature.ToString): implement.
13389 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13390 to the case where we reduced into a LongConstant.
13392 * decl.cs (CheckAccessLevel): If the type is an array, we can not
13393 depend on whether the information is acurrate, because the
13394 Microsoft runtime will always claim that the array type is public,
13395 regardless of the real state.
13397 If the type is a pointer, another problem happens: the type is
13398 reported as non-public in Microsoft.
13400 In both cases we have to call CheckAccessLevel recursively with
13401 the underlying type as the argument to be tested.
13403 2003-04-08 Miguel de Icaza <miguel@ximian.com>
13405 * assign.cs (Assign.Emit): If we are dealing with a compound
13406 assignment expression, we should use the code path that stores the
13407 intermediate result in a temporary value. This fixes #40903.
13409 *expression.cs (Indirection.ToString): Provide ToString method for
13412 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
13414 * class.cs: Null out fields holding references to Block objects so
13415 they can be garbage collected.
13417 * expression.cs (OverloadResolve): Remove unused local.
13419 2003-04-07 Martin Baulig <martin@ximian.com>
13421 * codegen.cs (EmitContext.CurrentFile): New public field.
13422 (EmitContext.Mark): Use the CurrentFile to check whether the
13423 location is in the correct file.
13424 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13426 2003-04-07 Martin Baulig <martin@ximian.com>
13428 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13430 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13431 location. [FIXME: The location argument which gets passed to this
13432 method is sometimes wrong!]
13434 2003-04-07 Nick Drochak <ndrochak@gol.com>
13436 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13438 2003-04-07 Miguel de Icaza <miguel@ximian.com>
13440 * expression.cs (Indirection.EmitAssign): We were using the
13441 temporary, but returning immediately instead of continuing the
13444 2003-04-06 Martin Baulig <martin@ximian.com>
13446 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13447 if it's a nested child, but also deriving from the outer class.
13450 * typemanager.cs (IsNestedChildOf): Make this work if it's a
13451 nested child, but also deriving from the outer class. See
13453 (FilterWithClosure): We may access private members of the outer
13454 class if we're a nested child and deriving from the outer class.
13455 (RealMemberLookup): Only set `closure_private_ok' if the
13456 `original_bf' contained BindingFlags.NonPublic.
13458 2003-04-05 Martin Baulig <martin@ximian.com>
13460 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
13461 probe if its a type parameter, and if so, flag an error.
13463 * decl.cs: Move here the SetParameterInfo code from class.cs.
13464 Handle IsGeneric here.
13466 Handle a variety of errors in the parameter info definition.
13468 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
13469 type parameters here.
13471 * cs-parser.jay (class_declaration): report errors for parameters
13474 2003-01-21 Miguel de Icaza <miguel@ximian.com>
13476 * generic.cs: New file, contains support code for generics.
13478 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
13479 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
13481 Update parser for the above removals.
13483 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
13484 now taken care of in the parser.
13486 2003-04-02 Miguel de Icaza <miguel@ximian.com>
13488 * class.cs (Event.Define): Do not allow abstract events to have
13491 2003-04-01 Miguel de Icaza <miguel@ximian.com>
13493 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13494 block in event declarations.
13496 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13497 value type, get its address.
13499 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13500 leaving a class on the stack instead of a boolean value (int
13501 0/1). Change the code so we compare against null, and then the
13502 result against zero.
13504 * class.cs (TypeContainer.GetClassBases): We were checking for the
13505 parent class being sealed too late.
13507 * expression.cs (Binary.Emit): For <= and >= when dealing with
13508 floating point values, use cgt.un and clt.un instead of cgt and
13511 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
13513 * statement.cs: Apply the same optimization as MS: skip the
13514 GetEnumerator returning an IEnumerator, and use the one returning a
13515 CharEnumerator instead. This allows us to avoid the try-finally block
13518 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
13520 * cs-parser.jay: Attributes cannot be applied to
13521 namespaces. Fixes #40473
13523 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13526 (Add*): check if the name is valid using the full name for constants,
13527 fields, properties and events.
13529 2003-03-28 Miguel de Icaza <miguel@ximian.com>
13531 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13532 char constants to be part of the enumeration.
13534 * expression.cs (Conditional.DoResolve): Add support for operator
13535 true. Implements the missing functionality from 14.12
13537 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13538 operator true/false as required by the spec.
13540 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13541 implicit conversion to boolean.
13543 * statement.cs (Statement.ResolveBoolean): A boolean expression is
13544 also one where the type implements `operator true'.
13546 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13547 get an expression that will invoke operator true based on an
13550 (GetConversionOperators): Removed the hack that called op_True
13553 (Expression.ResolveBoolean): Move this from Statement.
13555 2003-03-17 Miguel de Icaza <miguel@ximian.com>
13557 * ecore.cs (FieldExpr): do not allow initialization of initonly
13558 fields on derived classes
13560 2003-03-13 Martin Baulig <martin@ximian.com>
13562 * statement.cs (Block.Emit): Call ig.BeginScope() and
13563 ig.EndScope() when compiling with debugging info; call
13564 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13566 2003-03-08 Miguel de Icaza <miguel@ximian.com>
13568 * expression.cs (Indexers): Do not construct immediately, allow
13569 for new members to be appended as we go. Fixes 38143
13571 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13573 * expression.cs: save/restore context when resolving an unchecked
13576 2003-03-05 Miguel de Icaza <miguel@ximian.com>
13578 * cfold.cs: Catch division by zero in modulus operator during
13581 2003-03-03 Miguel de Icaza <miguel@ximian.com>
13583 * interface.cs (Interface.DefineMembers): Avoid defining members
13586 2003-02-27 Miguel de Icaza <miguel@ximian.com>
13588 * driver.cs: handle the +/- options for -noconfig
13590 * statement.cs (Unckeched.Resolve): Also track the state of
13591 unchecked in the Resolve phase.
13593 2003-02-27 Martin Baulig <martin@ximian.com>
13595 * ecore.cs (Expression.MemberLookup): Don't create a
13596 MethodGroupExpr for something which is not a method. Fixes #38291.
13598 2003-02-25 Miguel de Icaza <miguel@ximian.com>
13600 * class.cs (MemberBase.CheckParameters): Also check that the type
13601 is unmanaged if it is a pointer.
13603 * expression.cs (SizeOf.Resolve): Add location information.
13605 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13606 a managed type is declared.
13608 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13609 parameter modifiers as well. Fixes bug 38606
13611 * class.cs: Very sad. Am backing out the speed up changes
13612 introduced by the ArrayList -> Array in the TypeContainer, as they
13613 were not actually that much faster, and introduced a bug (no error
13614 reports on duplicated methods).
13616 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13617 source first, this will guarantee that we have a valid expression
13618 before calling in lower levels functions that will require a
13619 resolved object. Then use this original_source in the
13620 target.ResolveLValue instead of the original source that was
13623 Another change. Use target.Resolve instead of LValueResolve.
13624 Although we are resolving for LValues, we will let the Assign code
13625 take care of that (it will be called again from Resolve). This
13626 basically allows code like this:
13628 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13629 class Y { void A (X x) { x [0] += o; }
13631 The problem was that the indexer was trying to resolve for
13632 set_Item (idx, object o) and never finding one. The real set_Item
13633 was set_Item (idx, X). By delaying the process we get the right
13638 2003-02-23 Martin Baulig <martin@ximian.com>
13640 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
13641 while calling DoEmit ().
13643 * codegen.cs (EmitContext.Mark): Don't mark locations in other
13644 source files; if you use the #line directive inside a method, the
13645 compiler stops emitting line numbers for the debugger until it
13646 reaches the end of the method or another #line directive which
13647 restores the original file.
13649 2003-02-23 Martin Baulig <martin@ximian.com>
13651 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
13653 2003-02-23 Martin Baulig <martin@ximian.com>
13655 * statement.cs (Block.AddChildVariableNames): We need to call this
13656 recursively, not just for our immediate children.
13658 2003-02-23 Martin Baulig <martin@ximian.com>
13660 * class.cs (Event.Define): Always make the field private, like csc does.
13662 * typemanager.cs (TypeManager.RealMemberLookup): Make events
13663 actually work, fixes bug #37521.
13665 2003-02-23 Miguel de Icaza <miguel@ximian.com>
13667 * delegate.cs: When creating the various temporary "Parameters"
13668 classes, make sure that we call the ComputeAndDefineParameterTypes
13669 on those new parameters (just like we do with the formal ones), to
13670 allow them to be resolved in the context of the DeclSpace.
13672 This fixes the bug that Dick observed in Bugzilla #38530.
13674 2003-02-22 Miguel de Icaza <miguel@ximian.com>
13676 * expression.cs (ResolveMemberAccess): When resolving a constant,
13677 do not attempt to pull a constant if the value was not able to
13678 generate a valid constant.
13680 * const.cs (LookupConstantValue): Do not report more errors than required.
13682 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13684 * expression.cs: fixes bug #38328.
13686 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13688 * class.cs: Changed all the various members that can be part of a
13689 class from being an ArrayList to be an Array of the right type.
13690 During the DefineType type_list, interface_list, delegate_list and
13691 enum_list are turned into types, interfaces, delegates and enums
13694 And during the member population, indexer_list, event_list,
13695 constant_list, field_list, instance_constructor_list, method_list,
13696 operator_list and property_list are turned into their real arrays.
13698 Although we could probably perform this operation earlier, for
13699 good error reporting we need to keep the lists and remove the
13700 lists for longer than required.
13702 This optimization was triggered by Paolo profiling the compiler
13703 speed on the output of `gen-sample-program.pl' perl script.
13705 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13706 not crash in methods like MemberLookupFailed that use this field.
13708 This problem arises when the compiler fails to resolve a type
13709 during interface type definition for example.
13711 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13713 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13714 inherit from System.Object, so we have to stop at null, not only
13715 when reaching System.Object.
13717 2003-02-17 Miguel de Icaza <miguel@ximian.com>
13719 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13720 DeclaredOnly because the parent indexer might have had a different
13721 name, but did not loop until the top of the hierarchy was reached.
13723 The problem this one fixes is 35492: when a class implemented an
13724 indexer from an interface, we were getting the interface method
13725 (which was abstract) and we were flagging an error (can not invoke
13728 This also keeps bug 33089 functioning, and test-148 functioning.
13730 * typemanager.cs (IsSpecialMethod): The correct way of figuring
13731 out if a method is special is to see if it is declared in a
13732 property or event, or whether it is one of the predefined operator
13733 names. This should fix correctly #36804.
13735 2003-02-15 Miguel de Icaza <miguel@ximian.com>
13737 The goal here is to remove the dependency on EmptyCast.Peel ().
13738 Killing it completely.
13740 The problem is that currently in a number of places where
13741 constants are expected, we have to "probe" for an EmptyCast, and
13742 Peel, which is not the correct thing to do, as this will be
13743 repetitive and will likely lead to errors.
13745 The idea is to remove any EmptyCasts that are used in casts that
13746 can be reduced to constants, so we only have to cope with
13749 This bug hunt was triggered by Bug 37363 and the desire to remove
13750 the duplicate pattern where we were "peeling" emptycasts to check
13751 whether they were constants. Now constants will always be
13754 * ecore.cs: Use an enumconstant here instead of wrapping with
13757 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13758 throwing me off. By handling this we can get rid of a few hacks.
13760 * statement.cs (Switch): Removed Peel() code.
13762 2003-02-14 Miguel de Icaza <miguel@ximian.com>
13764 * class.cs: Location information for error 508
13766 * expression.cs (New.DoResolve): Add a guard against double
13767 resolution of an expression.
13769 The New DoResolve might be called twice when initializing field
13770 expressions (see EmitFieldInitializers, the call to
13771 GetInitializerExpression will perform a resolve on the expression,
13772 and later the assign will trigger another resolution
13774 This leads to bugs (#37014)
13776 * delegate.cs: The signature for EndInvoke should contain any ref
13777 or out parameters as well. We were not doing this in the past.
13779 * class.cs (Field.Define): Do not overwrite the type definition
13780 inside the `volatile' group. Turns out that volatile enumerations
13781 were changing the type here to perform a validity test, which
13784 2003-02-12 Miguel de Icaza <miguel@ximian.com>
13786 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13787 and structs, we do not want to load the instance variable
13789 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13790 enum_type has to be handled like an object reference (implicit
13791 conversions exists from this to object), but the regular IsClass
13792 and IsValueType tests will never return true for this one.
13794 Also we use TypeManager.IsValueType instead of type.IsValueType,
13795 just for consistency with the rest of the code (this is only
13796 needed if we ever use the construct exposed by test-180.cs inside
13797 corlib, which we dont today).
13799 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
13801 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13804 2003-02-09 Martin Baulig <martin@ximian.com>
13806 * namespace.cs (Namespace..ctor): Added SourceFile argument.
13807 (Namespace.DefineNamespaces): New static public method; this is
13808 called when we're compiling with debugging to add all namespaces
13809 to the symbol file.
13811 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13812 pass it to the Namespace's .ctor.
13814 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13815 and MethodBase arguments; pass the namespace ID to the symwriter;
13816 pass the MethodBase instead of the token to the symwriter.
13817 (SymbolWriter.DefineNamespace): New method to add a namespace to
13820 2003-02-09 Martin Baulig <martin@ximian.com>
13822 * symbolwriter.cs: New file. This is a wrapper around
13823 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
13824 methods here in near future.
13826 2003-02-09 Martin Baulig <martin@ximian.com>
13828 * codegen.cs (EmitContext.Mark): Just pass the arguments to
13829 ILGenerator.MarkSequencePoint() which are actually used by the
13832 2003-02-09 Martin Baulig <martin@ximian.com>
13834 * location.cs (SourceFile): New public sealed class. This
13835 contains the name and an index which is used in the location's token.
13836 (Location): Reserve an appropriate number of bits in the token for
13837 the source file instead of walking over that list, this gives us a
13838 really huge performance improvement when compiling with debugging.
13840 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13841 `SourceFile' argument instead of a string.
13842 (Driver.ProcessFile): Add all the files via Location.AddFile(),
13843 but don't parse/tokenize here, we need to generate the list of all
13844 source files before we do that.
13845 (Driver.ProcessFiles): New static function. Parses/tokenizes all
13848 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13849 instead of a string.
13851 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13854 2003-02-09 Martin Baulig <martin@ximian.com>
13856 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13857 filename on `#line default'.
13859 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13861 * statement.cs: don't clear the pinned var when the fixed statement
13862 returns from the method (fixes bug#37752).
13864 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13866 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
13869 2003-02-07 Martin Baulig <martin@ximian.com>
13871 * driver.cs: Removed the `--debug-args' command line argument.
13873 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13874 automatically by the AsssemblyBuilder.
13875 (CodeGen.InitializeSymbolWriter): We don't need to call any
13876 initialization function on the symbol writer anymore. This method
13877 doesn't take any arguments.
13879 2003-02-03 Miguel de Icaza <miguel@ximian.com>
13881 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13882 from referenced assemblies as well.
13884 2003-02-02 Martin Baulig <martin@ximian.com>
13886 * class.cs (MethodData.Emit): Generate debugging info for external methods.
13888 2003-02-02 Martin Baulig <martin@ximian.com>
13890 * class.cs (Constructor.Emit): Open the symbol writer before
13891 emitting the constructor initializer.
13892 (ConstructorInitializer.Emit): Call ec.Mark() to allow
13893 single-stepping through constructor initializers.
13895 2003-01-30 Miguel de Icaza <miguel@ximian.com>
13897 * class.cs: Handle error 549: do not allow virtual methods in
13900 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13902 * decl.cs: Check access levels when resolving types
13904 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13906 * statement.cs: Add parameters and locals set in catch blocks that might
13907 return to set vector
13909 2003-01-29 Miguel de Icaza <miguel@ximian.com>
13911 * class.cs (Operator): Set the SpecialName flags for operators.
13913 * expression.cs (Invocation.DoResolve): Only block calls to
13914 accessors and operators on SpecialName methods.
13916 (Cast.TryReduce): Handle conversions from char constants.
13919 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13921 * statement.cs: small memory and time optimization in FlowBranching.
13923 2003-01-28 Pedro Mart <yoros@wanadoo.es>
13925 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13926 problem that the last fix but in the other sid (Set).
13928 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13929 access when there is no indexer in the hierarchy.
13931 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13933 * class.cs: Combine some if statements.
13935 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13937 * driver.cs: fixed bug #37187.
13939 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
13941 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13942 any indexer, it's needed to build a list with all the indexers in the
13943 hierarchy (AllGetters), else we have problems. Fixes #35653.
13945 2003-01-23 Miguel de Icaza <miguel@ximian.com>
13947 * class.cs (MethodData.Define): It is wrong for an interface
13948 implementation to be static in both cases: explicit and implicit.
13949 We were only handling this in one case.
13951 Improve the if situation there to not have negations.
13953 * class.cs (Field.Define): Turns out that we do not need to check
13954 the unsafe bit on field definition, only on usage. Remove the test.
13956 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13958 * driver.cs: use assembly.Location instead of Codebase (the latest
13959 patch made mcs fail when using MS assemblies).
13961 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
13963 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13964 get the path to *corlib.dll.
13966 2003-01-21 Nick Drochak <ndrochak@gol.com>
13970 * typemanager.cs: Remove compiler warnings
13972 2003-01-20 Duncan Mak <duncan@ximian.com>
13974 * AssemblyInfo.cs: Bump the version number to 0.19.
13976 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13978 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13980 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
13982 * class.cs (Constructor::Emit): Emit debugging info for constructors.
13984 2003-01-17 Miguel de Icaza <miguel@ximian.com>
13986 * cs-parser.jay: Small fix: we were not comparing the constructor
13987 name correctly. Thanks to Zoltan for the initial pointer.
13989 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13991 * cs-tokenizer.cs: Set file name when specified with #line
13993 2003-01-15 Miguel de Icaza <miguel@ximian.com>
13995 * cs-parser.jay: Only perform the constructor checks here if we
13996 are named like the class; This will help provider a better
13997 error. The constructor path is taken when a type definition is
13998 not found, but most likely the user forgot to add the type, so
13999 report that rather than the constructor error.
14001 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14003 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14006 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14008 * cs-parser.jay: Add cleanup call.
14010 2003-01-13 Duncan Mak <duncan@ximian.com>
14012 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14013 consistent with other methods.
14015 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14017 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14019 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14021 * attribute.cs: only set GuidAttr to true when we have a
14024 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14028 * typemanager.cs: fixes to allow mcs compile corlib with the new
14029 Type.IsSubclassOf fix.
14031 2003-01-08 Miguel de Icaza <miguel@ximian.com>
14033 * expression.cs (LocalVariableReference.DoResolve): Classify a
14034 constant as a value, not as a variable. Also, set the type for
14037 * cs-parser.jay (fixed_statement): take a type instead of a
14038 pointer_type, so we can produce a better error message later.
14040 * statement.cs (Fixed.Resolve): Flag types that are not pointers
14043 (For.DoEmit): Make inifinite loops have a
14044 non-conditional branch back.
14046 (Fixed.DoEmit): First populate the pinned variables, then emit the
14047 statement, then clear the variables. Before I was emitting the
14048 code once for each fixed piece.
14051 2003-01-08 Martin Baulig <martin@ximian.com>
14053 * statement.cs (FlowBranching.MergeChild): A break in a
14054 SWITCH_SECTION does not leave a loop. Fixes #36155.
14056 2003-01-08 Martin Baulig <martin@ximian.com>
14058 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14059 lives in the same number space than `param_map'. Fixes #36154.
14061 2003-01-07 Miguel de Icaza <miguel@ximian.com>
14063 * cs-parser.jay (constructor_declaration): Set the
14064 Constructor.ModFlags before probing for it. This makes the
14065 compiler report 514, 515 and 132 (the code was there, but got
14068 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14069 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14070 (GotoCase.Resolve): Set `Returns' to ALWAYS.
14072 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14074 * enum.cs: create the enum static fields using the enum type.
14076 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14078 * class.cs: don't try to create the ParamBuilder for the return
14079 type if it's not needed (and handle it breaking for the ms runtime
14082 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14084 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14086 2002-12-29 Miguel de Icaza <miguel@ximian.com>
14088 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14089 the command. This showed up while compiling the JANET source
14090 code, which used \r as its only newline separator.
14092 2002-12-28 Miguel de Icaza <miguel@ximian.com>
14094 * class.cs (Method.Define): If we are an operator (because it
14095 reuses our code), then set the SpecialName and HideBySig. #36128
14097 2002-12-22 Miguel de Icaza <miguel@ximian.com>
14099 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14100 exception, report error 120 `object reference required'.
14102 * driver.cs: Add --pause option, used during to measure the size
14103 of the process as it goes with --timestamp.
14105 * expression.cs (Invocation.DoResolve): Do not allow methods with
14106 SpecialName to be invoked.
14108 2002-12-21 Miguel de Icaza <miguel@ximian.com>
14110 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14111 number before adding it.
14113 2002-12-21 Ravi Pratap <ravi@ximian.com>
14115 * ecore.cs (StandardImplicitConversion): When in an unsafe
14116 context, we allow conversion between void * to any other pointer
14117 type. This fixes bug #35973.
14119 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14121 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14122 is not thrown when extensionless outputs are used
14124 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14126 * rootcontext.cs: fixed compilation of corlib.
14128 2002-12-19 Miguel de Icaza <miguel@ximian.com>
14130 * attribute.cs (Attributes.Contains): Add new method.
14132 * class.cs (MethodCore.LabelParameters): if the parameter is an
14133 `out' parameter, check that no attribute `[In]' has been passed.
14135 * enum.cs: Handle the `value__' name in an enumeration.
14137 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
14139 * decl.cs: Added special case to allow overrides on "protected
14142 2002-12-18 Ravi Pratap <ravi@ximian.com>
14144 * attribute.cs (Attributes.AddAttributeSection): Rename to this
14145 since it makes much more sense.
14147 (Attributes.ctor): Don't require a Location parameter.
14149 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14151 * attribute.cs (ApplyAttributes): Remove extra Location parameters
14152 since we already have that information per attribute.
14154 * everywhere : make appropriate changes.
14156 * class.cs (LabelParameters): Write the code which actually
14157 applies attributes to the return type. We can't do this on the MS
14158 .NET runtime so we flag a warning in the case an exception is
14161 2002-12-18 Miguel de Icaza <miguel@ximian.com>
14163 * const.cs: Handle implicit null conversions here too.
14165 2002-12-17 Ravi Pratap <ravi@ximian.com>
14167 * class.cs (MethodCore.LabelParameters): Remove the extra
14168 Type [] parameter since it is completely unnecessary. Instead
14169 pass in the method's attributes so that we can extract
14170 the "return" attribute.
14172 2002-12-17 Miguel de Icaza <miguel@ximian.com>
14174 * cs-parser.jay (parse): Use Report.Error to flag errors instead
14175 of ignoring it and letting the compile continue.
14177 * typemanager.cs (ChangeType): use an extra argument to return an
14178 error condition instead of throwing an exception.
14180 2002-12-15 Miguel de Icaza <miguel@ximian.com>
14182 * expression.cs (Unary.TryReduce): mimic the code for the regular
14183 code path. Perform an implicit cast in the cases where we can
14184 implicitly convert to one of the integral types, and then reduce
14185 based on that constant. This fixes bug #35483.
14187 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14189 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14191 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14193 * namespace.cs: fixed bug #35489.
14195 2002-12-12 Miguel de Icaza <miguel@ximian.com>
14197 * class.cs: Remove some dead code.
14199 * cs-parser.jay: Estimate the number of methods needed
14200 (RootContext.MethodCount);
14202 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14203 numbers instead of StringBuilders.
14205 * support.cs (PtrHashtable): Add constructor with initial size;
14206 We can now reduce reallocations of the method table.
14208 2002-12-10 Ravi Pratap <ravi@ximian.com>
14210 * attribute.cs (ApplyAttributes): Keep track of the emitted
14211 attributes on a per-target basis. This fixes bug #35413.
14213 2002-12-10 Miguel de Icaza <miguel@ximian.com>
14215 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14216 default to the Windows 1252 encoding.
14218 (UnixParseOption): Support version, thanks to Alp for the missing
14221 * AssemblyInfo.cs: Add nice assembly information.
14223 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14226 * cs-parser.jay: Allow a trailing comma before the close bracked
14227 in the attribute_section production.
14229 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14230 address of the instance was being taken, I will take this out,
14231 because we take the address of the object immediately here.
14233 2002-12-09 Ravi Pratap <ravi@ximian.com>
14235 * typemanager.cs (AreMultipleAllowed): Take care of the most
14236 obvious case where attribute type is not in the current assembly -
14239 2002-12-08 Miguel de Icaza <miguel@ximian.com>
14241 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14242 definitions, instead of doing that afterwards.
14244 Also we use a nice little hack, depending on the constructor, we
14245 know if we are a "composed" name or a simple name. Hence, we
14246 avoid the IndexOf test, and we avoid
14248 * codegen.cs: Add code to assist in a bug reporter to track down
14249 the source of a compiler crash.
14251 2002-12-07 Ravi Pratap <ravi@ximian.com>
14253 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14254 types have been emitted for a given element and flag an error
14255 if something which does not have AllowMultiple set is used more
14258 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14259 attribute types and their corresponding AllowMultiple properties
14261 (AreMultipleAllowed): Check the property for a given type.
14263 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14264 property in the case we have a TypeContainer.
14266 (Attributes.AddAttribute): Detect duplicates and just skip on
14267 adding them. This trivial fix catches a pretty gross error in our
14268 attribute emission - global attributes were being emitted twice!
14270 Bugzilla bug #33187 is now fixed.
14272 2002-12-06 Miguel de Icaza <miguel@ximian.com>
14274 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14275 instead of pp_and).
14277 * expression.cs (Binary.ResolveOperator): I can only use the
14278 Concat (string, string, string) and Concat (string, string,
14279 string, string) if the child is actually a concatenation of
14282 2002-12-04 Miguel de Icaza <miguel@ximian.com>
14284 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14285 context where we need a 2-character lookahead.
14287 * pending.cs (PendingImplementation): Rework so we can keep track
14288 of interface types all the time, and flag those which were
14289 implemented by parents as optional.
14291 2002-12-03 Miguel de Icaza <miguel@ximian.com>
14293 * expression.cs (Binary.ResolveOperator): Use
14294 String.Concat(string,string,string) or
14295 String.Concat(string,string,string,string) when possible.
14297 * typemanager: More helper methods.
14300 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14302 * pending.cs: remove the bogus return from GetMissingInterfaces()
14303 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14305 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14307 * namespace.cs: avoid duplicated 'using xxx' being added to
14308 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14309 when we get more than one 'using' statement for the same namespace.
14310 Report a CS0105 warning for it.
14312 2002-11-30 Miguel de Icaza <miguel@ximian.com>
14314 * cs-tokenizer.cs (consume_identifier): use read directly, instead
14315 of calling getChar/putback, uses internal knowledge of it.
14317 (xtoken): Reorder tokenizer so most common patterns are checked
14318 first. This reduces the compilation time in another 5% (from 8.11s
14319 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14321 The parsing time is 22% of the compilation in mcs, and from that
14322 64% is spent on the tokenization process.
14324 I tried using a binary search for keywords, but this is slower
14325 than the hashtable. Another option would be to do a couple of
14328 * Not use a StringBuilder, instead use an array of chars,
14329 with a set value. Notice that this way we could catch
14330 the 645 error without having to do it *afterwards*.
14332 * We could write a hand-parser to avoid the hashtable
14333 compares altogether.
14335 The identifier consumption process takes 37% of the tokenization
14336 time. Another 15% is spent on is_number. 56% of the time spent
14337 on is_number is spent on Int64.Parse:
14339 * We could probably choose based on the string length to
14340 use Int32.Parse or Int64.Parse and avoid all the 64-bit
14343 Another 3% is spend on wrapping `xtoken' in the `token' function.
14345 Handle 0xa0 as whitespace (#34752)
14347 2002-11-26 Miguel de Icaza <miguel@ximian.com>
14349 * typemanager.cs (IsCLRType): New routine to tell whether a type
14350 is one of the builtin types.
14352 Maybe it needs to use TypeCodes to be faster. Maybe we could use
14353 typecode in more places instead of doing pointer comparissions.
14354 We could leverage some knowledge about the way the typecodes are
14357 New code to cache namespaces in assemblies, it is currently not
14358 invoked, to be used soon.
14360 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14362 * expression.cs (Binary.ResolveOperator): specially handle
14363 strings, and do not perform user-defined operator overloading for
14366 2002-11-24 Miguel de Icaza <miguel@ximian.com>
14368 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14369 internalcall as it is a pretty simple operation; Avoid whenever
14370 possible to call Char.IsLetter.
14372 (consume_identifier): Cut by half the number of
14373 hashtable calls by merging the is_keyword and GetKeyword behavior.
14375 Do not short-circuit, because if we do, we
14376 report errors (ie, #if false && true would produce an invalid
14380 2002-11-24 Martin Baulig <martin@ximian.com>
14382 * expression.cs (Cast.TryReduce): If we're in checked syntax,
14383 check constant ranges and report a CS0221. Fixes #33186.
14385 2002-11-24 Martin Baulig <martin@ximian.com>
14387 * cs-parser.jay: Make this work for uninitialized variable
14388 declarations in the `for' initializer. Fixes #32416.
14390 2002-11-24 Martin Baulig <martin@ximian.com>
14392 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14393 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
14395 2002-11-24 Martin Baulig <martin@ximian.com>
14397 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14398 argument; if true, we also check for user-defined conversions.
14399 This is only needed if both arguments are of a user-defined type.
14400 Fixes #30443, added test-175.cs.
14401 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14403 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14405 2002-11-24 Martin Baulig <martin@ximian.com>
14407 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14408 function to get the store opcode.
14409 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14410 only emit the Ldelema if the store opcode is Stobj. You must run
14411 both test-34 and test-167 to test this. Fixes #34529.
14413 2002-11-23 Martin Baulig <martin@ximian.com>
14415 * ecore.cs (Expression.MemberLookup): Added additional
14416 `qualifier_type' argument which is used when we're being called
14417 from MemberAccess.DoResolve() and null if we're called from a
14419 (Expression.MemberLookupFailed): New method to report errors; this
14420 does the CS1540 check and reports the correct error message.
14422 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14423 argument for the CS1540 check and redone the way how we're dealing
14424 with private members. See the comment in the source code for details.
14425 (FilterWithClosure): Reverted this back to revision 1.197; renamed
14426 `closure_start_type' to `closure_qualifier_type' and check whether
14427 it's not null. It was not this filter being broken, it was just
14428 being called with the wrong arguments.
14430 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14431 and pass it the correct `qualifier_type'; this also does the error
14434 2002-11-22 Miguel de Icaza <miguel@ximian.com>
14436 * expression.cs (Invocation.EmitParams): If the we are dealing
14437 with a non-built-in value type, load its address as well.
14439 (ArrayCreation): Use a a pretty constant instead
14440 of the hardcoded value 2. Use 6 instead of 2 for the number of
14441 static initializers.
14443 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14444 because they are not really value types, just glorified integers.
14446 * driver.cs: Do not append .exe, the CSC compiler does not do it.
14448 * ecore.cs: Remove redundant code for enumerations, make them use
14449 the same code path as everything else, fixes the casting issue
14450 with enumerations in Windows.Forms.
14452 * attribute.cs: Do only cast to string if it is a string, the
14453 validation happens later.
14455 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14456 people upgrade their corlibs.
14458 * ecore.cs: Oops, enumerations were not following the entire code path
14460 2002-11-21 Miguel de Icaza <miguel@ximian.com>
14462 * typemanager.cs (FilterWithClosure): Commented out the test for
14463 1540 in typemanager.cs, as it has problems when accessing
14464 protected methods from a parent class (see test-174.cs).
14466 * attribute.cs (Attribute.ValidateGuid): new method.
14467 (Attribute.Resolve): Use above.
14469 2002-11-19 Miguel de Icaza <miguel@ximian.com>
14471 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14473 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14474 handling for enumerations, as we only needed the TypeContainer
14475 functionality to begin with (this is required for the fix below to
14476 work for enums that reference constants in a container class for
14479 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14481 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14482 a valid TypeBuilder to perform lookups on.o
14484 * class.cs (InheritableMemberSignatureCompare): Use true in the
14485 call to GetGetMethod and GetSetMethod, because we are comparing
14486 the signature, and we need to get the methods *even* if they are
14489 (PropertyBase.CheckBase): ditto.
14491 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14492 GotoCase.Resolve): Use Peel on EmpytCasts.
14494 * ecore.cs (EmptyCast): drop child, add Peel method.
14496 2002-11-17 Martin Baulig <martin@ximian.com>
14498 * ecore.cs (EmptyCast.Child): New public property.
14500 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14501 label resolved to an EmptyCast. Fixes #34162.
14502 (GotoCase.Resolve): Likewise.
14503 (Block.EmitMeta): Likewise.
14505 2002-11-17 Martin Baulig <martin@ximian.com>
14507 * expression.cs (Invocation.BetterConversion): Prefer int over
14508 uint; short over ushort; long over ulong for integer literals.
14509 Use ImplicitConversionExists instead of StandardConversionExists
14510 since we also need to check for user-defined implicit conversions.
14511 Fixes #34165. Added test-173.cs.
14513 2002-11-16 Martin Baulig <martin@ximian.com>
14515 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14516 with the `true' and `false' literals. Fixes #33151.
14518 2002-11-16 Martin Baulig <martin@ximian.com>
14520 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14521 October 22nd; don't do the cs1540 check for static members.
14523 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14524 now using our own filter here and doing the cs1540 check again.
14526 2002-11-16 Martin Baulig <martin@ximian.com>
14528 * support.cs (InternalParameters): Don't crash if we don't have
14529 any fixed parameters. Fixes #33532.
14531 2002-11-16 Martin Baulig <martin@ximian.com>
14533 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14534 when looking up static methods to make this work on Windows.
14537 2002-11-16 Martin Baulig <martin@ximian.com>
14539 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14540 a setter rather than using PropertyInfo.CanWrite.
14542 2002-11-15 Nick Drochak <ndrochak@gol.com>
14544 * class.cs: Allow acces to block member by subclasses. Fixes build
14547 2002-11-14 Martin Baulig <martin@ximian.com>
14549 * class.cs (Constructor.Emit): Added the extern/block check.
14552 2002-11-14 Martin Baulig <martin@ximian.com>
14554 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14555 iteration while looking for indexers, this is needed because the
14556 indexer may have a different name in our base classes. Fixed the
14557 error reporting (no indexers at all, not get accessor, no
14558 overloaded match). Fixes bug #33089.
14559 (IndexerAccess.DoResolveLValue): Likewise.
14561 2002-11-14 Martin Baulig <martin@ximian.com>
14563 * class.cs (PropertyBase.CheckBase): Make this work for multiple
14564 indexers. Fixes the first part of bug #33089.
14565 (MethodSignature.InheritableMemberSignatureCompare): Added support
14568 2002-11-13 Ravi Pratap <ravi@ximian.com>
14570 * attribute.cs (Attribute.Resolve): Catch the
14571 NullReferenceException and report it since it isn't supposed to
14574 2002-11-12 Miguel de Icaza <miguel@ximian.com>
14576 * expression.cs (Binary.EmitBranchable): Also handle the cases for
14577 LogicalOr and LogicalAnd that can benefit from recursively
14578 handling EmitBranchable. The code now should be nice for Paolo.
14580 2002-11-08 Miguel de Icaza <miguel@ximian.com>
14582 * typemanager.cs (LookupType): Added a negative-hit hashtable for
14583 the Type lookups, as we perform quite a number of lookups on
14584 non-Types. This can be removed once we can deterministically tell
14585 whether we have a type or a namespace in advance.
14587 But this might require special hacks from our corlib.
14591 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14592 and double which avoids a conversion from an integer to a double.
14594 * expression.cs: tiny optimization, avoid calling IsConstant,
14595 because it effectively performs the lookup twice.
14597 2002-11-06 Miguel de Icaza <miguel@ximian.com>
14599 But a bogus return here to keep the semantics of the old code
14600 until the Mono runtime is fixed.
14602 * pending.cs (GetMissingInterfaces): New method used to remove all
14603 the interfaces that are already implemented by our parent
14604 classes from the list of pending methods.
14606 * interface.cs: Add checks for calls after ResolveTypeExpr.
14608 2002-11-05 Miguel de Icaza <miguel@ximian.com>
14610 * class.cs (Class.Emit): Report warning 67: event not used if the
14611 warning level is beyond 3.
14613 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14614 being a NullLiteral.
14616 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14619 * class.cs (TypeContainer.GetClassBases): Cover a missing code
14620 path that might fail if a type can not be resolved.
14622 * expression.cs (Binary.Emit): Emit unsigned versions of the
14625 * driver.cs: use error 5.
14627 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14629 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14631 2002-11-01 Miguel de Icaza <miguel@ximian.com>
14633 * cs-parser.jay (switch_section): A beautiful patch from Martin
14634 Baulig that fixed 33094.
14636 2002-10-31 Miguel de Icaza <miguel@ximian.com>
14638 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14639 Check whether the base is abstract and report an error if so.
14641 * expression.cs (IndexerAccess.DoResolveLValue,
14642 IndexerAccess.DoResolve): ditto.
14644 (Invocation.DoResolve): ditto.
14646 (Invocation.FullMethodDesc): Improve the report string.
14648 * statement.cs (Block): Eliminate IsVariableDefined as it is
14649 basically just a wrapper for GetVariableInfo.
14651 * ecore.cs (SimpleName): Use new
14653 * support.cs (ReflectionParamter.ParameterType): We unwrap the
14654 type, as we return the actual parameter ref/unref state on a
14657 2002-10-30 Miguel de Icaza <miguel@ximian.com>
14659 * support.cs: Return proper flags REF/OUT fixing the previous
14662 * expression.cs: Reverted last patch, that was wrong. Is_ref is
14663 not used to mean `ref' but `ref or out' in ParameterReference
14665 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
14666 full type signature instead of calling TypeManger.CSharpName
14669 * support.cs (InternalParameters.ParameterDesc): Do not compare
14670 directly to the modflags, because REF/OUT will actually be bitsets
14673 * delegate.cs (VerifyMethod): Check also the modifiers.
14675 * cs-tokenizer.cs: Fix bug where floating point values with an
14676 exponent where a sign was missing was ignored.
14678 * driver.cs: Allow multiple assemblies to be specified in a single
14681 2002-10-28 Miguel de Icaza <miguel@ximian.com>
14683 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
14684 because identifiers after a parenthesis would end up in this kind
14685 of production, and we needed to desamiguate it for having casts
14688 (UserDefinedType *) xxx
14690 2002-10-24 Miguel de Icaza <miguel@ximian.com>
14692 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14693 we should set on the Bindingflags.NonPublic, but not turn on
14694 private_ok. private_ok controls whether a Private member is
14695 returned (this is chekced on the filter routine), while the
14696 BindingFlags.NonPublic just controls whether private/protected
14697 will be allowed. This fixes the problem part of the problem of
14698 private properties being allowed to be used in derived classes.
14700 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14701 so we can call the children DoResolveLValue method (this will
14702 properly signal errors on lvalue assignments to base properties)
14704 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14705 getter are null, and we have a property info, we know that this
14706 happened because the lookup failed, so we report an error 122 for
14707 protection level violation.
14709 We also silently return if setter and getter are null in the
14710 resolve functions, this condition only happens if we have flagged
14711 the error before. This is the other half of the problem.
14713 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14714 not have accessibility information, that is why we were returning
14715 true in the filter function in typemanager.cs.
14717 To properly report 122 (property is inaccessible because of its
14718 protection level) correctly, we report this error in ResolveAccess
14719 by failing if both the setter and the getter are lacking (ie, the
14722 DoResolve and DoLResolve have been modified to check for both
14723 setter/getter being null and returning silently, the reason being
14724 that I did not want to put the knowledge about this error in upper
14727 int old = Report.Errors;
14728 x = new PropertyExpr (...);
14729 if (old != Report.Errors)
14734 So the property expr is returned, but it is invalid, so the error
14735 will be flagged during the resolve process.
14737 * class.cs: Remove InheritablePropertySignatureCompare from the
14738 class, as we no longer depend on the property signature to compute
14739 whether it is possible to implement a method or not.
14741 The reason is that calling PropertyInfo.GetGetMethod will return
14742 null (in .NET, in Mono it works, and we should change this), in
14743 cases where the Get Method does not exist in that particular
14748 class X { public virtual int A { get { return 1; } } }
14750 class Z : Y { public override int A { get { return 2; } } }
14752 Would fail in Z because the parent (Y) would not have the property
14753 defined. So we avoid this completely now (because the alternative
14754 fix was ugly and slow), and we now depend exclusively on the
14757 (PropertyBase.CheckBase): Use a method-base mechanism to find our
14758 reference method, instead of using the property.
14760 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14761 routines are gone now.
14763 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14764 names, they were incorrectly named.
14766 * cs-tokenizer.cs: Return are more gentle token on failure.
14768 * pending.cs (PendingImplementation.InterfaceMethod): This routine
14769 had an out-of-sync index variable, which caused it to remove from
14770 the list of pending methods the wrong method sometimes.
14772 2002-10-22 Miguel de Icaza <miguel@ximian.com>
14774 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14775 CanWrite, because those refer to this particular instance of the
14776 property, and do not take into account the fact that we can
14777 override single members of a property.
14779 Constructor requires an EmitContext. The resolution process does
14780 not happen here, but we need to compute the accessors before,
14781 because the resolution does not always happen for properties.
14783 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14784 subclass, before we did not update this flag, but we did update
14787 (GetAccessors): Drop this routine, as it did not work in the
14788 presence of partially overwritten set/get methods.
14790 Notice that this broke the cs1540 detection, but that will require
14793 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14797 * driver.cs: issue a warning instead of an error if we don't support
14798 debugging for the platform. Also ignore a couple of errors that may
14799 arise when trying to write the symbols. Undo my previous patch.
14801 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14803 * driver.cs: ignore /debug switch except for Unix platforms.
14805 2002-10-23 Nick Drochak <ndrochak@gol.com>
14807 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14809 2002-10-21 Miguel de Icaza <miguel@ximian.com>
14811 * driver.cs: Do not make mcs-debug conditional, so we do not break
14812 builds that use it.
14814 * statement.cs (UsageVector.MergeChildren): I would like Martin to
14815 review this patch. But basically after all the children variables
14816 have been merged, the value of "Breaks" was not being set to
14817 new_breaks for Switch blocks. I think that it should be set after
14818 it has executed. Currently I set this to the value of new_breaks,
14819 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14820 conservative, but I do not understand this code very well.
14822 I did not break anything in the build, so that is good ;-)
14824 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14826 2002-10-20 Mark Crichton <crichton@gimp.org>
14828 * cfold.cs: Fixed compile blocker. Really fixed it this time.
14830 2002-10-20 Nick Drochak <ndrochak@gol.com>
14832 * cfold.cs: Fixed compile blocker.
14834 2002-10-20 Miguel de Icaza <miguel@ximian.com>
14836 * driver.cs: I was chekcing the key, not the file.
14838 2002-10-19 Ravi Pratap <ravi@ximian.com>
14840 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14841 message that we were generating - we just need to silently return
14844 2002-10-19 Miguel de Icaza <miguel@ximian.com>
14846 * class.cs (Event.Define): Change my previous commit, as this
14847 breaks the debugger. This is a temporary hack, as it seems like
14848 the compiler is generating events incorrectly to begin with.
14850 * expression.cs (Binary.ResolveOperator): Added support for
14851 "U operator - (E x, E y)"
14853 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14856 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14857 init-only variables, but this path did not take into account that
14858 there might be also instance readonly variables. Correct this
14861 This fixes bug 32253
14863 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14866 * driver.cs: Change the extension for modules to `netmodule'
14868 * cs-parser.jay: Improved slightly the location tracking for
14869 the debugger symbols.
14871 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14872 modifiers that were specified instead of the hardcoded value
14873 (FamAndAssem). This was basically ignoring the static modifier,
14874 and others. Fixes 32429.
14876 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14877 fixed a bug in the process (32476)
14879 * expression.cs (ArrayAccess.EmitAssign): Patch from
14880 hwang_rob@yahoo.ca that fixes bug 31834.3
14882 2002-10-18 Miguel de Icaza <miguel@ximian.com>
14884 * driver.cs: Make the module extension .netmodule.
14886 2002-10-16 Miguel de Icaza <miguel@ximian.com>
14888 * driver.cs: Report an error if the resource file is not found
14889 instead of crashing.
14891 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14892 false, like Emit does.
14894 2002-10-16 Nick Drochak <ndrochak@gol.com>
14896 * typemanager.cs: Remove unused private member. Also reported mcs
14897 bug to report this as a warning like csc.
14899 2002-10-15 Martin Baulig <martin@gnome.org>
14901 * statement.cs (Statement.Emit): Made this a virtual method; emits
14902 the line number info and calls DoEmit().
14903 (Statement.DoEmit): New protected abstract method, formerly knows
14904 as Statement.Emit().
14906 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14908 2002-10-11 Miguel de Icaza <miguel@ximian.com>
14910 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14911 have fixed a remaining problem: not every AddXXXX was adding a
14912 fully qualified name.
14914 Now everyone registers a fully qualified name in the DeclSpace as
14915 being defined instead of the partial name.
14917 Downsides: we are slower than we need to be due to the excess
14918 copies and the names being registered this way.
14920 The reason for this is that we currently depend (on the corlib
14921 bootstrap for instance) that types are fully qualified, because
14922 we dump all the types in the namespace, and we should really have
14923 types inserted into the proper namespace, so we can only store the
14924 basenames in the defined_names array.
14926 2002-10-10 Martin Baulig <martin@gnome.org>
14928 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14929 from bug #31834, see the bug report for a testcase which is
14932 2002-10-10 Martin Baulig <martin@gnome.org>
14934 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14935 flow analysis code for this.
14937 * statement.cs (Do, While, For): Tell the flow analysis code about
14939 (FlowBranching.UsageVector): Added support for infinite loops.
14940 (Block.Resolve): Moved the dead code elimination here and use flow
14943 2002-10-09 Miguel de Icaza <miguel@ximian.com>
14945 * class.cs (Field.Define): Catch cycles on struct type
14948 * typemanager.cs (IsUnmanagedtype): Do not recursively check
14949 fields if the fields are static. We only need to check instance
14952 * expression.cs (As.DoResolve): Test for reference type.
14954 * statement.cs (Using.ResolveExpression): Use
14955 ConvertImplicitRequired, not ConvertImplicit which reports an
14957 (Using.ResolveLocalVariableDecls): ditto.
14959 * expression.cs (Binary.ResolveOperator): Report errors in a few
14960 places where we had to.
14962 * typemanager.cs (IsUnmanagedtype): Finish implementation.
14964 2002-10-08 Miguel de Icaza <miguel@ximian.com>
14966 * expression.cs: Use StoreFromPtr instead of extracting the type
14967 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
14969 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14970 an enumeration value to a System.Enum, but System.Enum is not a
14971 value type, but an class type, so we need to box.
14973 (Expression.ConvertExplicit): One codepath could return
14974 errors but not flag them. Fix this. Fixes #31853
14976 * parameter.cs (Resolve): Do not allow void as a parameter type.
14978 2002-10-06 Martin Baulig <martin@gnome.org>
14980 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14981 if it's a class type and not a struct. Fixes #31815.
14983 2002-10-06 Martin Baulig <martin@gnome.org>
14985 * statement.cs: Reworked the flow analysis code a bit to make it
14986 usable for dead code elimination.
14988 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14990 * cs-parser.jay: allow empty source files. Fixes bug #31781.
14992 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14994 * expression.cs (ComposedCast.DoResolveType): A quick workaround
14995 to fix the test 165, will investigate deeper.
14997 2002-10-04 Martin Baulig <martin@gnome.org>
14999 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15000 finally blocks actually work.
15001 (Try.Resolve): We don't need to create a sibling for `finally' if
15002 there is no finally block.
15004 2002-10-04 Martin Baulig <martin@gnome.org>
15006 * class.cs (Constructor.Define): The default accessibility for a
15007 non-default constructor is private, not public.
15009 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15011 * class.cs (Constructor): Make AllowedModifiers public, add
15014 * cs-parser.jay: Perform the modifiers test here, as the
15015 constructor for the Constructor class usually receives a zero
15016 because of the way we create it (first we create, later we
15017 customize, and we were never checking the modifiers).
15019 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15020 is a version of LookupTypeReflection that includes the type-name
15021 cache. This can be used as a fast path for functions that know
15022 the fully qualified name and are only calling into *.GetType() to
15023 obtain a composed type.
15025 This is also used by TypeManager.LookupType during its type
15028 (LookupType): We now also track the real type name, as sometimes
15029 we can get a quey for the real type name from things like
15030 ComposedCast. This fixes bug 31422.
15032 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15033 complete type fullname, it does not have to go through the type
15034 resolution system to obtain the composed version of the type (for
15035 obtaining arrays or pointers).
15037 (Conditional.Emit): Use the EmitBoolExpression to
15038 generate nicer code, as requested by Paolo.
15040 (ArrayCreation.CheckIndices): Use the patch from
15041 hwang_rob@yahoo.ca to validate the array initializers.
15043 2002-10-03 Miguel de Icaza <miguel@ximian.com>
15045 * class.cs (ConstructorInitializer.Emit): simplify code by using
15046 Invocation.EmitCall, and at the same time, fix the bugs in calling
15047 parent constructors that took variable arguments.
15049 * ecore.cs (Expression.ConvertNumericExplicit,
15050 Expression.ImplicitNumericConversion): Remove the code that
15051 manually wrapped decimal (InternalTypeConstructor call is now gone
15054 * expression.cs (Cast.TryReduce): Also handle decimal types when
15055 trying to perform a constant fold on the type.
15057 * typemanager.cs (IsUnmanagedtype): Partially implemented.
15059 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15060 that only turned off an error report, and did nothing else.
15062 2002-10-02 Miguel de Icaza <miguel@ximian.com>
15064 * driver.cs: Handle and ignore /fullpaths
15066 2002-10-01 Miguel de Icaza <miguel@ximian.com>
15068 * expression.cs (Binary.ResolveOperator): Catch the case where
15069 DoNumericPromotions returns true,
15071 (Binary.DoNumericPromotions): Simplify the code, and the tests.
15073 2002-09-27 Miguel de Icaza <miguel@ximian.com>
15075 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15078 2002-09-26 Miguel de Icaza <miguel@ximian.com>
15080 * ecore.cs (ConvertNumericExplicit): It is not enough that the
15081 conversion exists, but it is also required that the conversion be
15082 performed. This manifested in "(Type64Enum) 2".
15084 * class.cs (TypeManager.AddMethod): The fix is not to change
15085 AddEnum, because that one was using a fully qualified name (every
15086 DeclSpace derivative does), but to change the AddMethod routine
15087 that was using an un-namespaced name. This now correctly reports
15088 the duplicated name.
15090 Revert patch until I can properly fix it. The issue
15091 is that we have a shared Type space across all namespaces
15092 currently, which is wrong.
15094 Options include making the Namespace a DeclSpace, and merge
15095 current_namespace/current_container in the parser.
15097 2002-09-25 Miguel de Icaza <miguel@ximian.com>
15099 * cs-parser.jay: Improve error reporting when we get a different
15100 kind of expression in local_variable_type and
15101 local_variable_pointer_type.
15103 Propagate this to avoid missleading errors being reported.
15105 * ecore.cs (ImplicitReferenceConversion): treat
15106 TypeManager.value_type as a target just like object_type. As
15111 Is valid, and needs to result in the int 1 being boxed before it
15112 is assigned to the value type v.
15114 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15115 to validate the enumeration name.
15117 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15118 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
15119 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15121 * ecore.cs (TryImplicitIntConversion): When doing an
15122 implicit-enumeration-conversion, check if the type is 64-bits and
15123 perform a conversion before passing to EnumConstant.
15125 2002-09-23 Miguel de Icaza <miguel@ximian.com>
15127 * decl.cs (Error_AmbiguousTypeReference); New routine used to
15128 report ambiguous type references. Unlike the MS version, we
15129 report what the ambiguity is. Innovation at work ;-)
15131 (DeclSpace.FindType): Require a location argument to
15132 display when we display an ambiguous error.
15134 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15136 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15138 * expression.cs (EmitDynamicInitializers): Apply patch from
15139 hwang_rob@yahoo.ca that fixes the order in which we emit our
15142 2002-09-21 Martin Baulig <martin@gnome.org>
15144 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15145 delegate takes no arguments.
15147 2002-09-20 Miguel de Icaza <miguel@ximian.com>
15149 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15152 * expression.cs: Extract the underlying type.
15154 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15156 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15158 2002-09-19 Miguel de Icaza <miguel@ximian.com>
15160 * class.cs (TypeContainer.DefineType): We can not use the nice
15161 PackingSize with the size set to 1 DefineType method, because it
15162 will not allow us to define the interfaces that the struct
15165 This completes the fixing of bug 27287
15167 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15168 means also structs. This fixes part of the problem.
15169 (Expresion.ImplicitReferenceConversionExists): ditto.
15171 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15172 error if there were no errors reported during the type lookup
15173 process, to avoid duplicates or redundant errors. Without this
15174 you would get an ambiguous errors plus a type not found. We have
15175 beaten the user enough with the first error.
15177 (DeclSparce.FindType): Emit a warning if we have an ambiguous
15180 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15181 during the resolution process, stop the lookup, this avoids
15182 repeated error reports (same error twice).
15184 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15186 * typemanager.cs (LookupType): Redo the type lookup code to match
15187 the needs of System.Reflection.
15189 The issue is that System.Reflection requires references to nested
15190 types to begin with a "+" sign instead of a dot. So toplevel
15191 types look like: "NameSpace.TopLevelClass", and nested ones look
15192 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15195 2002-09-19 Martin Baulig <martin@gnome.org>
15197 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15198 says that a method always returns or always throws an exception,
15199 don't report the CS0161.
15201 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15202 set `Returns = new_returns'.
15204 2002-09-19 Martin Baulig <martin@gnome.org>
15206 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15207 to an enum constant, check for a CS0176.
15209 2002-09-18 Miguel de Icaza <miguel@ximian.com>
15211 * class.cs (TypeContainer.CheckPairedOperators): Now we check
15212 for operators that must be in pairs and report errors.
15214 * ecore.cs (SimpleName.DoResolveType): During the initial type
15215 resolution process, when we define types recursively, we must
15216 check first for types in our current scope before we perform
15217 lookups in the enclosing scopes.
15219 * expression.cs (MakeByteBlob): Handle Decimal blobs.
15221 (Invocation.VerifyArgumentsCompat): Call
15222 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15223 I thought we were supposed to always call this, but there are a
15224 few places in the code where we dont do it.
15226 2002-09-17 Miguel de Icaza <miguel@ximian.com>
15228 * driver.cs: Add support in -linkres and -resource to specify the
15229 name of the identifier.
15231 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15233 * ecore.cs (StandardConversionExists): Sync with the conversion
15234 code: allow anything-* to void* conversions.
15236 (FindMostSpecificSource): Use an Expression argument
15237 instead of a Type, because we might be handed over a Literal which
15238 gets a few more implicit conversions that plain types do not. So
15239 this information was being lost.
15241 Also, we drop the temporary type-holder expression when not
15244 2002-09-17 Martin Baulig <martin@gnome.org>
15246 * class.cs (PropertyBase.CheckBase): Don't check the base class if
15247 this is an explicit interface implementation.
15249 2002-09-17 Martin Baulig <martin@gnome.org>
15251 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15252 different `IndexerName' attributes.
15254 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15255 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15256 virtual CommonResolve().
15258 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15260 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15261 and convert that to the UnderlyingType.
15263 * statement.cs (Foreach.Resolve): Indexers are just like variables
15264 or PropertyAccesses.
15266 * cs-tokenizer.cs (consume_string): Track line numbers and columns
15267 inside quoted strings, we were not doing this before.
15269 2002-09-16 Martin Baulig <martin@gnome.org>
15271 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15272 resolve it. This is needed for the definite assignment check of the
15273 instance expression, fixes bug #29846.
15274 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15276 2002-09-16 Nick Drochak <ndrochak@gol.com>
15278 * parameter.cs: Fix compile error. Cannot reference static member
15279 from an instance object. Is this an mcs bug?
15281 2002-09-14 Martin Baulig <martin@gnome.org>
15283 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15284 multiple times. Fixes bug #30295, added test-166.cs.
15286 2002-09-14 Martin Baulig <martin@gnome.org>
15288 * statement.cs (Block.Emit): Don't emit unreachable code.
15289 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15290 `break' statements.
15291 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15293 2002-09-14 Martin Baulig <martin@gnome.org>
15295 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15298 2002-09-14 Martin Baulig <martin@gnome.org>
15300 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15301 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15302 be false on the ms runtime.
15304 2002-09-13 Martin Baulig <martin@gnome.org>
15306 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15307 the CS0038 error message.
15309 2002-09-12 Miguel de Icaza <miguel@ximian.com>
15311 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15312 constant inside, return it.
15314 2002-09-12 Martin Baulig <martin@gnome.org>
15316 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15317 implicit conversion can be done between enum types.
15319 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15320 check whether an implicit conversion to the current enum's UnderlyingType
15321 exists and report an error if not.
15323 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15324 without debugging support.
15326 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15327 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
15329 2002-09-12 Martin Baulig <martin@gnome.org>
15331 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15333 * ecore.cs (IMemberExpr.DeclaringType): New property.
15334 (SimpleName.SimpleNameResolve): Check whether we're accessing a
15335 nonstatic member of an outer type (CS0038).
15337 2002-09-11 Miguel de Icaza <miguel@ximian.com>
15339 * driver.cs: Activate the using-error detector at warning level
15340 4 (at least for MS-compatible APIs).
15342 * namespace.cs (VerifyUsing): Small buglett fix.
15344 * pending.cs (PendingImplementation): pass the container pointer.
15346 * interface.cs (GetMethods): Allow for recursive definition. Long
15347 term, I would like to move every type to support recursive
15348 definitions, not the current ordering mechanism that we have right
15351 The situation is this: Attributes are handled before interfaces,
15352 so we can apply attributes to interfaces. But some attributes
15353 implement interfaces, we will now handle the simple cases
15354 (recursive definitions will just get an error).
15356 * parameter.cs: Only invalidate types at the end if we fail to
15359 2002-09-09 Martin Baulig <martin@gnome.org>
15361 * ecore.cs (PropertyExpr.Emit): Also check for
15362 TypeManager.system_int_array_get_length so this'll also work when
15363 compiling corlib. Fixes #30003.
15365 2002-09-09 Martin Baulig <martin@gnome.org>
15367 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15368 and throw an exception if we can't get the type's size. Fixed #30040,
15371 2002-09-09 Martin Baulig <martin@gnome.org>
15373 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15375 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15376 context. Fixes bug #30027.
15378 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15379 virtual functions. Fixes bug #30043, added test-164.cs.
15381 2002-09-08 Ravi Pratap <ravi@ximian.com>
15383 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15385 2002-09-08 Nick Drochak <ndrochak@gol.com>
15387 * driver.cs: Use an object to get the windows codepage since it's not a
15390 2002-09-08 Miguel de Icaza <miguel@ximian.com>
15392 * statement.cs (For.Emit): for infinite loops (test == null)
15393 return whether there is a break inside, not always "true".
15395 * namespace.cs (UsingEntry): New struct to hold the name of the
15396 using definition, the location where it is defined, and whether it
15397 has been used in a successful type lookup.
15399 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15404 2002-09-06 Ravi Pratap <ravi@ximian.com>
15406 * attribute.cs : Fix incorrect code which relied on catching
15407 a NullReferenceException to detect a null being passed in
15408 where an object was expected.
15410 2002-09-06 Miguel de Icaza <miguel@ximian.com>
15412 * statement.cs (Try): flag the catch variable as assigned
15414 * expression.cs (Cast): Simplified by using ResolveType instead of
15415 manually resolving.
15417 * statement.cs (Catch): Fix bug by using ResolveType.
15419 2002-09-06 Ravi Pratap <ravi@ximian.com>
15421 * expression.cs (BetterConversion): Special case for when we have
15422 a NullLiteral as the argument and we have to choose between string
15423 and object types - we choose string the way csc does.
15425 * attribute.cs (Attribute.Resolve): Catch the
15426 NullReferenceException and report error #182 since the Mono
15427 runtime no more has the bug and having this exception raised means
15428 we tried to select a constructor which takes an object and is
15431 2002-09-05 Ravi Pratap <ravi@ximian.com>
15433 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15434 message (1502, 1503) when we can't locate a method after overload
15435 resolution. This is much more informative and closes the bug
15438 * interface.cs (PopulateMethod): Return if there are no argument
15439 types. Fixes a NullReferenceException bug.
15441 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15442 expressions too. Previously we were checking only in one place for
15443 positional arguments leaving out named arguments.
15445 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15446 type to the enum type is not allowed. Remove code corresponding to
15449 (ConvertNumericExplicit): Allow explicit conversions from
15450 the underlying type to enum type. This precisely follows the spec
15451 and closes a bug filed by Gonzalo.
15453 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15456 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15458 2002-09-03 Miguel de Icaza <miguel@ximian.com>
15460 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15461 it was important that we stored the right value after the
15462 reduction in `converted'.
15464 2002-09-04 Martin Baulig <martin@gnome.org>
15466 * location.cs (Location.SymbolDocument): Use full pathnames for the
15469 2002-08-30 Miguel de Icaza <miguel@ximian.com>
15471 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15472 of the expression resolve mechanism, because that will catch the
15473 SimpleName error failures.
15475 (Conditional): If we can not resolve the
15476 expression, return, do not crash.
15478 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15481 (location): display token name instead of its number.
15483 2002-08-28 Martin Baulig <martin@gnome.org>
15485 * expression.cs (Binary.ResolveOperator): Don't silently return
15486 but return an error if an operator cannot be applied between two
15489 2002-08-28 Martin Baulig <martin@gnome.org>
15491 * class.cs (Constructor.Define): Set the permission attributes
15492 correctly instead of making all constructors public.
15494 2002-08-28 Martin Baulig <martin@gnome.org>
15496 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15497 for private members before reporting a CS0103; if we find anything,
15500 2002-08-28 Martin Baulig <martin@gnome.org>
15502 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15503 to check whether `closure_start_type == closure_invocation_type',
15504 we also need to check whether `m.DeclaringType == closure_invocation_type'
15505 before bypassing the permission checks. We might be accessing
15506 protected/private members from the base class.
15507 (TypeManager.RealMemberLookup): Only set private_ok if private
15508 members were requested via BindingFlags.NonPublic.
15510 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15512 * expression.cs (MemberAccess.ResolveMemberAccess): Set
15513 MethodGroupExpr.IsExplicitImpl if appropriate.
15514 (Invocation.DoResolve): Don't report the CS0120 for explicit
15515 interface implementations.
15517 2002-08-27 Martin Baulig <martin@gnome.org>
15519 * expression.cs (Invocation.DoResolve): If this is a static
15520 method and we don't have an InstanceExpression, we must report
15523 2002-08-25 Martin Baulig <martin@gnome.org>
15525 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15526 `==' between a valuetype and an object.
15528 2002-08-25 Miguel de Icaza <miguel@ximian.com>
15530 * ecore.cs (TypeExpr): Provide a ToString method.
15532 2002-08-24 Martin Baulig <martin@gnome.org>
15534 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15535 now called proggie.dbg and it's a binary file.
15537 2002-08-23 Martin Baulig <martin@gnome.org>
15539 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15541 2002-08-23 Martin Baulig <martin@gnome.org>
15543 * struct.cs (MyStructInfo.ctor): Make this work with empty
15544 structs; it's not allowed to use foreach() on null.
15546 2002-08-23 Martin Baulig <martin@gnome.org>
15548 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15549 writer the full pathname of the generated assembly.
15551 2002-08-23 Martin Baulig <martin@gnome.org>
15553 * statements.cs (FlowBranching.UsageVector.MergeChildren):
15554 A `finally' block never returns or breaks; improved handling of
15557 2002-08-23 Martin Baulig <martin@gnome.org>
15559 * statement.cs (Throw.Resolve): Allow `throw null'.
15561 2002-08-23 Martin Baulig <martin@gnome.org>
15563 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15564 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15565 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
15566 MemberLookup would return a wrong event if this is an explicit
15567 interface implementation and the class has an event with the same
15570 2002-08-23 Martin Baulig <martin@gnome.org>
15572 * statement.cs (Block.AddChildVariableNames): New public method.
15573 (Block.AddChildVariableName): Likewise.
15574 (Block.IsVariableNameUsedInChildBlock): Likewise.
15575 (Block.AddVariable): Check whether a variable name has already
15576 been used in a child block.
15578 * cs-parser.jay (declare_local_variables): Mark all variable names
15579 from the current block as being used in a child block in the
15582 2002-08-23 Martin Baulig <martin@gnome.org>
15584 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15585 find the symbol writer.
15587 * driver.cs: csc also allows the arguments to /define being
15588 separated by commas, not only by semicolons.
15590 2002-08-23 Martin Baulig <martin@gnome.org>
15592 * interface.cs (Interface.GetMembers): Added static check for events.
15594 2002-08-15 Martin Baulig <martin@gnome.org>
15596 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15597 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15599 * ecore.cs (Expression.MemberLookup): Added documentation and explained
15600 why the MethodData.EmitDestructor() change was necessary.
15602 2002-08-20 Martin Baulig <martin@gnome.org>
15604 * class.cs (TypeContainer.FindMembers): Added static check for events.
15606 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15608 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15609 use Type.GetEvents(), not Type.FindMembers().
15611 2002-08-20 Martin Baulig <martin@gnome.org>
15613 * decl.cs (MemberCache): Added a special method cache which will
15614 be used for method-only searched. This ensures that a method
15615 search will return a MethodInfo with the correct ReflectedType for
15618 2002-08-20 Martin Baulig <martin@gnome.org>
15620 * decl.cs (DeclSpace.FindMembers): Made this public.
15622 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15624 * delegate.cs: fixed build on windows.
15625 [FIXME: Filed as bug #29150: MCS must report these errors.]
15627 2002-08-19 Ravi Pratap <ravi@ximian.com>
15629 * ecore.cs (StandardConversionExists): Return a false
15630 if we are trying to convert the void type to anything else
15631 since that is not allowed.
15633 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15634 we flag error 70 in the event an event is trying to be accessed
15635 directly from outside the declaring type.
15637 2002-08-20 Martin Baulig <martin@gnome.org>
15639 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
15640 MemberCache from typemanager.cs to decl.cs.
15642 2002-08-19 Martin Baulig <martin@gnome.org>
15644 * class.cs (TypeContainer): Implement IMemberContainer.
15645 (TypeContainer.DefineMembers): Create the MemberCache.
15646 (TypeContainer.FindMembers): Do better BindingFlags checking; only
15647 return public members if BindingFlags.Public was given, check
15648 whether members are static.
15650 2002-08-16 Martin Baulig <martin@gnome.org>
15652 * decl.cs (DeclSpace.Define): Splitted this in Define and
15653 DefineMembers. DefineMembers is called first and initializes the
15656 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
15657 DefineMembers() on all our DeclSpaces.
15659 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
15660 but call DefineMembers() on all nested interfaces. We call their
15661 Define() in our new Define() function.
15663 * interface.cs (Interface): Implement IMemberContainer.
15664 (Interface.Define): Moved all code except the attribute stuf to
15666 (Interface.DefineMembers): Initialize the member cache.
15668 * typemanager.cs (IMemberFinder): Removed this interface, we don't
15669 need this anymore since we can use MemberCache.FindMembers directly.
15671 2002-08-19 Martin Baulig <martin@gnome.org>
15673 * typemanager.cs (MemberCache): When creating the cache for an
15674 interface type, add all inherited members.
15675 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
15676 to `out bool used_cache' and documented it.
15677 (TypeManager.MemberLookup): If we already used the cache in the first
15678 iteration, we don't need to do the interfaces check.
15680 2002-08-19 Martin Baulig <martin@gnome.org>
15682 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
15683 here from IMemberFinder and don't implement this interface anymore.
15684 (DeclSpace.MemberCache): Moved here from IMemberFinder.
15686 * typemanager.cs (IMemberFinder): This interface is now only used by
15687 classes which actually support the member cache.
15688 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15689 since we only put DeclSpaces into this Hashtable.
15690 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15691 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15693 2002-08-16 Martin Baulig <martin@gnome.org>
15695 * typemanager.cs (ICachingMemberFinder): Removed.
15696 (IMemberFinder.MemberCache): New property.
15697 (TypeManager.FindMembers): Merged this with RealFindMembers().
15698 This function will never be called from TypeManager.MemberLookup()
15699 so we can't use the cache here, just the IMemberFinder.
15700 (TypeManager.MemberLookup_FindMembers): Check whether the
15701 IMemberFinder has a MemberCache and call the cache's FindMembers
15703 (MemberCache): Rewrote larger parts of this yet another time and
15704 cleaned it up a bit.
15706 2002-08-15 Miguel de Icaza <miguel@ximian.com>
15708 * driver.cs (LoadArgs): Support quoting.
15710 (Usage): Show the CSC-like command line arguments.
15712 Improved a few error messages.
15714 2002-08-15 Martin Baulig <martin@gnome.org>
15716 * typemanager.cs (IMemberContainer.Type): New property.
15717 (IMemberContainer.IsInterface): New property.
15719 The following changes are conditional to BROKEN_RUNTIME, which is
15720 defined at the top of the file.
15722 * typemanager.cs (MemberCache.MemberCache): Don't add the base
15723 class'es members, but add all members from TypeHandle.ObjectType
15724 if we're an interface.
15725 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15726 is the current type.
15727 (MemberCache.CacheEntry.Container): Removed this field.
15728 (TypeHandle.GetMembers): Include inherited members.
15730 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15732 * typemanager.cs: fixed compilation and added a comment on a field that
15735 2002-08-15 Martin Baulig <martin@gnome.org>
15737 * class.cs (ConstructorInitializer.Resolve): In the
15738 Expression.MemberLookup call, use the queried_type as
15741 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15742 declared' attribute, it's always true.
15743 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15744 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15745 temporary wrapper for FindMembers which tells MemberLookup whether
15746 members from the base classes are included in the return value.
15747 This will go away soon.
15748 (TypeManager.MemberLookup): Use this temporary hack here; once the
15749 new MemberCache is completed, we don't need to do the DeclaredOnly
15750 looping here anymore since the MemberCache will take care of this.
15751 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15752 (MemberCache): When creating the MemberCache for a class, get
15753 members from the current class and all its base classes.
15754 (MemberCache.CacheEntry.Container): New field. This is a
15755 temporary hack until the Mono runtime is fixed to distinguish
15756 between ReflectedType and DeclaringType. It allows us to use MCS
15757 with both the MS runtime and the unfixed Mono runtime without
15758 problems and without accecting performance.
15759 (MemberCache.SearchMembers): The DeclaredOnly looping from
15760 TypeManager.MemberLookup is now done here.
15762 2002-08-14 Martin Baulig <martin@gnome.org>
15764 * statement.cs (MyStructInfo.MyStructInfo): Don't call
15765 Type.GetFields on dynamic types but get the fields from the
15766 corresponding TypeContainer.
15767 (MyStructInfo.GetStructInfo): Added check for enum types.
15769 * typemanager.cs (MemberList.IsSynchronized): Implemented.
15770 (MemberList.SyncRoot): Implemented.
15771 (TypeManager.FilterWithClosure): No need to check permissions if
15772 closure_start_type == closure_invocation_type, don't crash if
15773 closure_invocation_type is null.
15775 2002-08-13 Martin Baulig <martin@gnome.org>
15777 Rewrote TypeContainer.FindMembers to use a member cache. This
15778 gives us a speed increase of about 35% for the self-hosting MCS
15779 build and of about 15-20% for the class libs (both on GNU/Linux).
15781 * report.cs (Timer): New class to get enhanced profiling. This
15782 whole class is "TIMER" conditional since it remarkably slows down
15785 * class.cs (MemberList): New class. This is an IList wrapper
15786 which we're now using instead of passing MemberInfo[]'s around to
15787 avoid copying this array unnecessarily.
15788 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15789 (ICachingMemberFinder, IMemberContainer): New interface.
15790 (TypeManager.FilterWithClosure): If `criteria' is null, the name
15791 has already been checked, otherwise use it for the name comparision.
15792 (TypeManager.FindMembers): Renamed to RealMemberFinder and
15793 provided wrapper which tries to use ICachingMemberFinder.FindMembers
15794 if possible. Returns a MemberList, not a MemberInfo [].
15795 (TypeHandle): New class, implements IMemberContainer. We create
15796 one instance of this class per type, it contains a MemberCache
15797 which is used to do the member lookups.
15798 (MemberCache): New class. Each instance of this class contains
15799 all members of a type and a name-based hash table.
15800 (MemberCache.FindMembers): This is our new member lookup
15801 function. First, it looks up all members of the requested name in
15802 the hash table. Then, it walks this list and sorts out all
15803 applicable members and returns them.
15805 2002-08-13 Martin Baulig <martin@gnome.org>
15807 In addition to a nice code cleanup, this gives us a performance
15808 increase of about 1.4% on GNU/Linux - not much, but it's already
15809 half a second for the self-hosting MCS compilation.
15811 * typemanager.cs (IMemberFinder): New interface. It is used by
15812 TypeManager.FindMembers to call FindMembers on a TypeContainer,
15813 Enum, Delegate or Interface.
15814 (TypeManager.finder_to_member_finder): New PtrHashtable.
15815 (TypeManager.finder_to_container): Removed.
15816 (TypeManager.finder_to_delegate): Removed.
15817 (TypeManager.finder_to_interface): Removed.
15818 (TypeManager.finder_to_enum): Removed.
15820 * interface.cs (Interface): Implement IMemberFinder.
15822 * delegate.cs (Delegate): Implement IMemberFinder.
15824 * enum.cs (Enum): Implement IMemberFinder.
15826 * class.cs (TypeContainer): Implement IMemberFinder.
15828 2002-08-12 Martin Baulig <martin@gnome.org>
15830 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15832 2002-08-12 Martin Baulig <martin@gnome.org>
15834 * ecore.cs (ITypeExpression): New interface for expressions which
15836 (TypeExpression): Renamed to TypeLookupExpression.
15837 (Expression.DoResolve): If we're doing a types-only lookup, the
15838 expression must implement the ITypeExpression interface and we
15839 call DoResolveType() on it.
15840 (SimpleName): Implement the new ITypeExpression interface.
15841 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15842 hack, the situation that we're only looking up types can't happen
15843 anymore when this method is called. Moved the type lookup code to
15844 DoResolveType() and call it.
15845 (SimpleName.DoResolveType): This ITypeExpression interface method
15846 is now doing the types-only lookup.
15847 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15848 (ResolveFlags): Added MaskExprClass.
15850 * expression.cs (MemberAccess): Implement the ITypeExpression
15852 (MemberAccess.DoResolve): Added support for a types-only lookup
15853 when we're called via ITypeExpression.DoResolveType().
15854 (ComposedCast): Implement the ITypeExpression interface.
15856 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
15857 Expression.Resolve() with ResolveFlags.Type instead.
15859 2002-08-12 Martin Baulig <martin@gnome.org>
15861 * interface.cs (Interface.Define): Apply attributes.
15863 * attribute.cs (Attribute.ApplyAttributes): Added support for
15864 interface attributes.
15866 2002-08-11 Martin Baulig <martin@gnome.org>
15868 * statement.cs (Block.Emit): Only check the "this" variable if we
15869 do not always throw an exception.
15871 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15872 whether the property has a set accessor.
15874 2002-08-11 Martin Baulig <martin@gnome.org>
15876 Added control flow analysis support for structs.
15878 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15879 with control flow analysis turned off.
15880 (IVariable): New interface.
15881 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15882 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15883 (FieldExpr.DoResolve): Resolve the instance expression with flow
15884 analysis turned off and do the definite assignment check after the
15885 resolving when we know what the expression will resolve to.
15887 * expression.cs (LocalVariableReference, ParameterReference):
15888 Implement the new IVariable interface, only call the flow analysis
15889 code if ec.DoFlowAnalysis is true.
15890 (This): Added constructor which takes a Block argument. Implement
15891 the new IVariable interface.
15892 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15893 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15894 This does the definite assignment checks for struct members.
15896 * class.cs (Constructor.Emit): If this is a non-static `struct'
15897 constructor which doesn't have any initializer, call
15898 Block.AddThisVariable() to tell the flow analysis code that all
15899 struct elements must be initialized before control returns from
15902 * statement.cs (MyStructInfo): New public class.
15903 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15904 argument to this indexer. If non-zero, check an individual struct
15905 member, not the whole struct.
15906 (FlowBranching.CheckOutParameters): Check struct members.
15907 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15908 overloaded versions of these methods which take an additional
15909 `int field_idx' argument to check struct members.
15910 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15911 overloaded versions of these methods which take an additional
15912 `string field_name' argument to check struct member.s
15913 (VariableInfo): Implement the IVariable interface.
15914 (VariableInfo.StructInfo): New public property. Returns the
15915 MyStructInfo instance of the variable if it's a struct or null.
15916 (Block.AddThisVariable): New public method. This is called from
15917 Constructor.Emit() for non-static `struct' constructor which do
15918 not have any initializer. It creates a special variable for the
15919 "this" instance variable which will be checked by the flow
15920 analysis code to ensure that all of the struct's fields are
15921 initialized before control returns from the constructor.
15922 (UsageVector): Added support for struct members. If a
15923 variable/parameter is a struct with N members, we reserve a slot
15924 in the usage vector for each member. A struct is considered fully
15925 initialized if either the struct itself (slot 0) or all its
15926 members are initialized.
15928 2002-08-08 Martin Baulig <martin@gnome.org>
15930 * driver.cs (Driver.MainDriver): Only report an error CS5001
15931 if there were no compilation errors.
15933 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15934 `UnsafeContext' property to determine whether the parent is in
15935 unsafe context rather than checking the parent's ModFlags:
15936 classes nested in an unsafe class are unsafe as well.
15938 2002-08-08 Martin Baulig <martin@gnome.org>
15940 * statement.cs (UsageVector.MergeChildren): Distinguish between
15941 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15942 we return. Added test17() and test18() to test-154.cs.
15944 2002-08-08 Martin Baulig <martin@gnome.org>
15946 * typemanager.cs (TypeManager.FilterWithClosure): If we have
15947 Family access, make sure the invoking type isn't a subclass of the
15948 queried type (that'd be a CS1540).
15950 * ecore.cs (Expression.MemberLookup): Added overloaded version of
15951 this method which takes an additional `Type invocation_type'.
15953 * expression.cs (BaseAccess.DoResolve): Use the base type as
15954 invocation and query type.
15955 (MemberAccess.DoResolve): If the lookup failed and we're about to
15956 report a CS0122, try a lookup with the ec.ContainerType - if this
15957 succeeds, we must report a CS1540.
15959 2002-08-08 Martin Baulig <martin@gnome.org>
15961 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15962 (MethodGroupExpr): Implement the IMemberExpr interface.
15964 * expression (MemberAccess.ResolveMemberAccess): No need to have
15965 any special code for MethodGroupExprs anymore, they're now
15968 2002-08-08 Martin Baulig <martin@gnome.org>
15970 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15971 Family, FamANDAssem and FamORAssem permissions.
15972 (TypeManager.IsSubclassOrNestedChildOf): New public method.
15974 2002-08-08 Martin Baulig <martin@gnome.org>
15976 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15977 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15980 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15982 * driver.cs: implemented /resource option to embed managed resources.
15984 2002-08-07 Martin Baulig <martin@gnome.org>
15986 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15987 (FieldBase.HasFieldInitializer): New public property.
15988 (FieldBase.GetInitializerExpression): New public method. Resolves and
15989 returns the field initializer and makes sure it is only resolved once.
15990 (TypeContainer.EmitFieldInitializers): Call
15991 FieldBase.GetInitializerExpression to get the initializer, this ensures
15992 that it isn't resolved multiple times.
15994 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
15995 the resolving process (SimpleName/MemberLookup) that we're currently
15996 emitting a field initializer (which must not access any instance members,
15997 this is an error CS0236).
15999 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16000 argument, if the `IsFieldInitializer' flag is set, we must report and
16001 error CS0236 and not an error CS0120.
16003 2002-08-07 Martin Baulig <martin@gnome.org>
16005 * ecore.cs (IMemberExpr): New public interface.
16006 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16007 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16008 if the expression is an IMemberExpr.
16010 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16011 to be null, implicitly default to `this' if we're non-static in
16012 this case. Simplified the code a lot by using the new IMemberExpr
16013 interface. Also fixed bug #28176 here.
16015 2002-08-06 Martin Baulig <martin@gnome.org>
16017 * cs-parser.jay (SimpleLookup): Removed. We need to create
16018 ParameterReferences during semantic analysis so that we can do a
16019 type-only search when resolving Cast, TypeOf and SizeOf.
16020 (block): Pass the `current_local_parameters' to the Block's
16023 * class.cs (ConstructorInitializer): Added `Parameters parameters'
16024 argument to the constructor.
16025 (ConstructorInitializer.Resolve): Create a temporary implicit
16026 block with the parameters.
16028 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16029 references here if we aren't doing a type-only search.
16031 * statement.cs (Block): Added constructor which takes a
16032 `Parameters parameters' argument.
16033 (Block.Parameters): New public property.
16035 * support.cs (InternalParameters.Parameters): Renamed `parameters'
16036 to `Parameters' and made it public readonly.
16038 2002-08-06 Martin Baulig <martin@gnome.org>
16040 * ecore.cs (Expression.Warning): Made this public as well.
16042 * report.cs (Report.Debug): Print the contents of collections.
16044 2002-08-06 Martin Baulig <martin@gnome.org>
16046 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
16047 used to tell Resolve() which kinds of expressions it may return.
16048 (Expression.Resolve): Added overloaded version of this method which
16049 takes a `ResolveFlags flags' argument. This can be used to tell
16050 Resolve() which kinds of expressions it may return. Reports a
16052 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16053 ResolveFlags.SimpleName.
16054 (Expression.Error118): Added overloaded version of this method which
16055 takes a `ResolveFlags flags' argument. It uses the flags to determine
16056 which kinds of expressions are allowed.
16058 * expression.cs (Argument.ResolveMethodGroup): New public method.
16059 Resolves an argument, but allows a MethodGroup to be returned.
16060 This is used when invoking a delegate.
16062 * TODO: Updated a bit.
16064 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16066 Fixed compilation with csc.
16068 * ecore.cs: Expression.Error made public. Is this correct? Should
16069 Warning be made public too?
16071 * expression.cs: use ea.Location instead of ea.loc.
16072 [FIXME: Filed as bug #28607: MCS must report these errors.]
16074 2002-08-06 Martin Baulig <martin@gnome.org>
16076 * ecore.cs (Expression.loc): Moved the location here instead of
16077 duplicating it in all derived classes.
16078 (Expression.Location): New public property.
16079 (Expression.Error, Expression.Warning): Made them non-static and
16080 removed the location argument.
16081 (Expression.Warning): Added overloaded version which takes an
16082 `int level' argument.
16083 (Expression.Error118): Make this non-static and removed the
16084 expression and location arguments.
16085 (TypeExpr): Added location argument to the constructor.
16087 * expression.cs (StaticCallExpr): Added location argument to
16089 (Indirection, PointerArithmetic): Likewise.
16090 (CheckedExpr, UnCheckedExpr): Likewise.
16091 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16092 (StringPtr): Likewise.
16095 2002-08-05 Martin Baulig <martin@gnome.org>
16097 * expression.cs (BaseAccess.DoResolve): Actually report errors.
16099 * assign.cs (Assign.DoResolve): Check whether the source
16100 expression is a value or variable.
16102 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16103 while resolving the corresponding blocks.
16105 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16106 an error, don't silently return null.
16108 * statement.cs (Block.AddVariable): Do the error reporting here
16109 and distinguish between CS0128 and CS0136.
16110 (Block.DoResolve): Report all unused labels (warning CS0164).
16111 (LabeledStatement): Pass the location to the constructor.
16112 (LabeledStatement.HasBeenReferenced): New property.
16113 (LabeledStatement.Resolve): Set it to true here.
16115 * statement.cs (Return.Emit): Return success even after reporting
16116 a type mismatch error (CS0126 or CS0127), this is what csc does and
16117 it avoids confusing the users with any consecutive errors.
16119 2002-08-05 Martin Baulig <martin@gnome.org>
16121 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16123 * const.cs (Const.LookupConstantValue): Catch circular definitions.
16125 * expression.cs (MemberAccess.DoResolve): Silently return if an
16126 error has already been reported.
16128 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16129 error has already been reported.
16131 2002-08-05 Martin Baulig <martin@gnome.org>
16133 * statement.cs (UsageVector): Only initialize the `parameters'
16134 vector if we actually have any "out" parameters.
16136 2002-08-05 Martin Baulig <martin@gnome.org>
16138 * expression.cs (Binary.ResolveOperator): When combining delegates,
16139 they must have the same type.
16141 2002-08-05 Martin Baulig <martin@gnome.org>
16143 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16144 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16145 work with the ms runtime and we also don't need it: if we're a
16146 PropertyBuilder and not in the `indexer_arguments' hash, then we
16147 are a property and not an indexer.
16149 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16150 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16151 since the latter one doesn't work with the ms runtime.
16153 2002-08-03 Martin Baulig <martin@gnome.org>
16155 Fixed bugs #27998 and #22735.
16157 * class.cs (Method.IsOperator): New public field.
16158 (Method.CheckBase): Report CS0111 if there's already a method
16159 with the same parameters in the current class. Report CS0508 when
16160 attempting to change the return type of an inherited method.
16161 (MethodData.Emit): Report CS0179 if a method doesn't have a body
16162 and it's not marked abstract or extern.
16163 (PropertyBase): New abstract base class for Property and Indexer.
16164 (PropertyBase.CheckBase): Moved here from Property and made it work
16166 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16167 the same so we can reuse it there.
16168 (Property, Indexer): Derive from PropertyBase.
16169 (MethodSignature.inheritable_property_signature_filter): New delegate
16170 to find properties and indexers.
16172 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16173 argument and improved error reporting.
16175 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16176 EmptyReadOnlyParameters and made it a property.
16178 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16179 version of this method which takes a `PropertyInfo indexer'.
16180 (TypeManager.RegisterIndexer): New method.
16182 * class.cs: Added myself as author of this file :-)
16184 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16186 * class.cs: fixed compilation on windoze.
16188 2002-08-03 Martin Baulig <martin@gnome.org>
16190 * interface.cs (Interface.GetInterfaceBases): Check whether all
16191 base interfaces are at least as accessible than the current one.
16193 * class.cs (TypeContainer.GetClassBases): Check whether base types
16194 are at least as accessible than the current type.
16195 (TypeContainer.AsAccessible): Implemented and made non-static.
16196 (MemberBase.CheckParameters): Report errors if the accessibility
16199 * delegate.cs (Delegate.Delegate): The default visibility is
16200 internal for top-level types and private for nested types.
16201 (Delegate.Define): Report errors if the accessibility checks fail.
16203 * enum.cs (Enum.Enum): The default visibility is internal for
16204 top-level types and private for nested types.
16205 (Enum.DefineType): Compute the correct visibility.
16207 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16208 function which takes a `bool is_toplevel' instead of a TypeContainer.
16210 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16213 2002-08-02 Martin Baulig <martin@gnome.org>
16215 * expression.cs (LocalVariableReferenc): Added constructor which
16216 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16217 (LocalVariableReference.IsReadOnly): New property.
16218 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16219 variable is readonly, use our own readonly flag to do this; you can
16220 use the new constructor to get a writable reference to a read-only
16223 * cs-parser.jay (foreach_statement, using_statement): Get a writable
16224 reference to the local variable.
16226 2002-08-01 Miguel de Icaza <miguel@ximian.com>
16228 * rootcontext.cs (ResolveCore): Also include System.Exception
16230 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16231 we reach an EmptyStatement.
16233 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16236 * expression.cs (Binary.ResolveOperator): Check error result in
16239 use brtrue/brfalse directly and avoid compares to null.
16241 2002-08-02 Martin Baulig <martin@gnome.org>
16243 * class.cs (TypeContainer.Define): Define all nested interfaces here.
16244 Fixes bug #28407, added test-155.cs.
16246 2002-08-01 Martin Baulig <martin@gnome.org>
16248 * class.cs (Event.EmitDefaultMethod): Make this work with static
16249 events. Fixes #28311, added verify-3.cs.
16251 2002-08-01 Martin Baulig <martin@gnome.org>
16253 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16254 `is_disposable' fields.
16255 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16256 `hm.is_disposable' if we're using the collection pattern.
16257 (Foreach.EmitCollectionForeach): Use the correct type for the
16258 enumerator's local variable, only emit the try/finally block if
16259 necessary (fixes #27713).
16261 2002-08-01 Martin Baulig <martin@gnome.org>
16263 * ecore.cs (Expression.report118): Renamed to Error118 and made
16266 * statement.cs (Throw.Resolve): Check whether the expression is of
16267 the correct type (CS0118) and whether the type derives from
16268 System.Exception (CS0155).
16269 (Catch.Resolve): New method. Do the type lookup here and check
16270 whether it derives from System.Exception (CS0155).
16271 (Catch.CatchType, Catch.IsGeneral): New public properties.
16273 * typemanager.cs (TypeManager.exception_type): Added.
16275 2002-07-31 Miguel de Icaza <miguel@ximian.com>
16277 * driver.cs: Updated About function.
16279 2002-07-31 Martin Baulig <martin@gnome.org>
16281 Implemented Control Flow Analysis.
16283 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16284 (EmitContext.CurrentBranching): Added.
16285 (EmitContext.StartFlowBranching): Added.
16286 (EmitContext.EndFlowBranching): Added.
16287 (EmitContext.KillFlowBranching): Added.
16288 (EmitContext.IsVariableAssigned): Added.
16289 (EmitContext.SetVariableAssigned): Added.
16290 (EmitContext.IsParameterAssigned): Added.
16291 (EmitContext.SetParameterAssigned): Added.
16292 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16293 Added control flow analysis stuff here.
16295 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16296 resolve the expression as lvalue.
16297 (LocalVariableReference.DoResolve): Check whether the variable has
16298 already been assigned.
16299 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16300 the parameter as assigned here.
16301 (ParameterReference.DoResolve): Check whether the parameter has already
16303 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16304 expression as lvalue.
16306 * statement.cs (FlowBranching): New class for the flow analysis code.
16307 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16308 (LabeledStatement.IsDefined): New public property.
16309 (LabeledStatement.AddUsageVector): New public method to tell flow
16310 analyis that the label may be reached via a forward jump.
16311 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16313 (VariableInfo.Number): New public field. This is used by flow analysis
16314 to number all locals of a block.
16315 (Block.CountVariables): New public property. This is the number of
16316 local variables in this block (including the locals from all parent
16318 (Block.EmitMeta): Number all the variables.
16320 * statement.cs: Added flow analysis support to all classes.
16322 2002-07-31 Martin Baulig <martin@gnome.org>
16324 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16325 To get debugging messages, compile mcs with /define:MCS_DEBUG and
16326 then use this argument.
16328 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16330 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16331 use this to specify /define options.
16333 2002-07-29 Martin Baulig <martin@gnome.org>
16335 * statement.cs (Fixed): Moved all code that does variable lookups
16336 and resolvings from Emit to Resolve.
16338 * statement.cs (For): Moved all code that does variable lookups
16339 and resolvings from Emit to Resolve.
16341 * statement.cs (Using): Moved all code that does variable lookups
16342 and resolvings from Emit to Resolve.
16344 2002-07-29 Martin Baulig <martin@gnome.org>
16346 * attribute.cs (Attribute.Resolve): Explicitly catch a
16347 System.NullReferenceException when creating the
16348 CustromAttributeBuilder and report a different warning message.
16350 2002-07-29 Martin Baulig <martin@gnome.org>
16352 * support.cs (ParameterData.ParameterName): Added method to
16353 get the name of a parameter.
16355 * typemanager.cs (TypeManager.IsValueType): New public method.
16357 2002-07-29 Martin Baulig <martin@gnome.org>
16359 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
16360 is a flag which specifies that it's either ref or out.
16361 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16362 the out parameter to `out Parameter.Modifier mod', also set the
16363 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16365 * support.cs (InternalParameters.ParameterModifier): Distinguish
16366 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16367 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16369 * expression.cs (Argument.GetParameterModifier): Distinguish
16370 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16371 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16373 2002-07-29 Martin Baulig <martin@gnome.org>
16375 * expression.cs (ParameterReference.ParameterReference): Added
16376 `Location loc' argument to the constructor.
16378 * cs-parser.jay: Pass location to ParameterReference.
16380 2002-07-28 Miguel de Icaza <miguel@ximian.com>
16382 * statement.cs (Try): Initialize the location.
16384 * cs-parser.jay: pass location to Try.
16386 * expression.cs (Unary.Reduce): Change the prototype to return
16387 whether a constant fold could be performed or not. The result is
16388 returned in an out parameters. In the case of Indirection and
16389 AddressOf, we want to perform the full tests.
16391 2002-07-26 Miguel de Icaza <miguel@ximian.com>
16393 * statement.cs (Statement.Emit): Flag dead code.
16395 2002-07-27 Andrew Birkett <andy@nobugs.org>
16397 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16399 2002-07-27 Martin Baulig <martin@gnome.org>
16401 * class.cs (MethodData.Define): Put back call to
16402 TypeManager.AddMethod(), accidentally commented this out.
16404 * report.cs (Debug): New public method to print debugging information,
16405 this is `[Conditional ("DEBUG")]'.
16407 2002-07-26 Martin Baulig <martin@gnome.org>
16409 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16410 (switch_statement): Push the current_block to the switch_stack and
16411 pop it again when we're done with the switch.
16412 (switch_section): The new block is a child of the current_block.
16413 Fixes bug #24007, added test-152.cs.
16415 2002-07-27 Martin Baulig <martin@gnome.org>
16417 * expression.cs (Invocation.EmitArguments): When calling a varargs
16418 function with only its fixed arguments, we need to pass an empty
16421 2002-07-27 Martin Baulig <martin@gnome.org>
16423 Mono 0.13 has been released.
16425 2002-07-25 Miguel de Icaza <miguel@ximian.com>
16427 * driver.cs: Rename --resource to --linkres, because that is what
16428 we do currently, we dont support --resource yet.
16430 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16432 2002-07-25 Martin Baulig <martin@gnome.org>
16434 * class.cs (MethodData): New public class. This is a `method builder'
16435 class for a method or one accessor of a Property/Indexer/Event.
16436 (MethodData.GetMethodFlags): Moved here from MemberBase.
16437 (MethodData.ApplyAttributes): Likewise.
16438 (MethodData.ApplyObsoleteAttribute): Likewise.
16439 (MethodData.ApplyConditionalAttribute): Likewise.
16440 (MethodData.ApplyDllImportAttribute): Likewise.
16441 (MethodData.CheckAbstractAndExternal): Likewise.
16442 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16443 (MethodData.Emit): Formerly known as Method.Emit().
16444 (MemberBase): Moved everything which was specific to a single
16445 accessor/method to MethodData.
16446 (Method): Create a new MethodData and call Define() and Emit() on it.
16447 (Property, Indexer, Event): Create a new MethodData objects for each
16448 accessor and call Define() and Emit() on them.
16450 2002-07-25 Martin Baulig <martin@gnome.org>
16452 Made MethodCore derive from MemberBase to reuse the code from there.
16453 MemberBase now also checks for attributes.
16455 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16456 (MemberBase.GetMethodFlags): Moved here from class Method and marked
16458 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16459 `CallingConventions cc' and `Attributes opt_attrs' arguments.
16460 (MemberBase.ApplyAttributes): New virtual method; applies the
16461 attributes to a method or accessor.
16462 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16463 (MemberBase.ApplyConditionalAttribute): Likewise.
16464 (MemberBase.ApplyDllImportAttribute): Likewise.
16465 (MemberBase.CheckAbstractAndExternal): Likewise.
16466 (MethodCore.ParameterTypes): This is now a property instead of a
16467 method, it's initialized from DoDefineParameters().
16468 (MethodCore.ParameterInfo): Removed the set accessor.
16469 (MethodCore.DoDefineParameters): New protected virtual method to
16470 initialize ParameterTypes and ParameterInfo.
16471 (Method.GetReturnType): We can now simply return the MemberType.
16472 (Method.GetMethodFlags): Override the MemberBase version and add
16473 the conditional flags.
16474 (Method.CheckBase): Moved some code from Define() here, call
16475 DoDefineParameters() here.
16476 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16477 here to avoid some larger code duplication.
16478 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16479 ensure that abstract and external accessors don't declare a body.
16481 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16482 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16483 lookup in the attribute's parent classes, so we need to abort as soon
16484 as we found the first match.
16485 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16486 the attribute has no arguments.
16488 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16491 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16493 * cs-parser.jay: reverted previous patch.
16495 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16497 * cs-parser.jay: fixed bug #22119.
16499 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16501 * attribute.cs: fixed compilation. The error was:
16502 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
16503 be assigned to before control leaves the current method."
16504 [FIXME: Filed as bug #28186: MCS must report this error.]
16506 2002-07-25 Martin Baulig <martin@gnome.org>
16508 * attribute.cs (Attribute.Conditional_GetConditionName): New static
16509 method to pull the condition name ouf of a Conditional attribute.
16510 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16511 the obsolete message and error flag out of an Obsolete attribute.
16513 * class.cs (Method.GetMethodFlags): New public method to get the
16514 TypeManager.MethodFlags for this method.
16515 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16517 (Method.Define): Get and apply the Obsolete and Conditional attributes;
16518 if we're overriding a virtual function, set the new private variable
16519 `parent_method'; call the new TypeManager.AddMethod().
16521 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
16522 the MethodBuilder and the Method in a PtrHashtable.
16523 (TypeManager.builder_to_method): Added for this purpose.
16524 (TypeManager.MethodFlags): Added IsObsoleteError.
16525 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
16526 Obsolete and Conditional arguments in MethodBuilders. If we discover
16527 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16528 the message from the attribute.
16530 2002-07-24 Martin Baulig <martin@gnome.org>
16532 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16533 preprocessor directives, ensure that the argument to #define/#undef is
16534 exactly one identifier and that it's actually an identifier.
16536 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16539 2002-07-24 Martin Baulig <martin@gnome.org>
16541 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16542 initialize it to TypeManager.object_type in the constructor.
16543 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16544 of the `hm.get_current' method if we're using the collection pattern.
16545 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16546 for the explicit conversion to make it work when we're using the collection
16547 pattern and the `Current' property has a different return type than `object'.
16550 2002-07-24 Martin Baulig <martin@gnome.org>
16552 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16553 does not match, but don't report any errors. This method is called in
16554 order for all methods in a MethodGroupExpr until a matching method is
16555 found, so we don't want to bail out if the first method doesn't match.
16556 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16557 matches, report the 123. Fixes #28070.
16559 2002-07-24 Martin Baulig <martin@gnome.org>
16561 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16562 TypeManager.TypeToCoreType() to the top of the method so the
16563 following equality checks will work. Fixes #28107.
16565 2002-07-24 Martin Baulig <martin@gnome.org>
16567 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16568 operand is of type uint, and the other operand is of type sbyte,
16569 short or int, the operands are converted to type long." -
16570 Actually do what this comment already told us. Fixes bug #28106,
16573 2002-07-24 Martin Baulig <martin@gnome.org>
16575 * class.cs (MethodBase): New abstract class. This is now a base
16576 class for Property, Indexer and Event to avoid some code duplication
16577 in their Define() and DefineMethods() methods.
16578 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16579 generic methods for Define() and DefineMethods().
16580 (FieldBase): Derive from MemberBase, not MemberCore.
16581 (Property): Derive from MemberBase, not MemberCore.
16582 (Property.DefineMethod): Moved all the code from this method to the
16583 new MethodBase.DefineAccessor(), just call it with appropriate
16585 (Property.Define): Call the new Property.DoDefine(), this does some
16586 sanity checks and we don't need to duplicate the code everywhere.
16587 (Event): Derive from MemberBase, not MemberCore.
16588 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16589 accessors, this will also make them work with interface events.
16590 (Indexer): Derive from MemberBase, not MemberCore.
16591 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16592 (Indexer.Define): Use the new MethodBase functions.
16594 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16595 argument to the constructor.
16596 (Interface.FindMembers): Added support for interface events.
16597 (Interface.PopluateEvent): Implemented.
16599 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
16601 2002-07-22 Miguel de Icaza <miguel@ximian.com>
16603 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16604 but this is required to check for a method name being the same as
16605 the containing class.
16609 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16611 * interface.cs: initialize variable.
16613 2002-07-23 Martin Baulig <martin@gnome.org>
16615 Implemented the IndexerName attribute in interfaces.
16617 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16618 name if this is an explicit interface implementation.
16619 (Indexer.InterfaceIndexerName): New public variable. If we're
16620 implementing an interface indexer, this is the IndexerName in that
16621 interface. Otherwise, it's the IndexerName.
16622 (Indexer.DefineMethod): If we're implementing interface indexer,
16623 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
16624 and Pending.ImplementIndexer methods.
16625 (Indexer.Define): Also define the PropertyBuilder if we're
16626 implementing an interface indexer and this is neither an explicit
16627 interface implementation nor do the IndexerName match the one in
16630 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16631 If a method is defined here, then we always need to create a proxy
16632 for it. This is used when implementing interface indexers.
16633 (Pending.IsInterfaceIndexer): New public method.
16634 (Pending.ImplementIndexer): New public method.
16635 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16636 This is used when implementing interface indexers to define a proxy
16638 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16639 define a proxy if necessary.
16641 * interface.cs (Interface.IndexerName): New public variable.
16642 (Interface.PopulateIndexer): Set the IndexerName.
16643 (Interface.DefineIndexers): New private method. Populate all the
16644 indexers and make sure their IndexerNames match.
16646 * typemanager.cs (IndexerPropertyName): Added support for interface
16649 2002-07-22 Martin Baulig <martin@gnome.org>
16651 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
16652 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
16653 ret if HasReturnLabel.
16654 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
16657 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
16658 and set the ec.LoopBeginTryCatchLevel.
16659 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
16660 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
16661 the current ec.TryCatchLevel, the branch goes out of an exception
16662 block. In this case, we need to use Leave and not Br.
16664 2002-07-22 Martin Baulig <martin@gnome.org>
16666 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
16667 block unless the block does not always return or it is contained in
16668 another try { ... } catch { ... } block. Fixes bug #26506.
16669 Added verify-1.cs to the test suite.
16671 2002-07-22 Martin Baulig <martin@gnome.org>
16673 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
16674 then we do not always return. Fixes bug #24985.
16676 2002-07-22 Martin Baulig <martin@gnome.org>
16678 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
16679 lookup on a per-class level; ie. walk up the class hierarchy until we
16680 found at least one applicable method, then choose the best among them.
16681 Fixes bug #24463 and test-29.cs.
16683 2002-07-22 Martin Baulig <martin@gnome.org>
16685 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16686 return types of the methods. The return type is not part of the
16687 signature and we must not check it to make the `new' modifier work.
16688 Fixes bug #27999, also added test-147.cs.
16689 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16691 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16692 on the method's return type.
16694 2002-07-21 Martin Baulig <martin@gnome.org>
16696 * assign.cs: Make this work if the rightmost source is a constant and
16697 we need to do an implicit type conversion. Also adding a few more tests
16698 to test-38.cs which should have caught this.
16700 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16701 target in the makefile for this. The makefile.gnu is primarily intended
16702 for end-users who don't want to debug the compiler.
16704 2002-07-21 Martin Baulig <martin@gnome.org>
16706 * assign.cs: Improved the Assign class so it can now handle embedded
16707 assignments (X = Y = Z = something). As a side-effect this'll now also
16708 consume less local variables. test-38.cs now passes with MCS, added
16709 a few new test cases to that test.
16711 2002-07-20 Martin Baulig <martin@gnome.org>
16713 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16714 instructions. Fixes bug #27977, also added test-146.cs.
16716 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16718 * cs-tokenizer.cs: fixed getHex ().
16720 2002-07-19 Martin Baulig <martin@gnome.org>
16722 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16723 not Type.GetType() to lookup the array type. This is needed when
16724 we're constructing an array of a user-defined type.
16725 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16726 single-dimensional arrays, but also for single-dimensial arrays of
16729 2002-07-19 Martin Baulig <martin@gnome.org>
16731 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16732 this function is called, it's not allowed to share LocalBuilders
16733 among ILGenerators.
16735 2002-07-19 Martin Baulig <martin@gnome.org>
16737 * expression.cs (Argument.Resolve): Report an error 118 when trying
16738 to pass a type as argument.
16740 2002-07-18 Martin Baulig <martin@gnome.org>
16742 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16743 Conv_R_Un for the signed `long' type.
16745 2002-07-15 Miguel de Icaza <miguel@ximian.com>
16747 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16748 `expr' for the temporary result, as that will fail if we do
16749 multiple resolves on the same expression.
16751 2002-07-05 Miguel de Icaza <miguel@ximian.com>
16753 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16754 ec.TypeContainer for looking up aliases.
16756 * class.cs (TypeContainer): Remove LookupAlias from here.
16758 * decl.cs (DeclSpace); Move here.
16760 2002-07-01 Miguel de Icaza <miguel@ximian.com>
16762 * class.cs (FindMembers): Only call filter if the constructor
16763 bulider is not null.
16765 Also handle delegates in `NestedTypes' now. Now we will perform
16766 type lookups using the standard resolution process. This also
16769 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16770 This uses Expressions (the limited kind that can be parsed by the
16771 tree) instead of strings.
16773 * expression.cs (ComposedCast.ToString): Implement, used to flag
16774 errors since now we have to render expressions.
16776 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
16779 * ecore.cs (SimpleName.ToString): ditto.
16781 * cs-parser.jay: Instead of using strings to assemble types, use
16782 Expressions to assemble the type (using SimpleName, ComposedCast,
16783 MemberAccess). This should fix the type lookups in declarations,
16784 because we were using a different code path for this.
16786 * statement.cs (Block.Resolve): Continue processing statements
16787 even when there is an error.
16789 2002-07-17 Miguel de Icaza <miguel@ximian.com>
16791 * class.cs (Event.Define): Also remove the `remove' method from
16792 the list of pending items.
16794 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16795 generate more compact code.
16797 2002-07-17 Martin Baulig <martin@gnome.org>
16799 * const.cs (Const.LookupConstantValue): Add support for constant
16800 `unchecked' and `checked' expressions.
16801 Also adding test case test-140.cs for this.
16803 2002-07-17 Martin Baulig <martin@gnome.org>
16805 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16806 check whether mi.ReturnType implements the IEnumerator interface; the
16807 `==' and the IsAssignableFrom() will fail in this situation.
16809 2002-07-16 Ravi Pratap <ravi@ximian.com>
16811 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
16814 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16816 * expression.cs: fixed bug #27811.
16818 2002-07-14 Miguel de Icaza <miguel@ximian.com>
16820 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16821 Molaro: when we are a ref, the value already contains a pointer
16822 value, do not take the address of it.
16824 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16825 * removed mb-parser.jay and mb-tokenizer.cs
16827 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16829 * expression.cs: check against the building corlib void type.
16831 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16833 * ecore.cs: fix for valuetype static readonly fields: when
16834 initializing them, we need their address, not the address of a copy.
16836 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16838 * typemanager.cs: register also enum_type in corlib.
16840 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16842 * class.cs: allow calling this (but not base) initializers in structs.
16844 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16846 * ecore.cs: make sure we compare against the building base types
16849 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16851 * typemanager.cs: fix TypeToCoreType() to handle void and object
16852 (corlib gets no more typerefs after this change).
16854 2002-07-12 Miguel de Icaza <miguel@ximian.com>
16856 * expression.cs (ArrayCreation.EmitArrayArguments): use
16857 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16859 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16860 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
16861 array indexes, the runtime actually forbids them.
16863 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16864 for array arguments here.
16866 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16867 instead of the default for ValueTypes.
16869 (New.DoEmit): Use IsValueType instead of
16870 IsSubclassOf (value_type)
16871 (New.DoResolve): ditto.
16872 (Invocation.EmitCall): ditto.
16874 * assign.cs (Assign): ditto.
16876 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16877 Statements *are* currently doing part of their resolution during
16880 Expressions do always resolve during resolve, but statements are
16881 only required to propagate resolution to their children.
16883 2002-07-11 Miguel de Icaza <miguel@ximian.com>
16885 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16887 (LoadAssembly): Do not add the dll if it is already specified
16889 (MainDriver): Add the System directory to the link path at the end,
16890 after all the other -L arguments.
16892 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16893 wrong opcode for loading bytes and bools (ldelem.i1 instead of
16894 ldelem.u1) and using the opposite for sbytes.
16896 This fixes Digger, and we can finally run it.
16898 * driver.cs (UnixParseOption): Move the option parsing here.
16899 (CSCParseOption): Implement CSC-like parsing of options.
16901 We now support both modes of operation, the old Unix way, and the
16902 new CSC-like way. This should help those who wanted to make cross
16903 platform makefiles.
16905 The only thing broken is that /r:, /reference: and /lib: are not
16906 implemented, because I want to make those have the same semantics
16907 as the CSC compiler has, and kill once and for all the confussion
16908 around this. Will be doing this tomorrow.
16910 * statement.cs (Unsafe.Resolve): The state is checked during
16911 resolve, not emit, so we have to set the flags for IsUnsfe here.
16913 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16915 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16916 not catch the Error_ObjectRefRequired in SimpleName (as it is
16917 possible to have a class/instance variable name that later gets
16918 deambiguated), we have to check this here.
16920 2002-07-10 Ravi Pratap <ravi@ximian.com>
16922 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16923 make static and put into Expression.
16925 (Event.Define): Register the private field of the event with the
16926 TypeManager so that GetFieldFromEvent can get at it.
16928 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16929 keep track of the private field associated with an event which
16932 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16935 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16937 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16939 * expression.cs (Binary.EmitBranchable): this routine emits the
16940 Binary expression in a branchable context. This basically means:
16941 we need to branch somewhere, not just get the value on the stack.
16943 This works together with Statement.EmitBoolExpression.
16945 * statement.cs (Statement.EmitBoolExpression): Use
16948 2002-07-09 Miguel de Icaza <miguel@ximian.com>
16950 * statement.cs (For): Reduce the number of jumps in loops.
16952 (For): Implement loop inversion for the For statement.
16954 (Break): We can be breaking out of a Try/Catch controlled section
16955 (foreach might have an implicit try/catch clause), so we need to
16956 use Leave instead of Br.
16958 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16959 now). If the instace expression supports IMemoryLocation, we use
16960 the AddressOf method from the IMemoryLocation to extract the
16961 address instead of emitting the instance.
16963 This showed up with `This', as we were emitting the instance
16964 always (Emit) instead of the Address of This. Particularly
16965 interesting when This is a value type, as we dont want the Emit
16966 effect (which was to load the object).
16968 2002-07-08 Miguel de Icaza <miguel@ximian.com>
16970 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16972 * statement.cs (Checked): Set the CheckedState during the resolve
16973 process too, as the ConvCast operations track the checked state on
16974 the resolve process, and not emit.
16976 * cs-parser.jay (namespace_member_declaration): Flag that we have
16977 found a declaration when we do. This is used to flag error 1529
16979 * driver.cs: Report ok when we display the help only.
16981 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
16983 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16985 2002-07-04 Miguel de Icaza <miguel@ximian.com>
16987 * cs-tokenizer.cs (define): We also have to track locally the
16988 defines. AllDefines is just used for the Conditional Attribute,
16989 but we also need the local defines for the current source code.
16991 2002-07-03 Miguel de Icaza <miguel@ximian.com>
16993 * statement.cs (While, For, Do): These loops can exit through a
16994 Break statement, use this information to tell whether the
16995 statement is the last piece of code.
16997 (Break): Flag that we break.
16999 * codegen.cs (EmitContexts): New `Breaks' state variable.
17001 2002-07-03 Martin Baulig <martin@gnome.org>
17003 * class.cs (TypeContainer.MethodModifiersValid): Allow override
17004 modifiers in method declarations in structs. Otherwise, you won't
17005 be able to override things like Object.Equals().
17007 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17009 * class.cs (Method, Property, Indexer): Do not allow the public
17010 modifier to be used in explicit interface implementations.
17012 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17013 override modifiers in method declarations in structs
17015 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
17017 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17018 integer or real overflow, report an error
17020 2002-07-02 Martin Baulig <martin@gnome.org>
17022 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17023 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17024 to tell the runtime about our newly created System.Object and
17025 System.ValueType types.
17027 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17029 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17030 struct instead of Ldarg/Starg.
17032 2002-07-02 Martin Baulig <martin@gnome.org>
17034 * expression.cs (Indirection.Indirection): Call
17035 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17037 2002-07-02 Martin Baulig <martin@gnome.org>
17039 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17040 ValueType, call TypeManager.TypeToCoreType() on it.
17041 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17042 the OpCodes.Newarr argument.
17044 2002-07-02 Martin Baulig <martin@gnome.org>
17046 * expression.cs (Invocation.EmitCall): When compiling corlib,
17047 replace all calls to the system's System.Array type to calls to
17048 the newly created one.
17050 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17051 System.Array methods.
17052 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17053 from the system's System.Array type which must be replaced.
17055 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17057 * typemanager.cs: load unverifiable_code_ctor so we can build
17058 corlib using the correct type. Avoid using GetTypeCode() with
17060 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17061 TypeManager.object_type to allow building corlib.
17063 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17065 * ecore.cs: handle System.Enum separately in LoadFromPtr().
17067 2002-07-01 Martin Baulig <martin@gnome.org>
17069 * class.cs: Make the last change actually work, we need to check
17070 whether `ifaces != null' to avoid a crash.
17072 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17074 * class.cs: when we build structs without fields that implement
17075 interfaces, we need to add the interfaces separately, since there is
17076 no API to both set the size and add the interfaces at type creation
17079 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17081 * expression.cs: the dimension arguments to the array constructors
17082 need to be converted if they are a long.
17084 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17086 * class.cs: don't emit ldarg.0 if there is no parent constructor
17087 (fixes showstopper for corlib).
17089 2002-06-29 Martin Baulig <martin@gnome.org>
17091 MCS now compiles corlib on GNU/Linux :-)
17093 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17094 ie. check for MethodImplOptions.InternalCall.
17096 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17097 and TypeManager.attribute_type are null, so we must explicitly check
17098 whether parent is not null to find out whether it's an attribute type.
17099 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17100 and SetBuilder, not only if the property is neither abstract nor external.
17101 This is necessary to set the MethodImplOptions on the accessor methods.
17102 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17103 SetBuilder, see Property.Emit().
17105 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17106 populate "System.Object", "System.ValueType" and "System.Attribute" since
17107 they've already been populated from BootCorlib_PopulateCoreTypes().
17109 2002-06-29 Martin Baulig <martin@gnome.org>
17111 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17112 is the NullLiteral, we also need to make sure that target_type is not
17115 2002-06-29 Martin Baulig <martin@gnome.org>
17117 * rootcontext.cs (RootContext.ResolveCore): We must initialize
17118 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17119 before calling BootstrapCorlib_ResolveDelegate ().
17121 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17123 * statement.cs: fixed build-breaker. All tests passed ok.
17125 2002-06-27 Martin Baulig <martin@gnome.org>
17127 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17128 for System.Decimal when compiling corlib.
17130 2002-06-27 Martin Baulig <martin@gnome.org>
17132 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17133 switch blocks which contain nothing but a default clause.
17135 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
17137 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17139 2002-06-27 Martin Baulig <martin@gnome.org>
17141 * ecore.cs (PropertyExpr.PropertyExpr): Call
17142 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17144 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17145 is already a TypeBuilder.
17147 2002-06-27 Martin Baulig <martin@gnome.org>
17149 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17150 `target_type == TypeManager.array_type', not IsAssignableFrom() in
17151 the "from an array-type to System.Array" case. This makes it work
17152 when compiling corlib.
17154 2002-06-27 Martin Baulig <martin@gnome.org>
17156 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17157 non-static PropertyExpr, set its InstanceExpression. This makes
17158 the `ICollection.Count' property work in System/Array.cs.
17160 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
17162 * driver.cs: Made error handling more consistent. Errors now
17163 tracked by Report class, so many methods which used to return int
17164 now return void. Main() now prints success/failure and
17165 errors/warnings message.
17167 Renamed '--probe' compiler argument to '--expect-error'. Removed
17168 the magic number return values (123 and 124). Now, if the
17169 expected error occurs, the compiler exits with success (exit value
17170 0). If the compilation completes without seeing that particular
17171 error, the compiler exits with failure (exit value 1). The
17172 makefile in mcs/errors has been changed to handle the new behaviour.
17174 * report.cs: Made 'expected error' number a property and renamed
17175 it from 'Probe' to 'ExpectedError'.
17177 * genericparser.cs: Removed error handling support, since it is
17178 now all done by Report class.
17180 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17181 class, so parse() no longer returns an int.
17183 * namespace.cs: Use Report.Error instead of GenericParser.error
17185 2002-06-22 Miguel de Icaza <miguel@ximian.com>
17187 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17188 TypeContainer.AddOperator): At the front of the list put the
17189 explicit implementations, so they get resolved/defined first.
17191 2002-06-21 Miguel de Icaza <miguel@ximian.com>
17193 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17194 interface type is implemented by this TypeContainer. Used during
17195 explicit interface implementation.
17197 (Property.Define, Indexer.Define, Method.Define): Validate that
17198 the given interface in the explicit implementation is one of the
17199 base classes for the containing type.
17201 Also if we are explicitly implementing an interface, but there is
17202 no match in the pending implementation table, report an error.
17204 (Property.Define): Only define the property if we are
17205 not explicitly implementing a property from an interface. Use the
17206 correct name also for those properties (the same CSC uses,
17207 although that is really not needed).
17209 (Property.Emit): Do not emit attributes for explicitly implemented
17210 properties, as there is no TypeBuilder.
17212 (Indexer.Emit): ditto.
17214 Hiding then means that we do not really *implement* a pending
17215 implementation, which makes code fail.
17217 2002-06-22 Martin Baulig <martin@gnome.org>
17219 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17220 the return value of Object.GetType(). [FIXME: we need to do this whenever
17221 we get a type back from the reflection library].
17223 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17225 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17227 2002-06-20 Miguel de Icaza <miguel@ximian.com>
17229 * attribute.cs: Return null if we can not look up the type.
17231 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17232 the interface types found.
17234 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17235 interface types found.
17237 * typemanager.cs (GetInterfaces): Make this routine returns alll
17238 the interfaces and work around the lame differences between
17239 System.Type and System.Reflection.Emit.TypeBuilder in the results
17240 result for GetInterfaces.
17242 (ExpandInterfaces): Given an array of interface types, expand and
17243 eliminate repeated ocurrences of an interface. This expands in
17244 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17247 2002-06-21 Martin Baulig <martin@gnome.org>
17249 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17252 2002-06-21 Martin Baulig <martin@gnome.org>
17254 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
17255 and called with one of the core types, return the corresponding typebuilder for
17258 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17261 2002-06-21 Martin Baulig <martin@gnome.org>
17263 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17264 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17265 (Expression.ConvertReferenceExplicit): Likewise.
17267 * expression.cs (ElementAccess.DoResolve): Likewise.
17268 (ElementAccess.DoResolveLValue): Likewise.
17270 2002-06-10 Martin Baulig <martin@gnome.org>
17272 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17273 add the "value" parameter to the parameter list.
17275 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17278 2002-06-19 Miguel de Icaza <miguel@ximian.com>
17280 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17281 the argument to an int, uint, long or ulong, per the spec. Also
17282 catch negative constants in array creation.
17284 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17286 * class.cs: do not allow the same interface to appear twice in
17287 the definition list.
17289 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17291 * ecore.cs: don't use ldlen with System.Array.
17293 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17295 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17297 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17299 * modifiers.cs: produce correct field attributes for protected
17300 internal. Easy fix so miguel can work on ther harder stuff:-)
17302 2002-06-18 Miguel de Icaza <miguel@ximian.com>
17304 * pending.cs: New file. Move the code from class.cs here.
17305 Support clearning the pending flag for all methods (when not doing
17306 explicit interface implementation).
17308 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17310 * rootcontext.cs: added a couple more types needed to bootstrap.
17312 2002-06-17 Miguel de Icaza <miguel@ximian.com>
17314 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17315 constructor in the type, instead of any constructor in the type
17316 hierarchy. Thanks to Paolo for finding this bug (it showed up as
17317 a bug in the Mono runtime when applying the params attribute).
17319 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17320 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17322 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
17324 * expression.cs (Unary.ResolveOperator): Use TypeManager
17325 to resolve the type.
17327 2002-06-13 Ravi Pratap <ravi@ximian.com>
17329 * cs-parser.jay (enum_member_declaration): Pass in the attributes
17332 * enum.cs (AddEnumMember): Add support to store the attributes associated
17333 with each member too.
17335 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17336 field builders too - this takes care of the enum member case.
17338 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
17340 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17341 address-of operator on both value types and pointers.
17343 2002-06-10 Martin Baulig <martin@gnome.org>
17345 * interface.cs (Interface.PopulateIndexer): Add the indexer's
17346 PropertyBuilder to the `property_builders' list.
17348 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17349 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17350 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
17351 find any indexers which are inherited from an interface.
17353 2002-06-09 Martin Baulig <martin@gnome.org>
17355 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17356 the same type as the constant if necessary. There's also a test-130.cs
17359 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17361 * typemanager.cs (TypeManager.ChangeType): Previously known as
17362 Enum.ChangeEnumType().
17364 2002-06-09 Martin Baulig <martin@gnome.org>
17366 * expression.cs (Cast.TryReduce): Added support for consts.
17368 2002-06-08 Ravi Pratap <ravi@ximian.com>
17370 * class.cs (Accessor): Hold attributes information so we can pass
17373 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17374 Modify to pass in attributes attached to the methods.
17376 (add_accessor_declaration, remove_accessor_declaration): Ditto.
17378 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17379 to handle the Accessor kind :-)
17381 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17383 2002-06-08 Martin Baulig <martin@gnome.org>
17385 * expression.cs (Unary.TryReduceNegative): Added support for
17388 2002-06-08 Martin Baulig <martin@gnome.org>
17390 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17391 name can't be found in the `defined_names' - the caller will do a
17392 MemberLookup in this case and thus find methods in System.Enum
17393 such as Enum.IsDefined().
17395 2002-06-08 Martin Baulig <martin@gnome.org>
17397 * enum.cs (Enum.ChangeEnumType): This is a custom version of
17398 Convert.ChangeType() which works with TypeBuilder created types.
17399 (Enum.LookupEnumValue, Enum.Define): Use it here.
17401 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17402 `TypeBuilder.BaseType != null' check.
17403 (TypeContainer.FindMembers): Only lookup parent members if we
17404 actually have a parent.
17405 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17406 (ConstructorInitializer.Resolve): Likewise.
17408 * interface.cs (Interface.FindMembers): Added
17409 `TypeBuilder.BaseType != null' check.
17411 * rootcontext.cs (RootContext.ResolveCore): Added
17412 "System.Runtime.CompilerServices.IndexerNameAttribute" to
17413 classes_second_stage.
17415 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17416 debug_type and trace_type when compiling with --nostdlib.
17418 2002-06-07 Martin Baulig <martin@gnome.org>
17420 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17421 (AddField): Set it to true when adding a non-static field.
17422 (DefineType): Use `have_nonstatic_fields' to find out whether we
17423 have non-static fields, not `Fields != null'.
17425 2002-06-02 Miguel de Icaza <miguel@ximian.com>
17427 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17428 dereferencing a null on the static-field code path)
17430 2002-05-30 Martin Baulig <martin@gnome.org>
17432 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17433 to take command line arguments. Use reflection to call the new
17434 custom `Initialize' function on the symbol writer and pass it the
17435 command line arguments.
17437 * driver.cs (--debug-args): New command line argument to pass command
17438 line arguments to the symbol writer.
17440 2002-05-28 Miguel de Icaza <miguel@ximian.com>
17442 * assign.cs (DoResolve): Forgot to do the implicit conversion to
17443 the target type for indexers and properties. Thanks to Joe for
17446 2002-05-27 Miguel de Icaza <miguel@ximian.com>
17448 * typemanager.cs (MethodFlags): returns the method flags
17449 (Obsolete/ShouldIgnore) that control warning emission and whether
17450 the invocation should be made, or ignored.
17452 * expression.cs (Invocation.Emit): Remove previous hack, we should
17453 not do this on matching a base type, we should do this based on an attribute
17455 Only emit calls to System.Diagnostics.Debug and
17456 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17457 on the command line.
17459 * rootcontext.cs: Global settings for tracing and debugging.
17461 * cs-tokenizer.cs (define): New utility function to track
17462 defines. Set the global settings for TRACE and DEBUG if found.
17464 2002-05-25 Ravi Pratap <ravi@ximian.com>
17466 * interface.cs (Populate*): Pass in the TypeContainer as well as
17467 the DeclSpace as parameters so that we can create EmitContexts and
17468 then use that to apply attributes etc.
17470 (PopulateMethod, PopulateEvent, PopulateProperty)
17471 (PopulateIndexer): Apply attributes everywhere.
17473 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17476 (ApplyAttributes): Update accordingly.
17478 We now apply interface attributes for all members too.
17480 2002-05-26 Miguel de Icaza <miguel@ximian.com>
17482 * class.cs (Indexer.Define); Correctly check if we are explicit
17483 implementation (instead of checking the Name for a ".", we
17484 directly look up if the InterfaceType was specified).
17486 Delay the creation of the PropertyBuilder.
17488 Only create the PropertyBuilder if we are not an explicit
17489 interface implementation. This means that explicit interface
17490 implementation members do not participate in regular function
17491 lookups, and hence fixes another major ambiguity problem in
17492 overload resolution (that was the visible effect).
17494 (DefineMethod): Return whether we are doing an interface
17497 * typemanager.cs: Temporary hack until we get attributes in
17498 interfaces (Ravi is working on that) and we get IndexerName
17499 support in interfaces.
17501 * interface.cs: Register the indexers as properties.
17503 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17504 warning, I have verified that this is a bug in the .NET runtime
17505 (JavaScript suffers of the same problem).
17507 * typemanager.cs (MemberLookup): When looking up members for
17508 interfaces, the parent of an interface is the implicit
17509 System.Object (so we succeed in searches of Object methods in an
17510 interface method invocation. Example: IEnumerable x; x.ToString
17513 2002-05-25 Miguel de Icaza <miguel@ximian.com>
17515 * class.cs (Event): Events should also register if they do
17516 implement the methods that an interface requires.
17518 * typemanager.cs (MemberLookup); use the new GetInterfaces
17521 (GetInterfaces): The code used to lookup interfaces for a type is
17522 used in more than one place, factor it here.
17524 * driver.cs: Track the errors at the bottom of the file, we kept
17527 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17528 instance if the method we are calling is static!
17530 2002-05-24 Miguel de Icaza <miguel@ximian.com>
17532 * attribute.cs (ApplyAttributes): Make this function filter out
17533 the IndexerName attribute (as that attribute in reality is never
17534 applied) and return the string constant for the IndexerName
17537 * class.cs (TypeContainer.Emit): Validate that all the indexers
17538 have the same IndexerName attribute, and if so, set the
17539 DefaultName attribute on the class.
17541 * typemanager.cs: The return value might contain other stuff (not
17542 only methods). For instance, consider a method with an "Item"
17543 property and an Item method.
17545 * class.cs: If there is a problem with the parameter types,
17548 2002-05-24 Ravi Pratap <ravi@ximian.com>
17550 * ecore.cs (ImplicitConversionExists): Wrapper function which also
17551 looks at user defined conversion after making a call to
17552 StandardConversionExists - we need this for overload resolution.
17554 * expression.cs : Update accordingly the various method calls.
17556 This fixes 2 bugs filed against implicit user defined conversions
17558 2002-05-22 Miguel de Icaza <miguel@ximian.com>
17560 * statement.cs: Track the result of the assignment.
17562 2002-05-21 Miguel de Icaza <miguel@ximian.com>
17564 * expression.cs (MemberAccess): Improved error reporting for
17565 inaccessible members.
17567 2002-05-22 Martin Baulig <martin@gnome.org>
17569 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
17570 itself with debugging support.
17572 2002-05-22 Martin Baulig <martin@gnome.org>
17574 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17575 Removed, this isn't needed anymore.
17577 2002-05-20 Martin Baulig <martin@gnome.org>
17579 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17580 be underlying type for an enum.
17582 2002-05-20 Miguel de Icaza <miguel@ximian.com>
17584 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17585 that splits out the loading of just the core types.
17587 * rootcontext.cs (ResolveCore): Split the struct resolution in
17588 two, so we can load the enumeration underlying types before any
17591 * expression.cs (Is): Bandaid until we fix properly Switch (see
17592 bug #24985 for details).
17594 * typemanager.cs (ImplementsInterface): The hashtable will contain
17595 a null if there are no interfaces implemented.
17597 2002-05-18 Miguel de Icaza <miguel@ximian.com>
17599 * cs-parser.jay (indexer_declarator): It is fine to have array
17602 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17604 * typemanager.cs: (RegisterBuilder): New function used to register
17605 TypeBuilders that implement interfaces. Since
17606 TypeBuilder.GetInterfaces (as usual) does not work with lame
17608 (AddUserType): register interfaces.
17610 (ImplementsInterface): Use the builder_to_ifaces hash if we are
17611 dealing with TypeBuilder. Also, arrays are showing up as
17612 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17613 methods can not be invoked on them!
17615 * ecore.cs (ExplicitReferenceConversionExists): Made public.
17616 (ImplicitReferenceConversionExists): Split out from
17617 StandardConversionExists.
17619 * expression.cs (As): We were only implementing one of the three
17620 cases for the as operator. We now implement them all.
17621 (Is): Implement the various other cases for Is as well.
17623 * typemanager.cs (CACHE): New define used to control if we want or
17624 not the FindMembers cache. Seems to have a negative impact on
17625 performance currently
17627 (MemberLookup): Nested types have full acess to
17628 enclosing type members
17630 Remove code that coped with instance/static returns for events, we
17631 now catch this in RealFindMembers.
17633 (RealFindMembers): only perform static lookup if the instance
17634 lookup did not return a type or an event.
17636 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17638 * assign.cs (CompoundAssign): We pass more semantic information
17639 now to Compound Assignments than we did before: now we have all
17640 the information at hand, and now we resolve the target *before* we
17641 do the expression expansion, which allows the "CacheValue" method
17642 to have the effect we intended (before, a [x] += 1 would generate
17643 two differen ArrayAccess expressions from the ElementAccess,
17644 during the resolution process).
17646 (CompoundAssign.DoResolve): Resolve target and original_source here.
17648 2002-05-16 Miguel de Icaza <miguel@ximian.com>
17650 * expression.cs (ArrayAccess): dropped debugging information.
17652 * typemanager.cs: Small bug fix: I was always returning i_members,
17653 instead of one of i_members or s_members (depending on which had
17656 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
17657 method is invoked before any code generation takes place, and it
17658 is a mechanism to inform that the expression will be invoked more
17659 than once, and that the method should use temporary values to
17660 avoid having side effects
17662 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
17664 * ecore.cs (Expression.CacheTemporaries): Provide empty default
17667 * expression.cs (Indirection, ArrayAccess): Add support for
17668 CacheTemporaries in these two bad boys.
17670 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
17671 ldobj or ldind_ref.
17672 (StoreFromPtr): Handle stobj as well.
17674 * expression.cs (UnaryMutator): Share more code.
17676 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
17677 down: I was not tracking the Filter function as well, which
17678 was affecting the results of the cache.
17680 2002-05-15 Miguel de Icaza <miguel@ximian.com>
17682 * attribute.cs: Remove the hack to handle the CharSet property on
17685 2002-05-14 Miguel de Icaza <miguel@ximian.com>
17687 * attribute.cs (DoResolve): More uglyness, we now only try to
17688 resolve the attribute partially, to extract the CharSet
17689 information (only if we are a StructLayout attribute). Otherwise
17691 (GetExtraTypeInfo): Add some code to conditionally kill in the
17692 future this. I am more and more convinced that the .NET
17693 framework has special code to handle the attribute setting on
17696 * expression.cs (IsParamsMethodApplicable): Revert my previous
17697 foreach change here, it was wrong.
17699 2002-05-13 Miguel de Icaza <miguel@ximian.com>
17701 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17702 (pp_expr): do not abort on unknown input, just return.
17703 (eval): abort if there are pending chars.
17705 * attribute.cs (Attribute.Resolve): Positional parameters are
17706 optional. Deal with that case.
17708 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17709 the Ansi/Unicode/Auto information for the type.
17711 (TypeContainer.DefineType): instantiate the EmitContext here, as
17712 we will be using it during the type definition (to resolve
17713 attributes) and during the emit phase.
17715 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17716 to pull type information out of the attributes
17718 (Attribute.Resolve): track the constructor builder, and allow for
17719 multiple invocations (structs and classes will use this).
17721 * ecore.cs (MemberLookupFinal): new version with all the
17722 parameters customizable.
17724 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17725 constructors. Return if the result value is null (as the error
17726 would have been flagged already by MemberLookupFinal)
17728 Do not allow instances of abstract classes or interfaces to be
17731 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17732 We have to compare the assembly property here when dealing with
17733 FamANDAssem and Assembly access modifiers, because we might be
17734 creating an assembly from *modules* (that means that we are not
17735 getting TypeBuilders for types defined in other modules that are
17736 part of this assembly).
17738 (Method.Emit): If the method is marked abstract and has a body,
17741 (TypeContainer.DefineMembers): If both the defined member and the
17742 parent name match are methods, then do not emit any warnings: let
17743 the Method.Define routine take care of flagging warnings. But if
17744 there is a mismatch (method overrides something else, or method is
17745 overriwritten by something, then emit warning).
17747 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17748 set to null, this means `do not check for the return type on the
17751 (Method.Define): set the return type for the method signature to
17752 null, so that we get methods with the same name and parameters and
17753 different return types. This is used to flag warning 114 (you are
17754 hiding a method, and you probably want to use the new/override
17757 * typemanager.cs (MemberLookup): Implemented proper access
17758 control, closing a long standing set of bug reports. The problem
17759 was that the Framework only has two bits: Public and NonPublic,
17760 and NonPublic includes private and protected methods, but we need
17761 to enforce the FamANDAssem, FamOrAssem and Family.
17763 2002-05-11 Miguel de Icaza <miguel@ximian.com>
17765 * statement.cs (GotoCase): Return true: Ammounts to giving up
17766 knowledge on whether we return or not, and letting the other case
17767 be responsible for it.
17769 2002-05-10 Miguel de Icaza <miguel@ximian.com>
17771 * driver.cs: Do not load directories for each file processed, only
17772 do it if there is a pattern.
17774 * ecore.cs: Report readonly assigns here as well, as we might have
17775 been resolved only by MemberAccess.
17777 (SimpleName.SimpleNameResolve): Also be useful for LValue
17778 resolution. We need this to propagate assign to local readonly variables
17780 * typemanager.cs: Use a ptrhashtable for the criteria, because we
17781 do not want to reuse potential criteria memory.
17783 * class.cs (MyEventBuilder): Set reflected_type;
17785 * ecore.cs (Constantify): Added support for constifying bools.
17787 (RootContext.LookupType): Added a cache for values looked up in
17788 the declaration space.
17790 * typemanager.cs (FindMembers): Now is a front-end to
17791 RealFindMembers, and provides a two-level hashtable-based cache to
17794 15% performance improvement: from 22.5 to 19.2 seconds.
17796 * expression.cs (IsParamsMethodApplicable): use foreach.
17797 (Invocation.DoResolve): ditto.
17798 (New.DoResolve): ditto.
17799 (ArrayCreation.DoResolve): ditto.
17801 * ecore.cs (FindMostEncompassingType): use foreach.
17803 * delegate.cs (NewDelegate.DoResolve): Use foreach
17805 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17806 (RemoveMethods): use foreach.
17808 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17809 nested foreach statements instead of for, and also break out of
17810 the inner loop once a match is found.
17812 (Invocation.OverloadResolve): Use foreach, simplify the code.
17814 2002-05-08 Miguel de Icaza <miguel@ximian.com>
17816 * cfold.cs (BinaryFold): During an enumeration evaluation context,
17817 we actually unwrap the expression to allow for extra information
17820 * expression.cs: Use Shr_Un on unsigned operations.
17822 2002-05-08 Ravi Pratap <ravi@ximian.com>
17824 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
17825 applicable operators was not being considered correctly. This closes
17826 the bug Miguel reported.
17828 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17830 * attribute.cs: check that the type derives from System.Attribute
17831 and report the correct error in that case (moved the duplicate code to
17832 its own method, too).
17834 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17836 * attribute.cs: lookup attribute type name as the spec says: first the
17837 bare attribute name and then name + "Attribute" (nant compiles with
17838 mcs after this fix).
17840 2002-05-07 Miguel de Icaza <miguel@ximian.com>
17842 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
17843 Because of the way we parse things, we should try to see if a
17844 UIntConstant can fit in an integer.
17846 2002-05-07 Ravi Pratap <ravi@ximian.com>
17848 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17849 when we are in an explicit context.
17851 (ConvertReferenceExplicit): When converting from Iface type S to Class
17852 T make sure the rules are implemented as an OR.
17854 * parameter.cs (ParameterType): Make it a property for now although the
17855 purpose really isn't anything immediate.
17857 * expression.cs (Is*Applicable): Do better checking on the parameter type
17858 of a ref/out parameter. The ones from the system assemblies are already
17859 marked with the correct type so we don't need to do any correction.
17861 * ecore.cs (StandardConversionExists): Conversion from Interface types to
17862 the object type is standard too so include that.
17864 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17866 * ecore.cs (StandardConversionExists): Augment with missing code:
17867 deal with IntConstant, LongConstants and Enumerations.
17869 * assign.cs: Report the error, instead of failing silently
17871 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17872 typecontainer that they are declared, because the
17873 typecontainer/namespace will have the list of using clauses that
17874 need to be applied.
17876 Assembly Attributes were escaping the normal registration
17879 (EmitCode): Apply attributes within an EmitContext that represents
17880 the container they were declared on.
17882 * cs-parser.jay: Track bases for structs. How did I get this wrong?
17884 2002-05-06 Ravi Pratap <ravi@ximian.com>
17886 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17887 Revamp completely - make much cleaner as we now operate only
17890 (FindMostSpecificSource, FindMostSpecificTarget): New methods
17891 to implement the logic detailed in the spec more correctly.
17893 (UserDefinedConversion): Update accordingly.
17895 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17897 * statement.cs: Return flow analysis information up.
17899 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17902 (token): Do not consume an extra character before calling
17905 2002-05-06 Piers Haken <piersh@friskit.com>
17907 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17909 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17911 * class.cs (Constructor.Emit): Set the IsStatic flag in the
17912 EmitContext during the instance constructor initializer
17913 resolution, to stop access to instance variables.
17915 This is mandated by the spec, last paragraph of the `constructor
17916 initializers' section.
17918 2002-05-05 Miguel de Icaza <miguel@ximian.com>
17920 * cs-parser.jay, class.cs (Accessor): new class used to represent
17921 an accessor (get or set). In the past we used `null' to represent
17922 a missing accessor. But this is ambiguous because there was no
17923 way to tell in abstract indexers/properties if one of them was
17926 Now there is a way of addressing that.
17928 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17929 instead of FindMembers.
17931 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17932 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17934 * attribute.cs: Treat indexers and properties as the same in terms
17935 of applying attributes
17937 * ecore.cs (FindMostEncompassedType): Use statically initialized
17938 EmptyExpressions()s like we do elsewhere to avoid creating useless
17939 objects (and we take this out of the tight loop).
17941 (GetConversionOperators): Move the code to extract the actual
17942 operators to a separate routine to clean things up.
17944 2002-05-04 Miguel de Icaza <miguel@ximian.com>
17946 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17947 events are always registered FieldBuilders.
17949 * class.cs (FieldBase): New class shared by Fields
17951 * delegate.cs: If we are a toplevel delegate, use our full name.
17952 If we are a nested delegate, then only use our tail name.
17954 2002-05-02 Ravi Pratap <ravi@ximian.com>
17956 * expression.cs (IsApplicable): Ensure that we add the "&" to
17957 ref/out types before comparing it with the type of the argument.
17959 (IsParamsMethodApplicable): Ditto.
17961 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
17964 * delegate.cs : Handle the case when we have more than one applicable
17965 method. Flag an error only when we finish checking all.
17967 2002-05-02 Miguel de Icaza <miguel@ximian.com>
17969 * expression.cs: Add support for boolean static initializers.
17971 2002-05-01 Miguel de Icaza <miguel@ximian.com>
17973 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17975 * parameter.cs (ComputeParameterTypes,
17976 ComputeAndDefineParameterTypes): Better error handling: now we
17977 clear the `types' cache if we fail during any of the type lookups.
17978 We also return the status code correctly to our caller
17980 * delegate.cs: If we fail to define a delegate, abort the extra
17983 * expression.cs (Binary.ResolveOperator): for
17984 operator==(object,object) and operator !=(object, object) we also
17985 have to verify that there is an implicit conversion from one to
17988 (ArrayAccess.DoResolve): Array Access can operate on
17991 2002-04-30 Miguel de Icaza <miguel@ximian.com>
17993 * assign.cs (CompoundAssign): A new class used as a "flag" that
17994 the assignment actually is happening as part of a compound
17995 assignment operator.
17997 During compound assignment, a few new rules exist to enable things
18004 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18005 to the type of x) if y is implicitly convertible to the type of x,
18006 and the operator is a builtin operator and the return type of the
18007 operator is explicitly convertible to the type of x.
18009 * rootcontext.cs: Reset warning level to 2. 4 catches various
18010 "interesting" features in mcs, we must clean this up at some
18011 point, but currently am trying to kill other bugs ;-)
18013 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18014 in container classes as well.
18016 * expression.cs (Binary.ResolveOperator): Handle string case
18017 before anything else (as operator overloading does emit an error
18018 before doing anything else).
18020 This code could go away when we move to a table driven model, but
18021 i could not come up with a good plan last night.
18023 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
18025 * typemanager.cs (CSharpName): reimplementation using regex.
18026 * class.cs: added null check for fields in Emit
18027 * rootcontext.cs: set warninglevel to 4
18029 2002-04-29 Miguel de Icaza <miguel@ximian.com>
18031 * typemanager.cs (CSharpName): reimplemented with Lupus
18034 2002-04-28 Miguel de Icaza <miguel@ximian.com>
18036 * statement.cs (If): correclty implement Resolve, because we were
18037 not catching sem errors in there. The same process is needed
18039 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18042 (Statement.Warning_DeadCodeFound): Factorize code.
18043 (While): Report dead code here too.
18045 (Statement): Added Resolve virtual method to allow
18046 for resolution split from the emit code.
18048 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18050 * statement.cs (EmitBoolExpression): No longer try to resolve the
18052 (MakeBoolean): New utility function that resolve, implicitly
18053 converts to boolean and tags the expression.
18056 (If, Do): Implement dead code elimination.
18057 (While): Implement loop inversion
18059 (Do, While, For, If): Resolve the expression prior to calling our
18062 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
18065 - added method Report28 (warning: program has more than one entry point)
18066 - added method IsEntryPoint, implements paragraph 10.1 of the spec
18067 - modified method Method.Define, the part at the end of the method
18069 * rootcontext.cs: added static public Location EntryPointLocation;
18071 * ../errors/cs0028.cs : Add test case for the above warning.
18074 - modified method CSharpName to allow arrays of primitive type to
18075 be printed nicely (e.g. instead of System.Int32[][] it now prints
18077 - added method CSharpSignature: returns the signature of a method
18078 in string format to be used in reporting errors, warnings, etc.
18080 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18083 2002-04-26 Ravi Pratap <ravi@ximian.com>
18085 * delegate.cs (Define): Fix extremely silly bug where I was
18086 setting the type of the 'object' parameter of the BeginInvoke
18087 method to System.IAsyncResult instead of System.Object ;-)
18089 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18091 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18094 (Constructor.Emit): return if we fail to initialize the
18095 constructor. Another door closed!
18097 * expression.cs (New.DoResolve): Improve error message (from -6 to
18098 1501). Use DeclaredOnly lookup to find the exact constructor.
18100 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18101 loop. This is useful.
18103 * cs-parser.jay: Adjust the default parameters so that destructors
18104 have the proper signature.
18106 2002-04-26 Martin Baulig <martin@gnome.org>
18108 * driver.cs (LoadAssembly): If `assembly' contains any characters
18109 which are only valid in path names and not in assembly names
18110 (currently slash, backslash and point), use Assembly.LoadFrom ()
18111 instead of Assembly.Load () on the `assembly' (before iteration
18112 over the link_paths).
18114 2002-04-26 Martin Baulig <martin@gnome.org>
18116 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18118 2002-04-25 Miguel de Icaza <miguel@ximian.com>
18120 * class.cs (Property): use the new typemanager.MemberLookup
18122 (TypeContainer.MemberLookup): Implement using the
18123 TypeManager.MemberLookup now.
18125 * typemanager.cs: Make MemberLookup a function of the TypeManager,
18126 and return MemberInfos, so that these can be used without an
18127 EmitContext (what we had before).
18129 2002-04-24 Miguel de Icaza <miguel@ximian.com>
18131 * expression.cs: Fix the case where the argument to params if the
18132 type of the params. I omitted handling this before. Fixed
18134 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18136 * driver.cs: Call BootCorlib_PopulateCoreType
18138 * class.cs (Property.CheckBase): Check for properties only, not
18141 * interface.cs: Temporary hack: try/catch around the
18142 CustomAttributeBuilder, because I am getting an exception that I
18145 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18146 types whose definitions are required to be there (attributes are
18147 defined before standard types).
18149 Compute definitions as we boot the various types, as they are used
18150 immediately (value_type class will need object_type, but if we do
18151 not initialize object_type, we will pass a null, which will let
18152 the runtime pick the System.Object from the existing corlib, which
18153 is not what we want).
18155 2002-04-22 Patrik Torstensson <totte@labs2.com>
18157 * cs-tokenizer.cs: fixed a number of trim() issues.
18159 2002-04-22 Ravi Pratap <ravi@ximian.com>
18161 * expression.cs (Argument.Type): Ensure that we return the correct
18162 type when we have out or ref parameters [in which case we
18165 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18167 * class.cs (Property, Indexer): Allow extern modifier in there.
18169 * typemanager.cs (InitBaseTypes): Initializes object_type and
18170 value_type, since those will be used early on during the bootstrap
18171 process to compile corlib.
18173 (InitCoreTypes): Move code from here to InitBaseTypes.
18175 2002-04-21 Miguel de Icaza <miguel@ximian.com>
18177 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18178 single-dimension arrays as using the ldlen opcode.
18180 Daniel Lewis discovered this optimization.
18182 * typemanager.cs: Add signature for System.Array::get_Length
18184 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18186 * statement.cs: report the error when the foreach does not apply to an
18187 array nor a collection.
18189 2002-04-19 Miguel de Icaza <miguel@ximian.com>
18191 * expression.cs: Add implicit conversions to the operator ~.
18193 * constant.cs (DecimalConstant.Emit): Emit decimal value.
18195 * typemanager.cs: Locate the decimal constructor.
18197 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18199 * attribute.cs: use the new property of TypeOf.
18200 * expression.cs: added 'get' property around typearg.
18202 These changes fix a build breaker reported by NickD. Is this the
18203 correct way to fix? If not, please, revert my changes and make it
18206 2002-04-17 Miguel de Icaza <miguel@ximian.com>
18208 * attribute.cs: Add support for typeof in attribute invocations.
18209 I am not sure that this is right though.
18211 2002-04-14 Duncan Mak <duncan@ximian.com>
18213 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18214 Binary.Operator.Division case.
18216 2002-04-13 Ravi Pratap <ravi@ximian.com>
18218 * class.cs (DefineType): Ensure that we do a proper check on
18219 attribute types and also register it with the TypeManager.
18221 (TypeContainer.Targets): The default for attribute types is
18222 AttributeTargets.All.
18224 * attribute.cs (ApplyAttributes): Registering the attribute type
18225 is done elsewhere, not when we discover we have a Usage attribute.
18227 2002-04-12 Ravi Pratap <ravi@ximian.com>
18229 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18230 and get rid of is_delegate parameter.
18232 * everywhere : update.
18234 2002-04-12 Ravi Pratap <ravi@ximian.com>
18236 * cs-parser.jay (compilation_unit): Revamp completely to use
18237 some new ideas that I got from Rhys' grammar to solve the problems
18238 with assembly level attributes.
18240 (outer_declaration): New grammar production.
18242 (attribute_sections): Add.
18244 (opt_attributes): Base on attribute_sections
18246 (namespace_declaration): Allow opt_attributes to tackle the case
18247 when we have assembly level attributes - we are clever in this
18250 * attribute.cs (ApplyAttributes): Do not worry about assembly
18251 attributes in the non-global context.
18253 * rootcontext.cs (AddGlobalAttributes): Go back to using this
18254 instead of SetGlobalAttributes.
18256 * class.cs, rootcontext.cs : Ensure we define and generate
18257 attribute types before anything else.
18259 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18260 and flag the new error -20 for the case when the attribute type
18261 does not have valid targets specified. csc does not catch this.
18263 * ../errors/errors.txt : update for error # -20
18265 2002-04-11 Ravi Pratap <ravi@ximian.com>
18267 * support.cs (InternalParameters.ParameterModifier): Do some null
18268 checking and return sane values.
18270 * class.cs (Method.Define): If we are a PInvoke method, ensure
18271 that we are static and extern. Report error # 601
18273 * ../errors/cs0601.cs : Add test case for the above error.
18275 2002-04-07 Ravi Pratap <ravi@ximian.com>
18277 * rootcontext.cs (attribute_types): We need to keep type of
18278 all attribute types separately and emit code for them first.
18280 (RegisterAttribute) : Implement.
18282 * class.cs (DefineType): Check if the current Type is a custom
18283 attribute type and register it accordingly.
18285 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18286 adding the first attribute twice and rename to
18288 (SetGlobalAttributes): this.
18290 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18293 * attribute.cs (ApplyAttributes): Take an additional argument telling us
18294 if we are processing global arguments. Hmm, I am unsure of this.
18296 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18298 * expression.cs: added static array of strings to avoid calling
18299 Enum.ToString () for Operator in Binary. Significant recover of
18302 2002-04-10 Miguel de Icaza <miguel@ximian.com>
18304 * class.cs (FindMembers): Allow the Builders of the various
18305 members to be null. If they are skip them. This only happens
18306 during the PInvoke declaration.
18308 2002-04-09 Miguel de Icaza <miguel@ximian.com>
18310 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18311 failure, so we do not keep going afterwards.
18313 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18314 wanted to pass `false' as the `is_delegate' argument. If this is
18315 the case, why not use delegate_type == null to mean `is_delegate =
18316 false' and anything else as is_delegate = true.
18318 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
18320 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18321 code for the section, not the beginning of the tests.
18323 2002-04-08 Miguel de Icaza <miguel@ximian.com>
18325 * cfold.cs: Handle operator + (Enum x, Underlying x)
18327 * expression.cs (Binary): same. Warn about errors where we have
18328 Enum/Enum in operator + as well.
18330 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
18333 - added support for switch(bool)
18334 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18335 - add TableSwitchEmit() to handle table-based switch statements
18337 2002-04-05 Ravi Pratap <ravi@ximian.com>
18339 * expression.cs (Invocation.OverloadResolve): Factor out code which
18340 does parameter compatibility checking with arguments so that we can
18341 re-use the code even from Delegate.VerifyApplicability
18343 (VerifyArgumentsCompat): Move above code here.
18345 * delegate.cs (VerifyApplicability): Get rid of duplicate code
18346 and instead make a call to the above method.
18348 2002-03-31 Ravi Pratap <ravi@ximian.com>
18350 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18351 We use it to keep track of classes which are attribute types.
18353 2002-04-02 Miguel de Icaza <miguel@ximian.com>
18355 * delegate.cs (Delegate.Define): Correctly define the types in the
18356 presence of fixed and array parameters.
18358 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18361 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18362 include NonPublic after the first iteration.
18364 * class.cs (Indexer.CheckBase): Only check if both parents are
18367 * cs-parser.jay (accessor_body): If empty, set to null.
18369 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18370 same code path here to resolve constants names that we did have in
18371 MemberAccess.DoResolve. There is too much code duplicated here.
18373 2002-04-01 Miguel de Icaza <miguel@ximian.com>
18375 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18377 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18380 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18381 tokens, numbers and strings.
18383 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18386 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18387 asyncronous parameters and the regular parameters.
18389 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18390 specify the target directory.
18392 * expression.cs: (This.DoResolve): Simplify
18393 (As.Emit): Optimize, do not generate IsInst if the expression is
18394 always of the given type.
18396 (Is.DoResolve): Bug fix, we were reporting both always/never for
18399 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18400 creating too many unnecessary arrays.
18402 2002-03-31 Miguel de Icaza <miguel@ximian.com>
18404 * class.cs (EmitFieldInitializer): Use Assign expression to assign
18405 fields instead of rolling our own initializer. Takes care of all
18406 implicit conversions, and drops unnecessary static checks/argument.
18408 2002-03-31 Dick Porter <dick@ximian.com>
18410 * driver.cs: use the GetDirectories() return values properly, and
18411 use "/" as path separator.
18413 2002-03-30 Miguel de Icaza <miguel@ximian.com>
18415 * expression.cs (Unary): Optimize - - expr into expr.
18416 (Binary): Optimize a + (-b) into a -b.
18418 * codegen.cs (CodeGen): Made all methods static.
18420 2002-03-29 Miguel de Icaza <miguel@ximian.com>
18424 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18425 TypeBuilder property.
18427 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18430 * tree.cs: Removed the various RecordXXXX, and replaced with a
18431 single RecordDecl. Removed all the accessor methods, and just
18432 left a single access point Type
18434 * enum.cs: Rename DefineEnum to DefineType.
18436 * decl.cs: New abstract method `DefineType' used to unify the
18437 Defines for Enumerations, Interfaces, TypeContainers and
18440 (FindType): Moved LookupInterfaceOrClass here. Moved the
18441 LookupBaseClasses method that used to live in class.cs and
18442 interface.cs here, and renamed to FindType.
18444 * delegate.cs: Implement DefineType. Take advantage of the
18445 refactored pattern for locating the parent builder without taking
18446 the parent_builder argument (which we know does not work if we are
18447 nested, and triggering a toplevel definition).
18449 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18451 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18452 accessibility of a member has changed during override and report
18455 * class.cs (Method.Define, Property.Define): Only complain on
18456 overrides if the method is private, any other accessibility is
18457 fine (and since we just checked the permission is the same, we are
18460 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18461 and elif are processed always. The other pre-processing
18462 directives are only processed if we are "taking" the path
18464 2002-03-29 Martin Baulig <martin@gnome.org>
18466 * class.cs (Method.Emit): Only emit symbolic debugging info if the
18467 current location is not Null.
18469 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18470 a separate method so we can profile it.
18472 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18473 `span.Seconds' are just seconds, but no minutes or hours.
18474 (MainDriver): Profile the CodeGen.SaveSymbols calls.
18476 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18478 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18479 Remove the gratuitous set of Final:
18481 // If an interface implementation, then we can set Final.
18482 if (((flags & MethodAttributes.Abstract) == 0) &&
18483 implementing.DeclaringType.IsInterface)
18484 flags |= MethodAttributes.Final;
18486 I do not know what I was smoking when I used that.
18489 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18490 step into fixing the name resolution issues for delegates and
18491 unifying the toplevel name resolution.
18493 2002-03-28 Martin Baulig <martin@gnome.org>
18495 * class.cs (Method.Emit): If we have a symbol writer, call its
18496 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18497 tell it about the current method.
18499 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18500 writer that we're going to emit the first byte of IL code for a new
18501 statement (a new source line).
18502 (EmitContext.EmitTopBlock): If we have a symbol writer, call
18503 EmitContext.Mark() before emitting any code.
18505 * location.cs (SymbolDocument): Return null when we're Null.
18507 * statement.cs (Statement): Moved the `Location loc' variable here.
18508 (Statement.EmitBoolExpression): If we have a symbol writer, call
18509 ec.Mark() before emitting any code to tell it that we're at the
18510 beginning of a new statement.
18511 (StatementExpression): Added `Location' argument to the constructor.
18512 (Block): Added public readonly variable `StartLocation' and public
18513 variable `EndLocation'. The latter is to be set using SetEndLocation().
18514 (Block): Added constructor which takes a start and end location.
18515 (Block.SetEndLocation): New method. This sets the end location.
18516 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18517 local variables we create.
18518 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18519 each statement and do also mark the begin and end of the block.
18521 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18522 tell it the current lexer.Location, use Location.Null for the end of the
18524 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18525 current block, set its end location using SetEndLocation().
18526 (statement_expression): StatementExpression constructor now takes the
18527 lexer.Location as additional argument.
18528 (for_statement, declare_local_variables): Likewise.
18529 (declare_local_variables): When creating a new implicit block, use the
18530 new Block constructor and pass it the lexer.Location.
18532 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18534 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18535 members also on the parent interfaces recursively.
18537 2002-03-27 Miguel de Icaza <miguel@ximian.com>
18539 * report.cs: Use new formats, since Gonzalo finished the missing
18542 * expression.cs (Binary.ResolveOperator): added missing operator|
18543 operator& and operator^ for bool/bool.
18545 * cs-parser.jay: CheckDef now takes a Location argument that is
18546 used to report errors more precisly (instead of reporting the end
18547 of a definition, we try to track something which is a lot closer
18548 to the source of the problem).
18550 * cs-tokenizer.cs: Track global token use, so we can properly flag
18551 the use of #define/#undef after the first token has been seen.
18553 Also, rename the reportXXXX to Error_DescriptiveName
18555 * decl.cs (DeclSpace.IsTopLevel): Move property here from
18556 TypeContainer, so that Enum and Interface can use this too.
18558 * class.cs (TypeContainer.LookupInterfaceOrClass,
18559 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18560 `builder' argument. Typically this was used to pass the parent
18561 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18564 The problem is that a nested class could trigger the definition of
18565 a toplevel class, and the builder would be obviously wrong in that
18568 So we drop this argument, and we compute dynamically the
18569 TypeBuilder/ModuleBuilder (the correct information was available
18570 to us anyways from DeclSpace.Parent)
18572 * interface.cs (Interface.DefineInterface): Drop builder
18573 parameter cleanup like class.cs
18575 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
18578 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18581 (Try.Emit): Propagate the returns value from the statement.
18583 (Return.Emit): Even if we are leavning
18585 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18587 * modifiers.cs: Fix the computation of MethodAttributes flags.
18589 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18591 * driver.cs: allow compilation of files that start with '/'.
18592 Add a default case when checking the argument of --target.
18594 2002-03-25 Miguel de Icaza <miguel@ximian.com>
18596 * interface.cs: Implement the same search algorithm for types in
18597 the interface code.
18599 * delegate.cs: Do not allow multiple definition.
18601 * Recovered ChangeLog that got accidentally amputated
18603 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18605 * rootcontext.cs: Load manually enum to allow core classes to
18606 contain enumerations.
18608 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18609 Update to new static methods in TypeManager.
18611 * typemanager.cs (GetMethod, GetConstructor): Use our
18612 implementation of FindMembers to find the members, since during
18613 corlib compilation, the types are TypeBuilders and GetMethod and
18614 GetConstructor do not work.
18616 Make all methods in TypeManager static.
18618 (InitCodeHelpers): Split the functionality from
18619 the InitCodeTypes function.
18621 * driver.cs: Call InitCodeHelpers after we have populated the
18624 * cs-parser.jay (delegate_declaration): we did not used to compute
18625 the delegate name correctly for void delegates.
18627 2002-03-24 Miguel de Icaza <miguel@ximian.com>
18629 * rootcontext.cs (RootContext): Init the interface_resolve_order
18630 and type_container_resolve_order always.
18632 (ResolveCore, BootstrapCorlib_ResolveClass,
18633 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18634 compiler when compiling with --nostdlib
18636 * class.cs (TypeContainer.DefineType): Check that our parent is
18637 not null. This test is most important when we are bootstraping
18640 * codegen.cs: Split out the symbol writing code.
18642 2002-03-25 Martin Baulig <martin@gnome.org>
18644 * driver.cs (-g): Made -g an alias for --debug.
18646 2002-03-24 Martin Baulig <martin@gnome.org>
18648 * codegen.cs (SymbolWriter): New public variable. Returns the
18649 current symbol writer.
18650 (CodeGen): Added `bool want_debugging_support' argument to the
18651 constructor. If true, tell the ModuleBuild that we want debugging
18652 support and ask it for the ISymbolWriter.
18653 (Save): If we have a symbol writer, call it's Close() method after
18654 saving the assembly.
18656 * driver.c (--debug): New command line argument to create a
18657 debugger information file.
18659 * location.cs (SymbolDocument): New public property. Returns an
18660 ISymbolDocumentWriter object for the current source file or null
18661 if we don't have a symbol writer.
18663 2002-03-21 Miguel de Icaza <miguel@ximian.com>
18665 * driver.cs (LoadAssembly): Correctly return when all the paths
18666 have been tried and not before.
18668 * statement.cs (Switch.Emit): return the actual coverage for this
18669 statement (returns/not-returns)
18671 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
18672 switch of the statement if we are the last switch section. That
18673 kills two problems: try/catch problems (we used to emit an empty
18674 nop at the end) and switch statements where all branches would
18677 2002-03-19 Miguel de Icaza <miguel@ximian.com>
18679 * driver.cs: Add default assemblies (the equivalent to the
18680 Microsoft CSC.RSP file)
18682 * cs-tokenizer.cs: When updating `cols and setting it to zero,
18683 also update tokens_seen and set it to false.
18685 * driver.cs: Implement --recurse for Mike.
18687 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18688 correctly splitting out the paths.
18690 2002-03-18 Miguel de Icaza <miguel@ximian.com>
18692 * interface.cs (Interface.PopulateProperty): Instead of using
18693 `parent' as the declaration space for the set parameters, use
18696 * support.cs (InternalParameters): InternalParameters constructor
18697 takes a DeclSpace instead of a TypeContainer.
18699 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18700 types are being initialized, load the address of it before calling
18703 (New): Provide a mechanism to disable the generation of local
18704 value type temporaries when the caller will be providing us with
18705 an address to store it.
18707 (ArrayCreation.EmitDynamicInitializers): Use it.
18709 2002-03-17 Miguel de Icaza <miguel@ximian.com>
18711 * expression.cs (Invocation.EmitArguments): Only probe for array
18712 property if there is more than one argument. Sorry about that.
18714 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18715 empty param arrays.
18717 * class.cs (Method.LabelParameters): Fix incorrect code path that
18718 prevented the `ParamArrayAttribute' from being applied to the
18721 2002-03-16 Miguel de Icaza <miguel@ximian.com>
18723 * support.cs (ReflectionParameters): Correctly compute whether the
18724 last argument is a params array. Fixes the problem with
18727 * typemanager.cs: Make the assemblies array always be non-null
18728 (empty, but non-null)
18730 * tree.cs (RecordDecl): New function that abstracts the recording
18731 of names. This reports error 101, and provides a pointer to the
18732 previous declaration. Fixes a crash in the compiler.
18734 * cs-parser.jay (constructor_declaration): Update to new grammar,
18735 and provide a constructor_body that can be empty.
18737 2002-03-15 Miguel de Icaza <miguel@ximian.com>
18739 * driver.cs: Add support for --resources.
18741 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18742 Make all types for the various array helper methods be integer.
18744 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18745 CheckState to ConvCast.
18747 (ConvCast): Now it takes a `checked' state argument, to avoid
18748 depending on the emit context for the conversion, and just using
18749 the resolve time setting.
18751 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18752 instead of Invocation.EmitArguments. We do not emit the original
18753 arguments, instead we emit those which have been converted to
18754 unsigned int expressions.
18756 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18758 * codegen.cs: ditto.
18760 * expression.cs (LocalVariableReference): Drop the use of the
18761 Store function that depended on the variable index.
18763 * statement.cs (VariableInfo): Drop the `Idx' property from this
18764 class, as this is not taking into account the indexes for
18765 temporaries tat we generate during the execution, getting the
18768 * class.cs: First emit class initializers, then call the parent
18771 * expression.cs (Binary): Fix opcode emision.
18772 (UnaryMutator.EmitCode): Support checked code generation
18774 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18775 matches for events for both the Static and Instance scans,
18776 pointing to the same element. Fix that.
18778 2002-03-14 Miguel de Icaza <miguel@ximian.com>
18780 * rootcontext.cs (ResolveTree): Always set the
18781 interface_resolve_order, because nested interfaces will be calling
18784 * class.cs (GetInterfaceOrClass): Track the same resolution
18785 process used by TypeManager.LookupType. This fixes the nested
18786 type lookups in class declarations (separate path from
18789 (TypeContainer.DefineType): Also define nested interfaces.
18790 (TypeContainer.RegisterOrder): New public function used to
18791 register the order in which child interfaces need to be closed.
18793 Nested interfaces need to be closed after their parents have been
18796 * interface.cs (InterfaceAttr): Put all the logic for computing
18797 the interface attribute here.
18799 (DefineInterface): Register our interface order with the
18800 RootContext or with the TypeContainer depending on the case.
18802 2002-03-12 Miguel de Icaza <miguel@ximian.com>
18804 * cs-parser.jay: rework foreach statement to work with the new
18805 changes to the policy on SimpleNames.
18807 * report.cs: support Stacktrace on warnings as well.
18809 * makefile: drop --unsafe and /unsafe from the compile.
18811 2002-03-13 Ravi Pratap <ravi@ximian.com>
18813 * ecore.cs (StandardConversionExists): Modify to take an Expression
18814 as the first parameter. Ensure we do null -> reference type conversion
18817 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18818 temporary Expression objects.
18820 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18822 * interface.cs: workaround bug in method overloading resolution
18823 (there is already a bugzilla bug for it).
18825 2002-03-12 Miguel de Icaza <miguel@ximian.com>
18827 We could also solve this problem by having a separate path for
18828 performing type lookups, instead of DoResolve, we could have a
18829 ResolveType entry point, and only participating pieces of the
18830 production (simplename, deref, array) would implement this.
18832 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18833 signal SimpleName to only resolve type names and not attempt to
18834 resolve anything else.
18836 * expression.cs (Cast): Set the flag.
18838 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18840 * class.cs: Only report 108 if there is no `new' modifier.
18842 * cs-parser.jay: rework foreach statement to work with the new
18843 changes to the policy on SimpleNames.
18845 * report.cs: support Stacktrace on warnings as well.
18847 * makefile: drop --unsafe and /unsafe from the compile.
18849 2002-03-11 Miguel de Icaza <miguel@ximian.com>
18851 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18852 lookups here, instead of doing that at parse time. This means
18853 that our grammar will not introduce `LocalVariableReferences' as
18854 expressions at this point. That solves the problem of code like
18858 static void Main ()
18862 This is only half the fix. The full fix requires parameters to
18863 also be handled in this way.
18865 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18866 makes the use more obvious of the DeclSpace. The
18867 ec.TypeContainer.TypeBuilder is now only used to pull the
18868 TypeBuilder for it.
18870 My theory is that I can get rid of the TypeBuilder completely from
18871 the EmitContext, and have typecasts where it is used (from
18872 DeclSpace to where it matters).
18874 The only pending problem is that the code that implements Aliases
18875 is on TypeContainer, and probably should go in DeclSpace.
18877 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18878 lookups here, instead of doing that at parse time. This means
18879 that our grammar will not introduce `LocalVariableReferences' as
18880 expressions at this point. That solves the problem of code like
18884 static void Main ()
18888 This is only half the fix. The full fix requires parameters to
18889 also be handled in this way.
18891 * class.cs (Property.DefineMethod): When implementing an interface
18892 method, set newslot, when implementing an abstract method, do not
18893 set the flag (before we tried never setting it, or always setting
18894 it, which is the difference).
18895 (Indexer.DefineMethod): same.
18896 (Method.DefineMethod): same.
18898 * ecore.cs: Only set the status used flag if we get back a Field.
18900 * attribute.cs: Temporary hack, so Paolo can keep working.
18902 2002-03-08 Ravi Pratap <ravi@ximian.com>
18904 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18905 the unmanaged type in the case we have a MarshalAs attribute.
18907 (Resolve): Handle the case when we are parsing the special MarshalAs
18908 attribute [we need to store the unmanaged type to use later]
18910 * typemanager.cs (marshal_as_attr_type): Built in type for the
18911 MarshalAs Attribute.
18913 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
18914 on parameters and accordingly set the marshalling info.
18916 2002-03-09 Miguel de Icaza <miguel@ximian.com>
18918 * class.cs: Optimizing slightly by removing redundant code after
18919 we switched to the `NoTypes' return value.
18920 (Property.DefineMethod): use NoTypes here too.
18922 This fixes the bug I introduced in my last batch of changes.
18924 2002-03-05 Ravi Pratap <ravi@ximian.com>
18926 * tree.cs (RecordEnum): Add. We now keep track of enums too.
18928 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18929 Enums since those are types too.
18931 * cs-parser.jay (enum_declaration): Record enums as we parse them.
18933 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
18934 thanks to a call during the lookup process.
18936 2002-03-07 Miguel de Icaza <miguel@ximian.com>
18938 * statement.cs (Foreach): Lots of work to accomodate a particular
18939 kind of foreach statement that I had not kept in mind. It is
18940 possible to have foreachs on classes that provide a GetEnumerator
18941 method that return objects that implement the "pattern" for using
18942 a foreach, there is no need to support GetEnumerator
18945 This is needed to compile nant.
18947 * decl.cs: Only report 114 if the member is not `Finalize' and if
18948 the warning level is at least 2.
18950 * class.cs: Moved the compare function from Method to
18953 (MethodSignature.InheritableMemberSignatureCompare): Add new
18954 filter function that is used to extract inheritable methods from a
18957 (Method.Define): Use the new `inheritable_method_signature_filter'
18960 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18963 2002-03-06 Miguel de Icaza <miguel@ximian.com>
18965 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18967 * cs-parser.jay: Add opt_semicolon to the interface declaration.
18969 * expression.cs: Pass location information to
18970 ConvertImplicitStandard.
18972 * class.cs: Added debugging code to track return values from
18975 2002-03-05 Miguel de Icaza <miguel@ximian.com>
18977 * expression.cs (Is.DoResolve): If either side of the `is' is an
18978 interface, do not flag the warning.
18980 * ecore.cs (ImplicitReferenceConversion): We need a separate test
18983 * report.cs: Allow for --fatal to be used with --probe.
18985 * typemanager.cs (NoTypes): Move the definition for the empty Type
18988 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18990 (TypeContainer.DefineProxy): New function used to proxy to parent
18991 implementations when implementing interfaces.
18992 (TypeContainer.ParentImplements): used to lookup if our parent
18993 implements a public function that is required by an interface.
18994 (TypeContainer.VerifyPendingMethods): Hook this up.
18996 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18997 `modules' and `assemblies' arraylists into arrays. We only grow
18998 these are the very early start up of the program, so this improves
18999 the speedof LookupType (nicely measured).
19001 * expression.cs (MakeByteBlob): Replaced unsafe code with
19002 BitConverter, as suggested by Paolo.
19004 * cfold.cs (ConstantFold.Binary): Special case: perform constant
19005 folding of string concatenation, but if either side is a string,
19006 and the other is not, then return null, and let the runtime use
19007 the concatenation on the string plus the object (using
19008 `Object.ToString').
19010 2002-03-04 Miguel de Icaza <miguel@ximian.com>
19012 Constant Folding has been implemented now.
19014 * expression.cs (Unary.Reduce): Do not throw an exception, catch
19015 the error instead on types that are not supported in one's
19018 * constant.cs (Constant and all children): New set of functions to
19019 perform implict and explicit conversions.
19021 * ecore.cs (EnumConstant): Implement the new functions to perform
19022 conversion by proxying to the child expression.
19024 * codegen.cs: (ConstantCheckState): Constant evaluation has its
19025 own separate setting that can not be turned off from the command
19026 line using --unchecked or --checked and is only controlled using
19027 the checked/unchecked statements and expressions. This setting is
19028 used by the constant folder to flag errors.
19030 * expression.cs (CheckedExpr, UncheckedExpr): Set the
19031 ConstantCheckState as well.
19033 During Resolve, they also have to flag the state, because the
19034 constant folder runs completely in the Resolve phase.
19036 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19039 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19041 * cfold.cs: New file, this file contains the constant folder.
19043 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19044 argument to track whether we are using the resulting address to
19045 load or store a value and provide better error messages.
19047 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19048 new AddressOf arguments.
19050 * statement.cs (Foreach.EmitCollectionForeach): Update
19052 * expression.cs (Argument.Emit): Call AddressOf with proper
19053 arguments to track usage.
19055 (New.DoEmit): Call AddressOf with new arguments.
19057 (Unary.Emit): Adjust AddressOf call.
19059 2002-03-01 Ravi Pratap <ravi@ximian.com>
19061 * cs-parser.jay (member_access): Change the case for pre-defined types
19062 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
19065 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19068 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19069 essentially like methods and apply attributes like MethodImplOptions to them too.
19071 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19074 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19075 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19078 * Update code everywhere accordingly.
19080 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19082 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19084 2002-02-28 Ravi Pratap <ravi@ximian.com>
19086 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19087 try performing lookups against those instead of jumping straight into using
19088 the 'using' clauses.
19090 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19092 (LookupType): Perform lookups in implicit parents too.
19094 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19095 sequence as RootContext.LookupType.
19097 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
19098 the various cases of namespace lookups into this method.
19100 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19102 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19103 in positional arguments)
19105 * class.cs (Operator): Update the AllowedModifiers to contain
19108 * cs-parser.jay: Update operator declaration to allow for the
19109 operator body to be empty.
19111 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19114 2002-02-27 Miguel de Icaza <miguel@ximian.com>
19116 * class.cs (Method.Emit): Label parameters.
19118 * driver.cs: Return 1 or 0 as the program exit code.
19120 2002-02-26 Miguel de Icaza <miguel@ximian.com>
19122 * expression.cs: Special case the `null' object when trying to
19123 auto-compute the type, as anything can be explicitly converted to
19126 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19127 spotting this Paolo.
19129 (Expression.ImplicitNumericConversion): Perform comparissions of
19130 the type using the underlying type in the case of an enumeration
19131 rather than using the enumeration type for the compare.
19133 Cope with the underlying == type case, which is not possible to
19136 (Expression.ConvertNumericExplicit): Perform comparissions of
19137 the type using the underlying type in the case of an enumeration
19138 rather than using the enumeration type for the compare.
19140 * driver.cs: If the user does not supply an extension, assume .exe
19142 * cs-parser.jay (if_statement): Rewrote so that we can track the
19143 location for the if statement.
19145 * expression.cs (Binary.ConstantFold): Only concat strings when
19146 the operation is "+", not everything ;-)
19148 * statement.cs (Statement.EmitBoolExpression): Take a location
19150 (If, While, Do): Track location.
19152 * expression.cs (Binary.ResolveOperator): In the object + string
19153 case, I was missing a call to ConvertImplicit
19155 2002-02-25 Ravi Pratap <ravi@ximian.com>
19157 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19158 Location arguments. Ensure we use RootContext.LookupType to do our work
19159 and not try to do a direct Type.GetType and ModuleBuilder.GetType
19161 * interface.cs (PopulateMethod): Handle the type of the parameter being
19164 * expression.cs (Invocation.BetterFunction): Handle the case when we
19165 have a params method with no fixed arguments and a call is made with no
19168 2002-02-25 Miguel de Icaza <miguel@ximian.com>
19170 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19171 the verbatim-string-literal
19173 * support.cs (InternalParameters.ParameterModifier): handle null
19175 (InternalParameters.ParameterType): ditto.
19177 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19178 duplicating the name of the variable parameter.
19179 (GetParameterByName): Fix bug where we were not looking up array
19180 paramters if they were the only present (thanks Paolo!).
19181 (GetParameterInfo): We only have an empty set of types if both
19182 fixed and array are set to null.
19183 (GetParameterInfo-idx): Handle FixedParameter == null
19185 * cs-parser.jay: Handle the case where there is no catch
19186 statements (missing null test).
19188 2002-02-22 Miguel de Icaza <miguel@ximian.com>
19190 * driver.cs (MainDriver): Be conservative on our command line
19193 Catch DirectoryNotFoundException when calling GetFiles.
19195 (SplitPathAndPattern): Used to split the input specification into
19196 a path and a pattern that we can feed to Directory.GetFiles.
19198 2002-02-21 Miguel de Icaza <miguel@ximian.com>
19200 * statement.cs (Fixed): Implement the last case of the Fixed
19201 statement (string handling).
19203 * expression.cs (StringPtr): New class used to return a char * to
19204 a string; Used by the Fixed statement.
19206 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
19208 * expression.cs (Binary.ResolveOperator): Remove redundant
19209 MemberLookup pn parent type.
19210 Optimize union call, we do not need a union if the types are the same.
19211 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19214 Specialize the use of MemberLookup everywhere, instead of using
19215 the default settings.
19217 (StackAlloc): Implement stackalloc keyword.
19219 * cs-parser.jay: Add rule to parse stackalloc.
19221 * driver.cs: Handle /h, /help, /?
19223 * expression.cs (MakeByteBlob): Removed the hacks we had in place
19224 before we supported unsafe code.
19226 * makefile: add --unsafe to the self compilation of mcs.
19228 2002-02-20 Miguel de Icaza <miguel@ximian.com>
19230 * expression.cs (PointerArithmetic): New class that is used to
19231 perform pointer arithmetic.
19232 (Binary.Resolve): Handle pointer arithmetic
19233 Handle pointer comparission.
19234 (ArrayPtr): Utility expression class that is used to take the
19235 address of an array.
19237 (ElementAccess): Implement array access for pointers
19239 * statement.cs (Fixed): Implement fixed statement for arrays, we
19240 are missing one more case before we are done.
19242 * expression.cs (Indirection): Implement EmitAssign and set the
19243 ExprClass to Variable. This allows pointer dereferences to be
19244 treated as variables, and to have values assigned to them.
19246 * ecore.cs (Expression.StoreFromPtr): New utility function to
19247 store values dereferencing.
19249 2002-02-20 Ravi Pratap <ravi@ximian.com>
19251 * expression.cs (Binary.ResolveOperator): Ensure that we are
19252 not trying to operate on a void type - this fixes the reported
19255 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19256 the parent implementation is sealed.
19258 * ../errors/cs0239.cs : Add.
19260 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19262 * typemanager.cs (unverifiable_code_type): Corresponds to
19263 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19264 which have unsafe code in them.
19266 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
19269 2002-02-19 Miguel de Icaza <miguel@ximian.com>
19271 * cs-tokenizer.cs: Add support for @"litreal strings"
19273 Make tokenizer accept pre-processor directives
19274 on any column (remove the old C-like limitation).
19276 * rootcontext.cs (EmitCode): Emit any global attributes.
19277 (AddGlobalAttributes): Used to keep track of assembly attributes.
19279 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19281 * cs-parser.jay: Add support for global attributes.
19283 2002-02-17 Miguel de Icaza <miguel@ximian.com>
19285 * expression.cs (Indirection): New helper class. Unary will
19286 create Indirection classes to be able to implement the
19287 IMemoryLocation interface on it.
19289 2002-02-16 Miguel de Icaza <miguel@ximian.com>
19291 * cs-parser.jay (fixed_statement): reference the right statement.
19293 * statement.cs (Fixed.Emit): Finish implementing the fixed
19294 statement for the &x case.
19296 2002-02-14 Miguel de Icaza <miguel@ximian.com>
19298 * class.cs (Property.Define, Method.Define): Remove newslot when
19301 * modifiers.cs: My use of NewSlot when `Abstract' was set was
19302 wrong. NewSlot should only be used if the `new' keyword is present.
19304 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19305 locating our system dir. Sorry about this.
19307 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19309 * driver.cs (GetSystemDir): Compute correctly the location of our
19310 system assemblies. I was using the compiler directory instead of
19311 the library directory.
19313 2002-02-13 Ravi Pratap <ravi@ximian.com>
19315 * expression.cs (BetterFunction): Put back in what Miguel commented out
19316 since it is the correct fix. The problem is elsewhere ;-)
19318 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19319 parameters of the parms method are themselves compatible or not !
19321 (StandardConversionExists): Fix very dangerous bug where we were forgetting
19322 to check that a class implements an interface before saying that an implicit
19323 conversion was allowed. Use ImplementsInterface to do the checking.
19325 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19327 * class.cs (Method.Define): Track whether we are an explicit
19328 implementation or not. And only call DefineMethodOverride if we
19329 are an explicit implementation.
19331 (Property.DefineMethod): Ditto.
19333 2002-02-11 Ravi Pratap <ravi@ximian.com>
19335 * expression.cs (BetterFunction): Catch hideous bug which was
19336 preventing us from detecting ambiguous calls due to implicit casts i.e
19339 2002-01-29 Miguel de Icaza <miguel@ximian.com>
19341 * support.cs (Pair): Remove un-needed method. I figured why I was
19342 getting the error in cs-parser.jay, the variable in a foreach loop
19343 is readonly, and the compiler does not really treat this as a variable.
19345 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
19346 instead of EQUALS in grammar.
19348 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19350 * expression.cs (Unary.DoResolve): Check whether the argument is
19353 2002-01-28 Miguel de Icaza <miguel@ximian.com>
19355 * support.cs: Api for Pair to set a value. Despite the fact that
19356 the variables are public the MS C# compiler refuses to compile
19357 code that accesses the field if the variable is part of a foreach
19360 * statement.cs (Fixed): Begin implementation of the fixed
19363 (Block.AddVariable): Return the VariableInfo on success and null
19364 on failure instead of true/false.
19366 * cs-parser.jay (foreach): Catch errors on variables already
19367 defined (we were ignoring this value before) and properly unwind
19368 the block hierarchy
19370 (fixed_statement): grammar for the fixed statement.
19372 2002-01-25 Miguel de Icaza <miguel@ximian.com>
19374 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19375 pointer types to be incretemented.
19377 (SizeOf): Implement.
19379 * cs-parser.jay (pointer_member_access): Implement
19380 expr->IDENTIFIER production.
19382 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19383 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19386 (Unary): Implement indirection.
19388 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19389 use in non-unsafe context).
19391 (SimpleName.DoResolve): Check for pointers in field access on safe
19394 (Expression.LoadFromPtr): Factor the load-indirect code in this
19395 function. This was duplicated in UnboxCast and ParameterReference
19397 2002-01-24 Miguel de Icaza <miguel@ximian.com>
19399 * expression.cs (ComposedCast): report an error if a pointer cast
19400 is used in a safe region.
19402 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19403 pointer type casts in unsafe context.
19405 * codegen.cs (EmitContext): Set up IsUnsafe.
19407 * cs-parser.jay (non_expression_type): Add productions for pointer
19410 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19411 code. We should not use force into static mode if the method is
19412 not virtual. Fixes bug in MIS
19414 * statement.cs (Do.Emit, While.Emit, For.Emit,
19415 Statement.EmitBoolExpression): Add support to Do and While to
19416 propagate infinite loop as `I do return' semantics.
19418 Improve the For case to also test for boolean constants.
19420 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19421 to the list of attributes we can add.
19423 Remove `EmitContext' argument.
19425 * class.cs (Method.Define): Apply parameter attributes.
19426 (Constructor.Define): Apply parameter attributes.
19427 (MethodCore.LabelParameters): Move here the core of labeling
19430 * support.cs (ReflectionParameters.ParameterModifier,
19431 InternalParameters.ParameterModifier): Use IsByRef on the type and
19432 only return the OUT bit for these parameters instead of in/out/ref
19435 This is because I miss-understood things. The ParameterInfo.IsIn
19436 and IsOut represent whether the parameter has the [In] and [Out]
19439 2002-01-22 Miguel de Icaza <miguel@ximian.com>
19441 * ecore.cs (FieldExpr.Emit): Release temporaries.
19443 * assign.cs (LocalTemporary.Release): new function.
19445 * codegen.cs (EmitContext.GetTemporaryStorage,
19446 EmitContext.FreeTemporaryStorage): Rework the way we deal with
19447 temporary storage. Now we can "put back" localbuilders when we
19450 2002-01-21 Miguel de Icaza <miguel@ximian.com>
19452 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19453 need to make a copy of the variable to generate verifiable code.
19455 2002-01-19 Miguel de Icaza <miguel@ximian.com>
19457 * driver.cs: Compute dynamically the system directory.
19459 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19460 Slower, but more generally useful. Used by the abstract
19461 registering implementation.
19463 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19464 the rules for the special rule on Type/instances. First check if
19465 we have the same name, and if so, try that special static path
19466 rather than the instance path.
19468 2002-01-18 Miguel de Icaza <miguel@ximian.com>
19470 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19473 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19474 Enum, ValueType, Delegate or Array for non-corlib compiles.
19476 * cs-tokenizer.cs: Catch long identifiers (645)
19478 * typemanager.cs (IndexerPropetyName): Ravi never tested this
19481 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19482 fix, we were returning too early, so we were not registering
19483 pending methods from abstract classes.
19485 Do not register pending methods if the class is abstract.
19487 * expression.cs (Conditional.DoResolve): Report circular implicit
19488 conversions when we neecd to compute it for conditional
19491 (Is.DoResolve): If the expression is always of the provided type,
19492 flag warning 183. If the expression can not ever be of the
19493 provided type flag warning 184.
19495 * class.cs: Catch 169 as well.
19497 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19500 2002-01-18 Nick Drochak <ndrochak@gol.com>
19502 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
19504 2002-01-17 Miguel de Icaza <miguel@ximian.com>
19506 * interface.cs: (PopulateMethod): Check for pointers being defined
19507 only if the unsafe context is active.
19508 (PopulateProperty): ditto.
19509 (PopulateIndexer): ditto.
19511 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19512 specified. If pointers are present, make sure that they are
19513 present in an unsafe context.
19514 (Constructor, Constructor.Define): ditto.
19515 (Field, Field.Define): ditto.
19516 (Property, Property.Define): ditto.
19517 (Event, Event.Define): ditto.
19519 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19520 hashtable if there are classes or structs defined.
19522 * expression.cs (LocalVariableReference.DoResolve): Simplify this
19523 code, as the constant resolution moved.
19525 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19526 the metadata, so we can flag error 133.
19528 * decl.cs (MemberCore.UnsafeOK): New function to test that a
19529 pointer is being declared in an unsafe context.
19531 2002-01-16 Miguel de Icaza <miguel@ximian.com>
19533 * modifiers.cs (Modifiers.Check): Require a Location argument.
19534 Report error 227 for Unsafe use.
19536 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19538 * statement.cs (For.Emit): If the test is null, then report that
19539 we do `return', as we wont reach anything afterwards.
19541 (Switch.SwitchGoverningType): Track the expression that matched
19544 * driver.cs: Allow negative numbers as an error code to flag.
19546 * cs-parser.jay: Handle 1551.
19548 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19550 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19552 * cs-parser.jay: Report 1518 (type declaration can only contain
19553 class, struct, interface, enum or delegate)
19555 (switch_label): Report 1523 (keywords `case' or `default' must
19558 (opt_switch_sections): Report 1522 (empty switch)
19560 * driver.cs: Report 1515 (response file specified multiple times)
19561 Report 1516 (Source file specified multiple times).
19563 * expression.cs (Argument.Resolve): Signal 1510
19565 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19566 access not allowed in static code)
19568 2002-01-11 Ravi Pratap <ravi@ximian.com>
19570 * typemanager.cs (IsPointerType): Utility method which we are going
19573 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19574 the object type, so we take care of that.
19576 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19578 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19579 added to non-params parameters :-)
19581 * typemanager.cs (CSharpName): Include 'void' type too.
19583 (void_ptr_type): Include in the set of core types.
19585 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
19588 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
19591 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
19592 completely forgotten about it.
19594 2002-01-10 Ravi Pratap <ravi@ximian.com>
19596 * cs-parser.jay (pointer_type): Add. This begins our implementation
19597 of parsing rules for unsafe code.
19599 (unsafe_statement): Implement.
19601 (embedded_statement): Modify to include the above.
19603 * statement.cs (Unsafe): Implement new class for unsafe blocks.
19605 * codegen.cs (EmitContext.InUnsafe): Add. This determines
19606 if the current context is an unsafe one.
19608 * cs-parser.jay (local_variable_pointer_type): Since local variable types
19609 are handled differently, we need separate rules for them.
19611 (local_variable_declaration): Update to use local_variable_pointer_type
19612 to allow variable declarations of unmanaged pointer types.
19614 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19615 in unsafe contexts.
19617 * ../errors/cs0214.cs : Add.
19619 2002-01-16 Nick Drochak <ndrochak@gol.com>
19621 * makefile: remove 'response' file when cleaning.
19623 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19625 * cs-parser.jay: Report 1524.
19627 2002-01-14 Miguel de Icaza <miguel@ximian.com>
19629 * typemanager.cs (RegisterMethod): drop checking if we have
19630 registered this from here
19632 2002-01-12 Miguel de Icaza <miguel@ximian.com>
19634 * class.cs (Method.EmitDestructor): Implement calling our base
19637 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19638 value of InFinally.
19640 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
19641 this routine and will wrap the call in a try/catch block. Deal
19644 2002-01-11 Miguel de Icaza <miguel@ximian.com>
19646 * ecore.cs (Expression.MemberLookup): instead of taking a
19647 parameter `same_type' that was used to tell whether we could
19648 access private members we compute our containing type from the
19651 (FieldExpr): Added partial support for volatile fields. This does
19652 not work for volatile fields exposed from assemblies, as I can not
19653 figure out how to extract the modreq from it.
19655 Updated all the source files to use this.
19657 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
19658 because it is referenced by MemberLookup very often.
19660 2002-01-09 Ravi Pratap <ravi@ximian.com>
19662 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
19663 TypeBuilder.GetCustomAttributes to retrieve what we need.
19665 Get rid of redundant default_member_attr_type as this is the same as
19666 default_member_type which already exists.
19668 * interface.cs, attribute.cs : Update accordingly.
19670 2002-01-08 Miguel de Icaza <miguel@ximian.com>
19672 * typemanager.cs: Enable IndexerPropertyName again. It does not
19673 work for TYpeBuilders though. Ravi, can you please fix this?
19675 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
19677 * expression.cs (Argument.Emit): Handle the case of ref objects
19678 being passed to ref functions;
19680 (ParameterReference.EmitLoad): Loads the content of the pointer
19681 without dereferencing.
19683 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19685 * cs-tokenizer.cs: Implemented the pre-processing expressions.
19687 2002-01-08 Ravi Pratap <ravi@ximian.com>
19689 * class.cs (Indexer.DefineMethod): Incorporate the interface
19690 type in the name of the method if we are doing explicit interface
19693 * expression.cs (ConversionExists): Remove as it is completely obsolete.
19695 (BetterConversion): Fix extremely trivial bug where we were referring to
19696 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19699 * ../errors/bug16.cs : Add although we have fixed it.
19701 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19703 * expression.cs (BaseIndexer): Begin implementation.
19705 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19707 * cs-parser.jay (indexer_declarator): Use qualified_identifier
19708 production directly to remove a shift/reduce, and implement
19709 explicit interface implementation.
19711 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19712 after a floating point suffix.
19714 * expression.cs (DoNumericPromotions): Improved the conversion for
19715 uint/uint. If we have a constant, we avoid doing a typecast to a
19718 * class.cs (Indexer): Implement explicit interface implementation
19721 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19723 * class.cs: make the default instance constructor public and hidebysig.
19725 2001-01-03 Ravi Pratap <ravi@ximian.com>
19727 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19728 so we can call it from elsewhere.
19730 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19731 we emit it internally if the class has a defined indexer; otherwise the user
19732 emits it by decorating the class definition with the DefaultMemberAttribute.
19734 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19735 attribute is not used on a type which defines an indexer.
19737 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19738 character when we skip whitespace.
19740 * ../errors/cs0646.cs : Add.
19742 2002-01-03 Miguel de Icaza <miguel@ximian.com>
19744 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19747 * makefile: Add practical target `mcs3.exe' which builds the third
19748 generation compiler.
19750 * expression.cs (New): Fix structures constructor calling.
19752 * class.cs (Property, Method, Indexer): Emit Final flag on the
19753 method if we are an interface implementation and we are not
19756 * ecore.cs (PropertyExpr): New public field `IsBase', tells
19757 whether this property is referencing a `base' method.
19759 * expression.cs (Invocation.EmitCall): take an extra argument:
19760 is_base, this is used to determine whether the `call' or
19761 `callvirt' opcode should be used.
19764 * delegate.cs: update EmitCall.
19766 * class.cs (Method.Define): Set NewSlot for the cases where we are
19767 not implementing an interface method.
19769 (Property.Define): ditto.
19771 2002-01-02 Miguel de Icaza <miguel@ximian.com>
19773 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19774 'r'. Allows mcs to parse itself fully.
19776 2002-01-02 Ravi Pratap <ravi@ximian.com>
19778 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19779 of the number of initializers that require the InitializeArray method.
19781 (CheckIndices): Store the Expression in all cases - not the plain value. Also
19782 update the above field where necessary.
19784 (MakeByteBlob): Update accordingly.
19786 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
19789 (EmitDynamicInitializers): Update in accordance with the new optimization.
19791 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19792 same OpCode applies.
19794 * cs-parser.jay : Fix some glaring errors I introduced.
19796 2002-01-01 Ravi Pratap <ravi@ximian.com>
19798 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19799 so that we can check for name clashes there too.
19801 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19802 for interface indexers.
19804 * interfaces.cs (Define): Emit the default member attribute.
19806 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19807 variable was being referred to while setting the value ;-)
19809 2002-01-01 Miguel de Icaza <miguel@ximian.com>
19811 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19812 byte-by-byte information when we know the data is zero.
19814 Make the block always a multiple of 4, because
19815 DefineInitializedData has a bug.
19817 * assign.cs: Fix, we should assign from the temporary, not from
19820 * expression.cs (MakeByteBlob): Fix my incorrect code.
19822 2001-12-31 Miguel de Icaza <miguel@ximian.com>
19824 * typemanager.cs (EnumToUnderlying): This function is used to get
19825 the underlying type from an enumeration, because it does not
19828 * constant.cs: Use the I4_S form for values between -128 and 127.
19830 * statement.cs (Block.LookupLabel): Looks up a label.
19831 (Block): Drop support for labeled blocks.
19833 (LabeledStatement): New kind of statement that represents a label
19836 (Goto): Finally implement this bad boy.
19838 * cs-parser.jay: Update to reflect new mechanism to implement
19841 2001-12-30 Miguel de Icaza <miguel@ximian.com>
19843 * codegen.cs (EmitContext.This): a codegen property that keeps the
19844 a single instance of this instead of creating many different this
19847 * delegate.cs (Delegate.DoResolve): Update to use the property;
19849 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19851 * expression.cs (BaseAccess.DoResolve): Ditto.
19853 2001-12-29 Ravi Pratap <ravi@ximian.com>
19855 * typemanager.cs (methodimpl_attr_type): Add to hold the type
19856 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19858 (InitCoreTypes): Update accordingly.
19860 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19861 so we can quickly store the state.
19863 (ApplyAttributes): Set the correct implementation flags
19864 for InternalCall methods.
19866 2001-12-29 Miguel de Icaza <miguel@ximian.com>
19868 * expression.cs (EmitCall): if a method is not virtual, then do
19869 not use callvirt on it.
19871 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19872 user defined stuff) requires the use of stobj, which takes an
19873 address on the stack instead of an array and an index. So emit
19874 the Ldelema operation for it.
19876 (EmitStoreOpcode): Use stobj for valuetypes.
19878 (UnaryMutator.EmitCode): Use the right 1 value depending on
19879 whether we are dealing with int64/uint64, float or doubles.
19881 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19882 constructors that I implemented last night.
19884 (Constructor.IsDefault): Fix to work properly for static
19887 * cs-parser.jay (CheckDef): report method signature errors.
19888 Update error number 103 to be 132.
19890 * decl.cs: New AdditionResult enumeration value: MethodExists.
19891 Although we do this check for methods later on in the semantic
19892 analysis, catching repeated default constructors is so easy that
19893 we catch these here.
19895 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19898 (ParameterReference.EmitAssign, Emit): handle
19901 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19902 (ArrayAccess.EmitStoreOpcode): ditto.
19904 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19906 * expression.cs (MakeByteBlob): Complete all the missing types
19907 (uint, short, ushort, byte, sbyte)
19909 * class.cs: Only init instance field initializers on instance
19912 Rename `constructors' to instance_constructors.
19914 (TypeContainer.AddConstructor): Only add constructors to the list
19915 if it is not static.
19917 Make sure that we handle default_static_constructor independently
19918 everywhere where we handle instance_constructors
19920 2001-12-28 Miguel de Icaza <miguel@ximian.com>
19922 * class.cs: Do not lookup or create a base initializer for a
19923 static constructor.
19925 (ConstructorInitializer.Resolve): use the proper type to lookup
19928 * cs-parser.jay: Report error 1585 (modifiers between type and name).
19930 * enum.cs, interface.cs: Remove CloseType, this is taken care by
19933 * decl.cs: CloseType is now an virtual method, the default
19934 implementation just closes this type.
19936 2001-12-28 Ravi Pratap <ravi@ximian.com>
19938 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19939 to PreserveSig by default. Also emit HideBySig on such methods.
19941 Basically, set the defaults to standard values.
19943 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19944 argument, if candidate is better, it can't be worse than the best !
19946 (Invocation): Re-write bits to differentiate between methods being
19947 applicable in their expanded form and their normal form - for params
19950 Get rid of use_standard everywhere as only standard conversions are allowed
19951 in overload resolution.
19953 More spec conformance.
19955 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19957 * driver.cs: Add --timestamp, to see where the compiler spends
19960 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19961 `this' in static code.
19963 (SimpleName.DoResolve): Implement in terms of a helper function
19964 that allows static-references to be passed upstream to
19967 (Expression.ResolveWithSimpleName): Resolve specially simple
19968 names when called by MemberAccess to implement the special
19971 (Expression.ImplicitReferenceConversion): Handle conversions from
19972 Null to reference types before others, as Null's type is
19975 * expression.cs (Invocation.EmitCall): Handle the special case of
19976 calling methods declared on a reference type from a ValueType
19977 (Base classes System.Object and System.Enum)
19979 (MemberAccess.Resolve): Only perform lookups on Enumerations if
19980 the left hand side is a TypeExpr, not on every enumeration.
19982 (Binary.Resolve): If types are reference types, then do a cast to
19983 object on operators != and == of both arguments.
19985 * typemanager.cs (FindMembers): Extract instance and static
19986 members if requested.
19988 * interface.cs (PopulateProperty): Use void_type instead of null
19989 as the return type for the setter method.
19991 (PopulateIndexer): ditto.
19993 2001-12-27 Ravi Pratap <ravi@ximian.com>
19995 * support.cs (ReflectionParameters): Fix minor bug where we
19996 were examining the wrong parameter for the ParamArray attribute.
19998 Cope with requests for the type of the parameter at position
19999 greater than the params parameter's. We now return the element
20000 type of the params array as that makes more sense.
20002 * expression.cs (Invocation.IsParamsMethodApplicable): Update
20003 accordingly as we no longer have to extract the element type
20006 (Invocation.OverloadResolve): Update.
20008 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20010 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20011 against IEnumerator, test whether the return value is a descendant
20012 of the IEnumerator interface.
20014 * class.cs (Indexer.Define): Use an auxiliary method to implement
20015 the other bits of the method definition. Begin support for
20016 explicit interface implementation.
20018 (Property.DefineMethod): Use TypeManager.void_type instead of null
20019 for an empty return value.
20021 2001-12-26 Miguel de Icaza <miguel@ximian.com>
20023 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20024 dealing with a FieldExpr which is composed of a FieldBuilder, in
20025 the code path we did extract the constant, but we should have
20026 obtained the underlying value to be able to cast it (otherwise we
20027 end up in an infinite loop, this is what Ravi was running into).
20029 (ArrayCreation.UpdateIndices): Arrays might be empty.
20031 (MemberAccess.ResolveMemberAccess): Add support for section
20032 14.5.4.1 that deals with the special case of E.I when E is a type
20033 and something else, that I can be a reference to a static member.
20035 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20036 handle a particular array type to create byte blobs, it is just
20037 something we dont generate byteblobs for.
20039 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20042 * location.cs (Push): remove the key from the hashtable that we
20043 are about to add. This happens for empty files.
20045 * driver.cs: Dispose files after we have parsed them.
20047 (tokenize): new function that only runs the tokenizer on its
20048 input, for speed testing.
20050 2001-12-26 Ravi Pratap <ravi@ximian.com>
20052 * class.cs (Event.Define): Define the private field only if there
20053 are no accessors defined.
20055 * expression.cs (ResolveMemberAccess): If there is no associated
20056 field with the event, that means we have an event defined with its
20057 own accessors and we should flag error cs0070 since transforming
20058 ourselves into a field is not valid in that case.
20060 * ecore.cs (SimpleName.DoResolve): Same as above.
20062 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20063 and charset to sane values.
20065 2001-12-25 Ravi Pratap <ravi@ximian.com>
20067 * assign.cs (DoResolve): Perform check on events only if they
20068 are being accessed outside the declaring type.
20070 * cs-parser.jay (event_declarations): Update rules to correctly
20071 set the type of the implicit parameter etc.
20073 (add_accessor, remove_accessor): Set current local parameters.
20075 * expression.cs (Binary): For delegate addition and subtraction,
20076 cast the return value from the method into the appropriate delegate
20079 2001-12-24 Ravi Pratap <ravi@ximian.com>
20081 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20082 of these as the workaround is unnecessary.
20084 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20085 delegate data - none of that is needed at all.
20087 Re-write bits to extract the instance expression and the delegate method
20090 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
20093 * attribute.cs (ApplyAttributes): New method to take care of common tasks
20094 of attaching attributes instead of duplicating code everywhere.
20096 * everywhere : Update code to do attribute emission using the above method.
20098 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20100 * expression.cs (IsParamsMethodApplicable): if there are not
20101 parameters, return immediately.
20103 * ecore.cs: The 0 literal can be implicity converted to an enum
20106 (SimpleName.DoResolve): First lookup the type, then lookup the
20109 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20110 want to get its address. If the InstanceExpression is not
20111 addressable, store the result in a temporary variable, then get
20114 * codegen.cs: Only display 219 errors on warning level or above.
20116 * expression.cs (ArrayAccess): Make it implement the
20117 IMemoryLocation interface.
20119 (Binary.DoResolve): handle the operator == (object a, object b)
20120 and operator != (object a, object b) without incurring into a
20121 BoxedCast (because 5 != o should never be performed).
20123 Handle binary enumerator operators.
20125 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20126 value type, otherwise use Ldelem_ref.
20128 Use precomputed names;
20130 (AddressOf): Implement address of
20132 * cs-parser.jay (labeled_statement): Fix recursive block
20133 addition by reworking the production.
20135 * expression.cs (New.DoEmit): New has a special case:
20137 If we are dealing with a ValueType, we have a few
20138 situations to deal with:
20140 * The target of New is a ValueType variable, that is
20141 easy, we just pass this as the variable reference
20143 * The target of New is being passed as an argument,
20144 to a boxing operation or a function that takes a
20147 In this case, we need to create a temporary variable
20148 that is the argument of New.
20151 2001-12-23 Ravi Pratap <ravi@ximian.com>
20153 * rootcontext.cs (LookupType): Check that current_type is not null before
20154 going about looking at nested types.
20156 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20157 not implement the IAssignMethod interface any more.
20159 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20160 where we tranform them into FieldExprs if they are being resolved from within
20161 the declaring type.
20163 * ecore.cs (SimpleName.DoResolve): Do the same here.
20165 * assign.cs (DoResolve, Emit): Clean up code considerably.
20167 * ../errors/bug10.cs : Add.
20169 * ../errors/cs0070.cs : Add.
20171 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20173 * assign.cs : Get rid of EventIsLocal everywhere.
20175 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20177 * ecore.cs (ConvertIntLiteral): finished the implementation.
20179 * statement.cs (SwitchLabel): Convert the value we are using as a
20180 key before looking up the table.
20182 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20184 * codegen.cs (EmitTopBlock): Require a Location argument now.
20186 * cs-parser.jay (constructor_declarator): We need to setup
20187 current_local_parameters before we parse the
20188 opt_constructor_initializer, to allow the variables to be bound
20189 to the constructor arguments.
20191 * rootcontext.cs (LookupType): First lookup nested classes in our
20192 class and our parents before we go looking outside our class.
20194 * expression.cs (ConstantFold): Extract/debox the values at the
20197 * rootcontext.cs (EmitCode): Resolve the constants first before we
20198 resolve the types. This is not really needed, but it helps debugging.
20200 * statement.cs: report location.
20202 * cs-parser.jay: pass location to throw statement.
20204 * driver.cs: Small bug fix.
20206 * report.cs: Updated format to be 4-zero filled digits.
20208 2001-12-22 Ravi Pratap <ravi@ximian.com>
20210 * expression.cs (CheckIndices): Fix minor bug where the wrong
20211 variable was being referred to ;-)
20213 (DoEmit): Do not call EmitStaticInitializers when the
20214 underlying type is System.Object.
20216 2001-12-21 Ravi Pratap <ravi@ximian.com>
20218 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20219 and do the usual workaround for SRE.
20221 * class.cs (MyEventBuilder.EventType): New member to get at the type
20222 of the event, quickly.
20224 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20226 * assign.cs (Assign.DoResolve): Handle the case when the target
20227 is an EventExpr and perform the necessary checks.
20229 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20232 (SimpleName.MemberStaticCheck): Include check for EventExpr.
20234 (EventExpr): Set the type in the constructor itself since we
20235 are meant to be born fully resolved.
20237 (EventExpr.Define): Revert code I wrote earlier.
20239 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20240 instance expression is null. The instance expression is a This in that case
20241 or a null, depending on whether it is a static method or not.
20243 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20244 refers to more than one method.
20246 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20247 and accordingly flag errors.
20249 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20251 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20253 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20255 * location.cs (ToString): Provide useful rutine.
20257 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20259 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20260 objects, return the actual integral boxed.
20262 * statement.cs (SwitchLabel): define an ILLabel for each
20265 (Switch.CheckSwitch): If the value is a Literal, extract
20266 the underlying literal.
20268 Also in the unused hashtable we had, add the SwitchLabel so we can
20269 quickly look this value up.
20271 * constant.cs: Implement a bunch of new constants. Rewrite
20272 Literal based on this. Made changes everywhere to adapt to this.
20274 * expression.cs (Expression.MakeByteBlob): Optimize routine by
20275 dereferencing array only once, and also copes with enumrations.
20277 bytes are two bytes wide, not one.
20279 (Cast): Perform constant conversions.
20281 * ecore.cs (TryImplicitIntConversion): Return literals instead of
20282 wrappers to the literals here.
20284 * expression.cs (DoNumericPromotions): long literals can converted
20285 to ulong implicity (this is taken care of elsewhere, but I was
20286 missing this spot).
20288 * ecore.cs (Expression.Literalize): Make the return type Literal,
20289 to improve type checking.
20291 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20293 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20295 * literal.cs: Revert code from ravi that checked the bounds. The
20296 bounds are sane by the definition of the type itself.
20298 * typemanager.cs: Fix implementation of ImplementsInterface. We
20299 need to actually look up in our parent hierarchy for interfaces
20302 * const.cs: Use the underlying type for enumerations
20304 * delegate.cs: Compute the basename for the delegate creation,
20305 that should fix the delegate test case, and restore the correct
20306 Type Lookup semantics in rootcontext
20308 * rootcontext.cs: Revert Ravi's last patch. The correct way of
20309 referencing a nested type with the Reflection API is using the "+"
20312 * cs-parser.jay: Do not require EOF token at the end.
20314 2001-12-20 Ravi Pratap <ravi@ximian.com>
20316 * rootcontext.cs (LookupType): Concatenate type names with
20317 a '.' instead of a '+' The test suite passes again.
20319 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20320 field of the enumeration.
20322 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20323 the case when the member is an EventExpr.
20325 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20326 static has an associated instance expression.
20328 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20330 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20332 * class.cs (Event.Define): Register event and perform appropriate checks
20335 We define the Add and Remove methods even if the use provides none because
20336 in that case, we provide default implementations ourselves.
20338 Define a private field of the type of the event. This is done by the CSC compiler
20339 and we should be doing it too ;-)
20341 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20342 More methods we use in code we generate.
20344 (multicast_delegate_type, delegate_type): Two separate types since the distinction
20347 (InitCoreTypes): Update accordingly for the above.
20349 * class.cs (Event.Emit): Generate code for default accessors that we provide
20351 (EmitDefaultMethod): Do the job in the above.
20353 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
20356 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20358 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20359 builders even if we were missing one.
20361 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20362 pass the Basename as our class name instead of the Name. The
20363 basename will be correctly composed for us.
20365 * parameter.cs (Paramters): Now takes a Location argument.
20367 * decl.cs (DeclSpace.LookupType): Removed convenience function and
20368 make all the code call directly LookupType in RootContext and take
20369 this chance to pass the Location information everywhere.
20371 * Everywhere: pass Location information.
20373 2001-12-19 Miguel de Icaza <miguel@ximian.com>
20375 * class.cs (Constructor.Define): Updated way of detecting the
20376 length of the parameters.
20378 (TypeContainer.DefineType): Use basename as the type name for
20381 (TypeContainer.Define): Do not recursively define types here, as
20382 definition is taken care in order by the RootContext.
20384 * tree.cs: Keep track of namespaces in a per-file basis.
20386 * parameter.cs (Parameter.ComputeSignature): Update to use
20389 (Parameters.GetSignature): ditto.
20391 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20392 instead of a TypeContainer.
20394 (Interface.SemanticAnalysis): Use `this' instead of our parent to
20395 resolve names. Because we need to be resolve in our context, not
20398 * driver.cs: Implement response files.
20400 * class.cs (TypeContainer.DefineType): If we are defined, do not
20401 redefine ourselves.
20403 (Event.Emit): Emit the code for add/remove handlers.
20404 (Event.Define): Save the MethodBuilders for add/remove.
20406 * typemanager.cs: Use pair here too.
20408 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20409 DictionaryEntry requires the first argument to be non-null.
20411 (enum_declaration): Compute full name for registering the
20414 (delegate_declaration): Instead of using
20415 formal_parameter_list, use opt_formal_parameter_list as the list
20418 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20419 (EventParsing): New property that controls whether `add' and
20420 `remove' are returned as tokens or identifiers (for events);
20422 2001-12-19 Ravi Pratap <ravi@ximian.com>
20424 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20425 use MyEventBuilder only and let it wrap the real builder for us.
20427 (MyEventBuilder): Revamp constructor etc.
20429 Implement all operations that we perform on EventBuilder in precisely the same
20432 (FindMembers): Update to use the EventBuilder member.
20434 (Event.Emit): Update accordingly.
20436 2001-12-18 Ravi Pratap <ravi@ximian.com>
20438 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20439 by calling the appropriate methods.
20441 (GetCustomAttributes): Make stubs as they cannot possibly do anything
20444 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20446 2001-12-17 Ravi Pratap <ravi@ximian.com>
20448 * delegate.cs (Delegate.Populate): Check that the return type
20449 and various parameters types are indeed accessible.
20451 * class.cs (Constructor.Define): Same here.
20453 (Field.Define): Ditto.
20455 (Event.Define): Ditto.
20457 (Operator.Define): Check that the underlying Method defined itself
20458 correctly - so it's MethodBuilder should not be null.
20460 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20461 expression happens to be null.
20463 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20464 members but as of now we don't seem to be able to do anything really useful with it.
20466 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20467 not the EventBuilder.
20469 2001-12-18 Miguel de Icaza <miguel@ximian.com>
20471 * cs-tokenizer.cs: Add support for defines.
20472 Add support for #if, #elif, #else, #endif
20474 (eval_var): evaluates a variable.
20475 (eval): stubbed for evaluating functions.
20477 * cs-parser.jay: Pass the defines information
20479 * driver.cs: Add --define command line option.
20481 * decl.cs: Move MemberCore here.
20483 Make it the base class for DeclSpace. This allows us to catch and
20484 report 108 and 109 for everything now.
20486 * class.cs (TypeContainer.Define): Extract all the members
20487 before populating and emit the warning 108 (new keyword required
20488 to override) instead of having each member implement this.
20490 (MemberCore.Define): New abstract method, we will be using this in
20491 the warning reporting engine in Populate.
20493 (Operator.Define): Adjust to new MemberCore protocol.
20495 * const.cs (Const): This does not derive from Expression, it is a
20496 temporary object we use to create fields, it is a MemberCore.
20498 * class.cs (Method.Define): Allow the entry point to be in a
20501 * driver.cs: Rewrite the argument handler to clean it up a bit.
20503 * rootcontext.cs: Made it just an auxiliary namespace feature by
20504 making everything static.
20506 * driver.cs: Adapt code to use RootContext type name instead of
20509 * delegate.cs: Remove RootContext argument.
20511 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20514 * class.cs (Event.Define): The lookup can fail.
20516 * cs-tokenizer.cs: Begin implementation of pre-procesor.
20518 * expression.cs: Resolve the this instance before invoking the code.
20520 2001-12-17 Miguel de Icaza <miguel@ximian.com>
20522 * cs-parser.jay: Add a production in element_access that allows
20523 the thing to become a "type" reference. This way we can parse
20524 things like "(string [])" as a type.
20526 Note that this still does not handle the more complex rules of
20530 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
20532 * ecore.cs: (CopyNewMethods): new utility function used to
20533 assemble the list of methods from running FindMembers.
20535 (MemberLookup): Rework FindMembers so that
20537 2001-12-16 Miguel de Icaza <miguel@ximian.com>
20539 * class.cs (TypeContainer): Remove Delegates who fail to be
20542 * delegate.cs (Populate): Verify that we dont get null return
20543 values. TODO: Check for AsAccessible.
20545 * cs-parser.jay: Use basename to emit error 574 (destructor should
20546 have the same name as container class), not the full name.
20548 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20549 possible representation.
20551 Also implements integer type suffixes U and L.
20553 2001-12-15 Miguel de Icaza <miguel@ximian.com>
20555 * expression.cs (ArrayCreation.DoResolve): We need to do the
20556 argument resolution *always*.
20558 * decl.cs: Make this hold the namespace. Hold the root context as
20560 (LookupType): Move here.
20562 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20564 * location.cs (Row, Name): Fixed the code, it was always returning
20565 references to the first file.
20567 * interface.cs: Register properties defined through interfaces.
20569 * driver.cs: Add support for globbing on the command line
20571 * class.cs (Field): Make it derive from MemberCore as well.
20574 2001-12-15 Ravi Pratap <ravi@ximian.com>
20576 * class.cs (Event::Define): Check that the type of the event is a delegate
20577 type else flag error #66.
20579 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20582 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20583 values of EntryPoint, CharSet etc etc.
20585 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20587 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20588 be null and we should ignore this. I am not sure if this is really clean. Apparently,
20589 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20590 which needs this to do its work.
20592 * ../errors/cs0066.cs : Add.
20594 2001-12-14 Miguel de Icaza <miguel@ximian.com>
20596 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20599 * class.cs: (MethodSignature.MethodSignature): Removed hack that
20600 clears out the parameters field.
20601 (MemberSignatureCompare): Cleanup
20603 (MemberCore): New base class used to share code between MethodCore
20606 (RegisterRequiredImplementations) BindingFlags.Public requires
20607 either BindingFlags.Instace or Static. Use instance here.
20609 (Property): Refactored code to cope better with the full spec.
20611 * parameter.cs (GetParameterInfo): Return an empty array instead
20614 * class.cs (Property): Abstract or extern properties have no bodies.
20616 * parameter.cs (GetParameterInfo): return a zero-sized array.
20618 * class.cs (TypeContainer.MethodModifiersValid): Move all the
20619 method modifier validation to the typecontainer so we can reuse
20620 this on properties.
20622 (MethodCore.ParameterTypes): return an empty sized array of types.
20624 (Property.Define): Test property modifier validity.
20626 Add tests for sealed/override too.
20628 (Method.Emit): abstract or extern methods have no bodies.
20630 2001-12-14 Ravi Pratap <ravi@ximian.com>
20632 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20635 (Method::Define, ::Emit): Modify accordingly.
20637 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20639 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
20641 * makefile: Pass in /unsafe.
20643 2001-12-13 Miguel de Icaza <miguel@ximian.com>
20645 * class.cs (MakeKey): Kill routine.
20647 * class.cs (TypeContainer.Define): Correctly define explicit
20648 method implementations (they require the full interface name plus
20651 * typemanager.cs: Deply the PtrHashtable here and stop using the
20652 lame keys. Things work so much better.
20654 This of course broke everyone who depended on `RegisterMethod' to
20655 do the `test for existance' test. This has to be done elsewhere.
20657 * support.cs (PtrHashtable): A hashtable that avoid comparing with
20658 the object stupid Equals method (because, that like fails all over
20659 the place). We still do not use it.
20661 * class.cs (TypeContainer.SetRequiredInterface,
20662 TypeContainer.RequireMethods): Killed these two routines and moved
20663 all the functionality to RegisterRequiredImplementations.
20665 (TypeContainer.RegisterRequiredImplementations): This routine now
20666 registers all the implementations required in an array for the
20667 interfaces and abstract methods. We use an array of structures
20668 which can be computed ahead of time to reduce memory usage and we
20669 also assume that lookups are cheap as most classes will not
20670 implement too many interfaces.
20672 We also avoid creating too many MethodSignatures.
20674 (TypeContainer.IsInterfaceMethod): Update and optionally does not
20675 clear the "pending" bit if we find that there are problems with
20678 (TypeContainer.VerifyPendingMethods): Update to report errors of
20679 methods that look like implementations but are not.
20681 (TypeContainer.Define): Add support for explicit interface method
20684 2001-12-12 Miguel de Icaza <miguel@ximian.com>
20686 * typemanager.cs: Keep track of the parameters here instead of
20687 being a feature of the TypeContainer.
20689 * class.cs: Drop the registration of parameters here, as
20690 InterfaceMethods are also interface declarations.
20692 * delegate.cs: Register methods with the TypeManager not only with
20693 the TypeContainer. This code was buggy.
20695 * interface.cs: Full registation here.
20697 2001-12-11 Miguel de Icaza <miguel@ximian.com>
20699 * expression.cs: Remove reducer for binary expressions, it can not
20702 * const.cs: Put here the code that used to go into constant.cs
20704 * constant.cs: Put here the code for constants, this is a new base
20705 class for Literals.
20707 * literal.cs: Make Literal derive from Constant.
20709 2001-12-09 Miguel de Icaza <miguel@ximian.com>
20711 * statement.cs (Return.Emit): Report error 157 if the user
20712 attempts to return from a finally block.
20714 (Return.Emit): Instead of emitting a return, jump to the end of
20717 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20718 LocalBuilder to store the result of the function. ReturnLabel is
20719 the target where we jump.
20722 2001-12-09 Radek Doulik <rodo@ximian.com>
20724 * cs-parser.jay: remember alias in current namespace
20726 * ecore.cs (SimpleName::DoResolve): use aliases for types or
20729 * class.cs (LookupAlias): lookup alias in my_namespace
20731 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20733 (LookupAlias): lookup alias in this and if needed in parent
20736 2001-12-08 Miguel de Icaza <miguel@ximian.com>
20740 * rootcontext.cs: (ModuleBuilder) Made static, first step into
20741 making things static. I need this to avoid passing the
20742 TypeContainer when calling ParameterType.
20744 * support.cs (InternalParameters.ParameterType): Remove ugly hack
20745 that did string manipulation to compute the type and then call
20746 GetType. Use Parameter.ParameterType instead.
20748 * cs-tokenizer.cs: Consume the suffix for floating values.
20750 * expression.cs (ParameterReference): figure out whether this is a
20751 reference parameter or not. Kill an extra variable by computing
20752 the arg_idx during emission.
20754 * parameter.cs (Parameters.GetParameterInfo): New overloaded
20755 function that returns whether a parameter is an out/ref value or not.
20757 (Parameter.ParameterType): The type of the parameter (base,
20758 without ref/out applied).
20760 (Parameter.Resolve): Perform resolution here.
20761 (Parameter.ExternalType): The full type (with ref/out applied).
20763 * statement.cs (Using.Emit, Using.EmitExpression): Implement
20764 support for expressions on the using statement.
20766 2001-12-07 Miguel de Icaza <miguel@ximian.com>
20768 * statement.cs (Using.EmitLocalVariableDecls): Split the
20769 localvariable handling of the using statement.
20771 (Block.EmitMeta): Keep track of variable count across blocks. We
20772 were reusing slots on separate branches of blocks.
20774 (Try.Emit): Emit the general code block, we were not emitting it.
20776 Check the type of the declaration to be an IDisposable or
20777 something that can be implicity converted to it.
20779 Emit conversions if required.
20781 * ecore.cs (EmptyExpression): New utility class.
20782 (Expression.ImplicitConversionExists): New utility function.
20784 2001-12-06 Miguel de Icaza <miguel@ximian.com>
20786 * statement.cs (Using): Implement.
20788 * expression.cs (LocalVariableReference): Support read only variables.
20790 * statement.cs: Remove the explicit emit for the Leave opcode.
20791 (VariableInfo): Add a readonly field.
20793 2001-12-05 Miguel de Icaza <miguel@ximian.com>
20795 * ecore.cs (ConvCast): new class used to encapsulate the various
20796 explicit integer conversions that works in both checked and
20797 unchecked contexts.
20799 (Expression.ConvertNumericExplicit): Use new ConvCast class to
20800 properly generate the overflow opcodes.
20802 2001-12-04 Miguel de Icaza <miguel@ximian.com>
20804 * statement.cs: The correct type for the EmptyExpression is the
20805 element_type, not the variable type. Ravi pointed this out.
20807 2001-12-04 Ravi Pratap <ravi@ximian.com>
20809 * class.cs (Method::Define): Handle PInvoke methods specially
20810 by using DefinePInvokeMethod instead of the usual one.
20812 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20813 above to do the task of extracting information and defining the method.
20815 2001-12-04 Ravi Pratap <ravi@ximian.com>
20817 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20818 of the condition for string type.
20820 (Emit): Move that here.
20822 (ArrayCreation::CheckIndices): Keep string literals in their expression
20825 (EmitDynamicInitializers): Handle strings appropriately.
20827 2001-12-04 Miguel de Icaza <miguel@ximian.com>
20829 * codegen.cs (EmitContext): Replace multiple variables with a
20830 single pointer to the current Switch statement.
20832 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20835 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20839 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20842 (Foreach.Emit): Foreach on arrays was not setting
20843 up the loop variables (for break/continue).
20845 (GotoCase): Semi-implented.
20847 2001-12-03 Ravi Pratap <ravi@ximian.com>
20849 * attribute.cs (CheckAttribute): Handle system attributes by using
20850 Attribute.GetAttributes to examine information we need.
20852 (GetValidPlaces): Same here.
20854 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20856 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20858 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20860 (Method::Define): Set appropriate flags if we have a DllImport attribute.
20862 (Method::Emit): Handle the case when we are a PInvoke method.
20864 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20866 * expression.cs: Use ResolveWithSimpleName on compound names.
20868 2001-12-02 Ravi Pratap <ravi@ximian.com>
20870 * constant.cs (EmitConstant): Make sure we resolve the associated expression
20871 before trying to reduce it.
20873 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20875 * constant.cs (LookupConstantValue): Implement.
20877 (EmitConstant): Use the above in emitting the constant.
20879 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20880 that are user-defined by doing a LookupConstantValue on them.
20882 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20885 2001-11-29 Miguel de Icaza <miguel@ximian.com>
20887 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20889 (BaseAccess.DoResolve): Implement.
20891 (MemberAccess.DoResolve): Split this routine into a
20892 ResolveMemberAccess routine that can be used independently
20894 2001-11-28 Miguel de Icaza <miguel@ximian.com>
20896 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20897 As that share bits of the implementation. Is returns a boolean,
20898 while As returns the Type that is being probed.
20900 2001-12-01 Ravi Pratap <ravi@ximian.com>
20902 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20903 instead of a Literal - much easier.
20905 (EnumInTransit): Remove - utterly useless :-)
20907 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20909 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20911 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20912 chain when we have no associated expression.
20914 2001-11-30 Ravi Pratap <ravi@ximian.com>
20916 * constant.cs (Define): Use Location while reporting the errror.
20918 Also emit a warning when 'new' is used and there is no inherited
20921 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
20924 (LookupEnumValue): Implement to lookup an enum member's value and define it
20927 (Populate): Re-write accordingly to use the above routine.
20929 2001-11-27 Miguel de Icaza <miguel@ximian.com>
20931 * expression.cs (This): Fix prototype for DoResolveLValue to
20932 override the base class DoResolveLValue.
20934 * cs-parser.cs: Report errors cs574 and cs575 (destructor
20937 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20938 (we need to load the address of the field here). This fixes
20941 (FieldExpr.DoResolveLValue): Call the DoResolve
20942 function to initialize the Instance expression.
20944 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20945 correctly the GetEnumerator operation on a value type.
20947 * cs-parser.jay: Add more simple parsing error catches.
20949 * statement.cs (Switch): Add support for string switches.
20950 Handle null specially.
20952 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
20954 2001-11-28 Ravi Pratap <ravi@ximian.com>
20956 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20958 (declare_local_constant): New helper function.
20960 * statement.cs (AddConstant): Keep a separate record of constants
20962 (IsConstant): Implement to determine if a variable is a constant.
20964 (GetConstantExpression): Implement.
20966 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20968 * statement.cs (IsVariableDefined): Re-write.
20970 2001-11-27 Ravi Pratap <ravi@ximian.com>
20972 * class.cs (TypeContainer::FindMembers): Look for constants
20973 in the case when we are looking for MemberTypes.Field
20975 * expression.cs (MemberAccess::DoResolve): Check that in the
20976 case we are a FieldExpr and a Literal, we are not being accessed
20977 by an instance reference.
20979 * cs-parser.jay (local_constant_declaration): Implement.
20981 (declaration_statement): Implement for constant declarations.
20983 2001-11-26 Miguel de Icaza <miguel@ximian.com>
20985 * statement.cs (Switch): Catch double defaults.
20987 (Switch): More work on the switch() statement
20988 implementation. It works for integral values now, need to finish
20992 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20994 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20995 integer literals into other integer literals. To be used by
20998 2001-11-24 Ravi Pratap <ravi@ximian.com>
21000 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21003 (EmitDynamicInitializers): Cope with the above since we extract data
21004 directly from ArrayData now.
21006 (ExpectInitializers): Keep track of whether initializers are mandatory
21009 (Bounds): Make it a hashtable to prevent the same dimension being
21010 recorded for every element in that dimension.
21012 (EmitDynamicInitializers): Fix bug which prevented the Set array method
21015 Also fix bug which was causing the indices to be emitted in the reverse
21018 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21020 * expression.cs (ArrayCreation): Implement the bits that Ravi left
21021 unfinished. They do not work, because the underlying code is
21024 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21026 * cs-parser.jay: Remove bogus fixme.
21028 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21029 on Switch statement.
21031 2001-11-23 Ravi Pratap <ravi@ximian.com>
21033 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21036 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21037 parameter. Apparently, any expression is allowed.
21039 (ValidateInitializers): Update accordingly.
21041 (CheckIndices): Fix some tricky bugs thanks to recursion.
21043 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
21044 I was being completely brain-dead.
21046 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21047 and re-write acordingly.
21049 (DelegateInvocation): Re-write accordingly.
21051 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21053 (MakeByteBlob): Handle types more correctly.
21055 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21056 initialization from expressions but it is incomplete because I am a complete
21059 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21061 * statement.cs (If.Emit): Fix a bug that generated incorrect code
21062 on If. Basically, we have to return `true' (ie, we do return to
21063 our caller) only if both branches of the if return.
21065 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21066 short-circuit operators, handle them as short circuit operators.
21068 (Cast.DoResolve): Resolve type.
21069 (Cast.Cast): Take an expression as the target type.
21071 * cs-parser.jay (cast_expression): Remove old hack that only
21072 allowed a limited set of types to be handled. Now we take a
21073 unary_expression and we resolve to a type during semantic
21076 Use the grammar productions from Rhys to handle casts (this is
21077 not complete like Rhys syntax yet, we fail to handle that corner
21078 case that C# has regarding (-x), but we will get there.
21080 2001-11-22 Ravi Pratap <ravi@ximian.com>
21082 * class.cs (EmitFieldInitializer): Take care of the case when we have a
21083 field which is an array type.
21085 * cs-parser.jay (declare_local_variables): Support array initialization too.
21087 * typemanager.cs (MakeKey): Implement.
21089 (everywhere): Use the above appropriately.
21091 * cs-parser.jay (for_statement): Update for array initialization while
21092 declaring variables.
21094 * ecore.cs : The error message was correct, it's the variable's names that
21095 were misleading ;-) Make the code more readable.
21097 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21098 the correct type etc.
21100 (ConvertExplicit): Handle Enum types by examining the underlying type.
21102 2001-11-21 Ravi Pratap <ravi@ximian.com>
21104 * parameter.cs (GetCallingConvention): Always return
21105 CallingConventions.Standard for now.
21107 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21109 * expression.cs (Binary.ResolveOperator): Update the values of `l'
21110 and `r' after calling DoNumericPromotions.
21112 * ecore.cs: Fix error message (the types were in the wrong order).
21114 * statement.cs (Foreach.ProbeCollectionType): Need to pass
21115 BindingFlags.Instance as well
21117 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21118 implicit int literal conversion in an empty cast so that we
21119 propagate the right type upstream.
21121 (UnboxCast): new class used to unbox value types.
21122 (Expression.ConvertExplicit): Add explicit type conversions done
21125 (Expression.ImplicitNumericConversion): Oops, forgot to test for
21126 the target type before applying the implicit LongLiterals to ULong
21129 2001-11-21 Miguel de Icaza <miguel@ximian.com>
21131 * cs-parser.jay (for_statement): Reworked the way For works: now
21132 we declare manually any variables that are introduced in
21133 for_initializer to solve the problem of having out-of-band code
21134 emition (that is what got for broken).
21136 (declaration_statement): Perform the actual variable declaration
21137 that used to be done in local_variable_declaration here.
21139 (local_variable_declaration): Do not declare anything, just pass
21140 the information on a DictionaryEntry
21142 2001-11-20 Ravi Pratap <ravi@ximian.com>
21144 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21145 re-write of the logic to now make it recursive.
21147 (UpdateIndices): Re-write accordingly.
21149 Store element data in a separate ArrayData list in the above methods.
21151 (MakeByteBlob): Implement to dump the array data into a byte array.
21153 2001-11-19 Ravi Pratap <ravi@ximian.com>
21155 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21158 * constant.cs (Define): Implement.
21160 (EmitConstant): Re-write fully.
21162 Pass in location info.
21164 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21167 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21168 DictionaryEntry since we need location info too.
21170 (constant_declaration): Update accordingly.
21172 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21173 code into another method : UpdateIndices.
21175 2001-11-18 Ravi Pratap <ravi@ximian.com>
21177 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21178 some type checking etc.
21180 2001-11-17 Ravi Pratap <ravi@ximian.com>
21182 * expression.cs (ArrayCreation::ValidateInitializers): Implement
21183 bits to provide dimension info if the user skips doing that.
21185 Update second constructor to store the rank correctly.
21187 2001-11-16 Ravi Pratap <ravi@ximian.com>
21189 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21190 and try to implement.
21192 * ../errors/cs0150.cs : Add.
21194 * ../errors/cs0178.cs : Add.
21196 2001-11-16 Miguel de Icaza <miguel@ximian.com>
21198 * statement.cs: Implement foreach on multi-dimensional arrays.
21200 * parameter.cs (Parameters.GetParameterByName): Also lookup the
21201 name of the params argument.
21203 * expression.cs: Use EmitStoreOpcode to get the right opcode while
21204 initializing the array.
21206 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21207 we can use this elsewhere.
21209 * statement.cs: Finish implementation of foreach for single
21212 * cs-parser.jay: Use an out-of-band stack to pass information
21213 around, I wonder why I need this.
21215 foreach_block: Make the new foreach_block the current_block.
21217 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21218 function used to return a static Parameters structure. Used for
21219 empty parameters, as those are created very frequently.
21221 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21223 2001-11-15 Ravi Pratap <ravi@ximian.com>
21225 * interface.cs : Default modifier is private, not public. The
21226 make verify test passes again.
21228 2001-11-15 Ravi Pratap <ravi@ximian.com>
21230 * support.cs (ReflectionParameters): Fix logic to determine
21231 whether the last parameter is a params one. Test 9 passes again.
21233 * delegate.cs (Populate): Register the builders we define with
21234 RegisterParameterForBuilder. Test 19 passes again.
21236 * cs-parser.jay (property_declaration): Reference $6 instead
21237 of $$ to get at the location.
21239 (indexer_declaration): Similar stuff.
21241 (attribute): Ditto.
21243 * class.cs (Property): Register parameters for the Get and Set methods
21244 if they exist. Test 23 passes again.
21246 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21247 call to EmitArguments as we are sure there aren't any params arguments.
21248 Test 32 passes again.
21250 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21251 IndexOutOfRangeException.
21253 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21254 Test 33 now passes again.
21256 2001-11-15 Miguel de Icaza <miguel@ximian.com>
21258 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21259 broke a bunch of things. Will have to come up with a better way
21260 of tracking locations.
21262 * statement.cs: Implemented foreach for single dimension arrays.
21264 2001-11-09 Miguel de Icaza <miguel@ximian.com>
21266 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21267 an error. This removes the lookup from the critical path.
21269 * cs-parser.jay: Removed use of temporary_loc, which is completely
21272 2001-11-14 Miguel de Icaza <miguel@ximian.com>
21274 * support.cs (ReflectionParameters.ParameterModifier): Report
21275 whether the argument is a PARAMS argument or not.
21277 * class.cs: Set the attribute `ParamArrayAttribute' on the
21278 parameter argument.
21280 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21281 and cons_param_array_attribute (ConstructorInfo for
21282 ParamArrayAttribute).,
21284 * codegen.cs: Emit the return using the `Return' statement, that
21285 way we can report the error correctly for missing return values.
21287 * class.cs (Method.Emit): Clean up.
21289 * expression.cs (Argument.Resolve): Take another argument: the
21290 location where this argument is used. Notice that this is not
21291 part of the "Argument" class as to reduce the size of the
21292 structure (we know the approximate location anyways).
21294 Test if the argument is a variable-reference, if not, then
21295 complain with a 206.
21297 (Argument.Emit): Emit addresses of variables.
21299 (Argument.FullDesc): Simplify.
21301 (Invocation.DoResolve): Update for Argument.Resolve.
21303 (ElementAccess.DoResolve): ditto.
21305 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21306 method should be virtual, as this method is always virtual.
21308 (NewDelegate.DoResolve): Update for Argument.Resolve.
21310 * class.cs (ConstructorInitializer.DoResolve): ditto.
21312 * attribute.cs (Attribute.Resolve): ditto.
21314 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21316 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21318 * expression.cs (ParameterReference): Drop IStackStorage and implement
21319 IAssignMethod instead.
21321 (LocalVariableReference): ditto.
21323 * ecore.cs (FieldExpr): Drop IStackStorage and implement
21324 IAssignMethod instead.
21326 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21328 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21329 enumerations that are used in heavily used structures derive from
21330 byte in a laughable and pathetic attempt to reduce memory usage.
21331 This is the kind of pre-optimzations that you should not do at
21332 home without adult supervision.
21334 * expression.cs (UnaryMutator): New class, used to handle ++ and
21335 -- separatedly from the other unary operators. Cleans up the
21336 code, and kills the ExpressionStatement dependency in Unary.
21338 (Unary): Removed `method' and `Arguments' from this class, making
21339 it smaller, and moving it all to SimpleCall, so I can reuse this
21340 code in other locations and avoid creating a lot of transient data
21341 strucutres when not required.
21343 * cs-parser.jay: Adjust for new changes.
21345 2001-11-11 Miguel de Icaza <miguel@ximian.com>
21347 * enum.cs (Enum.Populate): If there is a failure during
21350 * cs-parser.jay (opt_enum_base): we used to catch type errors
21351 here, but this is really incorrect. The type error should be
21352 catched during semantic analysis.
21354 2001-12-11 Ravi Pratap <ravi@ximian.com>
21356 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21357 current_local_parameters as expected since I, in my stupidity, had forgotten
21360 * attribute.cs (GetValidPlaces): Fix stupid bug.
21362 * class.cs (Method::Emit): Perform check on applicability of attributes.
21364 (Constructor::Emit): Ditto.
21366 (Field::Emit): Ditto.
21368 (Field.Location): Store location information.
21370 (Property, Event, Indexer, Operator): Ditto.
21372 * cs-parser.jay (field_declaration): Pass in location for each field.
21374 * ../errors/cs0592.cs : Add.
21376 2001-11-12 Ravi Pratap <ravi@ximian.com>
21378 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21380 (InitCoreTypes): Update accordingly.
21382 (RegisterAttrType, LookupAttr): Implement.
21384 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21385 info about the same.
21387 (Resolve): Update to populate the above as necessary.
21389 (Error592): Helper.
21391 (GetValidPlaces): Helper to the above.
21393 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21395 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21397 2001-11-12 Ravi Pratap <ravi@ximian.com>
21399 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21401 * ../errors/cs0617.cs : Add.
21403 2001-11-11 Ravi Pratap <ravi@ximian.com>
21405 * enum.cs (Emit): Rename to Populate to be more consistent with what
21406 we expect it to do and when exactly it is called.
21408 * class.cs, rootcontext.cs : Update accordingly.
21410 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21411 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21413 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21415 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21416 of a fieldinfo using the above, when dealing with a FieldBuilder.
21418 2001-11-10 Ravi Pratap <ravi@ximian.com>
21420 * ../errors/cs0031.cs : Add.
21422 * ../errors/cs1008.cs : Add.
21424 * ../errrors/cs0543.cs : Add.
21426 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21429 (FindMembers): Implement.
21431 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21432 enums and delegates too.
21434 (enum_types): Rename to builder_to_enum.
21436 (delegate_types): Rename to builder_to_delegate.
21438 * delegate.cs (FindMembers): Implement.
21440 2001-11-09 Ravi Pratap <ravi@ximian.com>
21442 * typemanager.cs (IsEnumType): Implement.
21444 * enum.cs (Emit): Re-write parts to account for the underlying type
21445 better and perform checking etc.
21447 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21448 of the underlying type.
21450 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21453 * enum.cs (error31): Helper to report error #31.
21455 * cs-parser.jay (enum_declaration): Store location of each member too.
21457 * enum.cs (member_to_location): New hashtable.
21459 (AddEnumMember): Update location hashtable.
21461 (Emit): Use the location of each member while reporting errors.
21463 2001-11-09 Miguel de Icaza <miguel@ximian.com>
21465 * cs-parser.jay: A for_initializer if is a
21466 local_variable_declaration really ammount to have an implicit
21467 block with the variable declaration and no initializer for for.
21469 * statement.cs (For.Emit): Cope with null initializers.
21471 This fixes the infinite loop on for initializers.
21473 2001-11-08 Miguel de Icaza <miguel@ximian.com>
21475 * enum.cs: More cleanup.
21477 * ecore.cs: Remove dead code.
21479 * class.cs (Property.Emit): More simplification.
21480 (Event.Emit): ditto.
21482 Reworked to have less levels of indentation.
21484 2001-11-08 Ravi Pratap <ravi@ximian.com>
21486 * class.cs (Property): Emit attributes.
21496 * enum.cs (Emit): Ditto.
21498 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21501 * class.cs (Field, Event, etc.): Move attribute generation into the
21502 Emit method everywhere.
21504 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21505 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21506 as we had no way of defining nested enums !
21508 * rootcontext.cs : Adjust code accordingly.
21510 * typemanager.cs (AddEnumType): To keep track of enum types separately.
21512 2001-11-07 Ravi Pratap <ravi@ximian.com>
21514 * expression.cs (EvalConstantExpression): Move into ecore.cs
21516 * enum.cs (Enum): Rename some members and make them public and readonly
21517 according to our convention.
21519 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21522 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21524 (Enum::Emit): Write a simple version for now which doesn't try to compute
21525 expressions. I shall modify this to be more robust in just a while.
21527 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21529 (TypeContainer::CloseType): Create the Enum types too.
21531 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21533 * expression.cs (EvalConstantExpression): Get rid of completely.
21535 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21536 user-defined values and other cases.
21538 (IsValidEnumLiteral): Helper function.
21540 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
21541 out there in the case we had a literal FieldExpr.
21543 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21545 (Literalize): Revamp a bit to take two arguments.
21547 (EnumLiteral): New class which derives from Literal to wrap enum literals.
21549 2001-11-06 Ravi Pratap <ravi@ximian.com>
21551 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21553 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21555 (Resolve): Use the above to ensure we have proper initializers.
21557 2001-11-05 Ravi Pratap <ravi@ximian.com>
21559 * expression.cs (Expression::EvalConstantExpression): New method to
21560 evaluate constant expressions.
21562 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21564 2001-11-07 Miguel de Icaza <miguel@ximian.com>
21566 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21569 (Binary.ResolveOperator): Handle operator != (object a, object b)
21570 and operator == (object a, object b);
21572 (Binary.DoNumericPromotions): Indicate whether the numeric
21573 promotion was possible.
21575 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21578 Made the ArrayAccess implement interface IAssignMethod instead of
21579 IStackStore as the order in which arguments are passed reflects
21582 * assign.cs: Instead of using expr.ExprClass to select the way of
21583 assinging, probe for the IStackStore/IAssignMethod interfaces.
21585 * typemanager.cs: Load InitializeArray definition.
21587 * rootcontext.cs (RootContext.MakeStaticData): Used to define
21588 static data that can be used to initialize arrays.
21590 2001-11-05 Miguel de Icaza <miguel@ximian.com>
21592 * expression.cs: Handle operator== and operator!= for booleans.
21594 (Conditioal.Reduce): Implement reducer for the ?: operator.
21596 (Conditional.Resolve): Implement dead code elimination.
21598 (Binary.Resolve): Catch string literals and return a new
21599 concatenated string.
21601 (Unary.Reduce): Implement reduction of unary expressions.
21603 * ecore.cs: Split out the expression core handling here.
21605 (Expression.Reduce): New method used to perform constant folding
21606 and CSE. This is needed to support constant-expressions.
21608 * statement.cs (Statement.EmitBoolExpression): Pass true and false
21609 targets, and optimize for !x.
21611 2001-11-04 Ravi Pratap <ravi@ximian.com>
21613 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21614 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21615 set custom atttributes.
21617 * literal.cs (Literal::GetValue): New abstract method to return the actual
21618 value of the literal, cast as an object.
21620 (*Literal): Implement GetValue method.
21622 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21623 expressions to the arraylist but objects of type Argument.
21625 * class.cs (TypeContainer::Emit): Emit our attributes too.
21627 (Method::Emit, Constructor::Emit): Ditto.
21629 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21630 to be ignoring earlier.
21632 2001-11-03 Ravi Pratap <ravi@ximian.com>
21634 * attribute.cs (AttributeSection::Define): Implement to do the business
21635 of constructing a CustomAttributeBuilder.
21637 (Attribute): New trivial class. Increases readability of code.
21639 * cs-parser.jay : Update accordingly.
21641 (positional_argument_list, named_argument_list, named_argument): New rules
21643 (attribute_arguments): Use the above so that we are more correct.
21645 2001-11-02 Ravi Pratap <ravi@ximian.com>
21647 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
21648 to perform all checks for a method with a params parameter.
21650 (Invocation::OverloadResolve): Update to use the above method and therefore
21651 cope correctly with params method invocations.
21653 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
21656 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
21657 constructors in our parent too because we can't afford to miss out on
21660 * attribute.cs (AttributeSection): New name for the class Attribute
21662 Other trivial changes to improve readability.
21664 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
21665 use the new class names.
21667 2001-11-01 Ravi Pratap <ravi@ximian.com>
21669 * class.cs (Method::Define): Complete definition for params types too
21671 (Indexer::Define): Ditto.
21673 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
21674 Cope everywhere with a request for info about the array parameter.
21676 2001-11-01 Ravi Pratap <ravi@ximian.com>
21678 * tree.cs (RecordNamespace): Fix up to check for the correct key.
21680 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
21681 local_variable_type to extract the string corresponding to the type.
21683 (local_variable_type): Fixup the action to use the new helper method.
21685 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
21688 * expression.cs : Clean out code which uses the above.
21690 2001-10-31 Ravi Pratap <ravi@ximian.com>
21692 * typemanager.cs (RegisterMethod): Check if we already have an existing key
21693 and bale out if necessary by returning a false.
21695 (RegisterProperty): Ditto.
21697 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21698 and print out appropriate error messages.
21700 * interface.cs (everywhere): Ditto.
21702 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21703 location to constructor.
21705 * class.cs (Property, Event, Indexer): Update accordingly.
21707 * ../errors/cs111.cs : Added.
21709 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21710 of a method, as laid down by the spec.
21712 (Invocation::OverloadResolve): Use the above method.
21714 2001-10-31 Ravi Pratap <ravi@ximian.com>
21716 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21717 now take a TypeContainer and a Parameters object.
21719 (ParameterData): Modify return type of ParameterModifier method to be
21720 Parameter.Modifier and not a string.
21722 (ReflectionParameters, InternalParameters): Update accordingly.
21724 * expression.cs (Argument::GetParameterModifier): Same here.
21726 * support.cs (InternalParameters::ParameterType): Find a better way of determining
21727 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21728 symbol in it at all so maybe this is only for now.
21730 2001-10-30 Ravi Pratap <ravi@ximian.com>
21732 * support.cs (InternalParameters): Constructor now takes an extra argument
21733 which is the actual Parameters class.
21735 (ParameterDesc): Update to provide info on ref/out modifiers.
21737 * class.cs (everywhere): Update call to InternalParameters to pass in
21738 the second argument too.
21740 * support.cs (ParameterData): Add ParameterModifier, which is a method
21741 to return the modifier info [ref/out etc]
21743 (InternalParameters, ReflectionParameters): Implement the above.
21745 * expression.cs (Argument::ParameterModifier): Similar function to return
21746 info about the argument's modifiers.
21748 (Invocation::OverloadResolve): Update to take into account matching modifiers
21751 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21752 a new SetFormalParameters object which we pass to InternalParameters.
21754 2001-10-30 Ravi Pratap <ravi@ximian.com>
21756 * expression.cs (NewArray): Merge into the ArrayCreation class.
21758 2001-10-29 Ravi Pratap <ravi@ximian.com>
21760 * expression.cs (NewArray): Merge classes NewBuiltinArray and
21761 NewUserdefinedArray into one as there wasn't much of a use in having
21764 * expression.cs (Argument): Change field's name to ArgType from Type.
21766 (Type): New readonly property which returns the proper type, taking into
21767 account ref/out modifiers.
21769 (everywhere): Adjust code accordingly for the above.
21771 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21772 whether we are emitting for a ref or out parameter.
21774 * expression.cs (Argument::Emit): Use the above field to set the state.
21776 (LocalVariableReference::Emit): Update to honour the flag and emit the
21779 * parameter.cs (Attributes): Set the correct flags for ref parameters.
21781 * expression.cs (Argument::FullDesc): New function to provide a full desc.
21783 * support.cs (ParameterData): Add method ParameterDesc to the interface.
21785 (ReflectionParameters, InternalParameters): Implement the above method.
21787 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21790 (Invocation::FullMethodDesc): Ditto.
21792 2001-10-29 Miguel de Icaza <miguel@ximian.com>
21794 * cs-parser.jay: Add extra production for the second form of array
21797 * expression.cs (ArrayCreation): Update to reflect the above
21800 * Small changes to prepare for Array initialization.
21802 2001-10-28 Miguel de Icaza <miguel@ximian.com>
21804 * typemanager.cs (ImplementsInterface): interface might be null;
21805 Deal with this problem;
21807 Also, we do store negative hits on the cache (null values), so use
21808 this instead of calling t.GetInterfaces on the type everytime.
21810 2001-10-28 Ravi Pratap <ravi@ximian.com>
21812 * typemanager.cs (IsBuiltinType): New method to help determine the same.
21814 * expression.cs (New::DoResolve): Get rid of array creation code and instead
21815 split functionality out into different classes.
21817 (New::FormArrayType): Move into NewBuiltinArray.
21819 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21822 (NewBuiltinArray): New class to handle creation of built-in arrays.
21824 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21825 account creation of one-dimensional arrays.
21827 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21829 (NewUserdefinedArray::DoResolve): Implement.
21831 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21833 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21834 we maintain inside the TypeManager. This is necessary to perform lookups on the
21837 (LookupType): Update to perform GetType on the module builders too.
21839 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21841 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21843 2001-10-23 Ravi Pratap <ravi@ximian.com>
21845 * expression.cs (New::DoResolve): Implement guts of array creation.
21847 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21849 2001-10-27 Miguel de Icaza <miguel@ximian.com>
21851 * expression.cs: Fix bug I introduced lsat night that broke
21854 (Expression.Resolve): Report a 246 error (can not resolve name)
21855 if we find a SimpleName in the stream.
21857 (Expression.ResolveLValue): Ditto.
21859 (Expression.ResolveWithSimpleName): This function is a variant of
21860 ResolveName, this one allows SimpleNames to be returned without a
21861 warning. The only consumer of SimpleNames is MemberAccess
21863 2001-10-26 Miguel de Icaza <miguel@ximian.com>
21865 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21866 might arrive here. I have my doubts that this is correct.
21868 * statement.cs (Lock): Implement lock statement.
21870 * cs-parser.jay: Small fixes to support `lock' and `using'
21872 * cs-tokenizer.cs: Remove extra space
21874 * driver.cs: New flag --checked, allows to turn on integer math
21877 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21878 Threading.Monitor.Exit
21880 2001-10-23 Miguel de Icaza <miguel@ximian.com>
21882 * expression.cs (IndexerAccess::DoResolveLValue): Set the
21883 Expression Class to be IndexerAccess.
21885 Notice that Indexer::DoResolve sets the eclass to Value.
21887 2001-10-22 Miguel de Icaza <miguel@ximian.com>
21889 * class.cs (TypeContainer::Emit): Emit code for indexers.
21891 * assign.cs (IAssignMethod): New interface implemented by Indexers
21892 and Properties for handling assignment.
21894 (Assign::Emit): Simplify and reuse code.
21896 * expression.cs (IndexerAccess, PropertyExpr): Implement
21897 IAssignMethod, clean up old code.
21899 2001-10-22 Ravi Pratap <ravi@ximian.com>
21901 * typemanager.cs (ImplementsInterface): New method to determine if a type
21902 implements a given interface. Provides a nice cache too.
21904 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21907 (ConvertReferenceExplicit): Ditto.
21909 * delegate.cs (Delegate::Populate): Update to define the parameters on the
21910 various methods, with correct names etc.
21912 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
21913 Operator.UnaryNegation.
21915 * cs-parser.jay (operator_declarator): Be a little clever in the case where
21916 we have a unary plus or minus operator.
21918 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
21921 * everywhere : update accordingly.
21923 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21926 * class.cs (Method::Define): For the case where we are implementing a method
21927 inherited from an interface, we need to set the MethodAttributes.Final flag too.
21928 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21930 2001-10-21 Ravi Pratap <ravi@ximian.com>
21932 * interface.cs (FindMembers): Implement to work around S.R.E
21935 * typemanager.cs (IsInterfaceType): Implement.
21937 (FindMembers): Update to handle interface types too.
21939 * expression.cs (ImplicitReferenceConversion): Re-write bits which
21940 use IsAssignableFrom as that is not correct - it doesn't work.
21942 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21943 and accordingly override EmitStatement.
21945 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21946 using the correct logic :-)
21948 2001-10-19 Ravi Pratap <ravi@ximian.com>
21950 * ../errors/cs-11.cs : Add to demonstrate error -11
21952 2001-10-17 Miguel de Icaza <miguel@ximian.com>
21954 * assign.cs (Assign::Resolve): Resolve right hand side first, and
21955 then pass this as a hint to ResolveLValue.
21957 * expression.cs (FieldExpr): Add Location information
21959 (FieldExpr::LValueResolve): Report assignment to readonly
21962 (Expression::ExprClassFromMemberInfo): Pass location information.
21964 (Expression::ResolveLValue): Add new method that resolves an
21967 (Expression::DoResolveLValue): Default invocation calls
21970 (Indexers): New class used to keep track of indexers in a given
21973 (IStackStore): Renamed from LValue, as it did not really describe
21974 what this did. Also ResolveLValue is gone from this interface and
21975 now is part of Expression.
21977 (ElementAccess): Depending on the element access type
21979 * typemanager.cs: Add `indexer_name_type' as a Core type
21980 (System.Runtime.CompilerServices.IndexerNameAttribute)
21982 * statement.cs (Goto): Take a location.
21984 2001-10-18 Ravi Pratap <ravi@ximian.com>
21986 * delegate.cs (Delegate::VerifyDelegate): New method to verify
21987 if two delegates are compatible.
21989 (NewDelegate::DoResolve): Update to take care of the case when
21990 we instantiate a delegate from another delegate.
21992 * typemanager.cs (FindMembers): Don't even try to look up members
21993 of Delegate types for now.
21995 2001-10-18 Ravi Pratap <ravi@ximian.com>
21997 * delegate.cs (NewDelegate): New class to take care of delegate
22000 * expression.cs (New): Split the delegate related code out into
22001 the NewDelegate class.
22003 * delegate.cs (DelegateInvocation): New class to handle delegate
22006 * expression.cs (Invocation): Split out delegate related code into
22007 the DelegateInvocation class.
22009 2001-10-17 Ravi Pratap <ravi@ximian.com>
22011 * expression.cs (New::DoResolve): Implement delegate creation fully
22012 and according to the spec.
22014 (New::DoEmit): Update to handle delegates differently.
22016 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22017 because of which we were printing out arguments in reverse order !
22019 * delegate.cs (VerifyMethod): Implement to check if the given method
22020 matches the delegate.
22022 (FullDelegateDesc): Implement.
22024 (VerifyApplicability): Implement.
22026 * expression.cs (Invocation::DoResolve): Update to accordingly handle
22027 delegate invocations too.
22029 (Invocation::Emit): Ditto.
22031 * ../errors/cs1593.cs : Added.
22033 * ../errors/cs1594.cs : Added.
22035 * delegate.cs (InstanceExpression, TargetMethod): New properties.
22037 2001-10-16 Ravi Pratap <ravi@ximian.com>
22039 * typemanager.cs (intptr_type): Core type for System.IntPtr
22041 (InitCoreTypes): Update for the same.
22043 (iasyncresult_type, asynccallback_type): Ditto.
22045 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22048 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22051 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22052 the builders for the 4 members of a delegate type :-)
22054 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22057 * expression.cs (New::DoResolve): Implement guts for delegate creation.
22059 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22061 2001-10-15 Miguel de Icaza <miguel@ximian.com>
22063 * statement.cs (Break::Emit): Implement.
22064 (Continue::Emit): Implement.
22066 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
22067 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
22068 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
22069 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
22072 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22073 properties that track the label for the current loop (begin of the
22074 loop and end of the loop).
22076 2001-10-15 Ravi Pratap <ravi@ximian.com>
22078 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22079 use of emitting anything at all.
22081 * class.cs, rootcontext.cs : Get rid of calls to the same.
22083 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22085 (Populate): Define the constructor correctly and set the implementation
22088 * typemanager.cs (delegate_types): New hashtable to hold delegates that
22091 (AddDelegateType): Implement.
22093 (IsDelegateType): Implement helper method.
22095 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22097 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22098 and accordingly handle it.
22100 * delegate.cs (Populate): Take TypeContainer argument.
22101 Implement bits to define the Invoke method. However, I still haven't figured out
22102 how to take care of the native int bit :-(
22104 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
22105 Qualify the name of the delegate, not its return type !
22107 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22110 (StandardConversionExists): Checking for array types turns out to be recursive.
22112 (ConvertReferenceExplicit): Implement array conversion.
22114 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22116 2001-10-12 Ravi Pratap <ravi@ximian.com>
22118 * cs-parser.jay (delegate_declaration): Store the fully qualified
22119 name as it is a type declaration.
22121 * delegate.cs (ReturnType, Name): Rename members to these. Make them
22124 (DefineDelegate): Renamed from Define. Does the same thing essentially,
22125 as TypeContainer::DefineType.
22127 (Populate): Method in which all the definition of the various methods (Invoke)
22130 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22133 (CloseDelegate): Finally creates the delegate.
22135 * class.cs (TypeContainer::DefineType): Update to define delegates.
22136 (Populate, Emit and CloseType): Do the same thing here too.
22138 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22139 delegates in all these operations.
22141 2001-10-14 Miguel de Icaza <miguel@ximian.com>
22143 * expression.cs: LocalTemporary: a new expression used to
22144 reference a temporary that has been created.
22146 * assign.cs: Handle PropertyAccess back here, so that we can
22147 provide the proper semantic access to properties.
22149 * expression.cs (Expression::ConvertReferenceExplicit): Implement
22150 a few more explicit conversions.
22152 * modifiers.cs: `NEW' modifier maps to HideBySig.
22154 * expression.cs (PropertyExpr): Make this into an
22155 ExpressionStatement, and support the EmitStatement code path.
22157 Perform get/set error checking, clean up the interface.
22159 * assign.cs: recognize PropertyExprs as targets, and if so, turn
22160 them into toplevel access objects.
22162 2001-10-12 Miguel de Icaza <miguel@ximian.com>
22164 * expression.cs: PropertyExpr::PropertyExpr: use work around the
22167 * typemanager.cs: Keep track here of our PropertyBuilders again to
22168 work around lameness in SRE.
22170 2001-10-11 Miguel de Icaza <miguel@ximian.com>
22172 * expression.cs (LValue::LValueResolve): New method in the
22173 interface, used to perform a second resolution pass for LValues.
22175 (This::DoResolve): Catch the use of this in static methods.
22177 (This::LValueResolve): Implement.
22179 (This::Store): Remove warning, assigning to `this' in structures
22182 (Invocation::Emit): Deal with invocation of
22183 methods on value types. We need to pass the address to structure
22184 methods rather than the object itself. (The equivalent code to
22185 emit "this" for structures leaves the entire structure on the
22186 stack instead of a pointer to it).
22188 (ParameterReference::DoResolve): Compute the real index for the
22189 argument based on whether the method takes or not a `this' pointer
22190 (ie, the method is static).
22192 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22193 value types returned from functions when we need to invoke a
22194 method on the sturcture.
22197 2001-10-11 Ravi Pratap <ravi@ximian.com>
22199 * class.cs (TypeContainer::DefineType): Method to actually do the business of
22200 defining the type in the Modulebuilder or Typebuilder. This is to take
22201 care of nested types which need to be defined on the TypeBuilder using
22202 DefineNestedMethod.
22204 (TypeContainer::GetClassBases): Implement. Essentially the code from the
22205 methods in RootContext, only ported to be part of TypeContainer.
22207 (TypeContainer::GetInterfaceOrClass): Ditto.
22209 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22211 * interface.cs (Interface::DefineInterface): New method. Does exactly
22212 what RootContext.CreateInterface did earlier, only it takes care of nested types
22215 (Interface::GetInterfaces): Move from RootContext here and port.
22217 (Interface::GetInterfaceByName): Same here.
22219 * rootcontext.cs (ResolveTree): Re-write.
22221 (PopulateTypes): Re-write.
22223 * class.cs (TypeContainer::Populate): Populate nested types too.
22224 (TypeContainer::Emit): Emit nested members too.
22226 * typemanager.cs (AddUserType): Do not make use of the FullName property,
22227 instead just use the name argument passed in as it is already fully
22230 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22231 to TypeContainer mapping to see if a type is user-defined.
22233 * class.cs (TypeContainer::CloseType): Implement.
22235 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22236 the default constructor.
22238 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22241 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22243 * interface.cs (CloseType): Create the type here.
22245 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22248 Remove all the methods which are now in TypeContainer.
22250 2001-10-10 Ravi Pratap <ravi@ximian.com>
22252 * delegate.cs (Define): Re-write bits to define the delegate
22255 2001-10-10 Miguel de Icaza <miguel@ximian.com>
22257 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22259 * expression.cs (ImplicitReferenceConversion): handle null as well
22260 as a source to convert to any reference type.
22262 * statement.cs (Return): Perform any implicit conversions to
22263 expected return type.
22265 Validate use of return statement.
22267 * codegen.cs (EmitContext): Pass the expected return type here.
22269 * class.cs (Method, Constructor, Property): Pass expected return
22270 type to EmitContext.
22272 2001-10-09 Miguel de Icaza <miguel@ximian.com>
22274 * expression.cs: Make DoResolve take an EmitContext instead of a
22277 Replaced `l' and `location' for `loc', for consistency.
22279 (Error, Warning): Remove unneeded Tc argument.
22281 * assign.cs, literal.cs, constant.cs: Update to new calling
22284 * codegen.cs: EmitContext now contains a flag indicating whether
22285 code is being generated in a static method or not.
22287 * cs-parser.jay: DecomposeQI, new function that replaces the old
22288 QualifiedIdentifier. Now we always decompose the assembled
22289 strings from qualified_identifier productions into a group of
22292 2001-10-08 Miguel de Icaza <miguel@ximian.com>
22294 * rootcontext.cs: Deal with field-less struct types correctly now
22295 by passing the size option to Define Type.
22297 * class.cs: Removed hack that created one static field.
22299 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22301 * statement.cs: Moved most of the code generation here.
22303 2001-10-09 Ravi Pratap <ravi@ximian.com>
22305 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22308 (ElementAccess): Remove useless bits for now - keep checks as the spec
22311 2001-10-08 Ravi Pratap <ravi@ximian.com>
22313 * expression.cs (ElementAccess::DoResolve): Remove my crap code
22314 and start performing checks according to the spec.
22316 2001-10-07 Ravi Pratap <ravi@ximian.com>
22318 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22319 rank_specifiers instead.
22321 (rank_specifiers): Change the order in which the rank specifiers are stored
22323 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22325 * expression.cs (ElementAccess): Implement the LValue interface too.
22327 2001-10-06 Ravi Pratap <ravi@ximian.com>
22329 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22330 except that user defined conversions are not included.
22332 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
22333 perform the conversion of the return type, if necessary.
22335 (New::DoResolve): Check whether we are creating an array or an object
22336 and accordingly do the needful.
22338 (New::Emit): Same here.
22340 (New::DoResolve): Implement guts of array creation.
22342 (New::FormLookupType): Helper function.
22344 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22346 * codegen.cs: Removed most of the code generation here, and move the
22347 corresponding code generation bits to the statement classes.
22349 Added support for try/catch/finalize and throw.
22351 * cs-parser.jay: Added support for try/catch/finalize.
22353 * class.cs: Catch static methods having the flags override,
22354 virtual or abstract.
22356 * expression.cs (UserCast): This user cast was not really doing
22357 what it was supposed to do. Which is to be born in fully resolved
22358 state. Parts of the resolution were being performed at Emit time!
22362 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22364 * expression.cs: Implicity convert the result from UserCast.
22366 2001-10-05 Ravi Pratap <ravi@ximian.com>
22368 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22369 prevented it from working correctly.
22371 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22372 merely ConvertImplicit.
22374 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22376 * typemanager.cs: Make the LookupTypeContainer function static,
22377 and not per-instance.
22379 * class.cs: Make static FindMembers (the one that takes a Type
22382 * codegen.cs: Add EmitForeach here.
22384 * cs-parser.jay: Make foreach a toplevel object instead of the
22385 inline expansion, as we need to perform semantic analysis on it.
22387 2001-10-05 Ravi Pratap <ravi@ximian.com>
22389 * expression.cs (Expression::ImplicitUserConversion): Rename to
22390 UserDefinedConversion.
22392 (Expression::UserDefinedConversion): Take an extra argument specifying
22393 whether we look for explicit user conversions too.
22395 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22397 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22399 (ExplicitUserConversion): Make it a call to UserDefinedConversion
22400 with the appropriate arguments.
22402 * cs-parser.jay (cast_expression): Record location too.
22404 * expression.cs (Cast): Record location info.
22406 (Expression::ConvertExplicit): Take location argument.
22408 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22409 to determine if we are doing explicit conversions.
22411 (UserCast::Emit): Update accordingly.
22413 (Expression::ConvertExplicit): Report an error if everything fails.
22415 * ../errors/cs0030.cs : Add.
22417 2001-10-04 Miguel de Icaza <miguel@ximian.com>
22419 * modifiers.cs: If the ABSTRACT keyword is present, also set the
22420 virtual and newslot bits.
22422 * class.cs (TypeContainer::RegisterRequiredImplementations):
22423 Record methods we need.
22425 (TypeContainer::MakeKey): Helper function to make keys for
22426 MethodBases, since the Methodbase key is useless.
22428 (TypeContainer::Populate): Call RegisterRequiredImplementations
22429 before defining the methods.
22431 Create a mapping for method_builders_to_methods ahead of time
22432 instead of inside a tight loop.
22434 (::RequireMethods): Accept an object as the data to set into the
22435 hashtable so we can report interface vs abstract method mismatch.
22437 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22439 * report.cs: Make all of it static.
22441 * rootcontext.cs: Drop object_type and value_type computations, as
22442 we have those in the TypeManager anyways.
22444 Drop report instance variable too, now it is a global.
22446 * driver.cs: Use try/catch on command line handling.
22448 Add --probe option to debug the error reporting system with a test
22451 * report.cs: Add support for exiting program when a probe
22452 condition is reached.
22454 2001-10-03 Ravi Pratap <ravi@ximian.com>
22456 * expression.cs (Binary::DoNumericPromotions): Fix the case when
22457 we do a forcible conversion regardless of type, to check if
22458 ForceConversion returns a null.
22460 (Binary::error19): Use location to report error.
22462 (Unary::error23): Use location here too.
22464 * ../errors/cs0019.cs : Check in.
22466 * ../errors/cs0023.cs : Check in.
22468 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22469 case of a non-null MethodInfo object with a length of 0 !
22471 (Binary::ResolveOperator): Flag error if overload resolution fails to find
22472 an applicable member - according to the spec :-)
22473 Also fix logic to find members in base types.
22475 (Unary::ResolveOperator): Same here.
22477 (Unary::report23): Change name to error23 and make first argument a TypeContainer
22478 as I was getting thoroughly confused between this and error19 :-)
22480 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22481 (::FindMostEncompassedType): Implement.
22482 (::FindMostEncompassingType): Implement.
22483 (::StandardConversionExists): Implement.
22485 (UserImplicitCast): Re-vamp. We now need info about most specific
22486 source and target types so that we can do the necessary conversions.
22488 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22489 mathematical union with no duplicates.
22491 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22493 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22494 in order from base classes to child classes, so that we can in
22495 child classes look up in our parent for method names and
22496 attributes (required for handling abstract, virtual, new, override
22497 constructs: we need to instrospect our base class, and if we dont
22498 populate the classes in order, the introspection might be
22499 incorrect. For example, a method could query its parent before
22500 the parent has any methods and would determine that the parent has
22501 no abstract methods (while it could have had them)).
22503 (RootContext::CreateType): Record the order in which we define the
22506 2001-10-02 Miguel de Icaza <miguel@ximian.com>
22508 * class.cs (TypeContainer::Populate): Also method definitions can
22509 fail now, keep track of this.
22511 (TypeContainer::FindMembers): Implement support for
22512 DeclaredOnly/noDeclaredOnly flag.
22514 (Constructor::Emit) Return the ConstructorBuilder.
22516 (Method::Emit) Return the MethodBuilder.
22517 Check for abstract or virtual methods to be public.
22519 * rootcontext.cs (RootContext::CreateType): Register all the
22520 abstract methods required for the class to be complete and the
22521 interface methods that must be implemented.
22523 * cs-parser.jay: Report error 501 (method requires body if it is
22524 not marked abstract or extern).
22526 * expression.cs (TypeOf::Emit): Implement.
22528 * typemanager.cs: runtime_handle_type, new global type.
22530 * class.cs (Property::Emit): Generate code for properties.
22532 2001-10-02 Ravi Pratap <ravi@ximian.com>
22534 * expression.cs (Unary::ResolveOperator): Find operators on base type
22535 too - we now conform exactly to the spec.
22537 (Binary::ResolveOperator): Same here.
22539 * class.cs (Operator::Define): Fix minor quirk in the tests.
22541 * ../errors/cs0215.cs : Added.
22543 * ../errors/cs0556.cs : Added.
22545 * ../errors/cs0555.cs : Added.
22547 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22549 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22550 single integer which is really efficient
22552 2001-10-01 Ravi Pratap <ravi@ximian.com>
22554 * expression.cs (Expression::ImplicitUserConversion): Use location
22555 even in the case when we are examining True operators.
22557 * class.cs (Operator::Define): Perform extensive checks to conform
22558 with the rules for operator overloading in the spec.
22560 * expression.cs (Expression::ImplicitReferenceConversion): Implement
22561 some of the other conversions mentioned in the spec.
22563 * typemanager.cs (array_type): New static member for the System.Array built-in
22566 (cloneable_interface): For System.ICloneable interface.
22568 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22569 we start resolving the tree and populating types.
22571 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22573 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22575 * expression.cs (Expression::ExprClassFromMemberInfo,
22576 Expression::Literalize): Create literal expressions from
22577 FieldInfos which are literals.
22579 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22580 type casts, because they were wrong. The test suite in tests
22583 (ImplicitNumericConversion): ushort to ulong requires a widening
22586 Int32 constant to long requires widening cast as well.
22588 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22589 for integers because the type on the stack is not i4.
22591 2001-09-30 Miguel de Icaza <miguel@ximian.com>
22593 * expression.cs (report118): require location argument.
22595 * parameter.cs: Do not dereference potential null value.
22597 * class.cs: Catch methods that lack the `new' keyword when
22598 overriding a name. Report warnings when `new' is used without
22599 anything being there to override.
22601 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22603 * class.cs: Only add constructor to hashtable if it is non-null
22604 (as now constructors can fail on define).
22606 (TypeManager, Class, Struct): Take location arguments.
22608 Catch field instance initialization in structs as errors.
22610 accepting_filter: a new filter for FindMembers that is static so
22611 that we dont create an instance per invocation.
22613 (Constructor::Define): Catch errors where a struct constructor is
22616 * cs-parser.jay: Pass location information for various new
22619 * delegate.cs (Delegate): take a location argument.
22621 * driver.cs: Do not call EmitCode if there were problesm in the
22622 Definition of the types, as many Builders wont be there.
22624 * decl.cs (Decl::Decl): Require a location argument.
22626 * cs-tokenizer.cs: Handle properly hex constants that can not fit
22627 into integers, and find the most appropiate integer for it.
22629 * literal.cs: Implement ULongLiteral.
22631 * rootcontext.cs: Provide better information about the location of
22632 failure when CreateType fails.
22634 2001-09-29 Miguel de Icaza <miguel@ximian.com>
22636 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22639 * expression.cs (Binary::CheckShiftArguments): Add missing type
22641 (Binary::ResolveOperator): Add type to the logical and and logical
22642 or, Bitwise And/Or and Exclusive Or code paths, it was missing
22645 (Binary::DoNumericPromotions): In the case where either argument
22646 is ulong (and most signed types combined with ulong cause an
22647 error) perform implicit integer constant conversions as well.
22649 2001-09-28 Miguel de Icaza <miguel@ximian.com>
22651 * expression.cs (UserImplicitCast): Method should always be
22653 (Invocation::BetterConversion): Simplified test for IntLiteral.
22655 (Expression::ImplicitNumericConversion): Split this routine out.
22656 Put the code that performs implicit constant integer conversions
22659 (Expression::Resolve): Become a wrapper around DoResolve so we can
22660 check eclass and type being set after resolve.
22662 (Invocation::Badness): Remove this dead function
22664 (Binary::ResolveOperator): Do not compute the expensive argumnets
22665 unless we have a union for it.
22667 (Probe::Emit): Is needs to do an isinst and then
22668 compare against null.
22670 (::CanConvert): Added Location argument. If the Location argument
22671 is null (Location.Null), then we do not report errors. This is
22672 used by the `probe' mechanism of the Explicit conversion. We do
22673 not want to generate an error for something that the user
22674 explicitly requested to be casted. But the pipeline for an
22675 explicit cast first tests for potential implicit casts.
22677 So for now, if the Location is null, it means `Probe only' to
22678 avoid adding another argument. Might have to revise this
22681 (ClassCast): New class used to type cast objects into arbitrary
22682 classes (used in Explicit Reference Conversions).
22684 Implement `as' as well.
22686 Reverted all the patches from Ravi below: they were broken:
22688 * The use of `level' as a mechanism to stop recursive
22689 invocations is wrong. That was there just to catch the
22690 bug with a strack trace but not as a way of addressing
22693 To fix the problem we have to *understand* what is going
22694 on and the interactions and come up with a plan, not
22695 just get things going.
22697 * The use of the type conversion cache that I proposed
22698 last night had an open topic: How does this work across
22699 protection domains. A user defined conversion might not
22700 be public in the location where we are applying the
22701 conversion, a different conversion might be selected
22702 (ie, private A->B (better) but public B->A (worse),
22703 inside A, A->B applies, but outside it, B->A will
22706 * On top of that (ie, even if the above is solved),
22707 conversions in a cache need to be abstract. Ie, `To
22708 convert from an Int to a Short use an OpcodeCast', not
22709 `To convert from an Int to a Short use the OpcodeCast on
22710 the variable 5' (which is what this patch was doing).
22712 2001-09-28 Ravi Pratap <ravi@ximian.com>
22714 * expression.cs (Invocation::ConversionExists): Re-write to use
22715 the conversion cache
22717 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22718 cache all conversions done, not just user-defined ones.
22720 (Invocation::BetterConversion): The real culprit. Use ConversionExists
22721 to determine if a conversion exists instead of acutually trying to
22722 perform the conversion. It's faster too.
22724 (Expression::ConvertExplicit): Modify to use ConversionExists to check
22725 and only then attempt the implicit conversion.
22727 2001-09-28 Ravi Pratap <ravi@ximian.com>
22729 * expression.cs (ConvertImplicit): Use a cache for conversions
22730 already found. Check level of recursion and bail out if necessary.
22732 2001-09-28 Miguel de Icaza <miguel@ximian.com>
22734 * typemanager.cs (string_concat_string_string, string_concat_object_object):
22735 Export standard methods that we expect for string operations.
22737 * statement.cs (Block::UsageWarning): Track usage of variables and
22738 report the errors for not used variables.
22740 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22743 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22745 * codegen.cs: remove unnneded code
22747 * expression.cs: Removed BuiltinTypeAccess class
22749 Fix the order in which implicit conversions are
22752 The previous fixed dropped support for boxed conversions (adding a
22753 test to the test suite now)
22755 (UserImplicitCast::CanConvert): Remove test for source being null,
22756 that code is broken. We should not feed a null to begin with, if
22757 we do, then we should track the bug where the problem originates
22758 and not try to cover it up here.
22760 Return a resolved expression of type UserImplicitCast on success
22761 rather than true/false. Ravi: this is what I was talking about,
22762 the pattern is to use a static method as a "constructor" for
22765 Also, do not create arguments until the very last minute,
22766 otherwise we always create the arguments even for lookups that
22767 will never be performed.
22769 (UserImplicitCast::Resolve): Eliminate, objects of type
22770 UserImplicitCast are born in a fully resolved state.
22772 * typemanager.cs (InitCoreTypes): Init also value_type
22773 (System.ValueType).
22775 * expression.cs (Cast::Resolve): First resolve the child expression.
22777 (LValue): Add new method AddressOf to be used by
22780 Change the argument of Store to take an EmitContext instead of an
22781 ILGenerator, because things like FieldExpr need to be able to call
22782 their children expression to generate the instance code.
22784 (Expression::Error, Expression::Warning): Sugar functions for
22787 (Expression::MemberLookup): Accept a TypeContainer instead of a
22788 Report as the first argument.
22790 (Expression::ResolvePrimary): Killed. I still want to improve
22791 this as currently the code is just not right.
22793 (Expression::ResolveMemberAccess): Simplify, but it is still
22796 (Unary::Resolve): Catch errors in AddressOf operators.
22798 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22799 index to a byte for the short-version, or the compiler will choose
22800 the wrong Emit call, which generates the wrong data.
22802 (ParameterReference::Emit, ::Store): same.
22804 (FieldExpr::AddressOf): Implement.
22806 * typemanager.cs: TypeManager: made public variable instead of
22809 * driver.cs: document --fatal.
22811 * report.cs (ErrorMessage, WarningMessage): new names for the old
22812 Error and Warning classes.
22814 * cs-parser.jay (member_access): Turn built-in access to types
22815 into a normal simplename
22817 2001-09-27 Ravi Pratap <ravi@ximian.com>
22819 * expression.cs (Invocation::BetterConversion): Fix to cope
22820 with q being null, since this was introducing a bug.
22822 * expression.cs (ConvertImplicit): Do built-in conversions first.
22824 2001-09-27 Ravi Pratap <ravi@ximian.com>
22826 * expression.cs (UserImplicitCast::Resolve): Fix bug.
22828 2001-09-27 Ravi Pratap <ravi@ximian.com>
22830 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22831 I had introduced long ago (what's new ?).
22833 * expression.cs (UserImplicitCast::CanConvert): Static method to do
22834 the work of all the checking.
22835 (ConvertImplicit): Call CanConvert and only then create object if necessary.
22836 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22838 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22839 that is the right way.
22841 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
22842 overloading resolution. Use everywhere instead of cutting and pasting code.
22844 (Binary::ResolveOperator): Use MakeUnionSet.
22846 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
22847 we have to convert to bool types. Not complete yet.
22849 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22851 * typemanager.cs (TypeManager::CSharpName): support ushort.
22853 * expression.cs (Expression::TryImplicitIntConversion): Attempts
22854 to provide an expression that performsn an implicit constant int
22855 conversion (section 6.1.6).
22856 (Expression::ConvertImplicitRequired): Reworked to include
22857 implicit constant expression conversions.
22859 (Expression::ConvertNumericExplicit): Finished.
22861 (Invocation::Emit): If InstanceExpression is null, then it means
22862 that we perform a call on this.
22864 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22866 * expression.cs (Unary::Emit): Remove some dead code.
22867 (Probe): Implement Resolve and Emit for `is'.
22868 (Expression::ConvertImplicitRequired): Attempt to do constant
22869 expression conversions here. Maybe should be moved to
22870 ConvertImplicit, but I am not sure.
22871 (Expression::ImplicitLongConstantConversionPossible,
22872 Expression::ImplicitIntConstantConversionPossible): New functions
22873 that tell whether is it possible to apply an implicit constant
22874 expression conversion.
22876 (ConvertNumericExplicit): Started work on explicit numeric
22879 * cs-parser.jay: Update operator constants.
22881 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22882 (Parameters::GetSignature): Hook up VerifyArgs here.
22883 (Parameters::VerifyArgs): Verifies that no two arguments have the
22886 * class.cs (Operator): Update the operator names to reflect the
22887 ones that the spec expects (as we are just stringizing the
22890 * expression.cs (Unary::ResolveOperator): Fix bug: Use
22891 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22892 previous usage did only work for our methods.
22893 (Expression::ConvertImplicit): Handle decimal implicit numeric
22894 conversions as well.
22895 (Expression::InternalTypeConstructor): Used to invoke constructors
22896 on internal types for default promotions.
22898 (Unary::Emit): Implement special handling for the pre/post
22899 increment/decrement for overloaded operators, as they need to have
22900 the same semantics as the other operators.
22902 (Binary::ResolveOperator): ditto.
22903 (Invocation::ConversionExists): ditto.
22904 (UserImplicitCast::Resolve): ditto.
22906 2001-09-26 Ravi Pratap <ravi@ximian.com>
22908 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22909 operator, return after emitting body. Regression tests pass again !
22911 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22912 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22913 (Invocation::OverloadResolve): Ditto.
22914 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22916 * everywhere : update calls to the above methods accordingly.
22918 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22920 * assign.cs (Assign): Make it inherit from ExpressionStatement.
22922 * expression.cs (ExpressionStatement): New base class used for
22923 expressions that can appear in statements, so that we can provide
22924 an alternate path to generate expression that do not leave a value
22927 (Expression::Emit, and all the derivatives): We no longer return
22928 whether a value is left on the stack or not. Every expression
22929 after being emitted leaves a single value on the stack.
22931 * codegen.cs (EmitContext::EmitStatementExpression): Use the
22932 facilties of ExpressionStatement if possible.
22934 * cs-parser.jay: Update statement_expression.
22936 2001-09-25 Miguel de Icaza <miguel@ximian.com>
22938 * driver.cs: Change the wording of message
22940 2001-09-25 Ravi Pratap <ravi@ximian.com>
22942 * expression.cs (Binary::ResolveOperator): Had forgottten to set
22943 the type of the expression to the return type of the method if
22944 we have an overloaded operator match ! The regression tests pass again !
22945 (Unary::ResolveOperator): Ditto.
22947 * expression.cs (Invocation::ConversionExists): Correct the member lookup
22948 to find "op_Implicit", not "implicit" ;-)
22949 (UserImplicitCast): New class to take care of user-defined implicit conversions.
22950 (ConvertImplicit, ForceConversion): Take TypeContainer argument
22952 * everywhere : Correct calls to the above accordingly.
22954 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22955 (ConvertImplicit): Do user-defined conversion if it exists.
22957 2001-09-24 Miguel de Icaza <miguel@ximian.com>
22959 * assign.cs: track location.
22960 (Resolve): Use implicit conversions on assignment.
22962 * literal.cs: Oops. Not good, Emit of short access values should
22963 pass (Bytes) or the wrong argument will be selected.
22965 * expression.cs (Unary::Emit): Emit code for -expr.
22967 (Unary::ResolveOperator): Handle `Substract' for non-constants
22968 (substract from zero from the non-constants).
22969 Deal with Doubles as well.
22971 (Expression::ConvertImplicitRequired): New routine that reports an
22972 error if no implicit conversion exists.
22974 (Invocation::OverloadResolve): Store the converted implicit
22975 expressions if we make them
22977 2001-09-24 Ravi Pratap <ravi@ximian.com>
22979 * class.cs (ConstructorInitializer): Take a Location argument.
22980 (ConstructorBaseInitializer): Same here.
22981 (ConstructorThisInitializer): Same here.
22983 * cs-parser.jay : Update all calls accordingly.
22985 * expression.cs (Unary, Binary, New): Take location argument.
22986 Update accordingly everywhere.
22988 * cs-parser.jay : Update all calls to the above to take a location
22991 * class.cs : Ditto.
22993 2001-09-24 Ravi Pratap <ravi@ximian.com>
22995 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22996 (Invocation::BetterConversion): Same here
22997 (Invocation::ConversionExists): Ditto.
22999 (Invocation::ConversionExists): Implement.
23001 2001-09-22 Ravi Pratap <ravi@ximian.com>
23003 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23004 Also take an additional TypeContainer argument.
23006 * All over : Pass in TypeContainer as argument to OverloadResolve.
23008 * typemanager.cs (CSharpName): Update to check for the string type and return
23011 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23014 2001-09-21 Ravi Pratap <ravi@ximian.com>
23016 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23017 (Invocation::BetterFunction): Implement.
23018 (Invocation::BetterConversion): Implement.
23019 (Invocation::ConversionExists): Skeleton, no implementation yet.
23021 Okay, things work fine !
23023 2001-09-21 Miguel de Icaza <miguel@ximian.com>
23025 * typemanager.cs: declare and load enum_type, delegate_type and
23028 * expression.cs (Expression::Emit): Now emit returns a value that
23029 tells whether a value is left on the stack or not. This strategy
23030 might be reveted tomorrow with a mechanism that would address
23031 multiple assignments.
23032 (Expression::report118): Utility routine to report mismatches on
23035 (Unary::Report23): Report impossible type/operator combination
23038 (Unary::IsIncrementableNumber): Whether the type can be
23039 incremented or decremented with add.
23040 (Unary::ResolveOperator): Also allow enumerations to be bitwise
23042 (Unary::ResolveOperator): Implement ++, !, ~,
23044 (Invocation::Emit): Deal with new Emit convetion.
23046 * All Expression derivatives: Updated their Emit method to return
23047 whether they leave values on the stack or not.
23049 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23050 stack for expressions that are statements.
23052 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23054 * expression.cs (LValue): New interface. Must be implemented by
23056 (LocalVariableReference, ParameterReference, FieldExpr): Implement
23059 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23060 interface for generating code, simplifies the code.
23062 2001-09-20 Ravi Pratap <ravi@ximian.com>
23064 * expression.cs (everywhere): Comment out return statements in ::Resolve
23065 methods to avoid the warnings.
23067 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23069 * driver.cs (parse): Report error 2001 if we can not open the
23072 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23075 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23078 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23079 otherwise nested blocks end up with the same index.
23081 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23083 * expression.cs: Instead of having FIXMEs in the Resolve
23084 functions, throw exceptions so it is obvious that we are facing a
23087 * cs-parser.jay (invocation_expression): Pass Location information.
23089 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23090 Use a basename for those routines because .NET does not like paths
23093 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23096 2001-09-19 Miguel de Icaza <miguel@ximian.com>
23098 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23099 are loading the correct data types (throws an exception if not).
23100 (TypeManager::InitCoreTypes): Use CoreLookupType
23102 * expression.cs (Unary::ResolveOperator): return the child
23103 expression for expressions which are just +expr.
23104 (Unary::ResolveOperator): Return negative literals for -LITERAL
23105 expressions (otherwise they are Unary {Literal}).
23106 (Invocation::Badness): Take into account `Implicit constant
23107 expression conversions'.
23109 * literal.cs (LongLiteral): Implement long literal class.
23110 (IntLiteral): export the `Value' of the intliteral.
23112 2001-09-19 Ravi Pratap <ravi@ximian.com>
23114 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23116 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
23117 instead of 'Operator'
23119 * expression.cs (Binary::ResolveOperator): Update accordingly.
23120 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23123 * cs-parser.jay (unary_expression): Update to use the new names.
23125 * gen-treedump.cs (GetUnary): Same here.
23127 * expression.cs (Unary::Resolve): Implement.
23128 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
23129 operators are found instead of making noise ;-)
23130 (Unary::ResolveOperator): New method to do precisely the same thing which
23131 Binary::ResolveOperator does for Binary expressions.
23132 (Unary.method, .Arguments): Add.
23133 (Unary::OperName): Implement.
23134 (Unary::ForceConversion): Copy and Paste !
23136 * class.cs (Operator::Define): Fix a small bug for the case when we have
23139 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23140 for the inbuilt operators. Only overloading works for now ;-)
23142 2001-09-18 Miguel de Icaza <miguel@ximian.com>
23144 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23145 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23147 * expression.cs (This::Emit): Implement.
23148 (This::Resolve): Implement.
23149 (TypeOf:Resolve): Implement.
23150 (Expression::ResolveSimpleName): Add an implicit this to instance
23152 (MemberAccess::Resolve): Deal with Parameters and Fields.
23153 Bind instance variable to Field expressions.
23154 (FieldExpr::Instance): New field used to track the expression that
23155 represents the object instance.
23156 (FieldExpr::Resolve): Track potential errors from MemberLookup not
23158 (FieldExpr::Emit): Implement.
23160 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23161 the last instruction contains a return opcode to avoid generating
23162 the last `ret' instruction (this generates correct code, and it is
23163 nice to pass the peverify output).
23165 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23166 initializer for static and instance variables.
23167 (Constructor::Emit): Allow initializer to be null in the case of
23168 static constructors. Only emit initializer for instance
23171 (TypeContainer::FindMembers): Return a null array if there are no
23174 Also fix the code for the MemberTypes.Method branch, as it was not
23175 scanning that for operators (or tried to access null variables before).
23177 * assign.cs (Assign::Emit): Handle instance and static fields.
23181 * driver.cs: Stop compilation if there are parse errors.
23183 * cs-parser.jay (constructor_declaration): Provide default base
23184 initializer for non-static constructors.
23185 (constructor_declarator): Do not provide a default base
23186 initializers if none was specified.
23187 Catch the fact that constructors should not have parameters.
23189 * class.cs: Do not emit parent class initializers for static
23190 constructors, that should be flagged as an error.
23192 2001-09-18 Ravi Pratap <ravi@ximian.com>
23194 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23195 Move back code into TypeContainer::Populate.
23197 2001-09-18 Ravi Pratap <ravi@ximian.com>
23199 * class.cs (TypeContainer::AddConstructor): Fix the check to
23200 compare against Name, not Basename.
23201 (Operator::OpType): Change Plus and Minus to Add and Subtract.
23203 * cs-parser.jay : Update accordingly.
23205 * class.cs (TypeContainer::FindMembers): For the case where we are searching
23206 for methods, don't forget to look into the operators too.
23207 (RegisterMethodBuilder): Helper method to take care of this for
23208 methods, constructors and operators.
23209 (Operator::Define): Completely revamp.
23210 (Operator.OperatorMethod, MethodName): New fields.
23211 (TypeContainer::Populate): Move the registering of builders into
23212 RegisterMethodBuilder.
23213 (Operator::Emit): Re-write.
23215 * expression.cs (Binary::Emit): Comment out code path to emit method
23216 invocation stuff for the case when we have a user defined operator. I am
23217 just not able to get it right !
23219 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23221 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23224 (Expression::MemberLookup): Provide a version that allows to
23225 specify the MemberTypes and BindingFlags.
23227 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23228 so it was not fetching variable information from outer blocks.
23230 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23231 Beforefieldinit as it was buggy.
23233 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23234 that Ravi put here.
23236 * class.cs (Constructor::Emit): Only emit if block is not null.
23237 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23238 deal with this by semantically definining it as if the user had
23241 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23242 constructors as we now "emit" them at a higher level.
23244 (TypeContainer::DefineDefaultConstructor): Used to define the
23245 default constructors if none was provided.
23247 (ConstructorInitializer): Add methods Resolve and Emit.
23249 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23251 2001-09-17 Ravi Pratap <ravi@ximian.com>
23253 * class.cs (TypeContainer::EmitDefaultConstructor): Register
23254 the default constructor builder with our hashtable for methodbuilders
23257 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23258 and argument_count is 0 in which case we have a match.
23259 (Binary::ResolveOperator): More null checking and miscellaneous coding
23262 2001-09-17 Ravi Pratap <ravi@ximian.com>
23264 * rootcontext.cs (IsNameSpace): Compare against null.
23266 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23268 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23269 and Unary::Operator.
23271 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23274 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23275 we have overloaded operators.
23276 (Binary::ResolveOperator): Implement the part which does the operator overload
23279 * class.cs (Operator::Emit): Implement.
23280 (TypeContainer::Emit): Emit the operators we have too.
23282 * expression.cs (Binary::Emit): Update to emit the appropriate code for
23283 the case when we have a user-defined operator.
23285 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23287 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23289 2001-09-16 Ravi Pratap <ravi@ximian.com>
23291 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23292 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23293 (Constructor::Emit): Implement.
23294 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23295 if we have no work to do.
23296 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
23299 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23300 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23302 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23305 2001-09-15 Ravi Pratap <ravi@ximian.com>
23307 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23309 (Tree::RecordNamespace): Method to do what the name says ;-)
23310 (Tree::Namespaces): Property to get at the namespaces hashtable.
23312 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
23315 * rootcontext.cs (IsNamespace): Fixed it :-)
23317 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23319 * class.cs (TypeContainer::FindMembers): Add support for
23321 (MethodCore): New class that encapsulates both the shared aspects
23322 of a Constructor and a Method.
23323 (Method, Constructor): Factored pieces into MethodCore.
23325 * driver.cs: Added --fatal which makes errors throw exceptions.
23326 Load System assembly as well as part of the standard library.
23328 * report.cs: Allow throwing exceptions on errors for debugging.
23330 * modifiers.cs: Do not use `parent', instead use the real type
23331 container to evaluate permission settings.
23333 * class.cs: Put Ravi's patch back in. He is right, and we will
23334 have to cope with the
23336 2001-09-14 Ravi Pratap <ravi@ximian.com>
23338 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23339 FamORAssem, not FamANDAssem.
23341 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23343 * driver.cs: Added --parse option that only parses its input files
23346 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
23347 incorrect. IsTopLevel is not used to tell whether an object is
23348 root_types or not (that can be achieved by testing this ==
23349 root_types). But to see if this is a top-level *class* (not
23350 necessarly our "toplevel" container).
23352 2001-09-14 Ravi Pratap <ravi@ximian.com>
23354 * enum.cs (Enum::Define): Modify to call the Lookup method on the
23355 parent instead of a direct call to GetType.
23357 2001-09-14 Ravi Pratap <ravi@ximian.com>
23359 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23360 Modifiers.TypeAttr. This should just be a call to that method.
23362 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23363 object so that we can determine if we are top-level or not.
23365 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
23368 * enum.cs (Enum::Define): Ditto.
23370 * modifiers.cs (FieldAttr): Re-write.
23372 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23373 (TypeContainer::HaveStaticConstructor): New property to provide access
23374 to precisely that info.
23376 * modifiers.cs (MethodAttr): Re-write.
23377 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23379 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23380 of top-level types as claimed.
23382 2001-09-13 Miguel de Icaza <miguel@ximian.com>
23384 * expression.cs (MemberLookup): Fruitless attempt to lookup
23385 constructors. Maybe I need to emit default constructors? That
23386 might be it (currently .NET emits this for me automatically).
23387 (Invocation::OverloadResolve): Cope with Arguments == null.
23388 (Invocation::EmitArguments): new function, shared by the new
23389 constructor and us.
23390 (Invocation::Emit): Handle static and instance methods. Emit
23391 proper call instruction for virtual or non-virtual invocations.
23392 (New::Emit): Implement.
23393 (New::Resolve): Implement.
23394 (MemberAccess:Resolve): Implement.
23395 (MethodGroupExpr::InstanceExpression): used conforming to the spec
23396 to track instances.
23397 (FieldExpr::Resolve): Set type.
23399 * support.cs: Handle empty arguments.
23401 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23402 SimpleLookup): Auxiliary routines to help parse a qualifier
23405 Update qualifier_identifier rule.
23407 * codegen.cs: Removed debugging messages.
23409 * class.cs: Make this a global thing, this acts just as a "key" to
23410 objects that we might have around.
23412 (Populate): Only initialize method_builders_to_methods once.
23414 * expression.cs (PropertyExpr): Initialize type from the
23417 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23418 Resolve pattern. Attempt to implicitly convert value to boolean.
23421 * expression.cs: Set the type for the int32/int32 argument case.
23422 (Binary::ResolveOperator): Set the return type to boolean for
23423 comparission operators
23425 * typemanager.cs: Remove debugging print code.
23427 (Invocation::Resolve): resolve type.
23429 * class.cs: Allocate a MemberInfo of the correct size, as the code
23430 elsewhere depends on the test to reflect the correct contents.
23432 (Method::) Keep track of parameters, due to System.Reflection holes
23434 (TypeContainer::Populate): Keep track of MethodBuilders to Method
23437 (TypeContainer::FindMembers): Use ArrayList and then copy an array
23438 of the exact size and return that.
23440 (Class::LookupMethodByBuilder): New function that maps
23441 MethodBuilders to its methods. Required to locate the information
23442 on methods because System.Reflection bit us again.
23444 * support.cs: New file, contains an interface ParameterData and
23445 two implementations: ReflectionParameters and InternalParameters
23446 used to access Parameter information. We will need to grow this
23449 * expression.cs (Invocation::GetParameterData): implement a cache
23450 and a wrapper around the ParameterData creation for methods.
23451 (Invocation::OverloadResolve): Use new code.
23453 2001-09-13 Ravi Pratap <ravi@ximian.com>
23455 * class.cs (TypeContainer::EmitField): Remove and move into
23456 (Field::Define): here and modify accordingly.
23457 (Field.FieldBuilder): New member.
23458 (TypeContainer::Populate): Update accordingly.
23459 (TypeContainer::FindMembers): Implement.
23461 2001-09-13 Miguel de Icaza <miguel@ximian.com>
23463 * statement.cs: (VariableInfo::VariableType): New field to be
23464 initialized with the full type once it is resolved.
23466 2001-09-12 Miguel de Icaza <miguel@ximian.com>
23468 * parameter.cs (GetParameterInfo): Use a type cache to compute
23469 things only once, and to reuse this information
23471 * expression.cs (LocalVariableReference::Emit): Implement.
23472 (OpcodeCast::Emit): fix.
23474 (ParameterReference::Resolve): Implement.
23475 (ParameterReference::Emit): Implement.
23477 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23478 that are expressions need to stay as Expressions.
23480 * typemanager.cs (CSharpName): Returns the C# name of a type if
23483 * expression.cs (Expression::ConvertImplicit): New function that
23484 implements implicit type conversions.
23486 (Expression::ImplicitReferenceConversion): Implements implicit
23487 reference conversions.
23489 (EmptyCast): New type for transparent casts.
23491 (OpcodeCast): New type for casts of types that are performed with
23492 a sequence of bytecodes.
23494 (BoxedCast): New type used for casting value types into reference
23495 types. Emits a box opcode.
23497 (Binary::DoNumericPromotions): Implements numeric promotions of
23498 and computation of the Binary::Type.
23500 (Binary::EmitBranchable): Optimization.
23502 (Binary::Emit): Implement code emission for expressions.
23504 * typemanager.cs (TypeManager): Added two new core types: sbyte
23507 2001-09-12 Ravi Pratap <ravi@ximian.com>
23509 * class.cs (TypeContainer::FindMembers): Method which does exactly
23510 what Type.FindMembers does, only we don't have to use reflection. No
23511 implementation yet.
23513 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23514 typecontainer objects as we need to get at them.
23515 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23517 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23518 typecontainer object.
23520 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23521 of just a Report object.
23523 2001-09-11 Ravi Pratap <ravi@ximian.com>
23525 * class.cs (Event::Define): Go back to using the prefixes "add_" and
23527 (TypeContainer::Populate): Now define the delegates of the type too.
23528 (TypeContainer.Delegates): Property to access the list of delegates defined
23531 * delegates.cs (Delegate::Define): Implement partially.
23533 * modifiers.cs (TypeAttr): Handle more flags.
23535 2001-09-11 Ravi Pratap <ravi@ximian.com>
23537 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23539 (Operator::Define): Re-write logic to get types by using the LookupType method
23540 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23541 (Indexer::Define): Ditto.
23542 (Event::Define): Ditto.
23543 (Property::Define): Ditto.
23545 2001-09-10 Ravi Pratap <ravi@ximian.com>
23547 * class.cs (TypeContainer::Populate): Now define operators too.
23548 (TypeContainer.Operators): New property to access the list of operators
23550 (Operator.OperatorMethodBuilder): New member to hold the method builder
23551 for the operator we are defining.
23552 (Operator::Define): Implement.
23554 2001-09-10 Ravi Pratap <ravi@ximian.com>
23556 * class.cs (Event::Define): Make the prefixes of the accessor methods
23557 addOn_ and removeOn_
23559 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23560 of the location being passed in too. Ideally, this should go later since all
23561 error reporting should be done through the Report object.
23563 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23564 (Populate): Iterate thru the indexers we have and define them too.
23565 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23566 for the get and set accessors.
23567 (Indexer::Define): Implement.
23569 2001-09-09 Miguel de Icaza <miguel@ximian.com>
23571 * expression.cs (Binary::Resolve): Beginning of it. I scratched
23572 my previous implementation, did not work.
23574 * typemanager.cs: Add a couple of missing types (the longs).
23576 * literal.cs: Use TypeManager.bool_type instead of getting it.
23578 * expression.cs (EventExpr): New kind of expressions.
23579 (Expressio::ExprClassFromMemberInfo): finish
23581 2001-09-08 Miguel de Icaza <miguel@ximian.com>
23583 * assign.cs: Emit stores to static fields differently.
23585 2001-09-08 Ravi Pratap <ravi@ximian.com>
23587 * Merge in changes and adjust code to tackle conflicts. Backed out my
23588 code in Assign::Resolve ;-)
23590 2001-09-08 Ravi Pratap <ravi@ximian.com>
23592 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23593 instead Report.Error and also pass in the location.
23594 (CSharpParser::Lexer): New readonly property to return the reference
23595 to the Tokenizer object.
23596 (declare_local_variables): Use Report.Error with location instead of plain
23600 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23601 (Operator.CheckBinaryOperator): Ditto.
23603 * cs-parser.jay (operator_declarator): Update accordingly.
23605 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23606 (CheckBinaryOperator): Same here.
23608 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23609 on the name without any prefixes of namespace names etc. This is because we
23610 already might have something already fully qualified like
23611 'System.Console.WriteLine'
23613 * assign.cs (Resolve): Begin implementation. Stuck ;-)
23615 2001-09-07 Ravi Pratap <ravi@ximian.com>
23617 * cs-tokenizer.cs (location): Return a string which also contains
23620 * expression.cs (ElementAccess): New class for expressions of the
23621 type 'element access.'
23622 (BaseAccess): New class for expressions of the type 'base access.'
23623 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23626 * cs-parser.jay (element_access): Implement action.
23627 (base_access): Implement actions.
23628 (checked_expression, unchecked_expression): Implement.
23630 * cs-parser.jay (local_variable_type): Correct and implement.
23631 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23633 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23635 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23636 name and the specifiers.
23638 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23640 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
23641 making them all public ;-)
23643 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
23646 2001-09-07 Miguel de Icaza <miguel@ximian.com>
23648 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
23650 (FieldExpr, PropertyExprs): New resolved expressions.
23651 (SimpleName::MemberStaticCheck): Perform static checks for access
23652 to non-static fields on static methods. Maybe this should be
23653 generalized for MemberAccesses.
23654 (SimpleName::ResolveSimpleName): More work on simple name
23657 * cs-parser.jay (primary_expression/qualified_identifier): track
23658 the parameter index.
23660 * codegen.cs (CodeGen::Save): Catch save exception, report error.
23661 (EmitContext::EmitBoolExpression): Chain to expression generation
23662 instead of temporary hack.
23663 (::EmitStatementExpression): Put generic expression code generation.
23665 * assign.cs (Assign::Emit): Implement variable assignments to
23666 local variables, parameters and fields.
23668 2001-09-06 Miguel de Icaza <miguel@ximian.com>
23670 * statement.cs (Block::GetVariableInfo): New method, returns the
23671 VariableInfo for a variable name in a block.
23672 (Block::GetVariableType): Implement in terms of GetVariableInfo
23674 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
23675 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
23677 2001-09-06 Ravi Pratap <ravi@ximian.com>
23679 * cs-parser.jay (operator_declaration): Continue on my quest : update
23680 to take attributes argument.
23681 (event_declaration): Ditto.
23682 (enum_declaration): Ditto.
23683 (indexer_declaration): Ditto.
23685 * class.cs (Operator::Operator): Update constructor accordingly.
23686 (Event::Event): Ditto.
23688 * delegate.cs (Delegate::Delegate): Same here.
23690 * enum.cs (Enum::Enum): Same here.
23692 2001-09-05 Ravi Pratap <ravi@ximian.com>
23694 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23696 * ../tests/cs0658.cs : New file to demonstrate error 0658.
23698 * attribute.cs (Attributes): New class to encapsulate all attributes which were
23699 being passed around as an arraylist.
23700 (Attributes::AddAttribute): Method to add attribute sections.
23702 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23703 (struct_declaration): Update accordingly.
23704 (constant_declaration): Update.
23705 (field_declaration): Update.
23706 (method_header): Update.
23707 (fixed_parameter): Update.
23708 (parameter_array): Ditto.
23709 (property_declaration): Ditto.
23710 (destructor_declaration): Ditto.
23712 * class.cs (Struct::Struct): Update constructors accordingly.
23713 (Class::Class): Ditto.
23714 (Field::Field): Ditto.
23715 (Method::Method): Ditto.
23716 (Property::Property): Ditto.
23717 (TypeContainer::OptAttribute): update property's return type.
23719 * interface.cs (Interface.opt_attributes): New member.
23720 (Interface::Interface): Update to take the extra Attributes argument.
23722 * parameter.cs (Parameter::Parameter): Ditto.
23724 * constant.cs (Constant::Constant): Ditto.
23726 * interface.cs (InterfaceMemberBase): New OptAttributes field.
23727 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
23728 the attributes as a parameter.
23729 (InterfaceProperty): Update constructor call.
23730 (InterfaceEvent): Ditto.
23731 (InterfaceMethod): Ditto.
23732 (InterfaceIndexer): Ditto.
23734 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
23735 pass the attributes too.
23736 (interface_event_declaration): Ditto.
23737 (interface_property_declaration): Ditto.
23738 (interface_method_declaration): Ditto.
23739 (interface_declaration): Ditto.
23741 2001-09-05 Miguel de Icaza <miguel@ximian.com>
23743 * class.cs (Method::Define): Track the "static Main" definition to
23744 create an entry point.
23746 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23747 EntryPoint if we find it.
23749 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23750 (EmitContext::ig): Make this variable public.
23752 * driver.cs: Make the default output file be the first file name
23753 with the .exe extension.
23755 Detect empty compilations
23757 Handle various kinds of output targets. Handle --target and
23758 rename -t to --dumper.
23760 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23761 methods inherited from Expression return now an Expression. This
23762 will is used during the tree rewriting as we resolve them during
23765 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23766 the spec. Missing entirely is the information about
23767 accessability of elements of it.
23769 (Expression::ExprClassFromMemberInfo): New constructor for
23770 Expressions that creates a fully initialized Expression based on
23771 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23774 (Invocation::Resolve): Begin implementing resolution of invocations.
23776 * literal.cs (StringLiteral): Implement Emit.
23778 2001-09-05 Ravi Pratap <ravi@ximian.com>
23780 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23783 2001-09-04 Ravi Pratap <ravi@ximian.com>
23785 * cs-parser.jay (attribute_arguments): Implement actions.
23786 (attribute): Fix bug in production. Implement action.
23787 (attribute_list): Implement.
23788 (attribute_target): Implement.
23789 (attribute_target_specifier, opt_target_specifier): Implement
23790 (CheckAttributeTarget): New method to check if the attribute target
23792 (attribute_section): Implement.
23793 (opt_attributes): Implement.
23795 * attribute.cs : New file to handle attributes.
23796 (Attribute): Class to hold attribute info.
23798 * cs-parser.jay (opt_attribute_target_specifier): Remove production
23799 (attribute_section): Modify production to use 2 different rules to
23800 achieve the same thing. 1 s/r conflict down !
23801 Clean out commented, useless, non-reducing dimension_separator rules.
23803 * class.cs (TypeContainer.attributes): New member to hold list
23804 of attributes for a type.
23805 (Struct::Struct): Modify to take one more argument, the attribute list.
23806 (Class::Class): Ditto.
23807 (Field::Field): Ditto.
23808 (Method::Method): Ditto.
23809 (Property::Property): Ditto.
23811 * cs-parser.jay (struct_declaration): Update constructor call to
23812 pass in the attributes too.
23813 (class_declaration): Ditto.
23814 (constant_declaration): Ditto.
23815 (field_declaration): Ditto.
23816 (method_header): Ditto.
23817 (fixed_parameter): Ditto.
23818 (parameter_array): Ditto.
23819 (property_declaration): Ditto.
23821 * constant.cs (Constant::Constant): Update constructor similarly.
23822 Use System.Collections.
23824 * parameter.cs (Parameter::Parameter): Update as above.
23826 2001-09-02 Ravi Pratap <ravi@ximian.com>
23828 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23829 (TypeContainer.delegates): New member to hold list of delegates.
23831 * cs-parser.jay (delegate_declaration): Implement the action correctly
23832 this time as I seem to be on crack ;-)
23834 2001-09-02 Miguel de Icaza <miguel@ximian.com>
23836 * rootcontext.cs (RootContext::IsNamespace): new function, used to
23837 tell whether an identifier represents a namespace.
23839 * expression.cs (NamespaceExpr): A namespace expression, used only
23840 temporarly during expression resolution.
23841 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23842 utility functions to resolve names on expressions.
23844 2001-09-01 Miguel de Icaza <miguel@ximian.com>
23846 * codegen.cs: Add hook for StatementExpressions.
23848 * class.cs: Fix inverted test for static flag in methods.
23850 2001-09-02 Ravi Pratap <ravi@ximian.com>
23852 * class.cs (Operator::CheckUnaryOperator): Correct error number used
23853 to make it coincide with MS' number.
23854 (Operator::CheckBinaryOperator): Ditto.
23856 * ../errors/errors.txt : Remove error numbers added earlier.
23858 * ../errors/cs1019.cs : Test case for error # 1019
23860 * ../errros/cs1020.cs : Test case for error # 1020
23862 * cs-parser.jay : Clean out commented cruft.
23863 (dimension_separators, dimension_separator): Comment out. Ostensibly not
23864 used anywhere - non-reducing rule.
23865 (namespace_declarations): Non-reducing rule - comment out.
23867 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23868 with TypeContainer::AddEnum.
23870 * delegate.cs : New file for delegate handling classes.
23871 (Delegate): Class for declaring delegates.
23873 * makefile : Update.
23875 * cs-parser.jay (delegate_declaration): Implement.
23877 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
23879 * class.cs (Event::Define): Implement.
23880 (Event.EventBuilder): New member.
23882 * class.cs (TypeContainer::Populate): Update to define all enums and events
23884 (Events): New property for the events arraylist we hold. Shouldn't we move to using
23885 readonly fields for all these cases ?
23887 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23889 * class.cs (Property): Revamp to use the convention of making fields readonly.
23890 Accordingly modify code elsewhere.
23892 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23893 the Define method of the Property class.
23895 * class.cs : Clean up applied patch and update references to variables etc. Fix
23897 (TypeContainer::Populate): Update to define all the properties we have. Also
23898 define all enumerations.
23900 * enum.cs (Define): Implement.
23902 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23904 * cs-parser.jay (overloadable_operator): The semantic value is an
23905 enum of the Operator class.
23906 (operator_declarator): Implement actions.
23907 (operator_declaration): Implement.
23909 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23910 validity of definitions.
23911 (Operator::CheckBinaryOperator): Static method to check for binary operators
23912 (TypeContainer::AddOperator): New method to add an operator to a type.
23914 * cs-parser.jay (indexer_declaration): Added line to actually call the
23915 AddIndexer method so it gets added ;-)
23917 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
23918 already taken care of by the MS compiler ?
23920 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23922 * class.cs (Operator): New class for operator declarations.
23923 (Operator::OpType): Enum for the various operators.
23925 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23927 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23928 ostensibly handle this in semantic analysis.
23930 * cs-parser.jay (general_catch_clause): Comment out
23931 (specific_catch_clauses, specific_catch_clause): Ditto.
23932 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23933 (catch_args, opt_catch_args): New productions.
23934 (catch_clause): Rewrite to use the new productions above
23935 (catch_clauses): Modify accordingly.
23936 (opt_catch_clauses): New production to use in try_statement
23937 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23938 and re-write the code in the actions to extract the specific and
23939 general catch clauses by being a little smart ;-)
23941 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23942 Hooray, try and catch statements parse fine !
23944 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23946 * statement.cs (Block::GetVariableType): Fix logic to extract the type
23947 string from the hashtable of variables.
23949 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23950 I end up making that mistake ;-)
23951 (catch_clauses): Fixed gross error which made Key and Value of the
23952 DictionaryEntry the same : $1 !!
23954 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23956 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23958 * cs-parser.jay (event_declaration): Correct to remove the semicolon
23959 when the add and remove accessors are specified.
23961 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23963 * cs-parser.jay (IndexerDeclaration): New helper class to hold
23964 information about indexer_declarator.
23965 (indexer_declarator): Implement actions.
23966 (parsing_indexer): New local boolean used to keep track of whether
23967 we are parsing indexers or properties. This is necessary because
23968 implicit_parameters come into picture even for the get accessor in the
23969 case of an indexer.
23970 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23972 * class.cs (Indexer): New class for indexer declarations.
23973 (TypeContainer::AddIndexer): New method to add an indexer to a type.
23974 (TypeContainer::indexers): New member to hold list of indexers for the
23977 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23979 * cs-parser.jay (add_accessor_declaration): Implement action.
23980 (remove_accessor_declaration): Implement action.
23981 (event_accessors_declaration): Implement
23982 (variable_declarators): swap statements for first rule - trivial.
23984 * class.cs (Event): New class to hold information about event
23986 (TypeContainer::AddEvent): New method to add an event to a type
23987 (TypeContainer::events): New member to hold list of events.
23989 * cs-parser.jay (event_declaration): Implement actions.
23991 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23993 * cs-parser.jay (dim_separators): Implement. Make it a string
23994 concatenating all the commas together, just as they appear.
23995 (opt_dim_separators): Modify accordingly
23996 (rank_specifiers): Update accordingly. Basically do the same
23997 thing - instead, collect the brackets here.
23998 (opt_rank_sepcifiers): Modify accordingly.
23999 (array_type): Modify to actually return the complete type string
24000 instead of ignoring the rank_specifiers.
24001 (expression_list): Implement to collect the expressions
24002 (variable_initializer): Implement. We make it a list of expressions
24003 essentially so that we can handle the array_initializer case neatly too.
24004 (variable_initializer_list): Implement.
24005 (array_initializer): Make it a list of variable_initializers
24006 (opt_array_initializer): Modify accordingly.
24008 * expression.cs (New::NType): Add enumeration to help us
24009 keep track of whether we have an object/delegate creation
24010 or an array creation.
24011 (New:NewType, New::Rank, New::Indices, New::Initializers): New
24012 members to hold data about array creation.
24013 (New:New): Modify to update NewType
24014 (New:New): New Overloaded contructor for the array creation
24017 * cs-parser.jay (array_creation_expression): Implement to call
24018 the overloaded New constructor.
24020 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
24022 * class.cs (TypeContainer::Constructors): Return member
24023 constructors instead of returning null.
24025 2001-08-26 Miguel de Icaza <miguel@ximian.com>
24027 * typemanager.cs (InitCoreTypes): Initialize the various core
24028 types after we have populated the type manager with the user
24029 defined types (this distinction will be important later while
24030 compiling corlib.dll)
24032 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24033 on Expression Classification. Now all expressions have a method
24034 `Resolve' and a method `Emit'.
24036 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24037 generation from working. Also add some temporary debugging
24040 2001-08-24 Miguel de Icaza <miguel@ximian.com>
24042 * codegen.cs: Lots of code generation pieces. This is only the
24043 beginning, will continue tomorrow with more touches of polish. We
24044 handle the fundamentals of if, while, do, for, return. Others are
24045 trickier and I need to start working on invocations soon.
24047 * gen-treedump.cs: Bug fix, use s.Increment here instead of
24050 * codegen.cs (EmitContext): New struct, used during code
24051 emission to keep a context. Most of the code generation will be
24054 * cs-parser.jay: Add embedded blocks to the list of statements of
24055 this block. So code generation proceeds in a top down fashion.
24057 2001-08-23 Miguel de Icaza <miguel@ximian.com>
24059 * statement.cs: Add support for multiple child blocks.
24061 2001-08-22 Miguel de Icaza <miguel@ximian.com>
24063 * codegen.cs (EmitCode): New function, will emit the code for a
24064 Block of code given a TypeContainer and its ILGenerator.
24066 * statement.cs (Block): Standard public readonly optimization.
24067 (Block::Block constructors): Link children.
24068 (Block::Child): Child Linker.
24069 (Block::EmitVariables): Emits IL variable declarations.
24071 * class.cs: Drop support for MethodGroups here, delay until
24073 (Method::): Applied the same simplification that I did before, and
24074 move from Properties to public readonly fields.
24075 (Method::ParameterTypes): Returns the parameter types for the
24076 function, and implements a cache that will be useful later when I
24077 do error checking and the semantic analysis on the methods is
24079 (Constructor::GetCallingConvention): Renamed from CallingConvetion
24080 and made a method, optional argument tells whether this is a class
24081 or a structure to apply the `has-this' bit.
24082 (Method::GetCallingConvention): Implement, returns the calling
24084 (Method::Define): Defines the type, a second pass is performed
24085 later to populate the methods.
24087 (Constructor::ParameterTypes): implement a cache similar to the
24088 one on Method::ParameterTypes, useful later when we do semantic
24091 (TypeContainer::EmitMethod): New method. Emits methods.
24093 * expression.cs: Removed MethodGroup class from here.
24095 * parameter.cs (Parameters::GetCallingConvention): new method.
24097 2001-08-21 Miguel de Icaza <miguel@ximian.com>
24099 * class.cs (TypeContainer::Populate): Drop RootContext from the
24102 (Constructor::CallingConvention): Returns the calling convention.
24103 (Constructor::ParameterTypes): Returns the constructor parameter
24106 (TypeContainer::AddConstructor): Keep track of default constructor
24107 and the default static constructor.
24109 (Constructor::) Another class that starts using `public readonly'
24110 instead of properties.
24112 (Constructor::IsDefault): Whether this is a default constructor.
24114 (Field::) use readonly public fields instead of properties also.
24116 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24117 track of static constructors; If none is used, turn on
24118 BeforeFieldInit in the TypeAttributes.
24120 * cs-parser.jay (opt_argument_list): now the return can be null
24121 for the cases where there are no arguments.
24123 (constructor_declarator): If there is no implicit `base' or
24124 `this', then invoke the default parent constructor.
24126 * modifiers.cs (MethodAttr): New static function maps a set of
24127 modifiers flags into a MethodAttributes enum
24128 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
24129 MethodAttr, TypeAttr to represent the various mappings where the
24130 modifiers are used.
24131 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
24133 2001-08-19 Miguel de Icaza <miguel@ximian.com>
24135 * parameter.cs (GetParameterInfo): Fix bug where there would be no
24138 * interface.cs (PopulateIndexer): Implemented the code generator
24139 for interface indexers.
24141 2001-08-17 Miguel de Icaza <miguel@ximian.com>
24143 * interface.cs (InterfaceMemberBase): Now we track the new status
24146 (PopulateProperty): Implement property population. Woohoo! Got
24147 Methods and Properties going today.
24149 Removed all the properties for interfaces, and replaced them with
24150 `public readonly' fields.
24152 2001-08-16 Miguel de Icaza <miguel@ximian.com>
24154 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24155 initialize their hashtables/arraylists only when they are needed
24156 instead of doing this always.
24158 * parameter.cs: Handle refs and out parameters.
24160 * cs-parser.jay: Use an ArrayList to construct the arguments
24161 instead of the ParameterCollection, and then cast that to a
24164 * parameter.cs: Drop the use of ParameterCollection and use
24165 instead arrays of Parameters.
24167 (GetParameterInfo): Use the Type, not the Name when resolving
24170 2001-08-13 Miguel de Icaza <miguel@ximian.com>
24172 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24173 and instead use public readonly fields.
24175 * class.cs: Put back walking code for type containers.
24177 2001-08-11 Miguel de Icaza <miguel@ximian.com>
24179 * class.cs (MakeConstant): Code to define constants.
24181 * rootcontext.cs (LookupType): New function. Used to locate types
24184 2001-08-08 Miguel de Icaza <miguel@ximian.com>
24186 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
24187 this System.Reflection code is. Kudos to Microsoft
24189 * typemanager.cs: Implement a type cache and avoid loading all
24190 types at boot time. Wrap in LookupType the internals. This made
24191 the compiler so much faster. Wow. I rule!
24193 * driver.cs: Make sure we always load mscorlib first (for
24194 debugging purposes, nothing really important).
24196 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
24197 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
24199 * rootcontext.cs: Lookup types on their namespace; Lookup types
24200 on namespaces that have been imported using the `using' keyword.
24202 * class.cs (TypeContainer::TypeAttr): Virtualize.
24203 (Class::TypeAttr): Return attributes suitable for this bad boy.
24204 (Struct::TypeAttr): ditto.
24205 Handle nested classes.
24206 (TypeContainer::) Remove all the type visiting code, it is now
24207 replaced with the rootcontext.cs code
24209 * rootcontext.cs (GetClassBases): Added support for structs.
24211 2001-08-06 Miguel de Icaza <miguel@ximian.com>
24213 * interface.cs, statement.cs, class.cs, parameter.cs,
24214 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24215 Drop use of TypeRefs, and use strings instead.
24217 2001-08-04 Miguel de Icaza <miguel@ximian.com>
24221 * class.cs (Struct::Struct): set the SEALED flags after
24222 checking the modifiers.
24223 (TypeContainer::TypeAttr): new property, returns the
24224 TypeAttributes for a class.
24226 * cs-parser.jay (type_list): Oops, list production was creating a
24227 new list of base types.
24229 * rootcontext.cs (StdLib): New property.
24230 (GetInterfaceTypeByName): returns an interface by type name, and
24231 encapsulates error handling here.
24232 (GetInterfaces): simplified.
24233 (ResolveTree): Encapsulated all the tree resolution here.
24234 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24237 * driver.cs: Add support for --nostdlib, to avoid loading the
24238 default assemblies.
24239 (Main): Do not put tree resolution here.
24241 * rootcontext.cs: Beginning of the class resolution.
24243 2001-08-03 Miguel de Icaza <miguel@ximian.com>
24245 * rootcontext.cs: Provide better error reporting.
24247 * cs-parser.jay (interface_base): set our $$ to be interfaces.
24249 * rootcontext.cs (CreateInterface): Handle the case where there
24250 are no parent interfaces.
24252 (CloseTypes): Routine to flush types at the end.
24253 (CreateInterface): Track types.
24254 (GetInterfaces): Returns an array of Types from the list of
24255 defined interfaces.
24257 * typemanager.c (AddUserType): Mechanism to track user types (puts
24258 the type on the global type hash, and allows us to close it at the
24261 2001-08-02 Miguel de Icaza <miguel@ximian.com>
24263 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24264 RecordInterface instead.
24266 * cs-parser.jay: Updated to reflect changes above.
24268 * decl.cs (Definition): Keep track of the TypeBuilder type that
24269 represents this type here. Not sure we will use it in the long
24270 run, but wont hurt for now.
24272 * driver.cs: Smaller changes to accomodate the new code.
24274 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24277 * rootcontext.cs (CreateInterface): New method, used to create
24278 the System.TypeBuilder type for interfaces.
24279 (ResolveInterfaces): new entry point to resolve the interface
24281 (CodeGen): Property, used to keep track of the code generator.
24283 2001-07-26 Miguel de Icaza <miguel@ximian.com>
24285 * cs-parser.jay: Add a second production for delegate_declaration
24288 (enum_body): Put an opt_comma here instead of putting it on
24289 enum_body or enum_member_declarations so we can handle trailing
24290 commas on enumeration members. Gets rid of a shift/reduce.
24292 (type_list): Need a COMMA in the middle.
24294 (indexer_declaration): Tell tokenizer to recognize get/set
24296 * Remove old targets.
24298 * Re-add the parser target.
24300 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24302 * cs-parser.jay: Add precendence rules for a number of operators
24303 ot reduce the number of shift/reduce conflicts in the grammar.
24305 2001-07-17 Miguel de Icaza <miguel@ximian.com>
24307 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24310 Get rid of old crufty code.
24312 * rootcontext.cs: Use this to keep track of the parsed
24313 representation and the defined types available to the program.
24315 * gen-treedump.cs: adjust for new convention.
24317 * type.cs: Split out the type manager, and the assembly builder
24320 * typemanager.cs: the type manager will live here now.
24322 * cil-codegen.cs: And the code generator here.
24324 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
24326 * makefile: Fixed up for easy making.
24328 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24330 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24333 (unary_expression): Expand pre_increment_expression and
24334 post_decrement_expression to reduce a shift/reduce.
24336 2001-07-11 Simon Cozens
24338 * cs-tokenizer.cs: Hex numbers should begin with a 0.
24340 Improve allow_keyword_as_indent name.
24342 2001-06-19 Miguel de Icaza <miguel@ximian.com>
24344 * Adjustments for Beta2.
24346 2001-06-13 Miguel de Icaza <miguel@ximian.com>
24348 * decl.cs: Added `Define' abstract method.
24349 (InTransit): new property, used to catch recursive definitions.
24351 * interface.cs: Implement `Define'.
24353 * modifiers.cs: Map Modifiers.constants to
24354 System.Reflection.TypeAttribute flags.
24356 * class.cs: Keep track of types and user-defined types.
24357 (BuilderInit): New method for creating an assembly
24358 (ResolveType): New function to launch the resolution process, only
24359 used by interfaces for now.
24361 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24362 that are inserted into the name space.
24364 2001-06-08 Miguel de Icaza <miguel@ximian.com>
24366 * ARGH. I have screwed up my tree so many times due to the use of
24367 rsync rather than using CVS. Going to fix this at once.
24369 * driver.cs: Objetify driver. Load assemblies, use assemblies to
24372 2001-06-07 Miguel de Icaza <miguel@ximian.com>
24374 * Experiment successful: Use System.Type rather that our own
24377 2001-05-25 Miguel de Icaza <miguel@ximian.com>
24379 * cs-parser.jay: Removed nsAliases from here.
24381 Use new namespaces, handle `using XXX;'
24383 * namespace.cs: Reimplemented namespace handling, use a recursive
24384 definition of the class. Now we can keep track of using clauses
24385 and catch invalid using clauses.
24387 2001-05-24 Miguel de Icaza <miguel@ximian.com>
24389 * gen-treedump.cs: Adapted for all the renaming.
24391 * expression.cs (Expression): this class now has a Type property
24392 which returns an expression Type.
24394 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24395 `Type', as this has a different meaning now in the base
24397 2001-05-22 Miguel de Icaza <miguel@ximian.com>
24399 * interface.cs, class.cs: Removed from all the sources the
24400 references to signature computation, as we can not do method
24401 signature computation during the parsing time, as we are not
24402 trying to solve at that point distinguishing:
24406 void a (NS.Blah x) {}
24409 Which depending on the context might be valid or not, as we do not
24410 know if Blah is the same thing as NS.Blah at that point.
24412 * Redid everything so the code uses TypeRefs now instead of
24413 Types. TypeRefs are just temporary type placeholders, that need
24414 to be resolved. They initially have a pointer to a string and the
24415 current scope in which they are used. This is used later by the
24416 compiler to resolve the reference to an actual Type.
24418 * DeclSpace is no longer a CIR.Type, and neither are
24419 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
24420 are all DeclSpaces, but no Types.
24422 * type.cs (TypeRefManager): This implements the TypeRef manager,
24423 which keeps track of all the types that need to be resolved after
24424 the parsing has finished.
24426 2001-05-13 Miguel de Icaza <miguel@ximian.com>
24428 * ARGH. We are going to have to store `foreach' as a class rather
24429 than resolving it, as we need to verify error 1579 after name
24430 resolution. *OR* we could keep a flag that says `This request to
24431 IEnumerator comes from a foreach statement' which we can then use
24432 to generate the error.
24434 2001-05-10 Miguel de Icaza <miguel@ximian.com>
24436 * class.cs (TypeContainer.AddMethod): we now add methods to the
24437 MethodGroup instead of the method hashtable.
24439 * expression.cs: Add MethodGroup abstraction, which gets us one
24440 step closer to the specification in the way we handle method
24443 * cs-parser.jay (primary_expression): qualified_identifier now
24444 tried to match up an identifier to a local variable reference or
24445 to a parameter reference.
24447 current_local_parameters is now a parser global variable that
24448 points to the current parameters for the block, used during name
24451 (property_declaration): Now creates an implicit `value' argument to
24454 2001-05-09 Miguel de Icaza <miguel@ximian.com>
24456 * parameter.cs: Do not use `param' arguments as part of the
24457 signature, per the spec.
24459 2001-05-08 Miguel de Icaza <miguel@ximian.com>
24461 * decl.cs: Base class for classes, structs and interfaces. This
24462 is the "Declaration Space"
24464 * cs-parser.jay: Use CheckDef for checking declaration errors
24465 instead of having one on each function.
24467 * class.cs: Factor out some code for handling error handling in
24468 accordance to the "Declarations" section in the "Basic Concepts"
24469 chapter in the ECMA C# spec.
24471 * interface.cs: Make all interface member classes derive from
24472 InterfaceMemberBase.
24474 2001-05-07 Miguel de Icaza <miguel@ximian.com>
24476 * Many things: all interfaces are parsed and generated in
24477 gen-treedump. Support for member variables, constructors,
24478 destructors, properties, constants is there.
24480 Beginning of the IL backend, but very little done, just there for
24483 2001-04-29 Miguel de Icaza <miguel@ximian.com>
24485 * cs-parser.jay: Fix labeled statement.
24487 * cs-tokenizer.cs (escape): Escape " and ' always.
24488 ref_line, ref_name: keep track of the line/filename as instructed
24489 by #line by the compiler.
24492 2001-04-27 Miguel de Icaza <miguel@ximian.com>
24494 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24495 to match the values in System.CodeDOM.
24497 Divid renamed to Divide.
24499 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24501 (Statements.set): remove.
24503 * System.CodeDOM/CodeCatchClause.cs: always have a valid
24506 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24507 falseStatements always have valid values.
24509 * cs-parser.jay: Use System.CodeDOM now.