1 2005-02-15 Raja R Harinath <rharinath@novell.com>
4 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5 'ignore_cs0104' parameter. Pass it to ...
6 (NamespaceEntry.Lookup): ... this.
7 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
8 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
9 (TypeLookupExpression.DoResolveAsTypeStep): Update.
10 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
11 Update. Request that cs0104 errors be ignored.
12 (ComposedCast.ResolveAsTypeStep): Update.
14 2005-02-14 Raja R Harinath <rharinath@novell.com>
17 * expression.cs (Invocation.BetterFunction): Remove support for
18 comparing virtual functions and their overrides.
19 (Invocation.IsOverride): New.
20 (Invocation.OverloadResolve): Don't consider 'override' functions
21 during candidate selection. Store them in a lookaside list.
22 If the selected method is a 'virtual' function, use the list to
23 find any overrides that are closer to the LHS type.
25 2005-02-14 Marek Safar <marek.safar@seznam.cz>
27 * expression.cs (New.DoResolve): Add complex core type reduction.
28 (New.Constantify): Converts complex core type syntax like 'new int ()'
31 2005-02-14 Raja R Harinath <rharinath@novell.com>
33 * decl.cs (EntryType.EntryType): New constructor to create an
34 updated copy of a cache entry.
35 (MemberCache.AddMethods): Use it.
36 (MemberCache.ClearDeclaredOnly): Remove.
37 (MemberCache.MemberCache): Update.
39 2005-02-11 Miguel de Icaza <miguel@novell.com>
41 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
42 variable. This one is represents the actual low-level declaration
43 of the method, as opposed to the semantic level `IsStatic'.
45 An anonymous method which is hosted into a static method might be
46 actually an instance method. IsStatic would reflect the
47 container, while MethodIsStatic represents the actual code
50 * expression.cs (ParameterReference): Use the new MethodIsStatic
53 * anonymous.cs (AnonymousMethod.Compatible): Pass the
54 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
55 set on the current EmitContext.
57 * expression.cs (Cast): Overload DoResolveLValue so we can pass
58 resolve our casted expression as an LValue. This triggers the
59 proper LValue processing that is later required by Assign.
63 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
65 2005-02-11 Marek Safar <marek.safar@seznam.cz>
67 C# 2.0 Fixed buffer implementation
69 * anonymous.cs: Update after RegisterHelperClass renaming.
71 * attribute.cs (AttributeTester.fixed_buffer_cache):
72 Cache of external fixed buffers.
73 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
74 implementation if field is fixed buffer else null.
77 (TypeContainer.AddField): Accept FieldMember instead of Field.
78 (FieldBase.IsFieldClsCompliant): Extracted code from
79 VerifyClsCompliance descendant customization.
80 (FixedField): New class handles fixed buffer fields.
81 (FixedFieldExternal): Keeps information about imported fixed
83 (IFixedField): Make access to internal or external fixed buffer
86 * cs-parser.jay: Add fixed buffer parsing.
88 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
91 * expression.cs (Indirection): Extended implementation to accept
93 (PointerArithmetic.Emit): Get element from fixed buffer as well.
94 (ElementAccess.MakePointerAccess): Get type as parameter.
95 (DoResolve): Add fixed buffer field expression conversion.
96 (DoResolveLValue): Ditto.
97 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
98 (ArrayPtr): Derives from FixedBufferPtr.
99 (ArrayPtr.Emit): Add extra emit for array elements.
101 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
103 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
104 for compiler generated types.
105 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
107 * statement.cs (Fixed): Refactored to be easier add fixed buffer
108 and consume less memory.
109 (Fixed.Resolve): Add fixed buffer case.
111 * typemanager.cs (compiler_generated_attr_ctor,
112 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
113 (HasElementType): Add our own implementation to work on every
116 2005-02-11 Miguel de Icaza <miguel@novell.com>
118 * anonymous.cs (CaptureContext): Track whether `this' has been
121 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
122 only captured `this' if it was implicitly done (instance
123 methods/variables were used).
125 * codegen.cs (EmitContext.CaptureThis): New method to flag that
126 `this' must be captured.
128 2005-01-30 Miguel de Icaza <miguel@novell.com>
130 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
131 is null it means that there has been no need to capture anything,
132 so we just create a sibling.
134 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
136 Just a partial fix. The other half is fairly elusive.
138 2005-02-10 Raja R Harinath <rharinath@novell.com>
140 Fix #52586, cs0121-4.cs.
141 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
142 and return a hashtable.
143 (MemberCache.ClearDeclaredOnly): New.
144 (MemberCache.MemberCache): Update to change. Make a deep copy of
145 the method_hash of a base type too.
146 (MemberCache.AddMethods): Adapt to having a deep copy of the base
147 type methods. Overwrite entries with the same MethodHandle so
148 that the ReflectedType is correct. The process leaves in base
149 virtual functions and their overrides as distinct entries.
150 (CacheEntry): Now a class instead of a struct. It shouldn't alter
151 matters since it was boxed in a ArrayList before.
152 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
154 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
155 case of a virtual function and its override (choose the overload
157 (Invocation.OverloadResolve): Avoid 'override' members during
158 'applicable_type' calculation.
160 2005-03-28 Raja R Harinath <rharinath@novell.com>
162 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
163 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
164 GetTypeHandle. It is possible for a reflected type to derive from
165 a TypeBuilder (e.g., int[] derives from the TypeBuilder
166 System.Array during mscorlib compilation).
167 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
168 contain a method_hash, don't create one either. Don't create a
169 deep copy of the base cache's method_hash.
170 (MemberCache.SetupCache): Rename back from DeepCopy.
171 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
172 already initialized. If we see an override function, add its
173 underlying base virtual function to the member_hash too.
175 2005-02-09 Raja R Harinath <rharinath@novell.com>
177 Combine two near-redundant caches.
178 * typemanager.cs (method_params): Rename from method_internal_params.
179 (TypeManager.GetParameterData): New. Replace
180 Invocation.GetParameterData.
181 (TypeManager.LookupParametersByBuilder): Remove.
182 * expression.cs (Invocation.method_parameter_cache): Remove.
183 (Invocation.GetParameterData): Remove.
185 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
188 2005-02-08 Raja R Harinath <rharinath@novell.com>
191 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
192 TypeManager.multicast_delegate_type is null, resolve it by looking
193 up "System.MulticastDelegate".
194 * rootcontext.cs (RootContext.ResolveCore): Simplify.
196 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
197 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
198 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
201 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
202 (LabeledStatement.AddReference): New. Set 'referenced'.
203 (Goto.Resolve): Use it.
205 2005-02-05 John Luke <john.luke@gmail.com>
207 * driver.cs: remove duplicate -doc line in Usage ()
209 2005-02-04 Raja R Harinath <rharinath@novell.com>
211 * location.cs (Location.AddFile): Fix CS2002 error report.
213 2005-02-02 Martin Baulig <martin@ximian.com>
215 * delegate.cs (Delegate.DefineType): Report an internal error if
216 TypeManager.multicast_delegate_type is null. See bug #72015 for
219 2005-02-02 Raja R Harinath <rharinath@novell.com>
221 Fix a crasher in a variant of #31984.
222 * const.cs (Constant.CheckBase): New override that defers the
223 new-or-override check in case the base type hasn't been populated
225 (Constant.Define): Ensure the new-or-override check is performed.
227 2005-02-01 Duncan Mak <duncan@ximian.com>
229 * const.cs (LookupConstantValue): Check that `ce' is not null
230 before calling GetValue ().
232 2005-02-01 Raja R Harinath <rharinath@novell.com>
234 Fix test-334.cs (#69519).
235 * cs-parser.jay (using_alias_directive): Pass in an expression to
236 NamespaceEntry.UsingAlias.
237 (using_namespace_directive): Pass in an expression to
238 NamespaceEntry.Using.
239 (namespace_name): Don't flatten to a string.
240 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
241 (NamespaceEntry.AliasEntry.Resolve): Lookup using
243 (NamespaceEntry.UsingEntry): Likewise.
244 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
246 (NamespaceEntry.LookupForUsing): Remove.
247 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
249 (NamespaceEntry.Lookup): Remove support for dotted names.
251 2005-02-01 Raja R Harinath <rharinath@novell.com>
253 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
255 (NamespaceEntry.ImplicitParent): Compute on demand.
256 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
257 parallels the current.
258 (NamespaceEntry.LookupForUsing): Use it.
259 (NamespaceEntry.Lookup): If the current namespace-entry is
260 implicit, don't search aliases and using tables.
262 2005-02-01 Raja R Harinath <rharinath@novell.com>
265 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
267 (TypeContainer.BaseCache): Compute on demand.
268 (TypeContainer.FindMembers): Define constants and types if they're
270 (FieldMember.Define): Move resetting of ec.InUnsafe before error
272 * const.cs (Constant.Define): Make idempotent.
274 2005-01-29 Miguel de Icaza <miguel@novell.com>
276 * pending.cs: Produce better code (no nops produced by using Ldarg
279 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
280 i - 1' it should be arg + 1.
284 2005-01-28 Raja R Harinath <rharinath@novell.com>
286 * attribute.cs (Attribute.CheckAttributeType): Make private
288 (Attribute.ResolveType): Make virtual.
289 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
290 handling of RootContext.Tree.Types.
292 2005-01-27 Raja R Harinath <rharinath@novell.com>
294 Update attribute-handling to use the SimpleName/MemberAccess
296 * cs-parser.jay (attribute): Pass in an expression to the
297 constructors of Attribute and GlobalAttribute.
298 * attribute.cs (Attribute): Take an expression for the name.
299 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
300 passed in attribute name expression.
301 (Attribute.CheckAttributeType): Use it.
302 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
303 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
304 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
305 argument to prevent error messages if the lookup fails.
307 2005-01-27 Marek Safar <marek.safar@seznam.cz>
309 * expression.cs (Indirection): Implemented IVariable interface
310 to support indirection in AddressOf operator.
311 (PointerArithmetic.Emit): Add optimalization for case where
312 result can be precomputed.
314 2005-01-26 Martin Baulig <martin@ximian.com>
316 * class.cs (TypeContainer.AttributeTargets): Return the correct
317 AttributeTargets depending on our `Kind' instead of throwing an
318 exception; fixes #71632.
320 2005-01-26 Marek Safar <marek.safar@seznam.cz>
323 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
326 2005-03-17 Martin Baulig <martin@ximian.com>
328 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
329 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
331 2005-03-17 Martin Baulig <martin@ximian.com>
333 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
334 to bool so we can return an error condition.
335 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
338 2005-03-17 Martin Baulig <martin@ximian.com>
340 * generic.cs (TypeMananager.IsIEnumerable): New public method.
342 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
343 converting from an array-type of T to `IEnumerable<T>'.
345 2005-03-16 Martin Baulig <martin@ximian.com>
347 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
348 (Nullable.LiftedUnaryMutator): New public class.
350 * expression.cs (UnaryMutator.DoResolve): Added support for
353 2005-03-14 Martin Baulig <martin@ximian.com>
355 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
357 2005-03-14 Martin Baulig <martin@ximian.com>
359 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
360 the comparision operators `<', `>', `<=' and `>='.
362 2005-03-13 Martin Baulig <martin@ximian.com>
365 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
366 avoid confusion with the `NullLiteral'.
367 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
369 2005-03-13 Martin Baulig <martin@ximian.com>
371 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
372 comparing arbitrary types with the null literal.
374 2005-03-13 Martin Baulig <martin@ximian.com>
376 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
377 boolean operators '&&', '||', '&' and '|'.
378 (Nullable.OperatorTrueOrFalse): New public class.
380 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
381 instead of a `StaticCallExpr'; added support for nullables.
383 2005-03-10 Martin Baulig <martin@ximian.com>
386 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
387 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
389 2005-03-07 Martin Baulig <martin@ximian.com>
391 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
392 it work if `expr' is not an IMemoryLocation.
393 (Nullable.Lifted): Implement IMemoryLocation.
394 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
397 2005-03-05 Martin Baulig <martin@ximian.com>
399 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
400 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
401 (Nullable): Added support for lifted unary and binary operators.
403 * expression.cs (Unary.DoResolve): Added support for nullable types.
404 (Binary.DoResolve): Likewise.
405 (Conditional.DoResolve): Likewise.
407 2005-03-02 Martin Baulig <martin@ximian.com>
409 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
411 * class.cs (ClassPart.SetParameterInfo): Override this.
412 (PartialContainer.SetParameterInfo): Override this.
413 (TypeContainer.CheckConstraints): New protected method.
414 (PartialContainer.CheckConstraints): Override this and check
415 whether the same contraints were specified in all parts of a
416 partial generic type definition.
417 (PartialContainer.UpdateConstraints): New public method.
419 * generic.cs (TypeParameter.UpdateConstraints): New public method.
421 2005-03-02 Martin Baulig <martin@ximian.com>
423 Committing a patch from Carlos Alberto Cortez to fix #72887.
425 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
426 casts from `T []' to `int []'.
428 2005-03-02 Martin Baulig <martin@ximian.com>
430 * generic.cs (TypeManager.IsEqual): Make this symmetric.
432 * expression.cs (Binary.ResolveOperator): When resolving a
433 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
434 `=='. Fixes #71866. See gen-127.cs.
436 2005-03-02 Martin Baulig <martin@ximian.com>
438 * class.cs (TypeContainer.DoDefineMembers): We also need a default
439 static constructor in static classes.
441 2005-03-02 Martin Baulig <martin@ximian.com>
444 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
445 (Nullable.LiftedConversion): Added support for user-defined
448 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
450 * cs-parser.jay: Use ComposedCast everywhere instead of
451 NullableType, so we don't need to check for NullableType
453 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
454 case where we'll be resolved into a `parenthesized_expression_0'
458 (Convert.UserDefinedConversion): Added nullable conversions.
460 2005-02-28 Martin Baulig <martin@ximian.com>
462 * generic.cs (TypeManager.IsNullableType): New static method.
463 (Nullable): New abstract class.
464 (Nullable.NullLiteral): New public class.
465 (Nullable.LiftedConversion): New public class.
467 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
468 `builtin_types opt_nullable'.
471 (Convert.ImplicitConversionStandard): Added nullable conversions.
472 (Convert.ExplicitConversionStandard): Likewise.
473 (Convert.ExplicitConversion): Likewise.
475 2005-02-26 Martin Baulig <martin@ximian.com>
477 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
478 begin with a "?", for instance "?[]". Don't do a type lookup if
481 2005-02-25 Martin Baulig <martin@ximian.com>
483 The first part of Nullable Types :-)
485 * generic.cs (NullableType): New public class.
486 (NullCoalescingOperator): New public class.
487 (TypeArguments.Resolve): Add a CS0306 check.
489 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
490 (opt_nullable): New rule.
491 (type): Added `opt_nullable' to `namespace_or_type_name',
492 `builtin_types' and `pointer_type'.
493 (array_type): Added `opt_nullable'.
494 (opt_rank_specifier_or_nullable): New rule; this is the
495 combination of `opt_rank_specifier' and `opt_nullable'.
496 (opt_error): New rule; catch errors here.
497 (nullable_type_or_conditional): New rule; we use this to check for
498 nullable and still detect the conditional operator.
499 (local_variable_type): Use `opt_rank_specifier_or_nullable'
500 instead `opt_rank_specifier'.
502 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
505 2005-02-24 Martin Baulig <martin@ximian.com>
507 * README, README.Changes: Removed; they're old and obsolete.
509 2005-02-22 Martin Baulig <martin@ximian.com>
511 * generic.cs (TypeParameter.Resolve): If resolving the constraints
512 returned an error, set `constraints' to null to avoid a crash
514 (TypeParameter.ResolveType): Likewise.
516 2005-02-22 Martin Baulig <martin@ximian.com>
519 (Constraints.ResolveTypes): Protect against being called twice.
520 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
521 (TypeParameter.ResolveType): New public method; calls
522 constraints.ResolveTypes().
523 (TypeParameter.DefineType): Moved constraints.ResolveType() out
524 into the new ResolveType().
525 (GenericMethod.Define): Call ResolveType() on all our
528 2005-02-21 Martin Baulig <martin@ximian.com>
531 (TypeManager.generic_nullable_type): New static public field.
532 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
535 (RootContext.ResolveCore): Resolve "System.Nullable`1".
537 2005-02-15 Martin Baulig <martin@ximian.com>
539 * generic.cs (ConstructedType.Constraints): Correctly check
540 constraints if the argument type is a type parameter; fixes
543 2005-02-02 Martin Baulig <martin@ximian.com>
545 * delegate.cs (Delegate.DefineType): Report an internal error if
546 TypeManager.multicast_delegate_type is null. See bug #72015 for
549 2005-01-29 Miguel de Icaza <miguel@novell.com>
551 * pending.cs: Produce better code (no nops produced by using Ldarg
554 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
555 i - 1' it should be arg + 1.
559 2005-01-26 Martin Baulig <martin@ximian.com>
561 * cs-parser.jay (indexer_declarator): Don't report an error if we
562 have type parameters since we can be an explicit interface
563 implementation; fixes #71449.
565 2005-01-26 Martin Baulig <martin@ximian.com>
567 * class.cs (TypeContainer.AttributeTargets): Return the correct
568 AttributeTargets depending on our `Kind' instead of throwing an
569 exception; fixes #71632.
571 2005-01-26 Martin Baulig <martin@ximian.com>
573 * delegate.cs (Delegate.DefineType): Correctly define our type
574 parameters. Fixes #71483.
576 2005-01-25 Raja R Harinath <rharinath@novell.com>
579 * expression.cs (MemberAccess.DoResolve): Don't complain with
580 cs0572 when the LHS of a member access has identical name and type
583 2005-01-25 Marek Safar <marek.safar@seznam.cz>
586 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
588 Create custom PermissionSet only for PermissionSetAttribute.
590 2005-01-24 Marek Safar <marek.safar@seznam.cz>
593 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
594 delegates in static class.
596 2005-01-24 Martin Baulig <martin@ximian.com>
598 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
599 merging an implicit block, just use its reachability.
601 * statement.cs (Block.Resolve): Make the unreachable code check
602 work wrt. implicit blocks; see test-337 from #63842.
604 2005-01-21 Alp Toker <alp@atoker.com>
606 * cs-parser.jay: destructor_declaration's container is PartialContainer
607 not Class when partial types are used, so use Kind prop instead of
610 2005-01-22 Miguel de Icaza <miguel@ximian.com>
612 * cs-parser.jay: Improve error reporting when an interface
615 2005-01-20 Dick Porter <dick@ximian.com>
617 * support.cs: SeekableStreamReader fix from Sandor Dobos
618 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
619 chars are read. Fixes bug 70369.
621 2005-01-20 Raja R Harinath <rharinath@novell.com>
623 * cs-parser.jay (catch_clause): Simplify current_block handling
626 2005-01-17 Miguel de Icaza <miguel@ximian.com>
628 * convert.cs (ImplicitStandardConversionExists): Synchronize the
629 code with ImplicitStandardConversion to handle the implicit
630 conversion of method groups into valid delegate invocations.
632 The problem is that in parameter handling we were using this code
633 path. Fixes bug #64698
635 2005-01-19 Raja R Harinath <rharinath@novell.com>
637 * cs-parser.jay: Fix several infelicities.
638 - Avoid assigning to the parser value stack. Code like
639 '$3 = null' is unclean. Synthesize a value for the code block
641 - Avoid using oob_stack for storing location information. Use ...
642 (_mark_): ... this. New (empty) rule. Saves the current location
644 (foreach_statement): Avoid using oob_stack for current_block
645 handling. Use technique used in for_statement and
646 using_statement. Synthesize a value for the code block to store
647 additional intermediate information.
649 2005-01-13 Miguel de Icaza <miguel@ximian.com>
651 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
652 of a different type is only allowed to private fields of a
653 containing type, not on fields of a base class.
655 See test-174.cs and error cs0122-9.cs
657 2005-01-13 Raja R Harinath <rharinath@novell.com>
659 Fix test-335.cs (bug #58126).
660 * cs-parser.jay (argument): Split out non-expression parts of the
661 rule into 'non_simple_argument'.
662 (invocation_expression): Support parenthesized invocations with
663 multiple arguments, and with single non-simple arguments.
665 2005-01-13 Raja R Harinath <rharinath@novell.com>
667 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
670 2005-01-12 Raja R Harinath <rharinath@novell.com>
672 Fix cs0038-1.cs, cs1640-6.cs.
673 * ecore.cs (Expression.Resolve): Remove special-case for
674 SimpleName in error-handling.
675 (Expression.almostMatchedMembers): Relax access permission to
677 (Expression.MemberLookupFailed): Handle duplicates in
678 almostMatchedMembers list.
679 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
680 * expression.cs (New.DoResolve): Report CS1540 for more cases.
681 * typemanager.cs (GetFullNameSignature): Use the MethodBase
682 overload if the passed in MemberInfo is a MethodBase.
684 2005-01-25 Martin Baulig <martin@ximian.com>
687 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
689 2005-01-12 Marek Safar <marek.safar@seznam.cz>
692 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
693 for non-CAS & merge permission sets properly.
695 2005-01-11 Raja R Harinath <rharinath@novell.com>
697 Improve standard-compliance of simple name and member access
698 resolution. Fixes bugs #52697, #57200, #67520, #69519.
699 * ecore.cs (FullNamedExpression): New abstract base class
700 for Namespaces and TypeExpressions.
701 (ResolveFlags.SimpleName): Remove.
702 (SimpleName): Remove support for dotted names.
703 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
704 DeclSpace.FindType and DeclSpace.LookupType.
705 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
706 (Expression.ExprClassName): Make member function.
707 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
708 a namespace. Remove creation of dotted "SimpleName"s.
709 (MemberAccess.DoResolve): Likewise.
710 * decl.cs (DeclSpace.Cache): Make private.
711 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
712 (DeclSpace.FindType): Update.
713 (DeclSpace.LookupType): Move here from RootContext. Return a
715 * namespace.cs (Namespace): Derive from FullNamedExpression
716 so that it can be part of expression resolution.
717 (Namespace.Lookup): Return an FullNamedExpression.
718 (NamespaceEntry.LookupAlias): Lookup aliases only in current
720 * rootcontext.cs (NamespaceLookup): Remove.
721 (LookupType): Move to DeclSpace.
722 * attribute.cs (CheckAttributeType): Update.
723 * doc.cs (FindDocumentedType): Remove allowAlias argument.
724 (FindDocumentedTypeNonArray): Likewise.
726 2005-01-11 Raja R Harinath <rharinath@novell.com>
728 Fix cs0509.cs, cs1632.cs.
729 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
730 is the same as IsInterface.
731 (TypeContainer.GetClassBases): Likewise.
732 * statement.cs (LabeledStatement.ig): New field.
733 (LabeledStatement.LabelTarget): Save ILGenerator which created the
735 (LabeledStatement.DoEmit): Check that the label was created with
736 the same ILGenerator.
738 2005-01-10 Marek Safar <marek.safar@seznam.cz>
741 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
742 accessors to its properties.
744 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
745 from accessors to property.
747 2005-01-10 Marek Safar <marek.safar@seznam.cz>
750 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
753 2005-01-08 Miguel de Icaza <miguel@ximian.com>
755 * attribute.cs: Check for null and empty strings.
757 I have lost another battle to Paolo.
759 2005-01-07 Marek Safar <marek.safar@seznam.cz>
762 * class.cs (PropertyMethod): Set Parent field in ctors.
763 (SetMethod.InternalParameters): Add unsafe switch hack.
764 Override MarkForDuplicationCheck where it is appropriate.
766 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
767 It says whether container allows members with the same name.
769 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
770 Removed is_method parameter.
772 2005-01-06 Duncan Mak <duncan@ximian.com>
774 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
775 because the previous change led to incorrect reporting of CS1032
776 ("Cannot define/undefine preprocessor symbols after first token in
777 file"). Instead of using `tokens_seen' as the only flag that
778 triggers CS1040, introduce `comments_seen'. This new flag is used
779 to signify having seen comments on the current line, so it is
780 unset after a newline.
782 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
784 * doc.cs : When searching for a type, find nested type too.
785 This fixes bug #71040.
787 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
790 - Warn missing member comment on those classes which also does not
791 have doc comments. Fixed bug #71041.
792 - Don't warn missing doc comment on default constructor.
795 2005-01-06 Duncan Mak <duncan@ximian.com>
797 * cs-tokenizer.cs (xtoken): After handling traditional C-style
798 comments, set `tokens_seen' to true. This allows us to detect
799 misplaced preprocessor directives (i.e. not at the beginning of
800 the a line, nor after whitespaces). In that case, report error
801 CS1040. This fixes bug #56460.
803 * cs-parser.jay (interface_member_declaration): Add checks for
804 IsExplicitImpl, and report CS0541 error if an interface member is
805 defined as an explicit interface declaration.
807 2005-01-06 Marek Safar <marek.safar@seznam.cz>
810 * class.cs (PropertyMethod): Set Parent field in ctors.
811 (SetMethod.InternalParameters): Add unsafe switch hack.
813 * decl.cs (MemberCore.Parent): Cannot be readonly.
815 2005-01-06 Raja R Harinath <rharinath@novell.com>
817 * decl.cs (DeclSpace.ResolveType): Remove.
818 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
819 Merge in code from ...
820 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
821 * class.cs, enum.cs: Update to changes.
823 2005-01-06 Miguel de Icaza <miguel@ximian.com>
825 * anonymous.cs: Ensure that we init the scope of our parent if it
826 has not been initialized yet.
828 2004-12-30 Duncan Mak <duncan@ximian.com>
830 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
831 if field.FieldBuilder is null. Fixes #70758.
833 * convert.cs: Fixed some typos and updated some of the comments.
834 (ImplicitStandardConversionExists):
835 (TryImplicitIntConversion): If `target_type' is an interface and
836 the type of `ic' implements this interface, return true or a new
837 BoxedCast instead of null. This fixes #70468.
839 2004-12-29 Duncan Mak <duncan@ximian.com>
841 * expression.cs (Argument.Emit): Check that Expr is
842 IMemoryLocation before casting to it, and report CS1510 otherwise.
846 2004-12-21 Ben Maurer <bmaurer@ximian.com>
848 * statement.cs (Block.ThisVariable): remove the recursion here, to
849 make the --profile more sane.
851 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
853 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
854 assembly, by JB Evain.
856 2004-12-17 Raja R Harinath <rharinath@novell.com>
858 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
859 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
860 "parent" refers to enclosing type/class. "base" refers to superclass.
862 2004-12-17 Raja R Harinath <rharinath@novell.com>
864 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
865 Ensure that we only have GlobalAttributes.
866 * attribute.cs (Attribute.Emit): Make non-virtual.
867 (GlobalAttribute.Emit): Remove.
868 (Attribute.Resolve): Make virtual.
869 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
870 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
871 the argument. Don't create one.
872 (Attribute.GetObsoleteAttribute): Likewise.
873 (Attribute.GetClsCompliantAttributeValue): Likewise.
874 * class.cs, decl.cs: Update to changes.
876 2004-12-17 Marek Safar <marek.safar@seznam.cz>
878 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
880 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
882 * statement.cs (Foreach.Resolve): Add error 186 report.
884 2004-12-16 Marek Safar <marek.safar@seznam.cz>
886 * expression.cs (Conditional.DoResolve): Add warning 429.
888 * statement.cs (If.Resolve): Add warning 665.
890 2004-12-16 Raja R Harinath <rharinath@novell.com>
892 New invariant: RootContext.Tree.Types.NamespaceEntry == null
893 except when in the parser, and in GlobalAttribute.
894 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
895 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
896 RootContext.Tree.Types.NamespaceEntry once work is done.
897 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
898 and resets RootContext.Tree.Types.NamespaceEntry.
900 2004-12-15 Marek Safar <marek.safar@seznam.cz>
902 * cs-parser.jay: Don't create a block for every variable.
904 2004-12-14 Miguel de Icaza <miguel@ximian.com>
906 * location.cs: Provide extra information.
908 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
909 variables from the captured environment, it is the ldarg_0.
911 2004-12-14 Marek Safar <marek.safar@seznam.cz>
913 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
916 * class.cs: Changed warning level for 169 to avoid developer
917 displeasure from warning flooding. It will be changed back when they
918 fix most of current BCL warnings.
920 * RootContext.cs: Pushed default WarningLevel to 3.
922 * statement.cs: Removed unused variable.
924 2004-12-14 Marek Safar <marek.safar@seznam.cz>
926 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
927 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
928 Add error 502 report.
929 (StaticClass.DefineType): Add error 441 report.
930 (Class.AllowedModifiersProp): New virtual property as temporary
931 extension to AllowedModifiers.
932 (Class.DefineType): Add error 418 report. Moved ModFlags check here
933 to share implementation with StaticClass and don't call virtual
936 * driver.cs (MainDriver): Add error 1558 test.
938 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
939 report. Moved error 36 test here.
941 * statement.cs (Throw.Resolve): Add error 724 report.
943 * typemanager.cs: Add out_attribute_type core type.
945 2004-12-13 Marek Safar <marek.safar@seznam.cz>
947 * class.cs (TypeContainer.VerifyClsCompliance): Add error
949 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
951 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
954 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
956 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
957 Add error 3023 report.
958 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
960 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
963 2004-12-12 John Luke <john.luke@gmail.com>
965 * driver.cs (AddArgs): take -- into account when
966 adding arguments, fixes bug 65710
968 2004-12-12 Martin Baulig <martin@ximian.com>
970 * expression.cs (Unary.TryReduceNegative): Added support for
971 SByteConstant and ByteConstant.
972 (Unary.Reduce): Check error values from TryReduceNegative().
974 2004-12-10 Marek Safar <marek.safar@seznam.cz>
976 * attributes.cs (Attribute.Resolve): Avoid multiple error report
977 and report exception as error 182.
979 2004-12-10 Raja R Harinath <rharinath@novell.com>
981 * driver.cs (Main): Fix message when there are warnings.
983 2004-12-09 Miguel de Icaza <miguel@ximian.com>
985 * delegate.cs: Fixed my fix from yesterday, sorry about that.
987 2004-12-09 Marek Safar <marek.safar@seznam.cz>
989 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
990 Reduced number of warnings.
992 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
994 2004-12-08 Miguel de Icaza <miguel@ximian.com>
996 * driver.cs: Removed message.
998 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
1000 2004-12-08 <vargaz@freemail.hu>
1002 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
1004 2004-12-08 Martin Baulig <martin@ximian.com>
1006 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
1007 instead of a CS3002 for properties and indexer.
1009 2004-12-08 Martin Baulig <martin@ximian.com>
1011 * decl.cs (MemberName.ToString): Make this work again.
1013 2004-12-08 Marek Safar <marek.safar@seznam.cz>
1015 * attribute.cs (Resolve): Add error 591 detection.
1017 * class.cs (FieldMember.Define): Add error 1547 detection.
1018 (Indexer.Define): Add error 620 detection.
1019 (Operator.Define): Add error 590 detection.
1021 * ecore.cs: Missing argument for error 79.
1023 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
1026 2004-12-07 Marek Safar <marek.safar@seznam.cz>
1029 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
1032 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
1034 * cs-parser.jay : handle doc comments on implicit/explicit operators.
1035 Some operator comments were suppressed.
1036 * doc.cs : Implicit/explicit operator name in doc comments are like
1037 "op_Explicit(type)~returnType", so added suffix handling.
1039 2005-01-21 Alp Toker <alp@atoker.com>
1041 * cs-parser.jay: destructor_declaration's container is PartialContainer
1042 not Class when partial types are used, so use Kind prop instead of 'is'.
1044 2004-12-12 Martin Baulig <martin@ximian.com>
1046 * expression.cs (Unary.TryReduceNegative): Added support for
1047 SByteConstant and ByteConstant.
1048 (Unary.Reduce): Check error values from TryReduceNegative().
1050 2004-12-11 Martin Baulig <martin@ximian.com>
1052 * support.cs (ReflectionParameters.ParameterName): If we have a
1053 `gpd', call `ParameterName' on it.
1055 * parameter.cs (Parameter.GetParameterAttributes): New static method.
1057 * pending.cs (PendingImplementation.DefineProxy): Call
1058 DefineParameter() for all of the MethodBuilder's arguments.
1060 2004-12-09 Martin Baulig <martin@ximian.com>
1062 * doc.cs (DocUtil): Make this a static class.
1064 2004-12-09 Martin Baulig <martin@ximian.com>
1066 * expression.cs (Invocation.InferType): Moved the type inference
1067 implementation into TypeManager.
1069 * generics.cs (TypeManager): Moved the type inference
1070 implementation here.
1072 2004-12-09 Martin Baulig <martin@ximian.com>
1074 * typemanager.cs (TypeManager): Make this a partial class.
1077 (TypeManager): Move the generics part of `TypeManager' here.
1079 2004-12-08 Martin Baulig <martin@ximian.com>
1081 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
1082 instead of a CS3002 for properties and indexer. Added CS3024
1083 check for generic interfaces.
1085 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
1086 instances are not CLS-compliant.
1088 2004-12-08 Martin Baulig <martin@ximian.com>
1091 (void_pointer_expression): New rule for `void*', `void**' etc.
1092 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
1094 2004-12-08 Martin Baulig <martin@ximian.com>
1096 * expression.cs (Invocation.InferType): Removed the hack for
1097 MethodCore.MayUnify().
1099 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
1102 * class.cs (MethodCore.MayUnify): Use
1103 TypeManager.MayBecomeEqualGenericTypes().
1105 2004-12-08 Martin Baulig <martin@ximian.com>
1107 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
1108 parameter, box it. Fixes #69233.
1110 2004-12-08 Martin Baulig <martin@ximian.com>
1112 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
1113 have the ctor constraint. Fixes #68326.
1115 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
1117 * cs-parser.jay : interface comment was not consumed because of
1118 extra opt_semicolon before doc handling.
1120 2004-12-03 Raja R Harinath <rharinath@novell.com>
1122 Fix test-327.cs, test-328.cs, and put in early infrastructure
1123 for eventually fixing #52697.
1124 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
1125 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
1127 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
1128 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
1129 (VerifyUsing, error246): Update.
1130 * rootcontext.cs (RootContext.NamespaceLookup): Just use
1131 'NamespaceEntry.LookupNamespaceOrType'.
1133 2004-12-07 Martin Baulig <martin@ximian.com>
1135 * driver.cs: Call it "BETA SOFTWARE" :-)
1137 2004-12-06 Raja R Harinath <rharinath@novell.com>
1139 Fix crash on cs0657-17.cs.
1140 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1141 Use RootContext.Tree.Types, not 'new RootTypes ()'.
1142 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
1143 the case where the NamespaceEntry gets overwritten.
1145 2004-12-06 Marek Safar <marek.safar@seznam.cz>
1147 Fixed #69195, #56821
1148 * ecore.cs (ResolveBoolean): Tiny refactoring.
1150 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
1151 of right expression resolving when left is false constant and
1152 operator is LogicalAnd OR true constant and operator is LogicalOr.
1154 * statement.cs (ResolveUnreachable): Always reports warning.
1156 2004-12-05 Miguel de Icaza <miguel@ximian.com>
1158 * class.cs: Distinguish between 1721 and 1722 (just a little help
1159 for the programmer).
1161 2004-12-03 Miguel de Icaza <miguel@ximian.com>
1163 * delegate.cs: Only allow this on new versions of the language.
1165 2004-12-02 Duncan Mak <duncan@ximian.com>
1167 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
1169 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
1170 here as a static method. Take an additional bool out parameter
1171 `must_do_cs1540_check' for signaling to InstanceResolve.
1172 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
1173 member field from PropertyExpr class and made it an argument of
1175 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
1176 check for MarshalByRefObject, and report CS0122 instead of CS1540.
1177 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
1178 and `remove_accessor' as well as InstanceResolve: report CS0122
1183 2004-12-07 Martin Baulig <martin@ximian.com>
1185 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
1186 and CS0692 where appropriate.
1188 2004-12-06 Martin Baulig <martin@ximian.com>
1190 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
1191 IsDuplicateImplementation() and improved it.
1193 * expression.cs (Invocation.InferTypeArguments): Added
1194 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
1195 and removed the "ref" modifier from `infered_types'.
1197 * decl.cs (MemberName.ToString): Removed the exception.
1199 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
1201 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
1202 comments are allowed.
1204 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1206 * delegate.cs: Add checks for subtypes in paramaters and return values
1207 in VerifyMethod () to add support for Covariance/Contravariance
1210 2004-12-02 Miguel de Icaza <miguel@ximian.com>
1212 * report.cs: Remove extra closing parenthesis.
1214 * convert.cs (Error_CannotImplicitConversion): If the name of the
1215 types are the same, provide some extra information.
1217 2004-12-02 Marek Safar <marek.safar@seznam.cz>
1220 * attribute.cs (Resolve): Improved implementation of params
1221 attribute arguments.
1223 * support.cs (ParameterData): Add HasParams to be faster.
1225 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
1227 all things are for /doc support:
1229 * doc.cs: new file that supports XML documentation generation.
1230 * mcs.exe.sources: added doc.cs.
1232 Handle /doc command line option.
1233 Report error 2006 instead of 5 for missing file name for /doc.
1234 Generate XML documentation when required, after type resolution.
1236 Added support for picking up documentation (/// and /** ... */),
1237 including a new XmlCommentState enumeration.
1239 Added lines to fill Documentation element for field, constant,
1240 property, indexer, method, constructor, destructor, operator, event
1241 and class, struct, interface, delegate, enum.
1242 Added lines to warn incorrect comment.
1244 Added Documentation field (passed only when /doc was specified).
1246 Added DocComment, DocCommentHeader, GenerateDocComment() and
1247 OnGenerateDocComment() and some supporting private members for
1248 /doc feature to MemberCore.
1250 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
1252 Added overriden DocCommentHeader.
1254 Added overriden DocCommentHeader and GenerateDocComment().
1256 2004-12-01 Miguel de Icaza <miguel@ximian.com>
1258 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
1259 unwrapping the enumeration values, chain to
1260 DoConstantNumericPromotions again, so we can promote things to the
1261 fundamental types (takes care of enums that are bytes, sbytes).
1265 2004-12-01 Raja R Harinath <rharinath@novell.com>
1267 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
1268 Fix long-standing bug in type-lookup. Use FindType instead of
1269 LookupType when ec.ResolvingTypeTree.
1270 (Attribute.ResolveType, Attribute.Resolve)
1271 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
1273 (Attributes.Search): Remove internal version. Update.
1274 (Attributes.SearchMulti): Update.
1275 (Attributes.GetClsCompliantAttribute): Remove.
1276 (Attributes.GetIndexerNameAttribute): Remove.
1277 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
1278 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
1279 * class.cs (Indexer.Define): Likewise.
1281 2004-12-01 Marek Safar <marek.safar@seznam.cz>
1284 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
1285 MarshallByReference members access.
1287 * expression.cs: Use CheckMarshallByRefAccess;
1288 Better error CS0197 message.
1290 * report.cs: Print whole related error message.
1292 2004-11-29 Marek Safar <marek.safar@seznam.cz>
1294 * class (GetClassBases): Better error 60 report.
1295 (EventProperty): Disabled warning 67 detection.
1297 2004-11-29 Marek Safar <marek.safar@seznam.cz>
1300 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
1302 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
1305 2004-11-29 Marek Safar <marek.safar@seznam.cz>
1308 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
1310 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
1312 2004-11-26 Miguel de Icaza <miguel@ximian.com>
1314 * attribute.cs (Attribute.Resolve): Refine error reporting and
1315 report a cs0117 if the identifier does not exist, to distinguish
1316 from 0617 which is a miss-use of the actual identifier.
1318 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
1319 between cs0070 and cs0079.
1321 * class.cs (MemberBase.DoDefine): When reporting a wrong
1322 accessibility level, we use MethodCore to compare instead of
1323 Method (this was a regression in some refactoring effort).
1325 So now we correctly report cs0056 again.
1327 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
1328 testing the target_type (which was known to be object_type) and
1329 not the source type (which is anonymous_method).
1331 Fixed reporting of error cs1660.
1333 * expression.cs (UserCast.Source): Expose the underlying cast.
1335 * statement.cs (Switch.SwitchGoverningType): Sort the list of
1336 allowed types to find a match to int32 first (most common).
1338 In addition, it ignores any ImplicitUserConversions that did an
1339 internal implicit conversion (as the switch statement allows only
1340 one integral conversion to exist).
1342 * class.cs (PartialContainer.Create): rename `name' to
1343 `member_name' for clarity. Then replace the string calls with a
1344 call to MemberName.GetPartialName, as now using
1345 MemberName.ToString is an error (this is due to the side effects
1346 it had, that were fixed in the past).
1348 This will restore the error reporting on a number of partial class
1349 errors that were missusing this (and getting an exception as a
1350 results, which is now just a plain textual warning, because
1351 yyparse debug output would crash otherwise).
1353 2004-11-26 Raja R Harinath <rharinath@novell.com>
1355 * Makefile (PROGRAM_INSTALL_DIR): Remove.
1357 2004-11-25 Ben Maurer <bmaurer@ximian.com>
1359 * rootcontext.cs (LookupType): Make sure to cache lookups that
1360 don't give us a negative result. This saves about 5% of corlib
1363 2004-11-25 Miguel de Icaza <miguel@ximian.com>
1365 * report.cs (AbstractMessage.Print): messages are sent to stderr
1367 * class.cs (TypeContainer.GetClassBases): It is an error to have a
1368 non-interface in the list of interfaces (at this point, either
1369 parent was properly set, or a base class is being listed in the
1370 interfaces section).
1372 This flags error 1722, and resolves the crash from bug 69259.
1374 2004-11-25 Ben Maurer <bmaurer@ximian.com>
1376 * statement.cs (Using.EmitExpressionFinally): make this work right
1377 for valuetypes. Fixes 69926.
1379 2004-11-25 Miguel de Icaza <miguel@ximian.com>
1381 * const.cs (Const.ChangeType): Cope with the "0 literal can be
1382 converted to an enum" here, before we try to change the underlying
1383 type. This code exists, but it is a different code path than the
1384 one used while encoding constants.
1386 (ImplicitReferenceConversionExists): In addition, resynchronized
1387 the code here, so it matches the same code in
1388 ImplicitReferenceConversionExists for the `from any class-type S
1389 to any interface-type T'.
1391 2004-11-25 Marek Safar <marek.safar@seznam.cz>
1393 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
1395 2004-11-24 Miguel de Icaza <miguel@ximian.com>
1397 * cs-parser.jay: Use verbosity accordingly.
1399 2004-11-24 Marek Safar <marek.safar@seznam.cz>
1401 * expression.cs (Unary.ResolveOperator): Do not report warning;
1402 AddressOf reads from variable.
1404 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
1406 2004-11-24 Marek Safar <marek.safar@seznam.cz>
1410 * attribute.cs (Attributable): Removed CheckTargets.
1411 (Attributes.Emit): Explicit attribute targets are tested here.
1413 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
1414 not enabled for interfaces.
1416 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
1417 (GetAssemblyName): Ouch next bug there.
1419 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1421 * expression.cs: Error 275 added.
1423 2004-11-23 Marek Safar <marek.safar@seznam.cz>
1425 Fix bug #69177 (Implemented decimal constant support)
1427 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
1428 (BinaryFold): Add DecimalConstant.
1430 * const.cs (Define): Decimal constant
1432 (ChangeType): Add decimal type handling.
1433 (LookupConstantValue): Don't set value for decimal type but
1434 emit DecimalConstantAttribute. Needed for constant optimization.
1436 * constant.cs (ToDecimal): New method.
1437 (ConvertToDecimal): New method.
1438 (IntConstant): Implemented ConvertToDecimal.
1439 (DecimalConstant.Emit): Emit optimized version for decimals in
1442 * expression.cs (ResolveOperator): Changed order of constant
1443 reduction to work correctly with native types which have
1444 overloaded operators.
1445 (ResolveMemberAccess): Extract constant value from attribute
1448 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
1450 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
1451 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
1452 (ChangeType): Decimal is special.
1453 (TypeToCoreType): Add decimal type.
1455 2004-11-22 Marek Safar <marek.safar@seznam.cz>
1457 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
1460 2004-11-22 Marek Safar <marek.safar@seznam.cz>
1462 * class.cs (EventField.ApplyAttributeBuilder): Fix error
1465 2004-11-19 Marek Safar <marek.safar@seznam.cz>
1467 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
1469 * pending.cs (PendingImplementation): Grab only interfaces.
1471 2004-11-19 Marek Safar <marek.safar@seznam.cz>
1473 * statement.cs (ForeachHelperMethods): Add location member and
1474 error 202 detection.
1476 2004-11-18 Marek Safar <marek.safar@seznam.cz>
1478 * expression.cs (DoResolveBase): Fixed wrong warning for out
1481 2004-12-04 Martin Baulig <martin@ximian.com>
1483 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
1484 to check whether the conversion is ok.
1486 * typemanager.cs (TypeManager.GetTypeArguments): Just return
1487 `Type.EmptyTypes' if we're not a generic TypeContainer.
1489 2004-11-25 Miguel de Icaza <miguel@ximian.com>
1491 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
1492 old bug: when converting from the null literal to a pointer,
1493 return an EmptyCast, not the NullLiteral.
1495 This fixes #69921, the recent null_type changes probably made this
1498 2004-12-03 Martin Baulig <martin@ximian.com>
1500 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1501 method as our child, call AnonymousMethod.Compatible() on it.
1503 2004-12-02 Miguel de Icaza <miguel@ximian.com>
1505 * class.cs (FieldBase): Use an unused bit field from the field to
1506 encode the `has_offset' property from the FieldMember. This saves
1507 a couple of Ks on bootstrap compilation.
1509 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1510 method as our child, return the AnonymousMethod resolved
1513 * expression.cs (New.DoResolve): Allow return values from
1514 NewDelegate to also include AnonymousMethods.
1518 2004-11-29 Raja R Harinath <rharinath@novell.com>
1520 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
1522 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
1523 System.Runtime.InteropServices._Exception, since it's a base
1524 interface of the core type System.Exception in the net_2_0 profile.
1526 2004-11-27 Martin Baulig <martin@ximian.com>
1528 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
1530 2004-11-26 Raja R Harinath <rharinath@novell.com>
1532 * Makefile: Convert to use executable.make.
1533 * gmcs.exe.sources: New.
1535 2004-11-25 Martin Baulig <martin@ximian.com>
1537 * expression.cs (Invocation.InferType): Added support for byref types.
1539 2004-11-25 Martin Baulig <martin@ximian.com>
1541 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
1542 in TypeManager.TypeToCoreType().
1544 2004-11-25 Martin Baulig <martin@ximian.com>
1546 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
1547 "Dispose" method from the `current_type'.
1548 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
1549 DoDefineMembers() instead of using the MethodBuilder; this is
1550 required for generic iterators.
1552 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
1554 2004-11-24 Martin Baulig <martin@ximian.com>
1556 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
1558 2004-11-20 Martin Baulig <martin@ximian.com>
1560 * expression.cs (Invocation.InferType): Correctly infer generic
1561 instances; see gen-103.cs.
1562 (Invocation.InferTypeArguments): If a generic method doesn't have
1563 any unbound type parameters, we don't need to infer anything.
1565 2004-11-19 Raja R Harinath <rharinath@novell.com>
1567 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
1569 2004-11-17 Raja R Harinath <rharinath@novell.com>
1571 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
1572 (TypeHandle.GetMemberCache): New.
1573 (TypeHandle.TypeHandle): Update.
1574 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
1575 (TypeManager.LookupParentInterfacesCache):
1576 Rename from LookupInterfaceCache. Optimize slightly.
1577 (TypeManager.MemberLookup_FindMembers): Update.
1578 * decl.cs (MemberCache.MemberCache): Set Container to null in the
1580 (AddCacheContents): Rename from AddHashtable.
1581 * class.cs (TypeContainer.parent_container): Remove.
1582 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
1583 (TypeContainer.DoDefineMembers): Don't initialize it.
1584 Update to name changes.
1586 2004-11-17 Miguel de Icaza <miguel@ximian.com>
1588 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
1589 that factors the code to check access modifiers on override.
1591 (PropertyBase): Use the code here.
1593 Patch from Lluis S'anchez, fixes bug #69361.
1595 2004-11-15 Miguel de Icaza <miguel@ximian.com>
1597 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
1598 routine that is used to report the use of a captured variable
1599 whose address has been taken.
1601 There are two checks: one when variables are being captured and
1602 the other check is when the address of a variable is taken.
1604 (because an anonymous methods might be resolved before *or* after
1605 the address has been taken) and
1607 * expression.cs (Conditional.DoResolve): Remove the special
1608 casing that Martin added to trueExpr and falseExpr being both
1609 NullLiteral. We get the right behavior now just by introducing
1610 the null_type into the compiler.
1612 * convert.cs (ExplicitConversion): Change the code to use
1613 null_type instead of testing `expr is NullLiteral'.
1614 (ImplicitConversionStandard): use null_type too.
1615 (ImplicitReferenceConversionExists): use null_type too.
1616 (ImplicitReferenceConversion): use null_type too.
1618 * literal.cs: The type of `NullLiteral' is now null_type instead
1620 (Resolve): Set the type here.
1622 * typemanager.cs: Introduce null_type.
1624 2004-11-18 Martin Baulig <martin@ximian.com>
1627 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
1629 2004-11-18 Martin Baulig <martin@ximian.com>
1631 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
1633 2004-11-18 Martin Baulig <martin@ximian.com>
1635 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
1636 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
1637 call ResolveConstructedType() on it to resolve it without checking
1639 (Constraints.ResolveTypes): Check them here.
1640 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
1641 but don't check constraints.
1642 (ConstructedType.ResolveAsTypeTerminal): Override this and also
1643 check constraints here.
1644 (ConstructedType.ResolveConstructedType): New public method. This
1645 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
1646 resolve ourselves without checking constraints.
1648 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
1650 2004-11-18 Martin Baulig <martin@ximian.com>
1653 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
1655 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
1657 2004-11-18 Martin Baulig <martin@ximian.com>
1659 * ecore.cs (TypeExpr.ResolveType): Removed.
1660 (Expression.ResolveAsTypeTerminal): We always return a fully
1661 resolved `TypeExpr', so we can just access its `Type'.
1663 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
1665 2004-11-17 Martin Baulig <martin@ximian.com>
1667 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
1668 sure we don't return any unresolved TypeExpr's.
1669 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
1671 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
1673 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
1674 unresolved `ConstructedType's.
1676 2004-11-17 Martin Baulig <martin@ximian.com>
1678 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
1680 2004-11-17 Martin Baulig <martin@ximian.com>
1683 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
1685 * decl.cs (DeclSpace.ResolveType): Removed.
1686 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
1688 2004-11-17 Martin Baulig <martin@ximian.com>
1690 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
1691 direction, like FindMembers() does. Fixes #69546, testcase is in
1694 2004-11-16 Martin Baulig <martin@ximian.com>
1696 This is based on a patch from Marek Safar, see bug #69082.
1697 Fixes bugs #63705 and #67130.
1699 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
1700 method; create a MemberCache for an interface type and cache the
1703 * decl.cs (IMemberContainer.ParentContainer): Removed.
1704 (IMemberContainer.ParentCache): New property.
1705 (MemberCache.SetupCacheForInterface): Removed.
1706 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
1707 to create a cache for an interface's "parent".
1709 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
1712 2004-11-14 Ben Maurer <bmaurer@ximian.com>
1714 * statement.cs: Avoid adding bools to a hashtable.
1716 2004-11-15 Martin Baulig <martin@ximian.com>
1718 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
1720 2004-11-11 Martin Baulig <martin@ximian.com>
1722 * typemanager.cs (TypeManager.GetMethodName): New method.
1724 * class.cs (MethodData.Define): Include the generic arity in the
1725 name of an explicit interface; also add it to the method name.
1727 * pending.cs (PendingImplementation.InterfaceMethod): The method
1728 name now includes the generic arity.
1730 2004-11-07 Miguel de Icaza <miguel@ximian.com>
1732 * expression.cs (Invocation.OverloadResolve): Flag error if we are
1733 calling an unsafe method from a safe location.
1735 2004-11-06 Marek Safar <marek.safar@seznam.cz>
1738 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
1740 2004-11-06 Miguel de Icaza <miguel@ximian.com>
1742 * namespace.cs (VerifyUsing): use GetPartialName instead of
1745 2004-11-05 Miguel de Icaza <miguel@ximian.com>
1747 * statement.cs (Return.Resolve): Fix regression in typo: if
1748 `in_exc', we have to request a NeedReturnLabel, this was a typo
1749 introduced in the anonymous method check-in. Fixes #69131.
1751 * Indexers were using the ShortName when defining themselves,
1752 causing a regression in the compiler bootstrap when applying the
1753 patch from 2004-11-02 (first part), now they use their full name
1754 and the bug is gone.
1756 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
1758 * driver.cs: Strip the path from the names of embedded resources. Fixes
1761 2004-11-04 Raja R Harinath <rharinath@novell.com>
1763 Fix error message regression: cs0104-2.cs.
1764 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
1765 (AliasEntry.Resolve): Update.
1766 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
1768 (RootContext.LookupType): Update.
1770 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
1772 * cs-parser.jay: Add support for handling accessor modifiers
1773 * class: Add support port accessor modifiers and error checking,
1774 define PropertyMethod.Define as virtual (not abstract anymore)
1775 * ecore.cs: Add checking for proeprties access with access modifiers
1776 * iterators.cs: Modify Accessor constructor call based in the modified
1778 2004-11-02 Ben Maurer <bmaurer@ximian.com>
1780 * expression.cs (StringConcat): Handle being called twice,
1781 as when we have a concat in a field init with more than two
1784 2004-11-02 Miguel de Icaza <miguel@ximian.com>
1786 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
1787 special case explicit implementations, we should always produce
1788 the .property or .event declaration.
1790 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
1791 since it will not return correct data if people use this
1792 unresolved in the presence of using statements (see test-313).
1794 * class.cs (MethodData.Define): If we are an explicit interface
1795 implementation, set the method name to the full name of the
1796 interface plus the name of the method.
1798 Notice that using the method.MethodName.GetFullName() does not
1799 work, as it will only contain the name as declared on the source
1800 file (it can be a shorthand in the presence of using statements)
1801 and not the fully qualifed type name, for example:
1805 class D : ICloneable {
1806 object ICloneable.Clone () {
1810 Would produce a method called `ICloneable.Clone' instead of
1811 `System.ICloneable.Clone'.
1813 * namespace.cs (Alias.Resolve): Use GetPartialName.
1815 2004-11-01 Marek Safar <marek.safar@seznam.cz>
1817 * cs-parser.jay: Add error 1055 report.
1819 2004-11-01 Miguel de Icaza <miguel@ximian.com>
1821 * assign.cs (Assign.DoResolve): Only do the transform of
1822 assignment into a New if the types are compatible, if not, fall
1823 through and let the implicit code deal with the errors and with
1824 the necessary conversions.
1826 2004-11-01 Marek Safar <marek.safar@seznam.cz>
1828 * cs-parser.jay: Add error 1031 report.
1830 * cs-tokenizer.cs: Add location for error 1038.
1832 2004-10-31 Marek Safar <marek.safar@seznam.cz>
1834 * cs-parser.jay: Add error 1016 report.
1836 2004-10-31 Marek Safar <marek.safar@seznam.cz>
1838 * cs-parser.jay: Add errors 1575,1611 report.
1840 2004-10-31 Marek Safar <marek.safar@seznam.cz>
1842 * cs-parser.jay: Add error 1001 report.
1844 2004-10-31 Marek Safar <marek.safar@seznam.cz>
1847 * attribute.cs (GetMarshal): Add method argument for
1848 caller identification.
1850 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
1851 agument for GetMarshal and RuntimeMissingSupport.
1853 2004-10-31 Marek Safar <marek.safar@seznam.cz>
1855 * attribute.cs (ExtractSecurityPermissionSet): Removed
1856 TypeManager.code_access_permission_type.
1858 * typemanager.cs: Removed TypeManager.code_access_permission_type.
1860 2004-10-27 Miguel de Icaza <miguel@ximian.com>
1862 * expression.cs (LocalVariableReference.DoResolveLValue): Check
1863 for obsolete use of a variable here. Fixes regression on errors
1864 cs0619-25 and cs0619-26.
1866 2004-10-27 Marek Safar <marek.safar@seznam.cz>
1868 Fix #62358, implemented security attribute encoding.
1870 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
1871 Tests permitted SecurityAction for assembly or other types.
1872 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
1873 data from SecurityPermissionAttribute to PermisionSet class.
1875 * class.cs (ApplyAttributeBuilder): Added special handling
1876 for System.Security.Permissions.SecurityAttribute based types.
1878 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
1879 special handling for System.Security.Permissions.SecurityAttribute
1882 * enum.cs (ApplyAttributeBuilder): Added special handling
1883 for System.Security.Permissions.SecurityAttribute based types.
1885 * parameter.cs (ApplyAttributeBuilder): Added special handling
1886 for System.Security.Permissions.SecurityAttribute based types.
1888 * rootcontext.cs: Next 2 core types.
1890 * typemanager.cs (TypeManager.security_permission_attr_type):
1891 Built in type for the SecurityPermission Attribute.
1892 (code_access_permission_type): Build in type.
1894 2004-10-17 Miguel de Icaza <miguel@ximian.com>
1896 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
1897 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
1898 all of this information into
1899 EmitContext.EmitCapturedVariableInstance.
1901 * codegen.cs (EmitCapturedVariableInstance): move here the
1902 funcionality of emitting an ldarg.0 in the presence of a
1903 remapping. This centralizes the instance emit code.
1905 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
1906 then emit a load of this: it means that we have reached the
1907 topmost ScopeInfo: the one that contains the pointer to the
1908 instance of the class hosting the anonymous method.
1910 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
1911 captures to the topmost CaptureContext.
1913 2004-10-12 Miguel de Icaza <miguel@ximian.com>
1915 * expression.cs (LocalVariableReference): Move the knowledge about
1916 the iterators into codegen's EmitCapturedVariableInstance.
1918 2004-10-11 Miguel de Icaza <miguel@ximian.com>
1920 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
1921 all code paths return a value from an anonymous method (it is the
1922 same as the 161 error, but for anonymous methods).
1924 2004-10-08 Miguel de Icaza <miguel@ximian.com>
1926 The introduction of anonymous methods in the compiler changed
1927 various ways of doing things in the compiler. The most
1928 significant one is the hard split between the resolution phase
1929 and the emission phases of the compiler.
1931 For instance, routines that referenced local variables no
1932 longer can safely create temporary variables during the
1933 resolution phase: they must do so from the emission phase,
1934 since the variable might have been "captured", hence access to
1935 it can not be done with the local-variable operations from the runtime.
1939 (Block.Flags): New flag `IsTopLevel' to indicate that this block
1940 is a toplevel block.
1942 (ToplevelBlock): A new kind of Block, these are the blocks that
1943 are created by the parser for all toplevel method bodies. These
1944 include methods, accessors and anonymous methods.
1946 These contain some extra information not found in regular blocks:
1947 A pointer to an optional CaptureContext (for tracking captured
1948 local variables and parameters). A pointer to the parent
1951 (Return.Resolve): Catch missmatches when returning a value from an
1952 anonymous method (error 1662).
1953 Invoke NeedReturnLabel from the Resolve phase instead of the emit
1956 (Break.Resolve): ditto.
1958 (SwitchLabel): instead of defining the labels during the
1959 resolution phase, we now turned the public ILLabel and ILLabelCode
1960 labels into methods called GetILLabelCode() and GetILLabel() that
1961 only define the label during the Emit phase.
1963 (GotoCase): Track the SwitchLabel instead of the computed label
1964 (its contained therein). Emit the code by using
1965 SwitchLabel.GetILLabelCode ().
1967 (LocalInfo.Flags.Captured): A new flag has been introduce to track
1968 whether the Local has been captured or not.
1970 (LocalInfo.IsCaptured): New property, used to tell whether the
1971 local has been captured.
1973 * anonymous.cs: Vastly updated to contain the anonymous method
1976 The main classes here are: CaptureContext which tracks any
1977 captured information for a toplevel block and ScopeInfo used to
1978 track the activation frames for various local variables.
1980 Each toplevel block has an optional capture context associated
1981 with it. When a method contains an anonymous method both the
1982 toplevel method and the anonymous method will create a capture
1983 context. When variables or parameters are captured, they are
1984 recorded on the CaptureContext that owns them, for example:
1988 MyDelegate d = delegate {
1993 Here `a' will be recorded as captured on the toplevel
1994 CapturedContext, the inner captured context will not have anything
1995 (it will only have data if local variables or parameters from it
1996 are captured in a nested anonymous method.
1998 The ScopeInfo is used to track the activation frames for local
1999 variables, for example:
2001 for (int i = 0; i < 10; i++)
2002 for (int j = 0; j < 10; j++){
2003 MyDelegate d = delegate {
2008 At runtime this captures a single captured variable `i', but it
2009 captures 10 different versions of the variable `j'. The variable
2010 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
2011 recorded on a child.
2013 The toplevel ScopeInfo will also track information like the `this'
2014 pointer if instance variables were referenced (this is necessary
2015 as the anonymous method lives inside a nested class in the host
2016 type of the method).
2018 (AnonymousMethod): Expanded to track the Toplevel, implement
2019 `AnonymousMethod.Compatible' to tell whether an anonymous method
2020 can be converted to a target delegate type.
2022 The routine now also produces the anonymous method content
2024 (AnonymousDelegate): A helper class that derives from
2025 DelegateCreation, this is used to generate the code necessary to
2026 produce the delegate for the anonymous method that was created.
2028 * assign.cs: API adjustments for new changes in
2029 Convert.ImplicitStandardConversionExists.
2031 * class.cs: Adjustments to cope with the fact that now toplevel
2032 blocks are of type `ToplevelBlock'.
2034 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
2035 insteda of standard blocks.
2037 Flag errors if params arguments are passed to anonymous methods.
2039 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
2040 `CurrentAnonymousMethod' which points to the current Anonymous
2041 Method. The variable points to the AnonymousMethod class that
2042 holds the code being compiled. It is set in the new EmitContext
2043 created for the anonymous method.
2045 (EmitContext.Phase): Introduce a variable and an enumeration to
2046 assist in enforcing some rules about when and where we are allowed
2047 to invoke certain methods (EmitContext.NeedsReturnLabel is the
2048 only one that enfonces this right now).
2050 (EmitContext.HaveCaptureInfo): new helper method that returns
2051 whether we have a CapturedContext initialized.
2053 (EmitContext.CaptureVariable): New method used to register that a
2054 LocalInfo must be flagged for capturing.
2056 (EmitContext.CapturedParameter): New method used to register that a
2057 parameters must be flagged for capturing.
2059 (EmitContext.CapturedField): New method used to register that a
2060 field must be flagged for capturing.
2062 (EmitContext.HaveCapturedVariables,
2063 EmitContext.HaveCapturedFields): Return whether there are captured
2064 variables or fields.
2066 (EmitContext.EmitMethodHostInstance): This is used to emit the
2067 instance for the anonymous method. The instance might be null
2068 (static methods), this (for anonymous methods that capture nothing
2069 and happen to live side-by-side with the current method body) or a
2070 more complicated expression if the method has a CaptureContext.
2072 (EmitContext.EmitTopBlock): Routine that drives the emission of
2073 code: it will first resolve the top block, then emit any metadata
2074 and then emit the code. The split is done so that we can extract
2075 any anonymous methods and flag any captured variables/parameters.
2077 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
2078 during this phase, the ILGenerator should not be used as labels
2079 and local variables declared here might not be accessible to any
2080 code that is part of an anonymous method.
2082 Exceptions to this include the temporary variables that are
2083 created by some statements internally for holding temporary
2086 (EmitContext.EmitMeta): New routine, in charge of emitting all the
2089 (EmitContext.TemporaryReturn): This method is typically called
2090 from the Emit phase, and its the only place where we allow the
2091 ReturnLabel to be defined other than the EmitMeta. The reason is
2092 that otherwise we would have to duplicate a lot of logic in the
2093 Resolve phases of various methods that today is on the Emit
2096 (EmitContext.NeedReturnLabel): This no longer creates the label,
2097 as the ILGenerator is not valid during the resolve phase.
2099 (EmitContext.EmitThis): Extended the knowledge in this class to
2100 work in anonymous methods in addition to iterators.
2102 (EmitContext.EmitCapturedVariableInstance): This emits whatever
2103 code is necessary on the stack to access the instance to a local
2104 variable (the variable will be accessed as a field).
2106 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
2107 EmitContext.EmitAddressOfParameter): Routines to support
2108 parameters (not completed at this point).
2110 Removals: Removed RemapLocal and RemapLocalLValue. We probably
2111 will also remove the parameters.
2113 * convert.cs (Convert): Define a `ConstantEC' which points to a
2114 null. This is just to prefity some code that uses
2115 ImplicitStandardConversion code and do not have an EmitContext
2118 The idea is to flag explicitly that at that point in time, it is
2119 known that the conversion will not trigger the delegate checking
2120 code in implicit conversions (which requires a valid
2123 Everywhere: pass new EmitContext parameter since
2124 ImplicitStandardConversionExists now requires it to check for
2125 anonymous method conversions.
2127 (Convert.ImplicitStandardConversionExists): If the type of an
2128 expression is the anonymous_method_type, and the type is a
2129 delegate, we invoke the AnonymousMethod.Compatible method to check
2130 whether an implicit conversion is possible.
2132 (Convert.ImplicitConversionStandard): Only do implicit method
2133 group conversions if the language level is not ISO_1.
2135 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
2136 MethodInfo for the Invoke method. used by Delegate and
2139 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
2140 method conversions if the target type is a delegate.
2142 Removed extra debugging nops.
2144 (LocalVariableReference): Turn the `local_info' into a public
2147 Add `prepared' field, the same hack used for FieldExprs to cope
2148 with composed assignments, as Local variables do not necessarily
2149 operate purely on the stack as they used to: they can be captured
2152 Add `temp' for a temporary result, like fields.
2154 Refactor DoResolve and DoResolveLValue into DoResolveBase.
2156 It now copes with Local variables that are captured and emits the
2157 proper instance variable to load it from a field in the captured
2160 (ParameterReference.DoResolveBase): During the resolve phase,
2161 capture parameters if we are in an anonymous method.
2163 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
2164 anonymous method, use the EmitContext helper routines to emit the
2165 parameter reference.
2167 * iterators.cs: Set RemapToProxy to true/false during the
2170 * parameters.cs (GetParameterByName): New helper method.
2172 * typemanager.cs (anonymous_method_type) a new type that
2173 represents an anonyous method. This is always an internal type,
2174 used as a fencepost to test against the anonymous-methodness of an
2177 2004-10-20 Marek Safar <marek.safar@seznam.cz>
2179 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
2181 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
2183 2004-11-10 Martin Baulig <martin@ximian.com>
2185 * expression.cs (Invocation.BetterFunction): If two methods have
2186 equal parameter types, but only one of them is generic, the
2187 non-generic one wins.
2188 (New.DoResolve): Don't set `is_struct' to false if we're a generic
2189 instance; just use `Type.IsValueType' to determine whether
2190 something is a struct or not.
2191 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
2192 so we can be called multiple times.
2194 2004-11-10 Martin Baulig <martin@ximian.com>
2196 * generic.cs (TypeParameter.DefineConstraints): New public method.
2197 (TypeParameter.CheckAccessLevel): Override this and return true.
2198 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
2199 override ResolveType() anymore.
2200 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
2202 2004-11-10 Martin Baulig <martin@ximian.com>
2204 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
2205 call DeclSpace.ResolveNestedType() on it.
2207 2004-11-10 Martin Baulig <martin@ximian.com>
2209 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
2210 non-null, call ParameterModifier() on it.
2212 2004-11-10 Martin Baulig <martin@ximian.com>
2215 (Iterators): Added `current_type' and `this_type' fields.
2216 (Iterators.DefineIterator): Create a new EmitContext and store it
2217 in `ec'; compute `this_type'.
2219 2004-11-10 Martin Baulig <martin@ximian.com>
2222 (TypeManager.IsPrivateAccessible): New public method.
2223 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
2225 2004-11-10 Martin Baulig <martin@ximian.com>
2227 * class.cs (TypeContainer.DefineType): Call
2228 TypeBuilder.DefineGenericParameters() before resolving the type
2230 (MethodData.parent_method): New protected field.
2231 (MethodData..ctor): Added `MethodInfo parent_method' argument.
2232 (MethodData.Define): Compute `parent_method'.
2235 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
2236 (MemberCore.GetClsCompliantAttributeValue): Likewise.
2237 (DeclSpace.ec): New protected field; store the EmitContext here.
2238 (DeclSpace.EmitContext): New public property.
2239 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
2240 (DeclSpace.ResolveNestedType): New public method.
2241 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
2242 (DeclSpace.NestedAccessible): Added `Type tb' argument.
2243 (DeclSpace.FamilyAccessible): Likewise.
2244 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
2245 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
2248 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
2251 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
2252 (Enum.Emit): Don't create a new EmitContext.
2254 2004-10-18 Martin Baulig <martin@ximian.com>
2256 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
2257 `Type' directly, but call ResolveType() on it.
2258 (Catch.Resolve): Likewise.
2259 (Foreach.Resolve): Likewise.
2261 2004-10-18 Martin Baulig <martin@ximian.com>
2263 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
2264 `Type' directly, but call ResolveType() on it.
2265 (Probe.DoResolve): Likewise.
2266 (ArrayCreation.LookupType): Likewise.
2267 (TypeOf.DoResolve): Likewise.
2268 (SizeOf.DoResolve): Likewise.
2270 2004-10-18 Raja R Harinath <rharinath@novell.com>
2272 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
2275 2004-10-17 John Luke <john.luke@gmail.com>
2277 * class.cs (Operator.GetSignatureForError): use CSharpName
2279 * parameter.cs (Parameter.GetSignatureForError): Returns
2280 correct name even if was not defined.
2282 2004-10-13 Raja R Harinath <rharinath@novell.com>
2285 * class.cs (TypeContainer.EmitContext): New property.
2286 (DefineNestedTypes): Create an emitcontext for each part.
2287 (MethodCore.DoDefineParameters): Use container's emitcontext.
2288 Pass type array to InternalParameters.
2289 (MemberBase.DoDefine): Use container's emitcontext.
2290 (FieldMember.Define): Likewise.
2291 (Event.Define): Likewise.
2292 (SetMethod.GetParameterInfo): Change argument to EmitContext.
2293 Pass type array to InternalParameters.
2294 (SetIndexerMethod.GetParameterInfo): Likewise.
2295 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2296 * delegate.cs (Define): Pass emitcontext to
2297 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
2298 array to InternalParameters.
2299 * expression.cs (ParameterReference.DoResolveBase): Pass
2300 emitcontext to GetParameterInfo.
2301 (ComposedCast.DoResolveAsTypeStep): Remove check on
2302 ec.ResolvingTypeTree.
2303 * parameter.cs (Parameter.Resolve): Change argument to
2304 EmitContext. Use ResolveAsTypeTerminal.
2305 (Parameter.GetSignature): Change argument to EmitContext.
2306 (Parameters.ComputeSignature): Likewise.
2307 (Parameters.ComputeParameterTypes): Likewise.
2308 (Parameters.GetParameterInfo): Likewise.
2309 (Parameters.ComputeAndDefineParameterTypes): Likewise.
2310 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
2311 * support.cs (InternalParameters..ctor): Remove variant that takes
2313 * typemanager.cs (system_intptr_expr): New.
2314 (InitExpressionTypes): Initialize it.
2316 2004-10-12 Chris Toshok <toshok@ximian.com>
2318 * cs-parser.jay: fix location for try_statement and catch_clause.
2320 2004-10-18 Martin Baulig <martin@ximian.com>
2322 * class.cs (FieldMember.Define): Don't access the TypeExpr's
2323 `Type' directly, but call ResolveType() on it.
2324 (MemberBase.DoDefine): Likewise.
2326 * expression.cs (New.DoResolve): Don't access the TypeExpr's
2327 `Type' directly, but call ResolveType() on it.
2328 (ComposedCast.DoResolveAsTypeStep): Likewise.
2330 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
2331 `Type' directly, but call ResolveType() on it.
2333 2004-10-17 John Luke <john.luke@gmail.com>
2335 * class.cs (Operator.GetSignatureForError): use CSharpName
2337 * parameter.cs (Parameter.GetSignatureForError): Returns
2338 correct name even if was not defined.
2340 2004-10-13 Raja R Harinath <rharinath@novell.com>
2343 * class.cs (TypeContainer.EmitContext): New property.
2344 (DefineNestedTypes): Create an emitcontext for each part.
2345 (MethodCore.DoDefineParameters): Use container's emitcontext.
2346 Pass type array to InternalParameters.
2347 (MemberBase.DoDefine): Use container's emitcontext.
2348 (FieldMember.Define): Likewise.
2349 (Event.Define): Likewise.
2350 (SetMethod.GetParameterInfo): Change argument to EmitContext.
2351 Pass type array to InternalParameters.
2352 (SetIndexerMethod.GetParameterInfo): Likewise.
2353 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2354 * delegate.cs (Define): Pass emitcontext to
2355 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
2356 array to InternalParameters.
2357 * expression.cs (ParameterReference.DoResolveBase): Pass
2358 emitcontext to GetParameterInfo.
2359 (ComposedCast.DoResolveAsTypeStep): Remove check on
2360 ec.ResolvingTypeTree.
2361 * parameter.cs (Parameter.Resolve): Change argument to
2362 EmitContext. Use ResolveAsTypeTerminal.
2363 (Parameter.GetSignature): Change argument to EmitContext.
2364 (Parameters.ComputeSignature): Likewise.
2365 (Parameters.ComputeParameterTypes): Likewise.
2366 (Parameters.GetParameterInfo): Likewise.
2367 (Parameters.ComputeAndDefineParameterTypes): Likewise.
2368 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
2369 * support.cs (InternalParameters..ctor): Remove variant that takes
2371 * typemanager.cs (system_intptr_expr): New.
2372 (InitExpressionTypes): Initialize it.
2374 2004-10-12 Chris Toshok <toshok@ximian.com>
2376 * cs-parser.jay: fix location for try_statement and catch_clause.
2378 2004-10-07 Raja R Harinath <rharinath@novell.com>
2380 More DeclSpace.ResolveType avoidance.
2381 * decl.cs (MemberCore.InUnsafe): New property.
2382 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
2383 with newly created EmitContext.
2384 (FieldMember.Define): Likewise.
2385 * delegate.cs (Delegate.Define): Likewise.
2386 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
2387 only if normal name-lookup fails.
2388 (TypeExpr.DoResolve): Enable error-checking.
2389 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
2390 (SizeOf.DoResolve): Likewise.
2391 (ComposedCast.DoResolveAsTypeStep): Likewise.
2392 (StackAlloc.DoResolve): Likewise.
2393 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
2394 (Block.Unsafe): New property.
2395 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
2396 (Unsafe): Set 'unsafe' flag of contained block.
2397 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
2398 (Fixed.Resolve): Likewise.
2399 (Catch.Resolve): Likewise.
2400 (Using.ResolveLocalVariableDecls): Likewise.
2401 (Foreach.Resolve): Likewise.
2403 2004-10-05 John Luke <john.luke@gmail.com>
2405 * cs-parser.jay: add location to error CS0175
2407 2004-10-04 Miguel de Icaza <miguel@ximian.com>
2409 * ecore.cs (Expression.Constantity): Add support for turning null
2412 * const.cs (Const.Define): Allow constants to be reference types
2413 as long as the value is Null.
2415 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
2417 * namespace.cs (NamespaceEntry.Using): No matter which warning
2418 level is set, check if this namespace name has already been added.
2420 2004-10-03 Ben Maurer <bmaurer@ximian.com>
2422 * expression.cs: reftype [!=]= null should always use br[true,false].
2425 2004-10-03 Marek Safar <marek.safar@seznam.cz>
2428 * attribute.cs: Enum conversion moved to
2429 GetAttributeArgumentExpression to be applied to the all
2432 2004-10-01 Raja R Harinath <rharinath@novell.com>
2434 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
2435 * class.c (TypeContainer.DefineType): Flag error if
2436 base types aren't accessible due to access permissions.
2437 * decl.cs (DeclSpace.ResolveType): Move logic to
2438 Expression.ResolveAsTypeTerminal.
2439 (DeclSpace.ResolveTypeExpr): Thin layer over
2440 Expression.ResolveAsTypeTerminal.
2441 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
2442 Refactor code into NestedAccess. Use it.
2443 (DeclSpace.NestedAccess): New.
2444 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
2445 argument to silence errors. Check access permissions.
2446 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
2447 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
2448 (Cast.DoResolve): Likewise.
2449 (New.DoResolve): Likewise.
2450 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
2451 (TypeOf.DoResolve): Likewise.
2453 * expression.cs (Invocation.BetterConversion): Return the Type of
2454 the better conversion. Implement section 14.4.2.3 more faithfully.
2455 (Invocation.BetterFunction): Make boolean. Make correspondence to
2456 section 14.4.2.2 explicit.
2457 (Invocation.OverloadResolve): Update.
2458 (Invocation): Remove is_base field.
2459 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
2460 (Invocation.Emit): Likewise.
2462 2004-09-24 Marek Safar <marek.safar@seznam.cz>
2464 * cs-parser.jay: Reverted 642 warning fix.
2466 2004-09-23 Marek Safar <marek.safar@seznam.cz>
2469 * decl.cs (FindMemberWithSameName): Indexer can have more than
2472 2004-09-23 Marek Safar <marek.safar@seznam.cz>
2474 * expression.cs (LocalVariableReference.DoResolveLValue):
2475 Do not report warning 219 for out values.
2476 (EmptyExpression.Null): New member to avoid extra allocations.
2478 2004-09-23 Marek Safar <marek.safar@seznam.cz>
2480 * cs-parser.jay: Fix wrong warning 642 report.
2482 * cs-tokenizer.cs (CheckNextToken): New helper;
2483 Inspect next character if is same as expected.
2485 2004-09-23 Martin Baulig <martin@ximian.com>
2487 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2488 (Convert.ImplicitReferenceConversionExists): Likewise.
2490 2004-11-09 Raja R Harinath <rharinath@novell.com>
2492 * Makefile (DISTFILES): Comment out a few missing files.
2494 2004-10-29 Raja R Harinath <rharinath@novell.com>
2496 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
2497 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
2498 (gmcs.exe): Invoke bootstrap-libs.
2499 (clean-local): Clean the net_2_0_bootstrap profile too.
2500 (PROGRAM_INSTALL_DIR): New.
2501 (install-local): Use it.
2503 2004-10-13 Martin Baulig <martin@ximian.com>
2505 * generic.cs (TypeManager.InflatedConstraints): New nested class.
2506 (TypeParameter.DefineType): If we're a method type parameter and
2507 that method is overriding something, "inflate" its constraints.
2509 2004-10-12 Martin Baulig <martin@ximian.com>
2511 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
2512 and have type arguments, create and resolve a ConstructedType.
2514 2004-10-12 Martin Baulig <martin@ximian.com>
2516 * decl.cs (MemberCache.FindMemberToOverride): Use
2517 TypeManager.IsEqual() to compare the parameters and Type.Equals()
2518 to compare the invocationType.
2520 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
2521 When comparing two type parameters, only do the signature-only
2522 comparision for method type parameters.
2524 2004-10-11 Martin Baulig <martin@ximian.com>
2526 * report.cs: Don't make --fatal abort on warnings, we have
2527 -warnaserror for that.
2529 2004-10-11 Martin Baulig <martin@ximian.com>
2532 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
2533 (TypeManager.IsEqual): Call ourself recursively instead of using
2536 2004-10-11 Martin Baulig <martin@ximian.com>
2538 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
2539 on our own type parameters, not on the ones we inherit from a containing
2542 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
2545 * generic.cs (TypeParameter.Define): We may only be called once.
2547 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
2548 instead of TypeManager.IsEqual().
2550 2004-09-28 Martin Baulig <martin@ximian.com>
2553 (GenericConstraints.EffectiveBaseClass): New public property.
2554 (TypeParameter.GenericConstraints): New public property.
2555 (ConstructedType.CheckConstraints): Improved.
2557 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
2558 (Convert.TypeParameterConversion): New private method; use this in
2559 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
2560 for all conversions related to type parameters.
2562 2004-09-24 Martin Baulig <martin@ximian.com>
2564 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
2565 type parameter conversions for type parameters which are known to
2568 2004-09-24 Martin Baulig <martin@ximian.com>
2570 * generic.cs (GenericConstraints): Added `IsReferenceType' and
2571 `IsValueType' properties.
2573 * support.cs (ReflectionConstraints): Use
2574 Type.GetGenericParameterConstraints() instead of the old hack.
2576 2004-09-24 Martin Baulig <martin@ximian.com>
2578 * generic.cs (GenericConstraints): Moved here and made it an
2581 * support.cs (GenericConstraints): Moved to generic.cs.
2583 2004-09-24 Martin Baulig <martin@ximian.com>
2586 (ReflectionConstraints): Un-nested this class and made it public.
2589 (TypeManager.GetTypeParameterConstraints): New public method.
2590 (TypeManager.HasConstructorConstraint): Use the attributes.
2592 2004-09-24 Martin Baulig <martin@ximian.com>
2594 * support.cs (GenericConstraints): Replaced `HasConstructor',
2595 `IsReferenceType' and `IsValueType' with `Attributes'.
2596 (ReflectionParameters.ReflectionConstraints): Removed the Create()
2597 method and made the .ctor public.
2599 * generic.cs (Constraints.Attributes): New public property.
2600 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
2601 `IsReferenceType' -> `HasReferenceTypeConstraint' and
2602 `IsValueType' -> `HasValueTypeConstraint'.
2604 2004-09-23 Martin Baulig <martin@ximian.com>
2606 * generic.cs (Constraints): Reflect latest runtime changes.
2608 2004-09-23 Martin Baulig <martin@ximian.com>
2610 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2611 (Convert.ImplicitReferenceConversionExists): Likewise.
2613 2004-09-23 Marek Safar <marek.safar@seznam.cz>
2615 * class.cs (Operator.Define): Add error 448 and 559 report.
2617 2004-09-22 Marek Safar <marek.safar@seznam.cz>
2619 * class.cs (MemberBase.IsTypePermitted): New protected
2620 method for checking error CS0610.
2622 2004-09-22 Marek Safar <marek.safar@seznam.cz>
2624 * class.cs (TypeContainer.HasExplicitLayout): New property
2625 Returns whether container has StructLayout attribute set Explicit.
2626 (FieldMember): New abstract class for consts and fields.
2627 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
2628 (Field): Reuse FieldMember.
2630 * const.cs (Const): Reuse FieldMember.
2632 * rootcontext.cs: EmitConstants call moved to class.
2634 2004-09-22 Martin Baulig <martin@ximian.com>
2636 Marek and me just fixed one of our oldest bugs: #28562 :-)
2638 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
2640 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
2641 we're an EnumConstant, just return that.
2642 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
2643 an EnumConstant. In this case, we need to use GetValueAsEnumType()
2644 to get the value which'll actually be written into the attribute.
2645 However, we have to use GetValue() to access the attribute's value
2648 2004-09-22 Marek Safar <marek.safar@seznam.cz>
2650 * constant.cs (Constant.IsNegative): New abstract property
2653 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
2654 (StackAlloc.DoResolve): Reused IsNegative.
2656 2004-09-22 Martin Baulig <martin@ximian.com>
2658 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
2659 public method; like LookupTypeContainer, but also works for
2662 * report.cs (Report.SymbolRelatedToPreviousError): Use
2663 TypeManager.LookupGenericTypeContainer().
2665 2004-09-22 Martin Baulig <martin@ximian.com>
2667 Thanks to Peter Sestoft for this bug report.
2669 * expression.cs (Conditional): If both the `trueExpr' and the
2670 `falseExpr' is a NullLiteral, return a NullLiteral.
2672 2004-09-22 Martin Baulig <martin@ximian.com>
2674 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
2675 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
2676 for the "get_Current" call.
2678 2004-09-21 Martin Baulig <martin@ximian.com>
2680 * convert.cs (Convert.ImplicitReferenceConversion): When
2681 converting to an interface type, first check whether we're
2682 converting from a reference type.
2684 2004-09-14 Martin Baulig <martin@ximian.com>
2686 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
2688 2004-09-14 Marek Safar <marek.safar@seznam.cz>
2691 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
2692 called and is obsolete then this member suppress message
2693 when call is inside next [Obsolete] method or type.
2695 * expression.cs: Use TestObsoleteMethodUsage member.
2697 2004-09-14 Martin Baulig <martin@ximian.com>
2699 * genericparser.cs: Removed.
2701 2004-09-13 Marek Safar <marek.safar@seznam.cz>
2703 * class.cs (MethodCore.CheckBase): Fix bug #65757.
2705 2004-09-12 Marek Safar <marek.safar@seznam.cz>
2707 * attribute.cs (Attribute.Resolve): Add error 653 report.
2709 * class.cs (Class.ApplyAttributeBuilder): Add error 641
2711 (Method.ApplyAttributeBuilder): Add error 685 report.
2712 (Operator.Define): Add error 564 report.
2714 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
2716 * expression.cs (Invocation.DoResolve): Add error
2719 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
2722 2004-09-11 Marek Safar <marek.safar@seznam.cz>
2724 * class.cs (ConstructorInitializer.Resolve):
2725 Wrong error number (515->516).
2727 2004-09-11 Marek Safar <marek.safar@seznam.cz>
2729 * class.cs (Indexer.Define): Add error 631 report.
2731 2004-09-11 Marek Safar <marek.safar@seznam.cz>
2733 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
2735 2004-09-11 Marek Safar <marek.safar@seznam.cz>
2737 * expression.cs (Probe.DoResolve): Add error CS0241 report.
2739 2004-09-10 Marek Safar <marek.safar@seznam.cz>
2741 * cs-parser.jay: Added error CS0241 report.
2743 2004-09-10 Raja R Harinath <rharinath@novell.com>
2745 * cs-parser.jay (fixed_statement): Introduce a scope for the
2746 declaration in the 'fixed' statement.
2748 2004-09-09 Marek Safar <marek.safar@seznam.cz>
2750 * cs-parser.jay: Added CS0230 error report.
2752 2004-09-09 Marek Safar <marek.safar@seznam.cz>
2754 * cs-parser.jay: Added errors CS0231 and CS0257 report.
2756 2004-09-09 Marek Safar <marek.safar@seznam.cz>
2758 * expression.cs (Argument.Resolve): Added error CS0192 and
2761 2004-09-09 Marek Safar <marek.safar@seznam.cz>
2763 C# 2.0 #pragma warning feature
2765 * cs-tokenizer.cs (PreProcessPragma): New method;
2766 Handles #pragma directive.
2768 * report.cs (WarningRegions): New class; Support
2769 class for #pragma warning directive. It tests whether
2770 warning is enabled for a given line.
2772 2004-09-08 Miguel de Icaza <miguel@ximian.com>
2774 * const.cs: Add more descriptive error report, tahnks to
2777 2004-09-08 Marek Safar <marek.safar@seznam.cz>
2779 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
2781 2004-09-07 Miguel de Icaza <miguel@ximian.com>
2783 * expression.cs: Apply patch from Ben: Remove dead code from
2784 ArrayCreation, and remove the TurnintoConstant call in const.cs,
2785 as that code just threw an exception anwyays.
2787 * const.cs: Remove the call to the turnintoconstant, for details
2790 * literal.cs: The type of the null-literal is the null type; So
2791 we use a placeholder type (literal.cs:System.Null, defined here)
2794 * expression.cs (Conditional.DoResolve): Remove some old code that
2795 is no longer needed, conversions have been fixed.
2797 (ArrayCreationExpression.DoResolve): Return false if we fail to
2798 resolve the inner expression.
2800 2004-09-07 Raja R Harinath <rharinath@novell.com>
2803 * cs-parser.jay (delegate_declaration): Record a delegate
2804 declaration as a type declaration.
2805 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
2807 2004-09-06 Miguel de Icaza <miguel@ximian.com>
2809 * parameter.cs: Do not crash if the type can not be resolved.
2811 * expression.cs: Report errors with unsafe pointers, fixes #64896
2813 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
2815 * expression.cs: Pointer arith always needs to do a conv.i
2816 if the operand is a long. fix 65320
2818 2004-09-04 Marek Safar <marek.safar@seznam.cz>
2820 Fixed cs0619-37.cs, cs0619-38.cs
2822 * enum.cs (GetObsoleteAttribute): Removed.
2824 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
2825 on Enum member is double staged. The first is tested member
2828 2004-09-04 Marek Safar <marek.safar@seznam.cz>
2830 Fixed #56986, #63631, #65231
2832 * class.cs: (TypeContainer.AddToMemberContainer): New method,
2833 adds member to name container.
2834 (TypeContainer.AddToTypeContainer): New method, adds type to
2836 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
2837 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
2838 AddOperator): Simplified by reusing AddToMemberContainer.
2839 (TypeContainer.UserDefinedStaticConstructor): Changed to property
2841 (Method.CheckForDuplications): Fixed implementation to test all
2843 (MemberBase): Detection whether member is explicit interface
2844 implementation is now in constructor.
2845 (MemberBase.UpdateMemberName): Handles IndexerName.
2846 (Accessor): Changed to keep also location information.
2847 (AbstractPropertyEventMethod): Is derived from MemberCore.
2848 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
2849 will be emited or not.
2850 (PropertyBase.AreAccessorsDuplicateImplementation):
2851 Tests whether accessors are not in collision with some method.
2852 (Operator): Is derived from MethodCore to simplify common
2855 * decl.cs (Flags.TestMethodDuplication): Test for duplication
2857 (DeclSpace.AddToContainer): Adds the member to defined_names
2858 table. It tests for duplications and enclosing name conflicts.
2860 * enum.cs (EnumMember): Clean up to reuse the base structures
2862 2004-09-03 Martin Baulig <martin@ximian.com>
2864 Merged latest changes into gmcs. Please keep this comment in
2865 here, it makes it easier for me to see what changed in MCS since
2866 the last time I merged.
2868 2004-09-03 Martin Baulig <martin@ximian.com>
2870 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2871 into TypeContainer, to make partial classes work again.
2873 2004-09-03 Martin Baulig <martin@ximian.com>
2875 * rootcontext.cs (RootContext.V2): Removed.
2877 2004-03-23 Martin Baulig <martin@ximian.com>
2879 * expression.cs (Invocation.OverloadResolve): Added `bool
2880 may_fail' argument and use it instead of the Location.IsNull() hack.
2882 2004-09-09 Martin Baulig <martin@ximian.com>
2884 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
2886 2004-09-09 Martin Baulig <martin@ximian.com>
2888 * generic.cs (TypeParameter.DefineType): Added support for
2889 explicit interface methods.
2891 2004-09-09 Martin Baulig <martin@ximian.com>
2893 * README.Changes: New document. Started to list important changes
2894 between MCS and GMCS here.
2896 2004-09-08 Martin Baulig <martin@ximian.com>
2899 (TypeContainer.CheckRecursiveDefinition): New protected method.
2900 (TypeContainer.DefineType): Move the CS0146 check into
2901 CheckRecursiveDefinition().
2903 2004-09-06 Martin Baulig <martin@ximian.com>
2905 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
2906 types for the constructor constraint.
2908 2004-09-03 Martin Baulig <martin@ximian.com>
2910 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
2911 into TypeContainer, to make partial classes work again.
2913 2004-09-03 Martin Baulig <martin@ximian.com>
2915 * rootcontext.cs (RootContext.V2): Removed.
2917 2004-03-23 Martin Baulig <martin@ximian.com>
2919 * expression.cs (Invocation.OverloadResolve): Added `bool
2920 may_fail' argument and use it instead of the Location.IsNull() hack.
2922 2004-09-03 Martin Baulig <martin@ximian.com>
2924 Merged latest changes into gmcs. Please keep this comment in
2925 here, it makes it easier for me to see what changed in MCS since
2926 the last time I merged.
2928 2004-09-03 Raja R Harinath <rharinath@novell.com>
2931 * expression.cs (BetterConversion): Don't allow either conversion
2932 to be null. Remove redundant implicit conversion test when 'q ==
2933 null' -- when this function is invoked, we already know that the
2934 implicit conversion exists.
2935 (BetterFunction): Assume that 'best' is non-null. Remove
2936 redundant reimplementation of IsApplicable when 'best' is null.
2937 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
2938 number of arguments.
2939 (IsAncestralType): Extract from OverloadResolve.
2940 (OverloadResolve): Make robust to the MethodGroupExpr being
2941 unsorted. Implement all the logic of Section 14.5.5.1, and
2942 support overloading of methods from multiple applicable types.
2943 Clean up logic somewhat. Don't pass null methods to BetterFunction.
2945 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
2946 (RealError, Warning): Append type of report to related symbol.
2948 2004-09-03 Marek Safar <marek.safar@seznam.cz>
2950 * enum.cs: Fixed CLS-Compliance checks for enum members.
2951 Error tests cs3008-8.cs, cs3014-8.cs
2953 2004-09-02 Marek Safar <marek.safar@seznam.cz>
2955 Fixed bug #62342, #63102
2956 * class.cs: ImplementIndexer uses member.IsExplicitImpl
2957 like ImplementMethod.
2959 2004-09-02 Marek Safar <marek.safar@seznam.cz>
2961 * attribute.cs (Attribute.GetAttributeArgumentExpression):
2964 2004-09-02 Martin Baulig <martin@ximian.com>
2966 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
2967 TypeManager.GetArgumentTypes() rather than calling GetParameters()
2970 2004-09-01 Marek Safar <marek.safar@seznam.cz>
2972 C# 2.0 Static classes implemented
2974 * class.cs (TypeContainer): instance_constructors,
2975 initialized_fields, initialized_static_fields,
2976 default_constructor, base_inteface_types are protected to be
2977 accessible from StaticClass.
2978 (TypeContainer.DefineDefaultConstructor): New virtual method
2979 for custom default constructor generating
2980 (StaticClass): New class to handle "Static classes" feature.
2982 * cs-parser.jay: Handle static keyword on class like instance
2985 * driver.cs: Added "/langversion" command line switch with two
2986 options (iso-1, default).
2988 2004-08-31 Marek Safar <marek.safar@seznam.cz>
2990 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
2992 2004-08-31 Miguel de Icaza <miguel@ximian.com>
2994 * delegate.cs: Style.
2996 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
2998 * delegate.cs: Add seperate instance expr field for miguel.
3000 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
3002 * PointerArithmetic (Resolve): make sure we are not doing
3003 pointer arith on void*. Also, make sure we are resolved
3004 by not setting eclass until resolve.
3006 All callers: Make sure that PointerArithmetic gets resolved.
3008 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
3010 * ArrayCreation (LookupType): If the type does not resolve
3011 to an array, give an error.
3013 2004-08-27 Marek Safar <marek.safar@seznam.cz>
3015 * statement.cs (Try.Resolve): Fixed bug #64222
3017 2004-08-27 Martin Baulig <martin@ximian.com>
3020 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
3023 2004-08-26 Marek Safar <marek.safar@seznam.cz>
3025 * ecore.cs (Constantify): Get underlying type via
3026 System.Enum.GetUnderlyingType to avoid StackOverflow on the
3027 Windows in special cases.
3029 2004-08-26 Marek Safar <marek.safar@seznam.cz>
3031 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
3032 for obtaining also private methods.
3033 (GetRemoveMethod): Used GetRemoveMethod (true)
3034 for obtaining also private methods.
3036 2004-09-02 Martin Baulig <martin@ximian.com>
3038 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
3039 TypeManager.GetArgumentTypes() rather than calling GetParameters()
3042 2004-08-27 Martin Baulig <martin@ximian.com>
3045 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
3048 2004-08-25 Martin Baulig <martin@ximian.com>
3050 * support.cs (ReflectionParameters..ctor): If this is a generic
3051 method, retrieve and store its type parameters.
3052 (InternalParameters..ctor): Added `TypeParameter[]' argument.
3053 (ReflectionParameters.GenericConstraints): The argument specifies
3054 the type parameter, not the method parameter.
3055 (InternalParameters.GenericConstraints): Likewise.
3057 * generic.cs (TypeParameter.DefineType): Correctly handle
3058 constraints wrt. generic methods in interfaces and their
3061 2004-08-24 Martin Baulig <martin@ximian.com>
3063 * generic.cs (TypeParameter.IsSubclassOf): New public method.
3064 (Constraints.IsSubclassOf): New internal method.
3066 * typemanager.cs (TypeManager.FindMembers): Added special support
3067 for GenericTypeParameterBuilder's.
3068 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
3071 2004-08-24 Martin Baulig <martin@ximian.com>
3074 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3075 this for accessibility checks.
3076 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3077 IsNestedFamilyAccessible.
3078 (TypeManager.IsSubclassOf): New method, do what the name actually
3081 2004-08-24 Martin Baulig <martin@ximian.com>
3083 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
3084 as a SimpleName, include the generic arity.
3086 2004-08-24 Martin Baulig <martin@ximian.com>
3088 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
3089 MethodAttributes.HideBySig for operators.
3091 2004-08-23 Martin Baulig <martin@ximian.com>
3093 Back to the old error reporting system :-)
3095 * report.cs (Message): Removed.
3096 (Report.MessageData, ErrorData, WarningData): Removed.
3097 (Report.Error, Warning): Back to the old system.
3099 2004-08-23 Martin Baulig <martin@ximian.com>
3101 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
3103 * class.cs (TypeContainer.ParentContainer): New public virtual
3104 method; replaces the explicit interface implementation.
3105 (ClassPart.ParentContainer): Override.
3107 2004-08-23 Martin Baulig <martin@ximian.com>
3109 * statement.cs (Switch): Added support for constant switches; see
3110 #59428 or test-285.cs.
3112 2004-08-22 Marek Safar <marek.safar@seznam.cz>
3115 * statement.cs (GetEnumeratorFilter): Removed useless
3116 logic because C# specs is strict. GetEnumerator must be
3119 2004-08-22 Martin Baulig <martin@ximian.com>
3121 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3122 a switch and may break, reset the barrier. Fixes #59867.
3124 2004-08-22 Marek Safar <marek.safar@seznam.cz>
3126 CLS-Compliance speed up (~5% for corlib)
3128 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
3129 New method. Tests container for CLS-Compliant names
3131 * class.cs (TypeContainer.VerifyClsName): New method.
3132 Checks whether container name is CLS Compliant.
3133 (Constructor): Implements IMethodData.
3135 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
3136 low-case table for CLS Compliance test.
3137 (MemberCache.VerifyClsParameterConflict): New method.
3138 Checks method parameters for CS3006 error.
3140 * enum.cs (EnumMember): Is derived from MemberCore.
3141 (Enum.VerifyClsName): Optimized for better performance.
3143 2004-08-06 Marek Safar <marek.safar@seznam.cz>
3145 * report.cs: Renamed Error_T to Error and changed all
3148 2004-08-06 Marek Safar <marek.safar@seznam.cz>
3150 * class.cs (TypeContainer.IndexerArrayList): New inner class
3151 container for indexers.
3152 (TypeContainer.DefaultIndexerName): New constant for default
3153 indexer name. Replaced all "Item" with this constant.
3154 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
3156 * typemanager.cs (TypeManager.default_member_ctor): Cache here
3157 DefaultMemberAttribute constructor.
3159 2004-08-05 Martin Baulig <martin@ximian.com>
3161 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3164 2004-08-05 Marek Safar <marek.safar@seznam.cz>
3166 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
3167 multi platforms problem.
3169 * compiler.csproj: Included shared files.
3171 2004-08-04 Marek Safar <marek.safar@seznam.cz>
3173 Fix bug 60333, 55971 in the more general way
3174 * attribute.cs (Attribute.GetAttributeArgumentExpression):
3175 Added arg_type argument for constant conversion.
3176 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
3178 2004-08-04 Marek Safar <marek.safar@seznam.cz>
3181 * class.cs (TypeContainer ): New inner classes MethodArrayList,
3182 OperatorArrayList, MethodCoreArrayList for typecontainer
3183 containers. Changed class member types to these new types.
3184 (MethodArrayList.DefineMembers): Added test for CS0659.
3186 2004-08-04 Miguel de Icaza <miguel@ximian.com>
3188 * cfold.cs: Synchronize the folding with the code in expression.cs
3189 Binary.DoNumericPromotions for uint operands.
3191 * attribute.cs: Revert patch from Raja, it introduced a regression
3192 while building Blam-1.2.1 (hard to isolate a test case).
3194 2004-08-04 Marek Safar <marek.safar@seznam.cz>
3198 (TypeContainer.Define): Renamed to DefineContainerMembers because of
3200 (MethodCore.parent_method): New member. The method we're overriding
3201 if this is an override method.
3202 (MethodCore.CheckBase): Moved from Method class and made common.
3203 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
3205 (MethodCore.CheckForDuplications): New abstract method. For custom
3206 member duplication search in a container
3207 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
3208 method and its return type.
3209 (Event.conflict_symbol): New member. Symbol with same name in the
3213 (MemberCache.FindMemberWithSameName): New method. The method
3214 is looking for conflict with inherited symbols.
3216 2004-08-04 Martin Baulig <martin@ximian.com>
3218 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3220 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3222 2004-08-03 Marek Safar <marek.safar@seznam.cz>
3224 * report.cs (Message): New enum for better error, warning reference in
3226 (MessageData): New inner abstract class. It generally handles printing of
3227 error and warning messages.
3228 Removed unused Error, Warning, Message methods.
3230 2004-08-03 Marek Safar <marek.safar@seznam.cz>
3232 Fix for cs0592-8.cs test
3234 (Attributable.ValidAttributeTargets): Made public.
3235 (Attribute.ExplicitTarget): New member for explicit target value.
3236 (Attribute.CheckTargets): Now we translate explicit attribute
3237 target to Target here.
3239 2004-08-03 Ben Maurer <bmaurer@ximian.com>
3241 * ecore.cs (MethodGroupExpr): new IsBase property.
3243 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
3245 * delegate.cs (DelegateCreation): store a MethodGroupExpr
3246 rather than an instance expr.
3248 (DelegateCreation.Emit): Use the method group rather than
3249 the instance expression. Also, if you have base.Foo as the
3250 method for a delegate, make sure to emit ldftn, not ldftnvirt.
3252 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
3254 (NewDelegate.DoResolve): Only check for the existance of Invoke
3255 if the method is going to be needed. Use MethodGroupExpr.
3257 (NewDelegate.Emit): Remove, DelegateCreation implements this.
3259 * expression.cs: For pointer arith., make sure to use
3260 the size of the type, not the size of the pointer to
3263 2004-08-03 Marek Safar <marek.safar@seznam.cz>
3266 * class.cs (Class): Added error CS0502 test.
3268 2004-08-03 John Luke <jluke@cfl.rr.com>
3269 Raja R Harinath <rharinath@novell.com>
3272 * attribute.cs (Attribute.complained_before): New flag.
3273 (Attribute.ResolveType, Attribute.Resolve),
3274 (Attribute.DefinePInvokeMethod): Set it.
3275 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
3277 2004-08-03 Martin Baulig <martin@ximian.com>
3279 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3280 use a user-defined operator; we still need to do numeric
3281 promotions in case one argument is a builtin type and the other
3282 one has an implicit conversion to that type. Fixes #62322.
3284 2004-08-18 Martin Baulig <martin@ximian.com>
3286 * class.cs (Method.Define): Use the correct method name when
3287 creating the MethodBuilder for a generic method.
3289 2004-08-17 Martin Baulig <martin@ximian.com>
3291 * generic.cs (Constraints): Support type parameter constraints.
3293 2004-08-16 Martin Baulig <martin@ximian.com>
3295 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
3296 (Token.GENERIC_DIMENSION): New token; this is returned if we
3297 encounter an unbound generic type in a typeof() expression.
3299 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
3300 this token is only generated while parsing a typeof() expression.
3301 (typeof_expression): Removed the old unbound_type hack.
3303 * generic.cs (TypeArguments.IsUnbound): New public property.
3305 * decl.cs (MemberName): Added support for unbound types.
3307 2004-08-14 Martin Baulig <martin@ximian.com>
3310 (TypeManager.IsEqualGenericInstance): New static method.
3311 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
3312 just used to check accessibility, so follow the rules of 26.1.6.
3314 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
3315 ConstructedType instead of a TypeExpression if we have type arguments.
3317 * cs-parser.jay (typeof_expression): Support unbound generic types.
3319 * ecore.cs (UnboundTypeExpression): New public class.
3321 2004-08-12 Martin Baulig <martin@ximian.com>
3323 * typemanager.cs (TypeManager.IsNestedChildOf): Use
3324 TypeManager.IsEqual() rather than `=='.
3326 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
3327 generic instances as well.
3329 2004-08-12 Martin Baulig <martin@ximian.com>
3331 * expression.cs (Invocation.InferType): We can only infer method
3332 type parameters. Fixes #62647.
3334 2004-08-11 Martin Baulig <martin@ximian.com>
3336 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
3337 before resolving the base classes.
3339 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
3341 * Makefile: install .mdb file too.
3343 2004-08-05 Martin Baulig <martin@ximian.com>
3345 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
3346 initializer, the current type is just the TypeBuilder, not the
3347 instantiated generic type.
3348 (FieldExpr.IsFieldInitializer): New public property.
3350 2004-08-04 Martin Baulig <martin@ximian.com>
3352 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3354 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3356 2004-08-03 Martin Baulig <martin@ximian.com>
3358 * class.cs (MethodData.Define): If we're an explicit
3359 implementation, remove the generic arity from the type name.
3361 2004-08-03 Martin Baulig <martin@ximian.com>
3363 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3364 use a user-defined operator; we still need to do numeric
3365 promotions in case one argument is a builtin type and the other
3366 one has an implicit conversion to that type. Fixes #62322.
3368 2004-08-02 Martin Baulig <martin@ximian.com>
3370 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
3372 (TypeContainer.GetClassBases): Return the unexpanded list of
3373 interfaces; we expand them later.
3374 (TypeContainer.DefineType): After creating the TypeBuilder, call
3375 TypeManager.ExpandInterfaces() to get an expanded and resolved
3378 * ecore.cs (TypeExpr.GetInterfaces): Removed
3380 * generics.cs (Constraints.InterfaceConstraints): Remove.
3381 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
3382 register the interface constraints.
3385 (TypeManager.AddUserType): Removed the `ifaces' argument.
3386 (TypeManager.AddTypeParameter): Likewise.
3387 (TypeManager.AddUserInterface): Removed, was unused.
3388 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
3389 `TypeExpr[]' array for the interfaces.
3390 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
3391 has been defined, returns a list of the resolved interfaces types.
3392 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
3393 (TypeManager.GetExplicitInterfaces): Likewise.
3395 2004-08-02 Martin Baulig <martin@ximian.com>
3397 * expression.cs (Invocation.EmitCall): If we're invoking a method
3398 on a type parameter, use the new `Constrained' prefix opcode.
3400 2004-08-02 Martin Baulig <martin@ximian.com>
3402 * statement.cs (LocalInfo.Flags): Added `IsThis'.
3403 (LocalInfo.IsThis): New public property.
3404 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
3406 2004-08-01 Martin Baulig <martin@ximian.com>
3408 * class.cs (TypeContainer.GetClassBases): Don't set the default
3409 here since we may get called from GetPartialBases().
3410 (TypeContainer.DefineType): If GetClassBases() didn't return a
3411 parent, use the default one.
3413 2004-07-30 Martin Baulig <martin@ximian.com>
3415 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
3417 * class.cs (SourceMethod): New public class, derive from the
3418 symbol writer's ISourceMethod.
3419 (Method): Use the new symbol writer API.
3421 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
3422 as argument and use the new symbol writer.
3425 (SourceFile): Implement the symbol writer's ISourceFile.
3426 (Location.SymbolDocument): Removed.
3427 (Location.SourceFile): New public property.
3429 * symbolwriter.cs: Use the new symbol writer API.
3431 2004-07-30 Raja R Harinath <rharinath@novell.com>
3433 * Makefile (install-local): Remove. Functionality moved to
3436 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
3438 * Makefile: Install mcs.exe.config file together with mcs.exe.
3439 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
3440 correct runtime version.
3442 2004-07-25 Martin Baulig <martin@ximian.com>
3445 (TypeContainer.RegisterOrder): Removed, this was unused.
3446 (TypeContainer, interface_order): Removed.
3447 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
3448 TypeContainer as argument since we can also be called with a
3449 `PartialContainer' for a partial class/struct/interface.
3450 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
3451 of checking whether we're an `Interface' - we could be a
3453 (PartialContainer.Register): Override; call
3454 AddClass()/AddStruct()/AddInterface() on our parent.
3456 * cs-parser.jay (interface_member_declaration): Add things to the
3457 `current_container', not the `current_class'.
3459 * rootcontext.cs (RegisterOrder): The overloaded version which
3460 takes an `Interface' was unused, removed.
3462 * typemanager.cs (TypeManager.LookupInterface): Return a
3463 `TypeContainer', not an `Interface'.
3464 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
3465 contain a `PartialContainer' for an interface, so check it's
3466 `Kind' to figure out what it is.
3468 2004-07-25 Martin Baulig <martin@ximian.com>
3470 * class.cs (Class.DefaultTypeAttributes): New public constant.
3471 (Struct.DefaultTypeAttributes): Likewise.
3472 (Interface.DefaultTypeAttributes): Likewise.
3473 (PartialContainer.TypeAttr): Override this and add the
3474 DefaultTypeAttributes.
3476 2004-07-25 Martin Baulig <martin@ximian.com>
3478 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
3479 we can just use the `Parent' field instead.
3481 2004-07-25 Martin Baulig <martin@ximian.com>
3483 * class.cs (TypeContainer.Emit): Renamed to EmitType().
3485 2004-07-25 Martin Baulig <martin@ximian.com>
3487 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
3488 our parts before defining any methods.
3489 (TypeContainer.VerifyImplements): Make this virtual.
3490 (ClassPart.VerifyImplements): Override and call VerifyImplements()
3491 on our PartialContainer.
3493 2004-07-25 Martin Baulig <martin@ximian.com>
3495 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
3497 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
3498 argument, we can just use the `Parent' field instead.
3501 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
3502 (MemberBase.DoDefine): Likewise.
3504 2004-07-24 Martin Baulig <martin@ximian.com>
3506 * decl.cs (MemberCore.Parent): New public field.
3507 (DeclSpace.Parent): Moved to MemberCore.
3509 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
3510 (MemberBase.ctor): Added TypeContainer argument, pass it to our
3512 (FieldBase, Field, Operator): Likewise.
3513 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
3514 (EventField, Event): Likewise.
3516 2004-07-23 Martin Baulig <martin@ximian.com>
3518 * class.cs (PartialContainer): New public class.
3519 (ClassPart): New public class.
3520 (TypeContainer): Added support for partial classes.
3521 (TypeContainer.GetClassBases): Splitted some of the functionality
3522 out into GetNormalBases() and GetPartialBases().
3524 * cs-tokenizer.cs (Token.PARTIAL): New token.
3525 (Tokenizer.consume_identifier): Added some hacks to recognize
3526 `partial', but only if it's immediately followed by `class',
3527 `struct' or `interface'.
3529 * cs-parser.jay: Added support for partial clases.
3531 2004-07-23 Martin Baulig <martin@ximian.com>
3533 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
3534 a `DeclSpace' and also made it readonly.
3535 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
3536 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
3537 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
3539 * cs-parser.jay: Pass the `current_class', not the
3540 `current_container' (at the moment, this is still the same thing)
3541 to a new Method, Property, Event, Indexer or Constructor.
3543 2004-07-23 Martin Baulig <martin@ximian.com>
3545 * cs-parser.jay (CSharpParser): Added a new `current_class' field
3546 and removed the `current_interface' one.
3547 (struct_declaration, class_declaration, interface_declaration):
3548 Set `current_class' to the newly created class/struct/interface;
3549 set their `Bases' and call Register() before parsing their body.
3551 2004-07-23 Martin Baulig <martin@ximian.com>
3553 * class.cs (Kind): New public enum.
3554 (TypeContainer): Made this class abstract.
3555 (TypeContainer.Kind): New public readonly field.
3556 (TypeContainer.CheckDef): New public method; moved here from
3558 (TypeContainer.Register): New public abstract method.
3559 (TypeContainer.GetPendingImplementations): New public abstract
3561 (TypeContainer.GetClassBases): Removed the `is_class' and
3562 `is_iface' parameters.
3563 (TypeContainer.DefineNestedTypes): Formerly known as
3565 (ClassOrStruct): Made this class abstract.
3567 * tree.cs (RootTypes): New public type.
3569 2004-07-20 Martin Baulig <martin@ximian.com>
3571 * tree.cs (Tree.RecordNamespace): Removed.
3572 (Tree.Namespaces): Removed.
3574 * rootcontext.cs (RootContext.IsNamespace): Removed.
3576 * cs-parser.jay (namespace_declaration): Just create a new
3577 NamespaceEntry here.
3579 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
3581 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
3582 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
3583 entry to make sure it runs in the correct runtime version.
3585 2004-07-18 Martin Baulig <martin@ximian.com>
3587 * generic.cs (ConstructedType.CheckConstraints): Improved
3588 constraints checking.
3590 2004-07-18 Martin Baulig <martin@ximian.com>
3592 * expression.cs (Invocation.BetterMethod): Call
3593 TypeManager.TypeToCoreType() on all types and removed my previous
3594 hack; we're already doig the right thing here.
3596 2004-07-17 Martin Baulig <martin@ximian.com>
3598 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
3600 2004-07-16 Martin Baulig <martin@ximian.com>
3602 * iterators.cs: Added generics support.
3604 2004-07-16 Martin Baulig <martin@ximian.com>
3606 * iterators.cs: Rewrote this. We're now using one single Proxy
3607 class for both the IEnumerable and the IEnumerator interface and
3608 `Iterator' derives from Class so we can use the high-level API.
3610 * class.cs (TypeContainer.AddIterator): New method.
3611 (TypeContainer.DoDefineType): New protected virtual method, which
3612 is called from DefineType().
3613 (TypeContainer.DoDefineMembers): Call DefineType() and
3614 DefineMembers() on all our iterators.
3615 (TypeContainer.Emit): Call Emit() on all our iterators.
3616 (TypeContainer.CloseType): Call CloseType() on all our iterators.
3618 * codegen.cs (EmitContext.CurrentIterator): New public field.
3620 2004-07-15 Martin Baulig <martin@ximian.com>
3623 (TypeManager.not_supported_exception_type): New type.
3625 2004-07-14 Martin Baulig <martin@ximian.com>
3628 (TypeManager.generic_ienumerable_type): New type.
3629 (TypeManager.generic_ienumerator_type): New type.
3632 (RootContext.interfaces_first_stage): Added
3633 "System.Collections.Generic.IEnumerator`1" and
3634 "System.Collections.Generic.IEnumerable`1".
3636 2004-07-14 Martin Baulig <martin@ximian.com>
3638 * iterators.cs: Use real error numbers.
3640 2004-07-14 Martin Baulig <martin@ximian.com>
3642 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
3643 requires this to be a System.Collection.IEnumerable and not a
3644 class implementing that interface.
3645 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
3647 2004-07-13 Marek Safar <marek.safar@seznam.cz>
3649 * class.cs: Fixed previous fix, it broke some error tests.
3651 2004-07-12 Martin Baulig <martin@ximian.com>
3653 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
3656 2004-07-14 Martin Baulig <martin@ximian.com>
3658 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
3659 an exclamation mark (!) for the generic arity to reflect the
3660 latest spec changes; ie. use "System.Collections.Generic.IList`1".
3662 2004-07-13 Martin Baulig <martin@ximian.com>
3664 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
3665 specifiers being part of a type argument.
3667 2004-07-13 Martin Baulig <martin@ximian.com>
3669 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
3670 name for generic types.
3672 2004-07-13 Martin Baulig <martin@ximian.com>
3674 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
3677 2004-07-09 Miguel de Icaza <miguel@ximian.com>
3679 * assign.cs (LocalTemporary): Add new argument: is_address,If
3680 `is_address' is true, then the value that we store is the address
3681 to the real value, and not the value itself.
3683 * ecore.cs (PropertyExpr): use the new local temporary
3684 stuff to allow us to handle X.Y += z (where X is a struct)
3686 2004-07-08 Martin Baulig <martin@ximian.com>
3688 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
3689 not always return, just like we're doing in Using.Resolve().
3691 2004-07-07 Miguel de Icaza <miguel@ximian.com>
3693 * cs-parser.jay (fixed_statement): flag this as Pinned.
3695 2004-07-06 Miguel de Icaza <miguel@ximian.com>
3697 * typemanager.cs (TypeManager): Removed MakePinned method, this
3698 mechanism is replaced with the .NET 2.x compatible mechanism of
3699 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
3701 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
3702 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
3703 `IsFixed' property which has a different meaning.
3705 2004-07-02 Raja R Harinath <rharinath@novell.com>
3707 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
3708 visible from inside a nested class, not just the names of the
3709 immediately enclosing class.
3712 2004-06-24 Raja R Harinath <rharinath@novell.com>
3714 * expression.cs (BetterConversion): Remove buggy special-case
3715 handling of "implicit constant expression conversions". At this
3716 point, we already know that the conversion is possible -- we're
3717 only checking to see which is better.
3719 2004-06-24 Marek Safar <marek.safar@seznam.cz>
3721 * cs-parser.jay: Added error CS0210 test.
3723 2004-06-24 Marek Safar <marek.safar@seznam.cz>
3725 * cs-parser.jay: Added error CS0134 test.
3727 2004-06-24 Marek Safar <marek.safar@seznam.cz>
3730 * cs-parser.jay: Added error CS0145 test.
3732 2004-06-24 Marek Safar <marek.safar@seznam.cz>
3734 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
3736 2004-06-23 Ben Maurer <bmaurer@ximian.com>
3738 * expression.cs (StackAlloc.Resolve): The argument may not
3739 be a constant; deal with this case.
3741 2004-06-23 Marek Safar <marek.safar@seznam.cz>
3743 * attribute.cs (IndexerName_GetIndexerName): Renamed to
3744 GetIndexerAttributeValue.
3745 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
3747 * class.cs (Indexer.Define): Added error tests for CS0415,
3750 2004-06-23 Miguel de Icaza <miguel@ximian.com>
3752 * attribute.cs (Attribute.Resolve): Keep field code in sync with
3755 2004-06-23 Martin Baulig <martin@ximian.com>
3757 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
3758 neither return nor throw, reset the barrier as well. Fixes #60457.
3760 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
3762 * class.cs : EventAttributes is now set to None by default.
3763 This fixes bug #60459.
3765 2004-06-18 Marek Safar <marek.safar@seznam.cz>
3768 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
3769 Don't throw exception but return null (it's sufficient now).
3771 2004-06-18 Marek Safar <marek.safar@seznam.cz>
3773 * typemanager.cs (GetArgumentTypes): Faster implementation.
3775 2004-06-18 Martin Baulig <martin@ximian.com>
3777 * attribute.cs (Attribute.Resolve): Check whether we're an
3778 EmptyCast which a Constant child. Fixes #60333.
3780 2004-06-17 Ben Maurer <bmaurer@ximian.com>
3782 * statement.cs (EmitCollectionForeach): Account for the fact that
3783 not all valuetypes are in areas which we can take the address of.
3784 For these variables, we store to a temporary variable. Also, make
3785 sure that we dont emit a `callvirt' on a valuetype method.
3787 2004-06-15 Marek Safar <marek.safar@seznam.cz>
3789 * expression.cs (StackAlloc.DoReSolve): Added test for
3790 negative parameter (CS0247).
3792 2004-06-15 Marek Safar <marek.safar@seznam.cz>
3795 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
3797 2004-06-15 Marek Safar <marek.safar@seznam.cz>
3800 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
3803 2004-06-14 Marek Safar <marek.safar@seznam.cz>
3805 Fix bug #58254 & cs1555.cs, cs1556.cs
3806 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
3808 2004-06-14 Marek Safar <marek.safar@seznam.cz>
3810 * cs-parser.jay: Added error CS1669 test for indexers.
3812 2004-06-18 Martin Baulig <martin@ximian.com>
3814 * generics.cs (GenericMethod.ctor): Don't take an Attributes
3815 argument. Fixes #60441.
3817 2004-06-16 Ben Maurer <bmaurer@ximian.com>
3818 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
3819 The name needs to have the actual name of the method in order
3820 for other tests (such as the one in OverloadResolve for Invoke
3821 on a delegate) to work. As well, it does not really help
3822 error reporting because the method group had multiple methods.
3823 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
3824 Make profiling work.
3826 2004-06-13 Martin Baulig <martin@ximian.com>
3828 * cs-parser.jay: Don't allow generic attributes.
3830 2004-06-13 Martin Baulig <martin@ximian.com>
3832 * class.cs (MemberBase.DoDefineBase): New protected method.
3833 (MemberBase.DoDefine): Compute the `flags' in the new
3834 DoDefineBase() which must be called first.
3835 (Method.Define): Call DoDefineBase() first so we have the flags
3836 when defining the generic method.
3838 * cs-parser.jay (interface_method_declaration): Support generic methods.
3840 2004-06-13 Martin Baulig <martin@ximian.com>
3842 * decl.cs (TypeName): Removed.
3843 (MemberName): Removed TypeName and MemberNow; now we just have
3846 * cs-parser.jay: Don't distinguish between type arguments and type
3847 parameters in the grammar and simplified the rules a bit. The
3848 reduce/reduce conflicts are now gone (except the one we inherited
3851 2004-06-11 Martin Baulig <martin@ximian.com>
3853 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
3854 call this twice: for params and varargs methods.
3856 2004-06-11 Marek Safar <marek.safar@seznam.cz>
3859 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
3861 2004-06-11 Marek Safar <marek.safar@seznam.cz>
3863 * attribute.cs (Attribute.GetValidTargets): Made public.
3866 (AbstractPropertyEventMethod): New class for better code sharing.
3867 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
3869 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
3871 2004-06-09 Martin Baulig <martin@ximian.com>
3873 * cs-parser.jay: Removed a reduce/reduce conflict.
3875 2004-06-03 Martin Baulig <martin@ximian.com>
3877 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
3878 GetSimpleName() and return a SimpleName.
3880 * ecore.cs (SimpleName.Arguments): New public field.
3881 (SimpleName): Added overloaded ctor which takes an additional
3882 TypeArguments argument.
3883 (SimpleName.SimpleNameResolve): Added support for generic methods.
3884 (MethodGroupExpr.ResolveGeneric): New public method. The code was
3885 formerly in MemberAccess.DoResolve(), but we also need it in
3886 SimpleNameResolve().
3888 * expression.cs (MemberAccess.DoResolve): Use the new
3889 MethodGroupExpr.ResolveGeneric().
3891 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
3893 * decl.cs: If possible, use lookuptypedirect here. We can only do
3894 this if there is no `.' after the namespace. Avoids using
3895 LookupType, which does lots of slow processing.
3896 (FindNestedType) New method, does what it says :-).
3897 * namespace.cs: use LookupTypeDirect.
3898 * rootcontext.cs: use membercache, if possible.
3899 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
3901 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
3904 According to the spec,
3906 In a member access of the form E.I, if E is a single identifier,
3907 and if the meaning of E as a simple-name (§7.5.2) is a constant,
3908 field, property, localvariable, or parameter with the same type as
3909 the meaning of E as a type-name (§3.8), then both possible
3910 meanings of E are permitted.
3912 We did not check that E as a simple-name had the same type as E as
3915 This trivial check gives us 5-7% on bootstrap time.
3917 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
3919 * expression.cs (Invocation.OverloadResolve): Avoid the
3920 use of hashtables and boxing here by allocating on demand.
3922 2004-05-30 Martin Baulig <martin@ximian.com>
3924 * rootcontext.cs (RootContext.LookupType): Don't cache things if
3925 we're doing a silent lookup. Don't try to lookup nested types in
3926 TypeManager.object_type (thanks to Ben Maurer).
3928 2004-05-30 Martin Baulig <martin@ximian.com>
3930 Committing a patch from Ben Maurer.
3932 * rootcontext.cs (RootContext.LookupType): Cache negative results.
3934 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
3936 * convert.cs: add a trivial cache for overload operator resolution.
3938 2004-05-31 Marek Safar <marek.safar@seznam.cz>
3941 (AttributeTester.GetObsoleteAttribute): Returns instance of
3942 ObsoleteAttribute when type is obsolete.
3945 (TypeContainer.VerifyObsoleteAttribute): Override.
3946 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
3947 (MethodCode.VerifyObsoleteAttribute): Override.
3948 (MemberBase.VerifyObsoleteAttribute): Override.
3951 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
3952 and report proper error.
3955 (Delegate.VerifyObsoleteAttribute): Override.
3958 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
3959 and report proper error.
3960 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
3963 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
3967 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
3968 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
3969 Added test for ObsoleteAttribute.
3972 (Catch): Derived from Statement.
3974 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
3976 * decl.cs: If possible, use lookuptypedirect here. We can only do
3977 this if there is no `.' after the namespace. Avoids using
3978 LookupType, which does lots of slow processing.
3979 (FindNestedType) New method, does what it says :-).
3980 * namespace.cs: use LookupTypeDirect.
3981 * rootcontext.cs: use membercache, if possible.
3982 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
3984 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
3987 According to the spec,
3989 In a member access of the form E.I, if E is a single identifier,
3990 and if the meaning of E as a simple-name (§7.5.2) is a constant,
3991 field, property, localvariable, or parameter with the same type as
3992 the meaning of E as a type-name (§3.8), then both possible
3993 meanings of E are permitted.
3995 We did not check that E as a simple-name had the same type as E as
3998 This trivial check gives us 5-7% on bootstrap time.
4000 2004-05-30 Marek Safar <marek.safar@seznam.cz>
4002 Fixed bug #59071 & cs0160.cs
4003 * statement.cs (Try.Resolve): Check here whether order of catch
4004 clauses matches their dependencies.
4006 2004-05-30 Marek Safar <marek.safar@seznam.cz>
4009 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
4012 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
4014 * expression.cs (Invocation.OverloadResolve): Avoid the
4015 use of hashtables and boxing here by allocating on demand.
4017 2004-05-30 Martin Baulig <martin@ximian.com>
4019 * rootcontext.cs (RootContext.LookupType): Don't cache things if
4020 we're doing a silent lookup. Don't try to lookup nested types in
4021 TypeManager.object_type (thanks to Ben Maurer).
4023 2004-05-30 Martin Baulig <martin@ximian.com>
4025 Committing a patch from Ben Maurer.
4027 * rootcontext.cs (RootContext.LookupType): Cache negative results.
4029 2004-05-29 Martin Baulig <martin@ximian.com>
4031 * class.cs (IMethodData.ShouldIgnore): New method.
4033 * typemanager.cs (TypeManager.MethodFlags): Don't take a
4034 `Location' argument, we don't need it anywhere. Use
4035 `IMethodData.ShouldIgnore ()' instead of
4036 `MethodData.GetMethodFlags ()'.
4037 (TypeManager.AddMethod): Removed.
4038 (TypeManager.AddMethod2): Renamed to AddMethod.
4040 2004-05-29 Martin Baulig <martin@ximian.com>
4042 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
4044 * convert.cs (Convert.ImplicitReferenceConversion): If we're
4045 converting from a class type S to an interface type and we already
4046 have an object on the stack, don't box it again. Fixes #52578.
4048 2004-05-29 Martin Baulig <martin@ximian.com>
4050 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
4051 Added support for `params' parameters. Fixes #59267.
4053 2004-05-29 Martin Baulig <martin@ximian.com>
4055 * literal.cs (NullPointer): Provide a private .ctor which sets
4056 `type' to TypeManager.object_type. Fixes #59048.
4058 2004-05-29 Martin Baulig <martin@ximian.com>
4060 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
4061 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
4063 * ecore.cs (EventExpr.instance_expr): Make the field private.
4065 2004-05-26 Marek Safar <marek.safar@seznam.cz>
4067 Fixed bug #50080 & cs0214-2.cs
4068 * expression.cs (Cast.DoResolve): Check unsafe context here.
4070 * statement.cs (Resolve.DoResolve): Likewise.
4072 2004-05-26 Martin Baulig <martin@ximian.com>
4074 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
4076 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
4077 (RootContext.LookupType): Pass down the `silent' flag.
4079 2004-05-25 Martin Baulig <martin@ximian.com>
4082 (MethodGroupExpr.IdenticalTypeName): New public property.
4083 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
4084 expression actually refers to a type.
4086 2004-05-25 Martin Baulig <martin@ximian.com>
4088 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
4089 for #56176 and made it actually work.
4091 2004-05-25 Martin Baulig <martin@ximian.com>
4093 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
4094 (FieldExpr, PropertyExpr): Override and implement
4095 CacheTemporaries. Fixes #52279.
4097 2004-05-25 Miguel de Icaza <miguel@ximian.com>
4099 * location.cs: In the new compiler listing a file twice is a
4100 warning, not an error.
4102 2004-05-24 Martin Baulig <martin@ximian.com>
4104 * enum.cs (Enum.DefineType): For the `BaseType' to be a
4105 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
4107 2004-05-24 Martin Baulig <martin@ximian.com>
4109 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
4110 walking the `using' list. Fixes #53921.
4112 2004-05-24 Martin Baulig <martin@ximian.com>
4114 * const.cs (Const.LookupConstantValue): Added support for
4115 EmptyCast's; fixes #55251.
4117 2004-05-24 Martin Baulig <martin@ximian.com>
4119 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
4120 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
4121 which does the CS0135 check. The reason is that we first need to
4122 check whether the variable actually exists.
4124 2004-05-24 Martin Baulig <martin@ximian.com>
4126 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
4127 than RootContext.LookupType() to find the explicit interface
4130 2004-05-24 Raja R Harinath <rharinath@novell.com>
4132 * Makefile: Simplify. Use executable.make.
4133 * mcs.exe.sources: New file. List of sources of mcs.exe.
4135 2004-05-24 Anders Carlsson <andersca@gnome.org>
4139 Use the invariant culture when doing String.Compare for CLS case
4142 2004-05-23 Martin Baulig <martin@ximian.com>
4144 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
4145 don't have any dots. Fixes #52622, added cs0246-8.cs.
4147 * namespace.cs (NamespaceEntry.Lookup): Likewise.
4149 2004-05-23 Marek Safar <marek.safar@seznam.cz>
4151 * class.cs (MemberBase.Define): Reuse MemberType member for
4152 resolved type. Other methods can use it too.
4154 2004-05-23 Martin Baulig <martin@ximian.com>
4156 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
4157 the variable also exists in the current block (otherwise, we need
4158 to report a CS0103). Fixes #58670.
4160 2004-05-23 Martin Baulig <martin@ximian.com>
4162 * flowanalysis.cs (Reachability.Reachable): Compute this
4163 on-the-fly rather than storing it as a field.
4165 2004-05-23 Martin Baulig <martin@ximian.com>
4167 * flowanalysis.cs (Reachability.And): Manually compute the
4168 resulting `barrier' from the reachability.
4170 2004-05-23 Marek Safar <marek.safar@seznam.cz>
4173 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
4174 instance of ObsoleteAttribute when symbol is obsolete.
4177 (IMethodData): Extended interface for ObsoleteAttribute support.
4179 2004-05-22 Marek Safar <marek.safar@seznam.cz>
4181 * attribute.cs: Fix bug #55970
4183 2004-05-22 Marek Safar <marek.safar@seznam.cz>
4187 (GetObsoleteAttribute): New method. Creates the instance of
4189 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
4190 ObsoleteAttribute when member is obsolete.
4191 (AttributeTester.Report_ObsoleteMessage): Common method for
4192 Obsolete error/warning reporting.
4195 (TypeContainer.base_classs_type): New member for storing parent type.
4198 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
4199 for this MemberCore.
4201 2004-05-21 Marek Safar <marek.safar@seznam.cz>
4203 * attribute.cs, const.cs: Fix bug #58590
4205 2004-05-21 Martin Baulig <martin@ximian.com>
4207 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
4208 out parameters if the end of the method is unreachable. Fixes
4211 2004-05-21 Marek Safar <marek.safar@seznam.cz>
4213 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
4214 Hari was right, why extra method.
4216 2004-05-21 Marek Safar <marek.safar@seznam.cz>
4218 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
4220 2004-05-20 Martin Baulig <martin@ximian.com>
4222 * delegate.cs: Convert this file to Unix mode - like the original
4225 2004-05-20 Martin Baulig <martin@ximian.com>
4227 * attribute.cs: Convert this file to Unix mode - like the original
4230 2004-05-19 Marek Safar <marek.safar@seznam.cz>
4232 Fix bug #58688 (MCS does not report error when the same attribute
4235 * attribute.cs (Attribute.Emit): Distinction between null and default.
4237 2004-05-19 Raja R Harinath <rharinath@novell.com>
4239 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
4240 of a top-level attribute without an attribute target.
4241 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
4243 (Attribute.Conditional_GetConditionName),
4244 (Attribute.Obsolete_GetObsoleteMessage): Update.
4245 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
4246 part of ScanForIndexerName.
4247 (Attribute.CanIgnoreInvalidAttribute): New function.
4248 (Attribute.ScanForIndexerName): Move to ...
4249 (Attributes.ScanForIndexerName): ... here.
4250 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
4251 (Attributes.Search): New internal variant that can choose not to
4252 complain if types aren't resolved. The original signature now
4254 (Attributes.GetClsCompliantAttribute): Use internal variant, with
4255 complaints suppressed.
4256 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
4257 only if it not useful.
4258 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
4259 top-level for attributes that are shared between the assembly
4260 and a top-level class.
4261 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
4262 * class.cs: Update to reflect changes.
4263 (DefineIndexers): Fuse loops.
4264 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
4265 a couple more variants of attribute names.
4267 2004-05-18 Marek Safar <marek.safar@seznam.cz>
4269 Fix bug #52585 (Implemented explicit attribute declaration)
4272 (Attributable.ValidAttributeTargets): New abstract method. It gets
4273 list of valid attribute targets for explicit target declaration.
4274 (Attribute.Target): It holds target itself.
4275 (AttributeSection): Removed.
4276 (Attribute.CheckTargets): New method. It checks whether attribute
4277 target is valid for the current element.
4280 (EventProperty): New class. For events that are declared like
4281 property (with add and remove accessors).
4282 (EventField): New class. For events that are declared like field.
4285 * cs-parser.jay: Implemented explicit attribute target declaration.
4287 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
4288 Override ValidAttributeTargets.
4291 (ReturnParameter): Class for applying custom attributes on
4293 (ParameterAtribute): New class. Class for applying custom
4294 attributes on the parameter type.
4296 2004-05-17 Miguel de Icaza <miguel@ximian.com>
4298 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
4301 (Method): Allow UNSAFE here.
4303 * modifiers.cs: Support unsafe reporting.
4305 2004-05-17 Marek Safar <marek.safar@seznam.cz>
4307 * decl.cs: Fix bug #58478.
4309 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
4311 * statement.cs: When checking for unreachable code on an EmptyStatement,
4312 set the location. Fixes bug #58488.
4314 2004-05-13 Miguel de Icaza <miguel@ximian.com>
4316 * driver.cs: Add -pkg handling.
4318 From Gonzalo: UseShelLExecute=false
4320 2004-05-12 Marek Safar <marek.safar@seznam.cz>
4323 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
4325 (Attribute.IsClsCompliaceRequired): Moved to base for better
4327 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
4328 when attribute is AttributeUsageAttribute.
4329 (Attribute.GetValidTargets): Simplified.
4330 (Attribute.GetAttributeUsage): New method returns AttributeUsage
4331 attribute for this type.
4332 (Attribute.ApplyAttributes): Method renamed to Emit and make
4334 (GlobalAttributeSection): New class for special handling of global
4335 attributes (assembly, module).
4336 (AttributeSection.Emit): New method.
4338 * class.cs: Implemented Attributable abstract methods.
4339 (MethodCore.LabelParameters): Moved to Parameter class.
4340 (Accessor): Is back simple class.
4341 (PropertyMethod): Implemented Attributable abstract class.
4342 (DelegateMethod): Implemented Attributable abstract class.
4343 (Event): New constructor for disctintion between normal Event
4344 and Event with accessors.
4346 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
4348 * codegen.cs, const.cs, decl.cs, delegate.cs:
4349 (CommonAssemblyModulClass): Implemented Attributable abstract class
4352 * enum.cs: Implement IAttributeSupport interface.
4353 (EnumMember): New class for emum members. Implemented Attributable
4357 (ParameterBase): Is abstract.
4358 (ReturnParameter): New class for easier [return:] attribute handling.
4360 * typemanager.cs: Removed builder_to_attr.
4362 2004-05-11 Raja R Harinath <rharinath@novell.com>
4365 * attribute.cs (Attribute.GetPositionalValue): New function.
4366 * class.cs (TypeContainer.VerifyMembers): New function.
4367 (TypeContainer.Emit): Use it.
4368 (ClassOrStruct): New base class for Class and Struct.
4369 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
4370 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
4372 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
4373 then each non-static field should have a FieldOffset attribute.
4374 Otherwise, none of the fields should have a FieldOffset attribute.
4375 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
4376 and FieldOffset attributes.
4377 * typemanager.cs (TypeManager.struct_layout_attribute_type)
4378 (TypeManager.field_offset_attribute_type): New core types.
4379 (TypeManager.InitCoreTypes): Initialize them.
4381 2004-05-11 Michal Moskal <malekith@pld-linux.org>
4383 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
4384 Return correct type.
4387 2004-05-09 Miguel de Icaza <miguel@ximian.com>
4389 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
4390 be implicitly converted to ulong.
4392 * expression.cs: The logic for allowing operator &, | and ^ worked
4393 was wrong, it worked before because we did not report an error in
4394 an else branch. Fixes 57895.
4396 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
4397 allow volatile fields to be reference types.
4399 2004-05-07 Miguel de Icaza <miguel@ximian.com>
4401 * driver.cs: Add support for /debug-
4403 2004-05-07 Raja R Harinath <rharinath@novell.com>
4405 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
4406 Add a 'complain' parameter to silence errors.
4407 (Attribute.Resolve): Update to changes. Put in sanity check to catch
4408 silently overlooked type-resolutions.
4409 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
4411 (Attributes.Search): New function.
4412 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
4413 (Attributes.GetAttributeFullName): Remove hack.
4414 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
4415 Update to reflect changes.
4416 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4417 Use Attributes.Search instead of nested loops.
4419 2004-05-07 Marek Safar <marek.safar@seznam.cz>
4422 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
4423 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
4424 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
4426 * report.cs: (Report.Warning): Renamed to Warning_T because of
4427 parameter collision.
4429 2004-05-05 Raja R Harinath <rharinath@novell.com>
4431 * expression.cs (MemberAccess.ResolveMemberAccess):
4432 Exit with non-zero status after Report.Error.
4433 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
4435 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
4437 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
4439 * support.cs: Don't hang when the file is empty.
4441 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
4443 * support.cs: In SeekableStreamReader, compute the preamble size of the
4444 underlying stream. Position changes should take into account that initial
4447 2004-05-03 Todd Berman <tberman@sevenl.net>
4449 * driver.cs: remove unused GetSysVersion function.
4451 2004-05-03 Todd Berman <tberman@sevenl.net>
4453 * driver.cs: Remove the hack from saturday, as well as the hack
4454 from jackson (LoadAssemblyFromGac), also adds the CWD to the
4455 link_paths to get that bit proper.
4457 2004-05-01 Todd Berman <tberman@sevenl.net>
4459 * driver.cs: Try a LoadFrom before a Load, this checks the current
4460 path. This is currently a bug in mono that is be fixed, however, this
4461 provides a workaround for now. This will be removed when the bug
4464 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
4466 * CryptoConvert.cs: Updated to latest version. Fix issue with
4467 incomplete key pairs (#57941).
4469 2004-05-01 Todd Berman <tberman@sevenl.net>
4471 * driver.cs: Remove '.' from path_chars, now System.* loads properly
4474 2004-04-30 Jackson Harper <jackson@ximian.com>
4476 * codegen.cs: Open keys readonly.
4478 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
4480 * typemanager.cs: don't report cyclic struct layout when a struct
4481 contains 2 or more fields of the same type. Failed for Pango.AttrShape
4482 which has 2 Pango.Rectangle fields.
4484 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
4486 * expression.cs: Handle IntPtr comparisons with IL code
4487 rather than a method call.
4489 2004-04-29 Martin Baulig <martin@ximian.com>
4491 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
4492 the list of PropertyInfo's in class hierarchy and find the
4493 accessor. Fixes #56013.
4495 2004-04-29 Martin Baulig <martin@ximian.com>
4497 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
4499 2004-04-29 Martin Baulig <martin@ximian.com>
4501 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4503 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
4505 2004-04-29 Martin Baulig <martin@ximian.com>
4507 * class.cs (ConstructorInitializer.Resolve): Check whether the
4508 parent .ctor is accessible. Fixes #52146.
4510 2004-04-29 Martin Baulig <martin@ximian.com>
4512 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4514 * statement.cs (Using.EmitLocalVariableDecls): Use
4515 TypeManager.idisposable_type, not typeof (IDisposable).
4516 (Foreach.EmitCollectionForeach): Added support for valuetypes.
4518 2004-04-29 Martin Baulig <martin@ximian.com>
4520 * class.cs (Event.Define): Don't emit the field and don't set
4521 RTSpecialName and SpecialName for events on interfaces. Fixes
4524 2004-04-29 Raja R Harinath <rharinath@novell.com>
4526 Refactor Attribute.ApplyAttributes.
4527 * attribute.cs (Attributable): New base class for objects that can
4528 have Attributes applied on them.
4529 (Attribute): Make AttributeUsage fields public.
4530 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
4531 (Attribute.IsInternalCall): New property.
4532 (Attribute.UsageAttr): Convert to a public read-only property.
4533 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
4534 (Attribute.ResolveType, Attribute.Resolve)
4535 (Attribute.ScanForIndexerName): Update to reflect changes.
4536 (Attribute.CheckAttributeTarget): Re-format.
4537 (Attribute.ApplyAttributes): Refactor, to various
4538 Attributable.ApplyAttributeBuilder methods.
4539 * decl.cs (MemberCore): Make Attributable.
4540 * class.cs (Accessor): Make Attributable.
4541 (MethodData.ApplyAttributes): Use proper attribute types, not
4543 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
4544 (TypeContainer.ApplyAttributeBuilder)
4545 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
4546 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
4547 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
4548 (Operator.ApplyAttributeBuilder): New factored-out methods.
4549 * const.cs (Const.ApplyAttributeBuilder): Likewise.
4550 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
4551 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
4552 * parameter.cs (ParameterBase): New Attributable base class
4553 that can also represent Return types.
4554 (Parameter): Update to the changes.
4556 2004-04-29 Jackson Harper <jackson@ximian.com>
4558 * driver.cs: Prefer the corlib system version when looking for
4559 assemblies in the GAC. This is still a hack, but its a better hack
4562 2004-04-29 Marek Safar <marek.safar@seznam.cz>
4564 * decl.cs, enum.cs: Improved error 3005 reporting.
4566 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
4567 (related_symbols): New private member for list of symbols
4568 related to reported error/warning.
4570 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
4572 2004-04-29 Martin Baulig <martin@ximian.com>
4574 * ecore.cs (Expression.Constantify): If we're an enum and
4575 TypeManager.TypeToCoreType() doesn't give us another type, use
4576 t.UnderlyingSystemType. Fixes #56178.
4578 2004-04-29 Martin Baulig <martin@ximian.com>
4580 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
4581 interfaces and for each interface, only add members directly
4582 declared in that interface. Fixes #53255.
4584 2004-04-28 Martin Baulig <martin@ximian.com>
4586 * expression.cs (ConditionalLogicalOperator): Use a temporary
4587 variable for `left' to avoid that we evaluate it more than once;
4590 2004-04-28 Martin Baulig <martin@ximian.com>
4592 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
4595 2004-04-28 Martin Baulig <martin@ximian.com>
4597 * statement.cs (LocalInfo.Resolve): Check whether the type is not
4600 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
4601 whether the type is not void (CS1547).
4603 2004-04-28 Martin Baulig <martin@ximian.com>
4605 * expression.cs (Unary.DoResolveLValue): Override this and report
4606 CS0131 for anything but Operator.Indirection.
4608 2004-04-28 Martin Baulig <martin@ximian.com>
4610 Committing a patch from Ben Maurer; see bug #50820.
4612 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4615 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4618 2004-04-28 Martin Baulig <martin@ximian.com>
4620 Committing a patch from Ben Maurer; see bug #50820.
4622 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4625 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4628 2004-04-28 Martin Baulig <martin@ximian.com>
4630 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
4631 (Block.AddLabel): Call DoLookupLabel() to only search in the
4634 2004-04-28 Martin Baulig <martin@ximian.com>
4636 * cfold.cs (ConstantFold.BinaryFold): Added special support for
4637 comparing StringConstants and NullLiterals in Equality and Inequality.
4639 2004-04-28 Jackson Harper <jackson@ximian.com>
4641 * driver.cs: Attempt to load referenced assemblies from the
4642 GAC. This is the quick and dirty version of this method that
4643 doesnt take into account versions and just takes the first
4644 canidate found. Will be good enough for now as we will not have more
4645 then one version installed into the GAC until I update this method.
4647 2004-04-28 Martin Baulig <martin@ximian.com>
4649 * typemanager.cs (TypeManager.CheckStructCycles): New public
4650 static method to check for cycles in the struct layout.
4652 * rootcontext.cs (RootContext.PopulateTypes): Call
4653 TypeManager.CheckStructCycles() for each TypeContainer.
4654 [Note: We only need to visit each type once.]
4656 2004-04-28 Martin Baulig <martin@ximian.com>
4658 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
4660 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
4661 success and added `out object value'. Use a `bool resolved' field
4662 to check whether we've already been called rather than
4663 `ConstantValue != null' since this breaks for NullLiterals.
4665 2004-04-28 Raja R Harinath <rharinath@novell.com>
4667 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
4668 setting of this flag, since the 'set' method may be non-public.
4670 2004-04-28 Raja R Harinath <rharinath@novell.com>
4672 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
4673 check on current_vector.Block.
4675 2004-04-27 Martin Baulig <martin@ximian.com>
4677 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
4678 a field initializer. Fixes #56459.
4680 2004-04-27 Martin Baulig <martin@ximian.com>
4682 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
4683 we're not attempting to use an indexer. Fixes #52154.
4685 2004-04-27 Martin Baulig <martin@ximian.com>
4687 * statement.cs (Return): Don't create a return label if we don't
4688 need it; reverts my change from January 20th. Thanks to Ben
4691 2004-04-27 Martin Baulig <martin@ximian.com>
4693 According to the spec, `goto' can only leave a nested scope, but
4696 * statement.cs (Block.LookupLabel): Only lookup in the current
4697 block, don't recurse into parent or child blocks.
4698 (Block.AddLabel): Check in parent and child blocks, report
4699 CS0140/CS0158 if we find a duplicate.
4700 (Block): Removed this indexer for label lookups.
4701 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
4702 this already does the error reporting for us.
4705 (FlowBranching.UsageVector.Block): New public variable; may be null.
4706 (FlowBranching.CreateSibling): Added `Block' argument.
4707 (FlowBranching.LookupLabel): New public virtual method. Lookup a
4708 label for the target of a `goto' and check whether we're not
4709 leaving a `finally'.
4711 2004-04-27 Martin Baulig <martin@ximian.com>
4713 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4714 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
4717 2004-04-27 Martin Baulig <martin@ximian.com>
4719 * statement.cs (Block.AddLabel): Also check for implicit blocks
4720 and added a CS0158 check.
4722 2004-04-27 Martin Baulig <martin@ximian.com>
4724 * flowanalysis.cs (FlowBranchingLoop): New class.
4725 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
4726 UsageVector's instead of an ArrayList.
4727 (FlowBranching.Label): Likewise.
4728 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
4729 (FlowBranching.AddBreakVector): New method.
4731 2004-04-27 Miguel de Icaza <miguel@ximian.com>
4733 * attribute.cs: Small regression fix: only convert the type if we
4734 the type is different, fixes System.Drawing build.
4736 2004-04-27 Martin Baulig <martin@ximian.com>
4738 * attribute.cs (Attribute.Resolve): If we have a constant value
4739 for a named field or property, implicity convert it to the correct
4742 2004-04-27 Raja R Harinath <rharinath@novell.com>
4744 * statement.cs (Block.Block): Implicit blocks share
4745 'child_variable_names' fields with parent blocks.
4746 (Block.AddChildVariableNames): Remove.
4747 (Block.AddVariable): Mark variable as "used by a child block" in
4748 every surrounding block.
4749 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
4750 been used in a child block, complain about violation of "Invariant
4751 meaning in blocks" rule.
4752 * cs-parser.jay (declare_local_variables): Don't use
4753 AddChildVariableNames.
4754 (foreach_statement): Don't create an implicit block: 'foreach'
4757 2004-04-23 Miguel de Icaza <miguel@ximian.com>
4759 * convert.cs (ImplicitNumericConversion): 0 is also positive when
4760 converting from 0L to ulong. Fixes 57522.
4762 2004-04-22 Marek Safar <marek.safar@seznam.cz>
4764 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
4765 derived class hides via 'new' keyword field from base class (test-242.cs).
4766 TODO: Handle this in the more general way.
4768 * class.cs (CheckBase): Ditto.
4770 2004-04-22 Marek Safar <marek.safar@seznam.cz>
4772 * decl.cs (caching_flags): New member for storing cached values
4774 (MemberCore.Flags): New enum where bit flags for caching_flags
4776 (MemberCore.cls_compliance): Moved to caching_flags.
4777 (DeclSpace.Created): Moved to caching_flags.
4779 * class.cs: Use caching_flags instead of DeclSpace.Created
4781 2004-04-21 Miguel de Icaza <miguel@ximian.com>
4783 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
4784 if we are only a derived class, not a nested class.
4786 * typemanager.cs: Same as above, but do this at the MemberLookup
4787 level (used by field and methods, properties are handled in
4788 PropertyExpr). Allow for the qualified access if we are a nested
4791 2004-04-21 Marek Safar <marek.safar@seznam.cz>
4793 * class.cs: Refactoring.
4794 (IMethodData): New inteface; Holds links to parent members
4795 to avoid member duplication (reduced memory allocation).
4796 (Method): Implemented IMethodData interface.
4797 (PropertyBase): New inner classes for get/set methods.
4798 (PropertyBase.PropertyMethod): Implemented IMethodData interface
4799 (Event): New inner classes for add/remove methods.
4800 (Event.DelegateMethod): Implemented IMethodData interface.
4802 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
4803 EmitContext (related to class.cs refactoring).
4805 2004-04-21 Raja R Harinath <rharinath@novell.com>
4807 * delegate.cs (Delegate.VerifyApplicability): If the number of
4808 arguments are the same as the number of parameters, first try to
4809 verify applicability ignoring any 'params' modifier on the last
4813 2004-04-08 Martin Baulig <martin@ximian.com>
4815 Merged latest changes into gmcs. Please keep this comment in
4816 here, it makes it easier for me to see what changed in MCS since
4817 the last time I merged.
4819 2004-04-16 Raja R Harinath <rharinath@novell.com>
4821 * class.cs (TypeContainer.AddIndexer): Use
4822 'ExplicitInterfaceName' to determine if interface name was
4823 explicitly specified. 'InterfaceType' is not initialized at this time.
4824 (TypeContainer.DefineIndexers): Remove use of temporary list. The
4825 Indexers array is already in the required order. Initialize
4826 'IndexerName' only if there are normal indexers.
4827 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
4828 (TypeContainer.Emit): Emit DefaultMember attribute only if
4829 IndexerName is initialized.
4832 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
4834 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
4837 2004-04-15 Raja R Harinath <rharinath@novell.com>
4839 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
4843 * attribute.cs (Attribute.Resolve): Check for duplicate named
4847 2004-04-15 Miguel de Icaza <miguel@ximian.com>
4849 * iterators.cs (MarkYield): track whether we are in an exception,
4850 and generate code accordingly. Use a temporary value to store the
4851 result for our state.
4853 I had ignored a bit the interaction of try/catch with iterators
4854 since their behavior was not entirely obvious, but now it is
4855 possible to verify that our behavior is the same as MS .NET 2.0
4859 2004-04-14 Miguel de Icaza <miguel@ximian.com>
4861 * iterators.cs: Avoid creating temporaries if there is no work to
4864 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
4865 Enumerations, use TypeManager.EnumToUnderlying and call
4868 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
4871 (This.Emit): Use EmitContext.EmitThis to emit our
4874 (This.EmitAssign): Ditto.
4876 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
4877 codepaths, we will move all the functionality into
4880 (FieldExpr.EmitAssign): Ditto.
4882 This fixes several hidden bugs that I uncovered while doing a code
4883 review of this today.
4885 * codegen.cs (EmitThis): reworked so the semantics are more clear
4886 and also support value types "this" instances.
4888 * iterators.cs: Changed so that for iterators in value types, we
4889 do not pass the value type as a parameter.
4891 Initialization of the enumerator helpers is now done in the caller
4892 instead of passing the parameters to the constructors and having
4893 the constructor set the fields.
4895 The fields have now `assembly' visibility instead of private.
4897 2004-04-11 Miguel de Icaza <miguel@ximian.com>
4899 * expression.cs (Argument.Resolve): Check if fields passed as ref
4900 or out are contained in a MarshalByRefObject.
4902 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
4903 another compiler type.
4905 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
4907 * class.cs (Indexer.Define): use the new name checking method.
4908 Also, return false on an error.
4909 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
4910 (is_identifier_[start/part]_character): make static.
4912 2004-04-10 Miguel de Icaza <miguel@ximian.com>
4914 * expression.cs (Binary.ResolveOperator): Do no append strings
4915 twice: since we can be invoked more than once (array evaluation)
4916 on the same concatenation, take care of this here. Based on a fix
4917 from Ben (bug #56454)
4919 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
4921 * codegen.cs: Fix another case where CS1548 must be reported (when
4922 delay-sign isn't specified and no private is available #56564). Fix
4923 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
4924 error when MCS is used on the MS runtime and we need to delay-sign
4925 (which seems unsupported by AssemblyBuilder - see #56621).
4927 2004-04-08 Marek Safar <marek.safar@seznam.cz>
4929 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
4930 (TypeManager.ComputeNamespaces): Faster implementation for
4933 * compiler.csproj: Updated AssemblyName to mcs.
4935 2004-05-11 Jackson Harper <jackson@ximian.com>
4937 * Makefile: Preserve MONO_PATH
4939 2004-05-11 Jackson Harper <jackson@ximian.com>
4941 * Makefile: Use mono and mcs to build gmcs
4943 2004-05-03 Miguel de Icaza <miguel@ximian.com>
4945 * codegen.cs: Add patch from Robert Shade
4946 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
4949 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
4951 * CryptoConvert.cs: Updated to latest version. Fix issue with
4952 incomplete key pairs (#57941).
4954 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
4956 * codegen.cs: Fix another case where CS1548 must be reported (when
4957 delay-sign isn't specified and no private is available #56564). Fix
4958 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
4959 error when MCS is used on the MS runtime and we need to delay-sign
4960 (which seems unsupported by AssemblyBuilder - see #56621).
4962 2004-04-29 Jackson Harper <jackson@ximian.com>
4964 * Makefile: Set MONO_PATH to use the bootstrap corlib
4965 * driver.cs: Check the GAC for referenced assemblies.
4967 2004-04-29 Martin Baulig <martin@ximian.com>
4969 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
4971 2004-04-07 Martin Baulig <martin@ximian.com>
4973 * expression.cs (Binary.ResolveOperator): Added special case for
4974 Equality/Inequality between a type parameter and a null literal.
4976 2004-04-07 Martin Baulig <martin@ximian.com>
4978 * convert.cs: Check null literal -> type parameter conversions.
4980 2004-04-07 Martin Baulig <martin@ximian.com>
4982 * generic.cs (ConstructedType.CheckConstraints): Enforce the
4983 `class' and `struct' constraints.
4985 2004-04-07 Martin Baulig <martin@ximian.com>
4987 * generic.cs (SpecialConstraint): New public enum.
4988 (Constraints.Resolve): Added support for the `class' and `struct'
4991 * cs-parser.jay (type_parameter_constraint): Added support for the
4992 `class' and `struct' constraints.
4994 2004-04-07 Martin Baulig <martin@ximian.com>
4996 * support.cs (GenericConstraints): Replaced `Types' by
4997 `ClassConstraint' and `InterfaceConstraints'; added
4998 `HasClassConstraint'.
5000 2004-04-07 Martin Baulig <martin@ximian.com>
5003 (Constraints.InterfaceConstraints): New public property.
5004 (Constraints.Types): Make this property public
5005 (TypeParameter): Implement IMemberContainer.
5006 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
5007 instead of a TypeBuilder/MethodBuilder; pass the interface
5008 constraints to TypeManager.AddTypeParameter().
5009 (TypeParameter.DefineType): Just take an EmitContext and no
5010 TypeBuilder/MethodBuilder. Use the new public API.
5012 * typemanager.cs (TypeManager.AddTypeParameter): Added
5013 `TypeExpr[]' argument; add the interfaces to the
5014 `builder_to_ifaces' hash.
5015 (TypeManager.LookupMemberContainer): For
5016 GenericTypeParameterBuilders, get the TypeParameter from the
5017 `builder_to_type_param'.
5018 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
5019 the TypeParameter and call FindMembers on it.
5021 2004-04-07 Martin Baulig <martin@ximian.com>
5024 (MethodCore.GenericMethod): Moved this field here from Method.
5025 (MethodCore.IsDuplicateImplementation): Take the number of type
5026 parameters into account if we're a generic method.
5028 * expression.cs (Invocation.InferTypeArguments): Don't return true
5029 if `arguments' is null; we still need to check whether we actually
5030 don't need to infer anything in this case.
5031 (MemberAccess): Merged the functionality from GenericMemberAccess
5034 * generic.cs (GenericMemberAccess): Removed.
5036 2004-04-05 Martin Baulig <martin@ximian.com>
5038 * decl.cs (MemberCore): For generic classes, interfaces and
5039 structs, `Name' now includes the number of type parameters
5041 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
5042 encode the number of type arguments in the type name.
5044 * expression.cs (Expression.MemberLookup): Removed the
5045 `num_type_args' argument; we now encode the number of type
5046 arguments in the type name.
5048 * ecore.cs (SimpleName): Encode the number of type arguments in
5049 the type name itself.
5051 * generic.cs (ConstructedType): Likewise.
5053 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
5054 `MemberName'; we now include the number of type parameters in the
5057 * typemanager.cs (TypeManager.CheckGeneric): Removed.
5058 (TypeManager.MemberLookup): Removed the
5059 `num_type_args' argument; we now encode the number of type
5060 arguments in the type name.
5062 2004-04-03 Martin Baulig <martin@ximian.com>
5064 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
5065 (MemberCore.MemberName): Moved here from MemberBase.
5066 (DeclSpace.SetParameterInfo): Just take the constraints as an
5067 ArrayList; we already have the type parameters in our
5068 `MemberName'; also do the CS0080 reporting here.
5070 * cs-parser.jay (struct_declaration): Use `member_name' instead of
5071 `IDENTIFIER opt_type_parameter_list'; when constructing our
5072 `MemberName', it'll already include our type parameters.
5073 (class_declaration, interface_declaration): Likewise.
5074 (delegate_declaration): Likewise.
5075 (MakeName): Take a MemberName and return a MemberName.
5076 The following two changes are required to avoid shift/reduce conflicts:
5077 (member_name): Don't include a TypeName anymore; ie. this is now
5078 just 'IDENTIFIER opt_type_parameter_list'.
5079 (property_declaration, event_declaration): Use a
5080 `namespace_or_type_name' instead of a `member_name'.
5082 2004-04-03 Martin Baulig <martin@ximian.com>
5084 * decl.cs (MemberName): Renamed to `TypeName' and created a new
5086 (TypeName): Formerly known as MemberName.
5088 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
5089 instead of a `MemberName'.
5091 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
5092 (member_name): New rule; create a MemberName.
5094 2004-04-02 Martin Baulig <martin@ximian.com>
5096 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
5097 (CS0305 and CS0308).
5099 2004-04-02 Martin Baulig <martin@ximian.com>
5101 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
5102 support for nested types.
5104 2004-04-02 Martin Baulig <martin@ximian.com>
5106 * ecore.cs (IAlias): New public interface.
5107 (TypeExpr, TypeExpression): Implement IAlias.
5108 (TypeAliasExpression): New public class.
5110 * namespace.cs (Namespace): Implement IAlias.
5111 (Namespace.Lookup): Return an IAlias instead on an object.
5112 (Namespace.DefineName): Take an IAlias instead of an object.
5113 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
5115 (NamespaceEntry.UsingAlias): Take a Membername instead of an
5117 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
5119 (NamespaceEntry.Lookup): Likewise.
5121 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
5124 * decl.cs (DeclSpace): Implement IAlias.
5125 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
5127 * generic.cs (ConstructedType): Improved error checking.
5129 2004-04-02 Martin Baulig <martin@ximian.com>
5131 * convert.cs: Added type parameter conversions.
5134 (UnboxCast.Emit): Emit an `unbox.any' for type params.
5135 (ClassCast.Emit): If the source type is a type parameter, box it.
5136 If the target type is a type parameter, emit an `unbox.any'
5137 instead of a `classcast'.1
5139 2004-04-01 Martin Baulig <martin@ximian.com>
5141 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
5143 2004-04-01 Martin Baulig <martin@ximian.com>
5145 * generic.cs (ConstructedType.CheckConstraints): Use
5146 Convert.ImplicitStandardConversionExists(); user-defined implicit
5147 conversions are not allowed according to the spec.
5149 2004-03-30 Martin Baulig <martin@ximian.com>
5151 * expression.cs (New): Added support for type parameters.
5154 (TypeManager.activator_type): New public static field.
5155 (TypeManager.activator_create_instance): Likewise.
5157 2004-03-30 Martin Baulig <martin@ximian.com>
5159 * typemanager.cs (TypeManager.HasConstructorConstraint): New
5162 2004-03-30 Martin Baulig <martin@ximian.com>
5164 * generic.cs (ConstructedType.CheckConstraints): Actually follow
5165 the spec here: the argument type must be convertible to the
5168 2004-03-30 Martin Baulig <martin@ximian.com>
5171 (TypeParameter.Define, TypeParameter.DefineMethod): Call
5172 TypeManager.AddTypeParameter().
5173 (ConstructedType.CheckConstraints): Re-enable this and actually
5174 check whether we have a constructor constraint.
5177 (TypeManager.builder_to_type_param): New static field.
5178 (TypeManager.AddTypeParameter): New static method.
5179 (TypeManager.LookupTypeParameter): New public method.
5181 2004-03-30 Martin Baulig <martin@ximian.com>
5183 * generic.cs (TypeParameter.DefineType): Return a boolean and use
5184 the new API to actually define the constructor constraint.
5187 (TypeManager.new_constraint_attr_type): New static field.
5188 (TypeManager.InitCoreTypes): Initialize it.
5190 2004-03-30 Martin Baulig <martin@ximian.com>
5192 * generic.cs (Constraints): Completed error checking, use correct
5195 2004-03-29 Martin Baulig <martin@ximian.com>
5197 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
5199 * expression.cs (Invocation.InferTypeArguments): Added overloaded
5200 public version which takes a `ParameterData pd' instead of an
5203 2004-03-29 Martin Baulig <martin@ximian.com>
5205 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
5208 2004-03-29 Martin Baulig <martin@ximian.com>
5210 * expression.cs (Argument.ResolveMethodGroup): If we're a
5211 ConstructedType, call GetMemberAccess() on it.
5213 2004-03-29 Martin Baulig <martin@ximian.com>
5215 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
5216 (MethodCore.CheckGenericOverride): When overriding a generic
5217 method, check whether the constraints match.
5219 * support.cs (GenericConstraints): New public interface.
5220 (ParameterData.GenericConstraints): New public method.
5222 * parameter.cs (Parameter.Resolve): Check whether we're a generic
5223 method parameter and compute our constraints if appropriate.
5224 (Parameter.GenericConstraints): New public property.
5226 * generic.cs (Constraints): Implement GenericConstraints.
5228 2004-03-29 Martin Baulig <martin@ximian.com>
5230 * decl.cs (MemberCache.FindMemberToOverride): Use
5231 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
5233 2004-03-29 Martin Baulig <martin@ximian.com>
5235 * generic.cs (GenericMethod.Define): Resolve our type parameters.
5237 2004-03-29 Martin Baulig <martin@ximian.com>
5239 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
5240 not allowed on non-generic declarations").
5242 2004-03-29 Martin Baulig <martin@ximian.com>
5244 * expression.cs (Invocation.InferTypeArguments): Added overloaded
5245 public version of this method.
5247 * class.cs (MethodCore.IsDuplicateImplementation): Use
5248 Invocation.InferTypeArguments() to check this.
5250 2004-03-29 Martin Baulig <martin@ximian.com>
5252 * convert.cs: Use TypeManager.IsDelegateType() instead of
5253 comparing types correctly.
5255 2004-03-29 Martin Baulig <martin@ximian.com>
5257 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
5258 types directly to make it work for generic instances.
5260 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
5262 2004-03-29 Martin Baulig <martin@ximian.com>
5264 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
5267 2004-03-24 Martin Baulig <martin@ximian.com>
5269 * decl.cs (DeclSpace.FindType): Also use
5270 TypeManager.CheckGeneric() for types from the using clauses.
5272 2004-03-23 Martin Baulig <martin@ximian.com>
5274 * expression.cs (Invocation.OverloadResolve): Added `bool
5275 may_fail' argument and use it instead of the Location.IsNull() hack.
5277 2004-03-23 Martin Baulig <martin@ximian.com>
5279 * expression.cs (Invocation.InferType): Use correct type inference
5282 2004-03-23 Martin Baulig <martin@ximian.com>
5284 * ecore.cs (MethodGroupExpr.Name): Use
5285 TypeManager.CSharpSignature() instead of just the name.
5287 * expression.cs (Invocation.OverloadResolve): Provide better error
5289 (Invocation.DoResolve): OverloadResolve() never returns null
5290 without reporting an error, so removed the error -6 reporting here.
5292 2004-03-23 Martin Baulig <martin@ximian.com>
5294 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
5297 * cs-parser.jay (delegate_declaration): Support generic delegates.
5299 * delegate.cs: Support generic delegates.
5301 2004-03-22 Martin Baulig <martin@ximian.com>
5303 * expression.cs (Invocation.InferParamsTypeArguments): New static
5304 method; does type inference for params arguments.
5306 2004-03-21 Martin Baulig <martin@ximian.com>
5308 * typemanager.cs (TypeManager.IsGenericMethod): New public static
5309 method; checks whether a method is a generic method.
5311 * expression.cs (Invocation.InferTypeArguments): New static method;
5312 infer type arguments for generic method invocation.
5314 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
5315 property; we set this to true if we're resolving a generic method
5316 invocation and the user specified type arguments, ie. we're not
5317 doing type inference.
5319 2004-03-20 Martin Baulig <martin@ximian.com>
5321 * class.cs (MethodData.DeclaringType): New public property.
5322 (MethodData.Define): Set DeclaringType here.
5323 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
5324 instead of OperatorMethodBuilder.DeclaringType.
5326 2004-03-20 Martin Baulig <martin@ximian.com>
5328 * cs-tokenizer.cs (xtoken): Return a special
5329 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
5331 * cs-parser.jay (default_value_expression): Switch to the new
5334 2004-03-19 Martin Baulig <martin@ximian.com>
5336 * decl.cs (MemberName): New class. We use this to "construct"
5337 namespace_or_type_name's.
5339 * generics.cs (TypeArguments.GetDeclarations): New public method;
5340 returns the type arguments as a string[] and reports a CS0081 if
5341 one of them is not an identifier.
5343 * class.cs (MemberBase): The .ctor now takes the name as a
5344 MemberName instead of a string.
5345 (MemberBase.ExplicitInterfaceName): Changed type from string to
5347 (MemberBase.DoDefine): If we're an explicit implementation, the
5348 InterfaceType may be a generic instance.
5350 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
5351 (namespace_name): Call MemberName.GetName () to transform the
5352 MemberName into a string and ensure we don't have any type
5354 (type_name): Call MemberName.GetTypeExpression() to transfrom the
5355 MemberName into an expression.
5356 (method_header): Use namespace_or_type_name instead of member_name.
5358 2004-04-07 Miguel de Icaza <miguel@ximian.com>
5360 * rootcontext.cs: Add new types to the boot resolution.
5362 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
5363 MulticastDelegate is not allowed.
5365 * typemanager.cs: Add new types to lookup: System.TypedReference
5368 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
5369 check for TypedReference or ArgIterator, they are not allowed.
5371 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
5372 makes us properly catch 1510 in some conditions (see bug 56016 for
5375 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
5377 * CryptoConvert.cs: update from corlib version
5380 2004-04-05 Miguel de Icaza <miguel@ximian.com>
5382 * class.cs (Indexer.Define): Check indexername declaration
5384 2004-04-05 Marek Safar <marek.safar@seznam.cz>
5386 * attribute.cs (IsClsCompliant): Fixed problem with handling
5387 all three states (compliant, not-compliant, undetected).
5389 2004-03-30 Marek Safar <marek.safar@seznam.cz>
5391 * attribute.cs (Attribute): Location is now public.
5392 (Resolve): Store resolved arguments (pos_values) in attribute class.
5393 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
5394 (GetClsCompliantAttributeValue): New method that gets
5395 CLSCompliantAttribute value.
5396 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
5397 if exists else null.
5398 (AttributeTester): New class for CLS-Compliant verification routines.
5400 * class.cs (Emit): Add CLS-Compliant verification.
5401 (Method.GetSignatureForError): Implemented.
5402 (Constructor.GetSignatureForError): Implemented
5403 (Constructor.HasCompliantArgs): Returns if constructor has
5404 CLS-Compliant arguments.
5405 (Constructor.Emit): Override.
5406 (Construcor.IsIdentifierClsCompliant): New method; For constructors
5407 is needed to test only parameters.
5408 (FieldBase.GetSignatureForError): Implemented.
5409 (TypeContainer): New member for storing base interfaces.
5410 (TypeContainer.FindMembers): Search in base interfaces too.
5412 * codegen.cs (GetClsComplianceAttribute): New method that gets
5413 assembly or module CLSCompliantAttribute value.
5414 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
5416 (ModuleClass.Emit): Add error 3012 test.
5418 * const.cs (Emit): Override and call base for CLS-Compliant tests.
5420 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
5421 state for all decl types.
5422 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
5423 if CLS-Compliant tests are required.
5424 (IsClsCompliaceRequired): New method. Analyze whether code
5425 must be CLS-Compliant.
5426 (IsExposedFromAssembly): New method. Returns true when MemberCore
5427 is exposed from assembly.
5428 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
5429 value or gets cached value.
5430 (HasClsCompliantAttribute): New method. Returns true if MemberCore
5431 is explicitly marked with CLSCompliantAttribute.
5432 (IsIdentifierClsCompliant): New abstract method. This method is
5433 used to testing error 3005.
5434 (IsIdentifierAndParamClsCompliant): New method. Common helper method
5435 for identifier and parameters CLS-Compliant testing.
5436 (VerifyClsCompliance): New method. The main virtual method for
5437 CLS-Compliant verifications.
5438 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
5439 null. I don't know why is null (too many public members !).
5440 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
5441 and get value of first CLSCompliantAttribute that found.
5443 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
5444 (VerifyClsCompliance): Override and add extra tests.
5446 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
5447 clscheck- disable CLS-Compliant verification event if assembly is has
5448 CLSCompliantAttribute(true).
5450 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
5451 ApllyAttribute is now called in emit section as in the other cases.
5452 Possible future Emit integration.
5453 (IsIdentifierClsCompliant): New override.
5454 (VerifyClsCompliance): New override.
5455 (GetEnumeratorName): Returns full enum name.
5457 * parameter.cs (GetSignatureForError): Implemented.
5459 * report.cs (WarningData): New struct for Warning message information.
5460 (LocationOfPreviousError): New method.
5461 (Warning): New method. Reports warning based on the warning table.
5462 (Error_T): New method. Reports error based on the error table.
5464 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
5465 verifications are done here.
5467 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
5469 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
5470 CLSCompliantAttribute.
5471 (all_imported_types): New member holds all imported types from other
5473 (LoadAllImportedTypes): New method fills static table with exported types
5474 from all referenced assemblies.
5475 (Modules): New property returns all assembly modules.
5477 2004-03-30 Miguel de Icaza <miguel@ximian.com>
5479 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
5480 throwing a parser error.
5482 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
5483 which removes the hardcoded get_/set_ prefixes for properties, as
5484 IL allows for the properties to be named something else.
5488 * expression.cs: Do not override operand before we know if it is
5491 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
5493 * typemanager.cs: support for pinned variables.
5495 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
5497 * decl.cs, typemanager.cs: Avoid using an arraylist
5498 as a buffer if there is only one result set.
5500 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
5502 * expression.cs: Make sure you cant call a static method
5503 with an instance expression, bug #56174.
5505 2004-03-29 Miguel de Icaza <miguel@ximian.com>
5507 * class.cs (IsDuplicateImplementation): Improve error reporting to
5508 flag 663 (method only differs in parameter modifier).
5510 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
5511 in preprocessor directives.
5513 * location.cs (LookupFile): Allow for the empty path.
5515 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
5516 better approach for some of that patch, but its failing with the
5517 CharSet enumeration. For now try/catch will do.
5519 * typemanager.cs: Do not crash if a struct does not have fields.
5522 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
5524 * expression.cs: cs0213, cant fix a fixed expression.
5527 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
5529 * cs-parser.jay: detect invalid embeded statements gracefully.
5532 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
5534 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
5537 the invocation type may not be a subclass of the tye of the item/
5538 The type of the item must be a subclass of the invocation item.
5543 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
5545 * attribute.cs: Added methods to get a string and a bool from an
5546 attribute. Required to information from AssemblyKeyFileAttribute,
5547 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
5548 * codegen.cs: Modified AssemblyName creation to include support for
5549 strongnames. Catch additional exceptions to report them as CS1548.
5550 * compiler.csproj: Updated include CryptoConvert.cs.
5551 * compiler.csproj.user: Removed file - user specific configuration.
5552 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
5553 Mono.Security assembly. The original class is maintained and tested in
5554 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
5555 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
5556 like CSC 8.0 (C# v2) supports.
5557 * Makefile: Added CryptoConvert.cs to mcs sources.
5558 * rootcontext.cs: Added new options for strongnames.
5560 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
5562 * driver.cs: For --expect-error, report error code `2'
5563 if the program compiled with no errors, error code `1' if
5564 it compiled with an error other than the one expected.
5566 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
5568 * compiler.csproj: Updated for Visual Studio .NET 2003.
5569 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
5570 * compiler.sln: Updated for Visual Studio .NET 2003.
5572 2004-03-24 Ravi Pratap M <ravi@ximian.com>
5574 * expression.cs: Fix bug #47234. We basically need to apply the
5575 rule that we prefer the conversion of null to a reference type
5576 when faced with a conversion to 'object' (csc behaviour).
5578 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
5580 * statement.cs: Shorter form for foreach, eliminates
5581 a local variable. r=Martin.
5583 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
5585 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
5586 checks if we can use brtrue/brfalse to test for 0.
5587 * expression.cs: use the above in the test for using brtrue/brfalse.
5590 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
5592 * expression.cs: Rewrite string concat stuff. Benefits:
5594 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
5595 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
5596 rather than a concat chain.
5598 * typemanager.cs: Add lookups for more concat overloads.
5600 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
5602 * expression.cs: Emit shorter il code for array init.
5619 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
5621 * statement.cs: Before, two switch blocks would be merged if the
5622 total size of the blocks (end_item - begin_item + 1) was less than
5623 two times the combined sizes of the blocks.
5625 Now, it will only merge if after the merge at least half of the
5630 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
5632 * class.cs : csc build fix for GetMethods(). See bug #52503.
5634 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
5636 * expression.cs: Make sure fp comparisons work with NaN.
5637 This fixes bug #54303. Mig approved this patch a long
5638 time ago, but we were not able to test b/c the runtime
5641 2004-03-19 Miguel de Icaza <miguel@ximian.com>
5643 * ecore.cs (TypExpr.GetHashCode): implement this overload.
5645 2004-03-19 Martin Baulig <martin@ximian.com>
5647 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
5648 two overloads may unify for some type parameter substitutions and
5649 report a CS0408 if appropriate.
5651 2004-03-19 Martin Baulig <martin@ximian.com>
5653 * class.cs (MemberCore.IsDuplicateImplementation): Report the
5654 error here and not in our caller.
5656 2004-03-19 Martin Baulig <martin@ximian.com>
5658 * interface.cs: Completely killed this file.
5659 (Interface): We're now a TypeContainer and live in class.cs.
5661 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
5662 argument; we're now also called for interfaces.
5663 (TypeContainer.DefineMembers): Allow this method being called
5665 (TypeContainer.GetMethods): New public method; formerly known as
5666 Interface.GetMethod(). This is used by PendingImplementation.
5667 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
5668 it's now private and non-static.
5669 (Interface): Moved this here; it's now implemented similar to
5671 (Method, Property, Event, Indexer): Added `bool is_interface'
5672 argument to their .ctor's.
5673 (MemberBase.IsInterface): New public field.
5675 * cs-parser.jay: Create normal Method, Property, Event, Indexer
5676 instances instead of InterfaceMethod, InterfaceProperty, etc.
5677 (opt_interface_base): Removed; we now use `opt_class_base' instead.
5678 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
5680 2004-03-19 Martin Baulig <martin@ximian.com>
5682 * class.cs (MethodCore.IsDuplicateImplementation): New private
5683 method which does the CS0111 checking.
5684 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
5685 Use IsDuplicateImplementation().
5687 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
5689 * decl.cs (FindMemberToOverride): New method to find the correct
5690 method or property to override in the base class.
5692 - Make Method/Property use the above method to find the
5693 version in the base class.
5694 - Remove the InheritableMemberSignatureCompare as it is now
5697 This patch makes large code bases much faster to compile, as it is
5698 O(n) rather than O(n^2) to do this validation.
5700 Also, it fixes bug 52458 which is that nested classes are not
5701 taken into account when finding the base class member.
5703 Reviewed/Approved by Martin.
5705 2004-03-17 Martin Baulig <martin@ximian.com>
5707 * expression.cs (MemberAccess.DoResolve): Take the parent's number
5708 of type arguments into account; use the `real_num_type_args'
5709 approach like in DoResolveAsTypeStep().
5711 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
5714 2004-03-17 Marek Safar <marek.safar@seznam.cz>
5716 * interface.cs: In all interface classes removed redundant
5717 member initialization.
5719 2004-03-16 Martin Baulig <martin@ximian.com>
5721 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5723 2004-03-15 Miguel de Icaza <miguel@ximian.com>
5725 * decl.cs (DefineTypeAndParents): New helper method to define a
5726 type's containers before the type itself is defined; This is a
5727 bug exposed by the recent changes to Windows.Forms when an
5728 implemented interface was defined inside a class that had not been
5731 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
5733 (Check): Loop correctly to report errors modifiers
5734 (UNSAFE was not in the loop, since it was the same as TOP).
5736 * interface.cs: Every interface member now takes a ModFlags,
5737 instead of a "is_new" bool, which we set on the base MemberCore.
5739 Every place where we called "UnsafeOk" in the interface, now we
5740 call the proper member (InterfaceMethod.UnsafeOK) instead to get
5741 the unsafe settings from the member declaration instead of the
5742 container interface.
5744 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
5746 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5747 `set_indexer_name' to the pending bits (one per type).
5749 We fixed a bug today that was picking the wrong method to
5750 override, since for properties the existing InterfaceMethod code
5751 basically ignored the method name. Now we make sure that the
5752 method name is one of the valid indexer names.
5754 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
5756 * support.cs (SeekableStreamReader): Keep track of stream byte
5757 positions and don't mix them with character offsets to the buffer.
5759 Patch from Gustavo Giráldez
5761 2004-03-15 Marek Safar <marek.safar@seznam.cz>
5763 * interface.cs (InterfaceSetGetBase): Removed double member
5764 initialization, base class does it as well.
5766 2004-03-13 Martin Baulig <martin@ximian.com>
5768 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
5769 when compiling corlib.
5771 2004-03-13 Miguel de Icaza <miguel@ximian.com>
5773 * convert.cs (ExplicitConversion): We were reporting an error on
5774 certain conversions (object_type source to a value type, when the
5775 expression was `null') before we had a chance to pass it through
5776 the user defined conversions.
5778 * driver.cs: Replace / and \ in resource specifications to dots.
5781 * class.cs: Add check for duplicate operators. Fixes 52477
5783 2004-03-11 Miguel de Icaza <miguel@ximian.com>
5785 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
5786 that are in the middle of the statements, not only at the end.
5789 * class.cs (TypeContainer.AddField): No longer set the
5790 `HaveStaticConstructor' flag, now we call it
5791 `UserDefineStaticConstructor' to diferentiate the slightly
5792 semantic difference.
5794 The situation is that we were not adding BeforeFieldInit (from
5795 Modifiers.TypeAttr) to classes that could have it.
5796 BeforeFieldInit should be set to classes that have no static
5801 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
5803 And most importantly Zoltan's comment:
5805 http://bugzilla.ximian.com/show_bug.cgi?id=44229
5807 "I think beforefieldinit means 'it's ok to initialize the type sometime
5808 before its static fields are used', i.e. initialization does not need
5809 to be triggered by the first access to the type. Setting this flag
5810 helps the JIT to compile better code, since it can run the static
5811 constructor at JIT time, and does not need to generate code to call it
5812 (possibly lots of times) at runtime. Unfortunately, mcs does not set
5813 this flag for lots of classes like String.
5815 csc sets this flag if the type does not have an explicit static
5816 constructor. The reasoning seems to be that if there are only static
5817 initalizers for a type, and no static constructor, then the programmer
5818 does not care when this initialization happens, so beforefieldinit
5821 This bug prevents the AOT compiler from being usable, since it
5822 generates so many calls to mono_runtime_class_init that the AOT code
5823 is much slower than the JITted code. The JITted code is faster,
5824 because it does not generate these calls if the vtable is type is
5825 already initialized, which is true in the majority of cases. But the
5826 AOT compiler can't do this."
5828 2004-03-10 Miguel de Icaza <miguel@ximian.com>
5830 * class.cs (MethodData.Emit): Refactor the code so symbolic
5831 information is generated for destructors; For some reasons we
5832 were taking a code path that did not generate symbolic information
5835 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
5837 * class.cs: Create a Constructor.CheckBase method that
5838 takes care of all validation type code. The method
5839 contains some code that was moved from Define.
5841 It also includes new code that checks for duplicate ctors.
5842 This fixes bug #55148.
5844 2004-03-09 Joshua Tauberer <tauberer@for.net>
5846 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
5847 a { ... }-style array creation invokes EmitStaticInitializers
5848 which is not good for reference-type arrays. String, decimal
5849 and now null constants (NullCast) are not counted toward
5850 static initializers.
5852 2004-03-05 Martin Baulig <martin@ximian.com>
5854 * location.cs (SourceFile.HasLineDirective): New public field;
5855 specifies whether the file contains or is referenced by a "#line"
5857 (Location.DefineSymbolDocuments): Ignore source files which
5858 either contain or are referenced by a "#line" directive.
5860 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
5862 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
5863 direct access to our parent, so check the method inline there.
5865 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
5867 * expression.cs (Invocation.EmitCall): Miguel's last commit
5868 caused a regression. If you had:
5873 In Foo the implict this would be null.
5875 2004-02-27 Miguel de Icaza <miguel@ximian.com>
5877 * expression.cs (Invocation.EmitCall): If the method is not
5878 virtual, do not emit a CallVirt to it, use Call.
5880 * typemanager.cs (GetFullNameSignature): Improve the method to
5881 cope with ".ctor" and replace it with the type name.
5883 * class.cs (ConstructorInitializer.Resolve): Now the method takes
5884 as an argument the ConstructorBuilder where it is being defined,
5885 to catch the recursive constructor invocations.
5887 2004-03-16 Martin Baulig <martin@ximian.com>
5889 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
5890 ConstructedType, call ResolveType() on it to get the type rather
5891 than just using `expr.Type'.
5893 2004-03-16 Martin Baulig <martin@ximian.com>
5895 * generics.cs (ConstructedType.GetMemberAccess): Take the
5896 EmitContext instead on the TypeExpr and use
5897 ec.TypeContainer.CurrentType/ec.ContainerType.
5899 2004-03-16 Martin Baulig <martin@ximian.com>
5901 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
5902 parameters before aliases.
5904 2004-03-16 Martin Baulig <martin@ximian.com>
5906 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
5907 New oublic function; checks whether two generic instances may become
5908 equal under some instantiations (26.3.1).
5910 * class.cs (TypeContainer.Define): Call
5911 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
5914 2004-03-16 Martin Baulig <martin@ximian.com>
5916 * class.cs (TypeContainer.GetClassBases): Moved
5917 Error_TypeParameterAsBase() here and also check whether the base
5918 class is not an attribute.
5920 2004-03-16 Martin Baulig <martin@ximian.com>
5922 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5924 2004-03-16 Martin Baulig <martin@ximian.com>
5926 * class.cs (Error_TypeParameterAsBase): Use correct error number
5929 2004-03-16 Martin Baulig <martin@ximian.com>
5931 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
5934 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
5937 2004-03-15 Martin Baulig <martin@ximian.com>
5939 * typemanager.cs (TypeManager.GetFullName): New public method.
5940 (TypeManager.MemberLookup): Added `int_num_type_arguments'
5941 argument; only return members with the correct number of type
5943 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
5944 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
5945 whether the number of type arguments matches.
5947 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
5948 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
5950 * expression.cs (MemberAccess): Added public `NumTypeArguments'
5951 field; it's set by the protected .ctor when we're actually a
5952 GenericMemberAccess.
5953 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
5954 arguments and pass it to MemberLookupFinal ().
5956 * ecore.cs (Expression.MemberLookup): Added `int
5957 num_type_arguments' argument; only return members with the correct
5958 number of type arguments.
5959 (Expression.MemberLookupFailed): Check whether the MemberLookup
5960 failed because we did not have the correct number of type
5961 arguments; report CS0305 in this case.
5963 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
5964 `e.ResolveAsTypeTerminal()' already did so.
5966 2004-03-15 Martin Baulig <martin@ximian.com>
5968 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
5969 we're a ConstructedType; in this case, the caller must report an
5970 error (for instance CS0131).
5972 * generic.cs (TypeArguments): Added Location argument to the .ctor.
5973 (TypeArguments.Resolve): Actually report errors here.
5975 2004-03-15 Miguel de Icaza <miguel@ximian.com>
5977 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
5978 `set_indexer_name' to the pending bits (one per type).
5980 We fixed a bug today that was picking the wrong method to
5981 override, since for properties the existing InterfaceMethod code
5982 basically ignored the method name. Now we make sure that the
5983 method name is one of the valid indexer names.
5985 2004-03-15 Martin Baulig <martin@ximian.com>
5987 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
5988 for generic instances.
5990 2004-03-13 Martin Baulig <martin@ximian.com>
5992 * class.cs (TypeContainer.DefineType): Call
5993 TypeManager.AddUserType() immediately after creating the
5994 TypeBuilder; pass all type parameters when creating the
5997 * decl.cs (DeclSpace.FindNestedType): New public method.
5998 (DeclSpace.FindType): Added `int num_type_args' argument; only
5999 return types with the correct number of type parameters.
6000 (DeclSpace.CountTypeParams): New public property.
6002 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
6003 the number of type parameters; defaults to zero.
6005 * generic.cs (TypeArguments.Count): New public property.
6006 (ConstructedType.DoResolveAsTypeStep): First call
6007 ds.FindNestedType() to find out whether we're nested in the
6008 current generic type; in this case, we inherit all type parameters
6009 from the current class.
6011 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
6012 num_type_args' argument.
6013 (RootContext.LookupType): Added overloaded version which takes the
6014 number of type arguments; only return types with the correct
6015 number of type arguments.
6017 * typemanager.cs (TypeManager.CheckGeneric): New public function;
6018 checks whether `Type t' has `int num_type_args'.
6020 2004-03-13 Martin Baulig <martin@ximian.com>
6022 * generic.cs (GenericMethod.DefineType): New method; calls
6023 DefineType() on all the type parameters.
6025 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
6026 (MethodData.Define): If we're a generic method, call
6027 GenericMethod.DefineType() to define the type parameters.
6029 2004-03-10 Martin Baulig <martin@ximian.com>
6031 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
6032 instead of IsAssignableFrom.
6034 2004-03-10 Martin Baulig <martin@ximian.com>
6036 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
6038 * support.cs (ParameterData.HasArrayParameter): New property.
6039 (ReflectionParameters.ctor): Take a MethodBase instead of a
6040 ParameterInfo[]. If we have any type parameters, get the generic
6041 method definition and ask it whether we have variable arguments.
6043 2004-02-26 Miguel de Icaza <miguel@ximian.com>
6045 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
6046 routines to check if a type is an enumerable/enumerator allow
6047 classes that implement the IEnumerable or IEnumerator interfaces.
6049 * class.cs (Property, Operator): Implement IIteratorContainer, and
6050 implement SetYields.
6052 (Property.Define): Do the block swapping for get_methods in the
6053 context of iterators. We need to check if Properties also
6054 include indexers or not.
6056 (Operator): Assign the Block before invoking the
6057 OperatorMethod.Define, so we can trigger the Iterator code
6060 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
6061 Property and Operator classes are not created when we parse the
6062 declarator but until we have the block completed, so we use a
6063 singleton SimpleIteratorContainer.Simple to flag whether the
6064 SetYields has been invoked.
6066 We propagate this setting then to the Property or the Operator to
6067 allow the `yield' to function.
6069 2004-02-25 Marek Safar <marek.safar@seznam.cz>
6071 * codegen.cs: Implemented attribute support for modules.
6072 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
6073 Assembly/Module functionality.
6075 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
6076 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
6077 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
6079 2004-02-16 Marek Safar <marek.safar@seznam.cz>
6081 * interface.cs (FindMembers): The operation is performed on all base
6082 interfaces and not only on the first. It is required for future CLS Compliance patch.
6084 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
6086 * statement.cs, codegen.cs:
6087 This patch deals with patterns such as:
6089 public class List : IEnumerable {
6091 public MyEnumerator GetEnumerator () {
6092 return new MyEnumerator(this);
6095 IEnumerator IEnumerable.GetEnumerator () {
6099 public struct MyEnumerator : IEnumerator {
6104 Before, there were a few things we did wrong:
6105 1) we would emit callvirt on a struct, which is illegal
6106 2) we emited ldarg when we needed to emit ldarga
6107 3) we would mistakenly call the interface methods on an enumerator
6108 type that derived from IEnumerator and was in another assembly. For example:
6110 public class MyEnumerator : IEnumerator
6112 Would have the interface methods called, even if there were public impls of the
6113 method. In a struct, this lead to invalid IL code.
6115 2004-02-11 Marek Safar <marek.safar@seznam.cz>
6117 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
6120 * delegate.cs (Define): Fixed crash when delegate type is undefined.
6122 2004-02-11 Miguel de Icaza <miguel@ximian.com>
6124 * cs-parser.jay: Fix small regression: we were not testing V2
6125 compiler features correctly.
6127 * interface.cs: If the emit context is null, then create one
6129 2004-02-09 Marek Safar <marek.safar@seznam.cz>
6131 * decl.cs (GetSignatureForError): New virtual method to get full name
6134 * attribute.cs (IAttributeSupport): New interface for attribute setting.
6135 Now it is possible to rewrite ApplyAttributes method to be less if/else.
6137 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
6138 Duplicated members and code in these classes has been removed.
6139 Better encapsulation in these classes.
6141 2004-02-07 Miguel de Icaza <miguel@ximian.com>
6143 * assign.cs (Assign.DoResolve): When dealing with compound
6144 assignments, there is a new rule in ECMA C# 2.4 (might have been
6145 there before, but it is documented here) that states that in:
6149 If b is of type int, and the `op' is a shift-operator, then the
6150 above is evaluated as:
6154 * expression.cs (Binary.ResolveOperator): Instead of testing for
6155 int/uint/long/ulong, try to implicitly convert to any of those
6156 types and use that in pointer arithmetic.
6158 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
6159 method to print information for from the type, not from the
6160 null-method we were given.
6162 2004-02-01 Duncan Mak <duncan@ximian.com>
6164 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
6165 parsing for cmd, fixes bug #53694.
6167 2004-02-04 Marek Safar <marek.safar@seznam.cz>
6169 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
6170 in the member name duplication tests. Property and operator name duplication
6171 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
6173 2004-02-03 Marek Safar <marek.safar@seznam.cz>
6175 * interface.cs (PopulateMethod): Fixed crash when interface method
6176 returns not existing type (error test cs0246-3.cs).
6178 2004-02-02 Ravi Pratap M <ravi@ximian.com>
6180 * cs-parser.jay (interface_accessors): Re-write actions to also
6181 store attributes attached to get and set methods. Fix spelling
6184 (inteface_property_declaration): Modify accordingly.
6186 (InterfaceAccessorInfo): New helper class to store information to pass
6187 around between rules that use interface_accessors.
6189 * interface.cs (Emit): Apply attributes on the get and set
6190 accessors of properties and indexers too.
6192 * attribute.cs (ApplyAttributes): Modify accordingly to use the
6193 right MethodBuilder when applying attributes to the get and set accessors.
6195 2004-01-31 Miguel de Icaza <miguel@ximian.com>
6197 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
6199 2004-01-26 Miguel de Icaza <miguel@ximian.com>
6201 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
6203 2004-01-25 Miguel de Icaza <miguel@ximian.com>
6205 * cs-parser.jay: Remove YIELD token, instead use the new grammar
6206 changes that treat `yield' specially when present before `break'
6209 * cs-tokenizer.cs: yield is no longer a keyword.
6211 2004-01-23 Marek Safar <marek.safar@seznam.cz>
6213 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
6214 setting for default constructors.
6215 For default constructors are almost every time set wrong Modifier. The
6216 generated IL code has been alright. But inside mcs this values was
6217 wrong and this was reason why several of my CLS Compliance tests
6220 2004-02-27 Martin Baulig <martin@ximian.com>
6222 * generics.cs (ConstructedType.ResolveType): Make the nested type
6223 stuff actually work.
6225 2004-02-25 Martin Baulig <martin@ximian.com>
6227 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
6228 property; returns the type parameters just from the current type,
6229 ie. with the ones from outer classes.
6230 (DeclSpace.LookupGeneric): First search in the current class, then
6232 (DeclSpace.initialize_type_params): When hiding a type parameter
6233 from an outer class, put it into the `type_param_list' anyways.
6235 * expression.cs (MemberAccess.expr): Made this field protected.
6237 * class.cs (TypeContainer.Define): The `CurrentType' just contains
6238 the type parameters from the current class.
6240 * generic.cs (ConstructedType.ResolveType): Support nested generic
6241 types by taking the type parameters which we inherit from outer
6242 classes into account.
6243 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
6244 support for nested generic types.
6246 2004-02-23 Martin Baulig <martin@ximian.com>
6248 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
6249 field and check whether we're nested inside a generic type.
6250 (DeclSpace.ResolveType): If we're resolving to a generic type
6251 definition, create a ConstructedType and return its resolved type.
6252 (DeclSpace.initialize_type_params): New private method;
6253 initializes the `type_param_list' field from the type parameters
6254 from this and all enclosing classes.
6255 (DeclSpace.TypeParameters): Call initialize_type_params() unless
6256 we're already initialized.
6258 2004-02-23 Martin Baulig <martin@ximian.com>
6260 * class.cs (Method.Define): Create the generic method before
6262 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
6263 the TypeContainer one); we use this for generic methods.
6265 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
6266 parent's TypeBuilder.
6268 2004-02-18 Martin Baulig <martin@ximian.com>
6270 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
6271 to check for equality.
6273 2004-02-05 Martin Baulig <martin@ximian.com>
6275 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
6276 `ec.TypeContainer.CurrentType', use it instead of
6277 `ec.ContainerType' to check whether we're in the type's ctor.
6279 2004-01-29 Martin Baulig <martin@ximian.com>
6281 * expression.cs (Invocation.DoResolve): If we're a
6282 `ConstructedType', then we're actually a generic method, so
6283 rewrite the expr as a GenericMemberAccess.
6285 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
6286 here; manually parse it into a string.
6288 2004-01-28 Martin Baulig <martin@ximian.com>
6290 * typemanager.cs (TypeManager.IsEqual): New static method.
6291 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
6292 check for equality instead of using `=='.
6294 2004-01-26 Martin Baulig <martin@ximian.com>
6296 * decl.cs (DeclSpace.CurrentType): New public field.
6298 * expression.cs (This.ResolveBase): If we have an
6299 `ec.TypeContainer.CurrentType', use it instead of
6302 * class.cs (TypeContainer.DefineType): If we're a generic type,
6303 create the `CurrentType' (unresolved).
6304 (TypeContainer.GenericType): New private field.
6305 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
6306 it and store it in `GenericType' before creating the MemberCache.
6307 (TypeContainer.GetMembers): If we have a `GenericType', call
6308 TypeManager.FindMembers() on it.
6310 * interface.cs (Interface.GenericType): New private field.
6311 (Interface.DefineType): If we're a generic type, create the
6312 `CurrentType' (unresolved).
6313 (Interface.DefineMembers): If we have a `CurrentType', resolve it
6314 and store it in `GenericType' before creating the MemberCache.
6315 (Interface.GetMembers): If we have a `GenericType', call
6316 TypeManager.FindMembers() on it.
6318 2004-01-22 Martin Baulig <martin@ximian.com>
6320 * cs-parser.jay (namespace_or_type_name): Return an Expression,
6321 not a QualifiedIdentifier. This is what `type_name_expression'
6322 was previously doing.
6323 (type_name_expression): Removed; the code is now in
6324 `namespace_or_type_name'.
6325 (qualified_identifier): Removed, use `namespace_or_type_name'
6327 (QualifiedIdentifier): Removed this class.
6329 2004-01-22 Martin Baulig <martin@ximian.com>
6331 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
6332 not a string as alias name.
6334 2004-01-21 Miguel de Icaza <miguel@ximian.com>
6336 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
6337 #52730 bug, and instead compute correctly the need to use a
6338 temporary variable when requesting an address based on the
6339 static/instace modified of the field and the constructor.
6341 2004-01-21 Martin Baulig <martin@ximian.com>
6343 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
6344 class and namespace before looking up aliases. Fixes #52517.
6346 2004-01-21 Martin Baulig <martin@ximian.com>
6348 * flowanalysis.cs (UsageVector.Merge): Allow variables being
6349 assinged in a 'try'; fixes exception4.cs.
6351 2004-01-21 Marek Safar <marek.safar@seznam.cz>
6352 * class.cs : Implemented parameter-less constructor for TypeContainer
6354 * decl.cs: Attributes are now stored here. New property OptAttributes
6356 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
6358 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
6360 2004-01-21 Marek Safar <marek.safar@seznam.cz>
6362 * typemanager.cs (CSharpSignature): Now reports also inner class name.
6363 (CSharpSignature): New method for indexer and property signature.
6365 2004-01-21 Marek Safar <marek.safar@seznam.cz>
6367 * pending.cs (IsVirtualFilter): Faster implementation.
6369 2004-01-21 Marek Safar <marek.safar@seznam.cz>
6371 * typemanager.cs: Avoid inclusion of same assembly more than once.
6373 2004-01-21 Marek Safar <marek.safar@seznam.cz>
6375 * cs-parser.jay: Fixed problem where the last assembly attribute
6376 has been applied also to following declaration (class, struct, etc.)
6378 2004-01-21 Marek Safar <marek.safar@seznam.cz>
6380 * class.cs: Added error CS0538, CS0539 reporting.
6381 Fixed crash on Microsoft runtime when field type is void.
6383 * cs-parser.jay: Added error CS0537 reporting.
6385 * pending.cs: Added error CS0535 reporting.
6386 Improved error report for errors CS0536, CS0534.
6388 2004-01-20 Miguel de Icaza <miguel@ximian.com>
6390 Merge a few bits from the Anonymous Method MCS tree.
6392 * statement.cs (ToplevelBlock): New class for toplevel methods,
6393 will hold anonymous methods, lifted variables.
6395 * cs-parser.jay: Create toplevel blocks for delegates and for
6396 regular blocks of code.
6398 2004-01-20 Martin Baulig <martin@ximian.com>
6400 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
6401 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
6402 and `NeedExplicitReturn'; added `IsLastStatement'.
6403 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
6404 have a `ReturnLabel' or we're not unreachable.
6406 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
6407 child's reachability; don't just override ours with it. Fixes
6408 #58058 (lluis's example).
6409 (FlowBranching): Added public InTryOrCatch(), InCatch(),
6410 InFinally(), InLoop(), InSwitch() and
6411 BreakCrossesTryCatchBoundary() methods.
6413 * statement.cs (Return): Do all error checking in Resolve().
6414 Unless we are the last statement in a top-level block, always
6415 create a return label and jump to it.
6416 (Break, Continue): Do all error checking in Resolve(); also make
6417 sure we aren't leaving a `finally'.
6418 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
6419 statement in a top-level block.
6420 (Block.Flags): Added `IsDestructor'.
6421 (Block.IsDestructor): New public property.
6423 2004-01-20 Martin Baulig <martin@ximian.com>
6425 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
6427 2004-01-20 Martin Baulig <martin@ximian.com>
6429 * statement.cs (Statement.ResolveUnreachable): New public method.
6430 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
6431 (Block.Resolve): Resolve unreachable statements.
6433 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
6435 * expression.cs: We need to fix the case where we do
6436 not have a temp variable here.
6438 * assign.cs: Only expression compound assignments need
6439 temporary variables.
6441 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
6443 * flowanalysis.cs: Reduce memory allocation in a few ways:
6444 - A block with no variables should not allocate a bit
6446 - A method with no out parameters does not need any tracking
6447 for assignment of the parameters, so we need not allocate
6450 public readonly Type[] VariableTypes;
6451 public readonly string[] VariableNames;
6452 Are redundant. The data is already stored in the variable
6453 map, so we need not allocate another array for it.
6454 - We need to add alot of checks for if (params | locals) == null
6455 due to the first two changes.
6457 2004-01-18 Miguel de Icaza <miguel@ximian.com>
6459 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
6460 implement IMemoryLocation, we store a copy on a local variable and
6461 take the address of it. Patch from Benjamin Jemlich
6463 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
6464 to use a special "type_name_expression" rule which reduces the
6465 number of "QualifiedIdentifier" classes created, and instead
6466 directly creates MemberAccess expressions.
6468 2004-01-17 Miguel de Icaza <miguel@ximian.com>
6470 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
6471 that fixes #52853. Null literal assignment to ValueType
6473 * class.cs (MethodData.Emit): Instead of checking the name of the
6474 method to determine if its a destructor, create a new derived
6475 class from Method called Destructor, and test for that.
6477 * cs-parser.jay: Create a Destructor object instead of a Method.
6479 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
6483 2004-01-16 Miguel de Icaza <miguel@ximian.com>
6485 * expression.cs (Binary.ResolveOperator): Perform an implicit
6486 conversion from MethodGroups to their delegate types on the
6489 * delegate.cs: Introduce a new class DelegateCreation that is the
6490 base class for `NewDelegate' and `ImplicitDelegateCreation',
6491 factor some code in here.
6493 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
6494 conversion from MethodGroups to compatible delegate types.
6496 * ecore.cs (Expression.Resolve): Do not flag error 654
6497 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
6498 we allow conversions from MethodGroups to delegate types now.
6500 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
6501 assignments in v2 either.
6503 2004-01-10 Miguel de Icaza <miguel@ximian.com>
6505 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
6506 static read-only fields in ctors.
6508 Applied patch from Benjamin Jemlich
6510 * expression.cs (UnaryMutator): Avoid leaking local variables.
6512 2004-01-09 Miguel de Icaza <miguel@ximian.com>
6514 * cs-tokenizer.cs (IsCastToken): Allow the various native types
6515 here to return true, as they can be used like this:
6519 Fixed 49836 and all the other dups
6521 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
6523 * driver.cs: Implement /win32res and /win32icon.
6525 2004-01-08 Miguel de Icaza <miguel@ximian.com>
6527 * cs-parser.jay: Add a rule to improve error handling for the
6528 common mistake of placing modifiers after the type.
6530 2004-01-07 Miguel de Icaza <miguel@ximian.com>
6532 * cs-parser.jay (interface_event_declaration): Catch
6533 initialization of events on interfaces, and report cs0068
6535 * cs-parser.jay (interface_event_declaration): Catch
6536 initialization of events.
6538 * ecore.cs: Better report missing constructors.
6540 * expression.cs (Binary.ResolveOperator): My previous bug fix had
6541 the error reporting done in the wrong place. Fix.
6543 * expression.cs (Binary.ResolveOperator): Catch the
6544 operator + (E x, E y) error earlier, and later allow for implicit
6545 conversions in operator +/- (E e, U x) from U to the underlying
6548 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
6549 52596, if the container class is abstract, the default constructor
6550 is protected otherwise its public (before, we were always public).
6552 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
6555 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
6556 Jemlich that fixes bug #52597, MCS was generating invalid code for
6557 idisposable structs. Thanks to Ben for following up with this
6560 2004-01-06 Miguel de Icaza <miguel@ximian.com>
6562 * driver.cs: Allow assemblies without code to be generated, fixes
6565 2004-01-07 Nick Drochak <ndrochak@gol.com>
6567 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
6569 2004-01-05 Miguel de Icaza <miguel@ximian.com>
6571 * cs-parser.jay: Add rules to improve error reporting if fields or
6572 methods are declared at the namespace level (error 116)
6574 * Add rules to catch event add/remove
6576 2004-01-04 David Sheldon <dave-mono@earth.li>
6578 * expression.cs: Added matching ")" to error message for
6581 2004-01-03 Todd Berman <tberman@gentoo.org>
6583 * ecore.cs, attribute.cs:
6584 Applying fix from #52429.
6586 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
6588 * ecore.cs, expression.cs, statement.cs:
6589 Total rewrite of how we handle branching. We
6590 now handle complex boolean expressions with fewer
6591 jumps. As well if (x == 0) no longer emits a ceq.
6593 if (x is Foo) is much faster now, because we generate
6596 Overall, we get a pretty big improvement on our benchmark
6597 tests. The code we generate is smaller and more readable.
6599 I did a full two-stage bootstrap. The patch was reviewed
6600 by Martin and Miguel.
6602 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
6604 * cs-parser.jay: Make primary_expression not take a QI.
6605 we dont need this because the member_access rule covers
6606 us here. So we replace the rule with just IDENTIFIER.
6608 This has two good effects. First, we remove a s/r conflict.
6609 Second, we allocate many fewer QualifiedIdentifier objects.
6611 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
6613 * attribute.cs: Handle MarshalAs attributes as pseudo, and
6614 set the correct information via SRE. This prevents
6615 hanging on the MS runtime. Fixes #29374.
6617 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
6619 * convert.cs: correctly handle conversions to value types
6620 from Enum and ValueType as unboxing conversions.
6622 Fixes bug #52569. Patch by Benjamin Jemlich.
6624 2004-01-02 Ravi Pratap <ravi@ximian.com>
6626 * expression.cs (BetterConversion): Prefer int -> uint
6627 over int -> ulong (csc's behaviour). This fixed bug #52046.
6629 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
6631 * decl.cs (MemberCache.FindMembers): now returns a
6634 * typemanager.cs: In general, go with with ^^.
6635 (CopyNewMethods): take an IList.
6636 (RealMemberLookup): Only allocate an arraylist
6637 if we copy from two sets of methods.
6639 This change basically does two things:
6640 1) Fewer array lists allocated due to CopyNewMethods.
6641 2) the explicit cast in MemberList costed ALOT.
6643 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
6645 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
6646 a hashtable to avoid needless string allocations when an identifier is
6647 used more than once (the common case).
6649 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
6651 * pending.cs: MS's TypeBuilder.GetInterfaces ()
6652 is broken, it will not return anything. So, we
6653 have to use the information we have in mcs to
6656 * typemanager.cs: Add a cache for GetInterfaces,
6657 since this will now be used more often (due to ^^)
6659 (GetExplicitInterfaces) New method that gets the
6660 declared, not effective, interfaces on a type
6661 builder (eg, if you have interface IFoo, interface
6662 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
6665 This patch makes MCS able to bootstrap itself on
6668 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
6670 * expression.cs: Remove the Nop's that Miguel put
6673 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
6675 * report.cs, codegen.cs: Give the real stack trace to
6676 the error when an exception is thrown.
6678 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
6680 * decl.cs: only allocate hashtables for ifaces if
6683 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
6685 * expression.cs: fix the error from cs0121-2.cs
6686 (a parent interface has two child interfaces that
6687 have a function with the same name and 0 params
6688 and the function is called through the parent).
6690 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
6692 * class.cs, rootcontext.cs, typmanager.cs: do not
6695 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
6697 * codegen.cs: remove stack for the ec flow branching.
6698 It is already a linked list, so no need.
6700 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
6702 * Makefile: Allow custom profiler here.
6704 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
6706 * typemanager.cs (LookupType):
6707 - Use a static char [], because split takes
6708 a param array for args, so it was allocating
6710 - Do not store true in a hashtable, it boxes.
6712 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
6714 * flowanalysis.cs: bytify common enums.
6716 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
6718 * modifiers.cs: Add a new set of flags for the
6719 flags allowed on explicit interface impls.
6720 * cs-parser.jay: catch the use of modifiers in
6721 interfaces correctly.
6722 * class.cs: catch private void IFoo.Blah ().
6724 All related to bug #50572.
6726 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
6728 * decl.cs: Rewrite the consistant accessability checking.
6729 Accessability is not linear, it must be implemented in
6730 a tableish way. Fixes #49704.
6732 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
6734 * expression.cs: Handle negation in a checked context.
6735 We must use subtraction from zero. Fixes #38674.
6737 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
6739 * class.cs: Ignore static void main in DLLs.
6740 * rootcontext.cs: Handle the target type here,
6741 since we are have to access it from class.cs
6742 * driver.cs: account for the above.
6744 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
6746 * report.cs: Give line numbers and files if available.
6748 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
6750 * driver.cs: Implement /addmodule.
6752 * typemanager.cs: Change 'modules' field so it now contains Modules not
6755 2003-12-20 Martin Baulig <martin@ximian.com>
6757 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
6758 (FieldBase.IsAssigned): Removed this field.
6759 (FieldBase.SetAssigned): New public method.
6760 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
6762 2003-12-20 Martin Baulig <martin@ximian.com>
6764 * expression.cs (LocalVariableReference.DoResolve): Don't set
6765 `vi.Used' if we're called from DoResolveLValue().
6767 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
6768 returns the usage vector it just merged into the current one -
6769 pass this one to UsageWarning().
6770 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
6771 of the `EmitContext', don't call this recursively on our children.
6773 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
6775 * driver.cs: Implement /target:module.
6777 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
6779 * support.cs (CharArrayHashtable): New helper class.
6781 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
6782 char arrays, not strings, so we can avoid creating a string in
6783 consume_identifier if the identifier is a keyword.
6785 2003-12-16 Martin Baulig <martin@ximian.com>
6787 * statement.cs (LocalInfo.Assigned): Removed this property.
6788 (LocalInfo.Flags): Removed `Assigned'.
6789 (LocalInfo.IsAssigned): New public method; takes the EmitContext
6790 and uses flow analysis.
6791 (Block.UsageWarning): Made this method private.
6792 (Block.Resolve): Call UsageWarning() if appropriate.
6794 * expression.cs (LocalVariableReference.DoResolve): Always set
6795 LocalInfo.Used here.
6797 2003-12-13 Martin Baulig <martin@ximian.com>
6799 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
6800 any value here; we're now using flow analysis to figure out
6801 whether a statement/block returns a value.
6803 2003-12-13 Martin Baulig <martin@ximian.com>
6805 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
6807 (FlowBranching.MergeFinally): Don't call
6808 `branching.CheckOutParameters()' here, this is called in
6810 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
6811 when adding the `finally' vector.
6813 2003-12-13 Martin Baulig <martin@ximian.com>
6816 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
6817 actually work and also fix #48962.
6819 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
6821 * decl.cs: Do not check System.Object for nested types,
6822 since we know it does not have any. Big bang for buck:
6827 corlib: 17.99 seconds
6831 corlib: 17.39 seconds
6833 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
6835 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
6836 time we are returning 0 members, so we save alot here.
6838 2003-12-11 Martin Baulig <martin@ximian.com>
6840 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
6841 `MergeChild()', also just take the `FlowBranching' as argument;
6842 call Merge() on it and return the result.
6843 (FlowBranching.Merge): We don't need to do anything if we just
6846 2003-12-11 Martin Baulig <martin@ximian.com>
6848 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
6849 them in an `ArrayList' to reduce memory usage. Thanks to Ben
6850 Maurer for this idea.
6852 2003-12-11 Martin Baulig <martin@ximian.com>
6854 * flowanalysis.cs (MergeResult): This class is now gone; we now
6855 use the `UsageVector' for this. The reason for this is that if a
6856 branching just has one sibling, we don't need to "merge" them at
6857 all - that's the next step to do.
6858 (FlowBranching.Merge): We now return a `UsageVector' instead of a
6861 2003-12-11 Martin Baulig <martin@ximian.com>
6863 Reworked flow analyis and made it more precise and bug-free. The
6864 most important change is that we're now using a special `Reachability'
6865 class instead of having "magic" meanings of `FlowReturns'. I'll
6866 do some more cleanups and optimizations and also add some more
6867 documentation this week.
6869 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
6870 largely reworked this class.
6871 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
6872 the new `Reachability' class instead of having "magic" values here.
6873 (FlowBranching): We're now using an instance of `Reachability'
6874 instead of having separate `Returns', `Breaks' etc. fields.
6876 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
6877 based on flow analysis; ignore the return value of block.Emit ().
6879 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
6881 * driver.cs typemanager.cs: Find the mono extensions to corlib even
6882 if they are private.
6884 2003-12-09 Martin Baulig <martin@ximian.com>
6886 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
6887 call them directly on the UsageVector.
6889 2003-12-09 Martin Baulig <martin@ximian.com>
6891 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
6892 Changed return type from `FlowReturns' to `Reachability'.
6894 2003-12-09 Martin Baulig <martin@ximian.com>
6896 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
6897 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
6898 `Reachable' fields with a single `Reachability' one.
6900 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
6902 * class.cs (FindMembers): Remove foreach's.
6915 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
6920 This patch does a few things:
6921 1. EmptyStatement is now a singleton, so it is never reallocated.
6922 2. All blah is EmptyStatement constructs have been changed to
6923 blah == EmptyStatement.Value, which is much faster and valid
6924 now that EmptyStatement is a singleton.
6925 3. When resolving a block, rather than allocating a new array for
6926 the non-empty statements, empty statements are replaced with
6927 EmptyStatement.Value
6928 4. Some recursive functions have been made non-recursive.
6929 Mainly the performance impact is from (3), however (1) and (2) are needed for
6930 this to work. (4) does not make a big difference in normal situations, however
6931 it makes the profile look saner.
6936 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6937 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
6938 Total memory allocated: 56397 KB
6941 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
6942 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
6943 Total memory allocated: 55666 KB
6945 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
6947 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
6948 than the hashtable in a hashtable version
6950 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
6951 we always end up concating a string. This results in a huge perf
6952 loss, because many strings have to be tracked by the GC. In this
6953 patch, we first use a hashtable that works with two keys, so that
6954 the strings do not need to be concat'ed.
6965 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
6967 * Makefile: Add a new target `do-time' that does a quick and simple
6968 profile, leaving easy to parse output.
6970 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
6972 * codegen.cs (Init): Create the dynamic assembly with
6973 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
6975 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
6977 * support.cs: Make the PtrHashtable use only one
6978 instance of its comparer.
6980 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
6982 * typemanager.cs: Fix lookup of GetNamespaces.
6984 2003-11-29 Miguel de Icaza <miguel@ximian.com>
6986 * expression.cs: Removed redundant line.
6988 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
6989 ArrayLists, use for loops with bounds.
6991 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
6994 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
6995 arraylists, use for loop with bounds.
6997 The above three changes give us a 0.071 second performance
6998 improvement out of 3.294 seconds down to 3.223. On my machine
6999 the above changes reduced the memory usage by 1,387 KB during
7002 * cs-parser.jay (QualifiedIdentifier): New class used to represent
7003 QualifiedIdentifiers. Before we created a new string through
7004 concatenation, and mostly later on, the result would be
7005 manipulated by DecomposeQI through string manipulation.
7007 This reduced the compiler memory usage for bootstrapping from
7008 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
7009 compile times in 0.05 seconds.
7011 2003-11-28 Dick Porter <dick@ximian.com>
7013 * support.cs: Do string compares with the Invariant culture.
7021 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
7022 the comparison is done with the Invariant culture.
7024 2003-11-27 Miguel de Icaza <miguel@ximian.com>
7026 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
7027 GetEnumerator method.
7029 (ProbeCollectionType): Iterate starting at the most specific type
7030 upwards looking for a GetEnumerator
7032 * expression.cs: Shift count can be up to 31 for int/uint and 63
7035 2003-11-26 Miguel de Icaza <miguel@ximian.com>
7037 * statement.cs (Block.LookupLabel): Also look for the label on the
7038 children blocks. Use a hash table to keep track of visited
7041 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
7042 we actually did transform the other operand, otherwise fall back
7043 to the common codepath that casts to long.
7045 * cs-tokenizer.cs: Use the same code pattern as the int case.
7046 Maybe I should do the parsing myself, and avoid depending on the
7047 Parse routines to get this done.
7049 2003-11-25 Miguel de Icaza <miguel@ximian.com>
7051 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
7052 which fixes bug 51347. This time test it.
7054 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
7055 attributes for example can not tell the difference between these.
7056 The difference was only a syntax feature of the language.
7058 * attribute.cs: Apply attributes to delegates.
7060 * delegate.cs: Call the apply attributes method.
7062 2003-11-24 Miguel de Icaza <miguel@ximian.com>
7064 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
7065 comparing 0 vs Byte.MinValue, not the value
7067 (ImplicitConversionRequired): When reporting a conversion error,
7068 use error 31 to print out the constant error instead of the
7071 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
7072 which fixes bug 51347.
7074 2003-11-22 Miguel de Icaza <miguel@ximian.com>
7076 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
7077 which fixes the -warnaserror command line option.
7079 2003-11-21 Miguel de Icaza <miguel@ximian.com>
7081 * cfold.cs (DoNumericPromotions): During constant folding of
7082 additions on UIntConstant, special case intconstants with
7083 IntConstants like we do on the expression binary operator.
7085 2003-11-12 Miguel de Icaza <miguel@ximian.com>
7087 * convert.cs (ImplicitReferenceConversion): We were missing a case
7088 (System.Enum are not value types or class types, so we need to
7089 classify them separatedly).
7091 * driver.cs: We do not support error 2007.
7093 2003-11-12 Jackson Harper <jackson@ximian.com>
7095 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
7096 system directory. Also use the full file name so users can
7097 libraries names mscorlib-o-tron.dll in a non system dir.
7099 2004-01-04 David Sheldon <dave-mono@earth.li>
7101 * expression.cs: Added matching ")" to error message for CS0077.
7103 2003-12-19 Martin Baulig <martin@ximian.com>
7105 * typemanager.cs (TypeManager.IsEqualGenericType): New public
7106 static method; see documentation in the method.
7107 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
7109 * convert.cs (Convert.ImplicitReferenceConversion,
7110 Convert.ImplicitReferenceConversionExists): Add support for
7111 generic type declarations; see gen-36.cs.
7113 2003-12-19 Martin Baulig <martin@ximian.com>
7115 * pending.cs (Pending.InterfaceMethod): Use
7116 `Type.IsAssignableFrom()' instead of `=='.
7118 2003-12-18 Martin Baulig <martin@ximian.com>
7120 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
7123 * convert.cs (Convert.ImplicitStandardConversionExists): Use
7124 `expr_type.Equals (target_type)' instead of `=='.
7126 2003-12-08 Martin Baulig <martin@ximian.com>
7128 * generics.cs (Constraints.Types): Removed.
7129 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
7131 (Constraints.ResolveTypes): New public method; resolves the
7132 TypeExpr's to Type's.
7133 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
7134 longer takes the constraints.
7135 (TypeParameter.DefineMethod): Likewise.
7136 (TypeParameter.DefineType): New public method. Calls
7137 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
7140 2003-12-08 Martin Baulig <martin@ximian.com>
7142 * convert.cs (Convert.ImplicitConversionStandard): Use
7143 `expr_type.Equals (target_type)' instead of `=='.
7145 2003-12-08 Martin Baulig <martin@ximian.com>
7147 * typemanager.cs (TypeManager.GetReferenceType): Call
7148 `Type.MakeByRefType ()'.
7150 2003-12-08 Martin Baulig <martin@ximian.com>
7152 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
7153 just has some special meaning in some situations. For instance,
7154 it is allowed to use `where' as the name of a variable etc.
7156 2003-12-04 Martin Baulig <martin@ximian.com>
7158 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
7159 `Type.MakeArrayType()' for array types.
7161 2003-11-18 Miguel de Icaza <miguel@ximian.com>
7163 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
7166 (SizeOf.DoResolve): assign the `type_queried' field. This gets
7169 2003-11-16 Martin Baulig <martin@ximian.com>
7171 * codegen.cs (EmitContext.IsGeneric): Removed.
7173 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
7174 ResolveGeneric() on the DeclSpace.
7176 2003-11-16 Martin Baulig <martin@ximian.com>
7178 * generic.cs (TypeArguments.Resolve):
7179 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
7180 `ResolveType()' on it to get the Type.
7182 2003-11-15 Martin Baulig <martin@ximian.com>
7184 * generic.cs (ConstructedType.GetInterfaces): Override this.
7186 2003-11-14 Martin Baulig <martin@ximian.com>
7188 * interface.cs (Interface.DefineType): Define all type parameters
7189 before adding the interfaces we inherit.
7191 2003-11-11 Martin Baulig <martin@ximian.com>
7193 * generic.cs (ConstructedType.ResolveType): Always call
7194 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
7196 2003-11-10 Martin Baulig <martin@ximian.com>
7198 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
7199 (TypeManager.InitCoreTypes): Initialize them here, but instead of
7200 calling `ResolveType()' on them, directly assign their `Type'.
7202 2003-11-08 Martin Baulig <martin@ximian.com>
7204 * generic.cs (ConstructedType): Override `IsClass' etc.
7206 2003-11-08 Martin Baulig <martin@ximian.com>
7208 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
7209 return value and the `out parent' parameter.
7210 (TypeContainer.DefineType): Moved the CS0644 check into
7211 GetClassBases(). Don't pass the interface types to the
7212 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
7213 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
7215 * ecore.cs (TypeExpr.IsAttribute): New property.
7216 (TypeExpr.GetInterfaces): New method.
7218 * interface.cs (Interface.GetInterfaceTypeByName): Return a
7219 TypeExpr instead of a Type.
7220 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
7221 (Interface.DefineType): Don't pass the interface types to the
7222 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
7223 them later and then call `TypeBulider.AddInterfaceImplementation()'.
7225 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
7226 instead of a `Type[]'.
7227 (TypeManager.RegisterBuilder): Likewise.
7228 (TypeManager.AddUserInterface): Likewise.
7229 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
7230 `Type[]' and also return a `TypeExpr[]'.
7231 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
7233 2003-11-08 Martin Baulig <martin@ximian.com>
7235 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
7238 2003-11-08 Martin Baulig <martin@ximian.com>
7240 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
7241 TypeManager.ResolveExpressionTypes().
7243 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
7244 instead of an Expression.
7245 (TypeExpr): This is now an abstract base class for `TypeExpression'.
7246 (TypeExpression): New public class; formerly known as `TypeExpr'.
7248 * expression.cs (ComposedCast): Derive from TypeExpr.
7250 * typemanager.cs (TypeManager.system_*_expr): These are now
7251 TypExpr's instead of Expression's.
7252 (TypeManager.ResolveExpressionTypes): New public static function;
7253 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
7256 2003-11-06 Miguel de Icaza <miguel@ximian.com>
7258 * expression.cs (New.DoResolve): Do not dereference value that
7259 might be a null return.
7261 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
7262 sure that the constant value has the right type. Fixes an
7263 unreported bug, similar to 50425.
7265 * const.cs (Const.LookupConstantValue): Call
7266 ImplicitStandardConversionExists before doing a conversion to
7267 avoid havng the TypeManager.ChangeType do conversions.
7269 Reduced the number of casts used
7271 (Const.ChangeType): New routine to enable reuse of the constant
7272 type changing code from statement.
7274 * typemanager.cs (ChangeType): Move common initialization to
7275 static global variables.
7279 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
7280 every value type to go through, even if it was void. Fix that.
7282 * cs-tokenizer.cs: Use is_identifier_start_character on the start
7283 character of the define, and the is_identifier_part_character for
7284 the rest of the string.
7286 2003-11-05 Miguel de Icaza <miguel@ximian.com>
7288 * expression.cs (UnaryMutator.EmitCode): When I updated
7289 LocalVariableReference.DoResolve, I overdid it, and dropped an
7290 optimization done on local variable references.
7292 2003-11-04 Miguel de Icaza <miguel@ximian.com>
7294 * ecore.cs: Convert the return from Ldlen into an int.
7296 2003-10-20 Miguel de Icaza <miguel@ximian.com>
7298 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
7299 the accessibility, this is a special case for toplevel non-public
7300 classes (internal for instance).
7302 2003-10-20 Nick Drochak <ndrochak@gol.com>
7304 * ecore.cs: Fix typo and build. Needed another right paren.
7306 2003-10-19 Miguel de Icaza <miguel@ximian.com>
7308 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
7309 `internal' case regular and protected, but not allowing protected
7310 to be evaluated later. Bug 49840
7312 2003-10-15 Miguel de Icaza <miguel@ximian.com>
7314 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
7315 to kb.Nlast, and not the kb.nFirst to isolate the switch
7318 Extract the underlying type, so enumerations of long/ulong are
7319 treated like long/ulong.
7321 2003-10-14 Miguel de Icaza <miguel@ximian.com>
7323 * expression.cs (New): Overload the meaning of RequestedType to
7324 track the possible creation of the NewDelegate type, since
7325 DoResolve is invoked more than once for new constructors on field
7328 See bugs: #48800 and #37014
7330 * cs-parser.jay (declare_local_constants): Take an arraylist
7331 instead of a single constant.
7333 (local_constant_declaration): It should take a
7334 constant_declarators, not a constant_declarator. Fixes 49487
7336 * convert.cs: Fix error report.
7338 2003-10-13 Jackson Harper <jackson@ximian.com>
7340 * typemanager.cs (TypeToCoreType): Add float and double this fixes
7343 2003-11-03 Martin Baulig <martin@ximian.com>
7345 * expression.cs (ArrayAccess.GetStoreOpcode): Added
7346 `out bool has_type_arg'; if set, we need to pass the type to
7348 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
7349 Stelem_Any/Ldelem_Any for generic parameters.
7351 2003-11-02 Martin Baulig <martin@ximian.com>
7353 * expression.cs (Invocation.EmitCall): Use
7354 `TypeManager.IsValueType()' to check whether it's a value type.
7355 Don't set `struct_call' when calling a method on a type parameter.
7357 2003-11-02 Martin Baulig <martin@ximian.com>
7359 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
7360 and removed the TypeBuilder argument.
7362 * typemanager.cs (TypeManager.IsValueType): Return
7363 `t.IsGenericParameter || t.IsValueType'.
7365 2003-10-25 Martin Baulig <martin@ximian.com>
7367 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
7368 call ConstructedType.Resolve() on it.
7370 * generic.cs (ConstructedType.Resolve): Set `type' on success.
7372 2003-10-25 Martin Baulig <martin@ximian.com>
7374 * class.cs (TypeContainer.GetClassBases): Changed
7375 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
7376 CS8214 reporting here.
7377 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
7378 instead of a `Type' for our parent. In case of a recursive
7379 declaration (see tests/gen-23.cs for an example), our parent is a
7380 ConstructedType and it doesn't have its type set. So, first
7381 create our own TypeBuilder, then call constructed.Resolve() to get
7382 the parent's type and finally TypeBuilder.SetParent() it.
7384 * ecore.cs (TypeExpr.Name): New public virtual property.
7387 (ConstructedType): We're now a TypeExpr and not just an Expression.
7388 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
7389 arguments here; this is done later.
7390 (ConstructedType.Resolve): New public method to resolve the type
7391 arguments and bind them.
7393 2003-10-21 Martin Baulig <martin@ximian.com>
7395 * convert.cs: Use `TypeManager.IsValueType' instead of
7396 'type.IsValueType' everywhere.
7398 * typemanager.cs (TypeManager.IsValueType): Return true for type
7399 parameters. The reason for this is that we need to box a type
7400 parameter when converting it to a reference type.
7402 * cs-parser.jay: Added support for default value expressions.
7404 * generics.cs (DefaultValueExpression): New public class.
7406 2003-10-17 Martin Baulig <martin@ximian.com>
7408 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
7409 TypeContainer so we can also use this for Interfaces.
7410 (TypeParameter.Resolve): Likewise.
7412 * interface.cs (Interface.DefineType): Added support for generic
7415 * cs-parser.jay: Added support for generic structs and interfaces.
7417 2003-10-17 Martin Baulig <martin@ximian.com>
7419 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
7420 call generic methods :-)
7422 2003-10-16 Martin Baulig <martin@ximian.com>
7424 * cs-parser.jay (namespace_or_type_name): Only create a
7425 GenericMemberAccess if we actually have type arguments.
7427 2003-10-13 Martin Baulig <martin@ximian.com>
7429 * class.cs (Method.Define): If we're a generic method, call
7430 TypeBuilder.DefineGenericMethod () before resolving
7432 (MethodData): Added .ctor which takes an additional MethodBuilder
7433 argument; this is used for generic methods.
7434 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
7435 we already have a MethodBuilder.
7437 2003-10-10 Martin Baulig <martin@ximian.com>
7439 * class.cs (Method): Added .ctor which takes a `GenericMethod'
7440 instead of a `DeclSpace'. This is used for generic methods.
7442 * cs-parser.jay (method_header): Added support for generic
7443 methods; create a `GenericMethod' instance and pass it to the
7444 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
7445 parameters and locals.
7447 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
7448 since we already have the location. Check whether we're a generic
7449 type declaration or a generic method and create the correct type
7452 * generic.cs (TypeParameter.DefineMethod): New public method.
7453 (GenericMethod): New public class; derives from DeclSpace and is
7454 used for generic methods.
7456 2003-10-09 Martin Baulig <martin@ximian.com>
7458 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
7460 (MethodCore.DoDefineParameters): Removed the TypeContainer
7461 argument; use the DeclSpace which was passed to the .ctor instead.
7462 (MethodCore.CheckParameter): Take a DeclSpace instead of a
7463 TypeContainer; we only need a DeclSpace here.
7465 2003-10-09 Martin Baulig <martin@ximian.com>
7467 * class.cs (MethodData): Added additional `DeclSpace ds' argument
7469 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
7470 EmitContext's .ctor.
7472 2003-10-09 Martin Baulig <martin@ximian.com>
7474 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
7475 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
7476 AsAccessible(), moved them as well.
7478 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
7480 2003-10-07 Miguel de Icaza <miguel@ximian.com>
7482 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
7483 generation for >=, as spotted by Paolo, bug 48679.
7484 Patch from David Waite.
7486 * cs-tokenizer.cs: Add handling for #pragma.
7488 * cs-parser.jay: Allow for both yield and yield return in the
7489 syntax. The anti-cobolization of C# fight will go on!
7491 * class.cs (TypeBuilder.DefineType): Catch error condition here
7492 (Parent.DefineType erroring out and returning null).
7494 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7495 coping with enumerations variables, we were mistakenly processing
7496 them as a regular value type instead of built-in types. Fixes the
7499 * typemanager.cs (IsBuiltinOrEnum): New method.
7501 2003-09-30 Miguel de Icaza <miguel@ximian.com>
7503 * cs-parser.jay: Upgrade: yield now needs the return clause.
7505 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
7507 * cs-parser.jay : Renamed yyName to yyNames related to jay.
7509 2003-09-29 Martin Baulig <martin@ximian.com>
7511 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
7512 inflated generic methods.
7514 * generics.cs (ConstructedType): Distinguish between open and
7515 closed constructed types; correctly resolve the arguments.
7517 2003-09-22 Martin Baulig <martin@ximian.com>
7519 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
7520 all type arguments meet their constraints.
7522 2003-09-19 Martin Baulig <martin@ximian.com>
7524 * decl.cs (MemberCache.SetupCacheForInterface): Take a
7525 `MemberCache parent' argument. Normally, an interface doesn't
7526 have a parent type except System.Object, but we use this in gmcs
7527 for generic type parameters.
7529 2003-09-18 Martin Baulig <martin@ximian.com>
7531 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
7532 on `type.IsInterface'; don't check whether the type has a parent
7533 to determine whether it's an interface.
7535 2003-09-17 Martin Baulig <martin@ximian.com>
7537 * generic.cs (ConstructedType.ToString): Always use `name' as the
7540 2003-09-15 Martin Baulig <martin@ximian.com>
7542 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
7544 * generic.cs (Constraints.Resolve): New public method; this is
7545 called to resolve the constraint types and to check whether all
7546 the constraints are correct.
7547 (Constraints.Types): New public property.
7548 (TypeParameter.Resolve): New public method; resolves all the
7551 * class.cs (TypeContainer.DefineType): Call
7552 TypeParameter.Resolve() before actually defining the type.
7554 2003-09-15 Martin Baulig <martin@ximian.com>
7556 * class.cs (TypeContainer.DefineType): Added an error flag to
7557 avoid reporting duplicate CS0146's ("class definition is
7560 * driver.cs (Driver.MainDriver): Abort if
7561 RootContext.ResolveTree() reported any errors.
7563 2003-09-07 Martin Baulig <martin@ximian.com>
7565 * report.cs (Error, Warning): Added overloaded versions which take
7566 a `params object[] args' and call String.Format().
7568 2003-09-07 Martin Baulig <martin@ximian.com>
7570 * decl.cs (DeclSpace..ctor): Don't call
7571 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
7572 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
7573 (DeclSpace.RecordDecl): New method.
7575 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
7577 2003-09-02 Ravi Pratap <ravi@ximian.com>
7579 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
7580 value attributes to be applied to ParameterBuilders.
7582 * class.cs (MethodCore.LabelParameters): Make static and more
7583 generic so that it can be used from other places - like interface
7584 methods, for instance.
7586 * interface.cs (Interface.Emit): Call LabelParameters before
7587 emitting attributes on the InterfaceMethod.
7589 2003-09-07 Martin Baulig <martin@ximian.com>
7591 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
7592 if the number of type parameters doesn't match.
7594 2003-09-04 Martin Baulig <martin@ximian.com>
7596 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
7597 for arrays of generic type params (ie. `!0[]').
7599 2003-09-04 Martin Baulig <martin@ximian.com>
7601 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
7604 2003-09-04 Martin Baulig <martin@ximian.com>
7606 * decl.cs (DeclSpace.LookupGeneric): New method.
7607 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
7610 * generic.cs (TypeParameterExpr): Take a TypeParameter as
7611 argument, not just a string.
7612 (TypeParameter.Define): New public method; this is called to
7613 actually define the generic parameter; after this, you can use the
7614 new `Type' property to get the type.
7616 2003-09-04 Martin Baulig <martin@ximian.com>
7618 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
7619 is now an ArrayList; initialize the result of the `TypeParameters'
7621 (DeclSpace.GetGenericData): Removed.
7622 (DeclSpace.LookupGeneric): Temporarily removed; we need to
7623 implement this in a different way.
7624 (DeclSpace.GetTypeParameters): Removed; there's now a
7625 `TypeParameters' property.
7626 (DeclSpace.TypeParameters): New public property.
7628 * generic.cs (Constraints): Make this class public.
7629 (TypeParameter): New public class.
7631 2003-09-04 Martin Baulig <martin@ximian.com>
7633 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
7636 * class.cs (TypeContainer.DefineType): Call
7637 TypeBuilder.DefineGenericParameter () on all generic parameters if
7638 this is a generic type.
7640 2003-08-28 Martin Baulig <martin@ximian.com>
7642 * sample-stack.il: Compile this with ilasm: "ilasm /dll
7645 * sample-hello.cs: Compile this with gmcs: "gmcs
7646 /r:sample-stack.dll sample-hello.cs".
7648 2003-08-28 Martin Baulig <martin@ximian.com>
7650 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
7651 the parameters to the generic type.
7653 2003-08-28 Martin Baulig <martin@ximian.com>
7655 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
7657 2003-08-28 Martin Baulig <martin@ximian.com>
7659 * cs-parser.jay (opt_type_argument_list): Use
7660 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
7661 (primary_expression): Replace `qualified_identifier' with `type_name'.
7662 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
7664 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
7665 parser to check whether it is syntactically a type parameter list;
7666 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
7669 2003-08-26 Martin Baulig <martin@ximian.com>
7671 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
7672 resolving aliases; fixes #47927.
7674 2003-08-26 Martin Baulig <martin@ximian.com>
7676 * statement.cs (Using.DoResolve): This is internally emitting a
7677 try/finally clause, so we need to set ec.NeedExplicitReturn if we
7678 do not always return. Fixes #47681.
7680 2003-08-26 Martin Baulig <martin@ximian.com>
7682 * decl.cs (MemberCore): Moved WarningNotHiding(),
7683 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
7685 (AdditionResult): Make this nested in DeclSpace.
7686 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
7687 argument; call NamespaceEntry.Define() unless we're nested in a
7690 * namespace.cs (Namespace.DefineName): New public function. This
7691 is called from DeclSpace's .ctor to add
7692 (Namespace.Lookup): Include DeclSpaces in the lookup.
7694 * class.cs (Operator): Derive from MemberBase, not MemberCore.
7696 * const.cs (Const): Derive from MemberBase, not MemberCore.
7698 2003-08-25 Martin Baulig <martin@ximian.com>
7700 * convert.cs (Convert.ExplicitReferenceConversion): When
7701 converting from an interface type to a class, unbox if the target
7702 type is a struct type. Fixes #47822.
7704 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
7706 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
7709 2003-08-22 Martin Baulig <martin@ximian.com>
7711 * class.cs (TypeManager.DefineType): When defining a nested type,
7712 call DefineType() on our parent; fixes #47801.
7714 2003-08-22 Martin Baulig <martin@ximian.com>
7716 * class.cs (MethodData.Define): While checking if a method is an
7717 interface implementation, improve the test a bit more to fix #47654.
7719 2003-08-22 Martin Baulig <martin@ximian.com>
7721 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
7722 correctly; fixes #47722.
7724 2003-08-22 Martin Baulig <martin@ximian.com>
7726 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
7727 LocalVariableReference, ensure it's not read-only. Fixes #47536.
7729 * statement.cs (Fixed.DoResolve): Make all variables read-only.
7731 2003-08-22 Martin Baulig <martin@ximian.com>
7733 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
7734 can only be assigned in static constructors. Fixes #47161.
7736 2003-08-22 Martin Baulig <martin@ximian.com>
7738 Rewrote and improved the flow analysis code.
7740 * flowbranching.cs (FlowBranching): Make this class abstract.
7741 (FlowBranching.CreateBranching): New static function to create a
7743 (FlowBranchingBlock, FlowBranchingException): New classes.
7744 (FlowBranching.UsageVector.Type): New public readonly field.
7745 (FlowBranching.UsageVector.Breaks): Removed the setter.
7746 (FlowBranching.UsageVector.Returns): Removed the setter.
7747 (FlowBranching.UsageVector): Added Break(), Return(),
7748 NeverReachable() and Throw() methods to modify the reachability.
7749 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
7750 done by FlowBranching.Merge().
7751 (FlowBranching.UsageVector.MergeChild): New method; merges the
7752 merge result into the current vector.
7753 (FlowBranching.Merge): New abstract method to merge a branching.
7755 2003-08-12 Martin Baulig <martin@ximian.com>
7757 * expression.cs (Indirection.CacheTemporaries): Create the
7758 LocalTemporary with the pointer type, not its element type.
7760 2003-08-10 Miguel de Icaza <miguel@ximian.com>
7762 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
7763 token was a keyword or not.
7765 Add `error' options where an IDENTIFIER was expected; Provide
7766 CheckToken and CheckIdentifierToken convenience error reporting
7769 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
7771 * decl.cs: Rename `NamespaceEntry Namespace' public field into
7772 NameSpaceEntry NameSpaceEntry.
7774 (LookupInterfaceOrClass): Avoid creating a full qualified name
7775 from namespace and name: avoid doing lookups when we know the
7776 namespace is non-existant. Use new Tree.LookupByNamespace which
7777 looks up DeclSpaces based on their namespace, name pair.
7779 * driver.cs: Provide a new `parser verbose' to display the
7780 exception thrown during parsing. This is turned off by default
7781 now, so the output of a failure from mcs is more graceful.
7783 * namespace.cs: Track all the namespaces defined in a hashtable
7786 (IsNamespace): New method
7788 2003-08-09 Miguel de Icaza <miguel@ximian.com>
7790 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
7791 we know that we need to concatenate (full typename can never be
7796 * statement.cs: Use a bitfield; Do not initialize to null things
7797 which are done by the constructor by default.
7799 * cs-parser.jay: bug fix, parameter was 4, not 3.
7801 * expression.cs: Just use the property;
7803 * statement.cs: No need for GetVariableInfo method.
7805 2003-08-08 Martin Baulig <martin@ximian.com>
7807 * flowanalysis.cs (FlowReturns): This is now nested in the
7808 `FlowBranching' class.
7809 (MyBitVector): Moved this here from statement.cs.
7810 (FlowBranching.SiblingType): New enum type.
7811 (FlowBranching.CreateSibling): Added `SiblingType' argument.
7813 2003-08-07 Martin Baulig <martin@ximian.com>
7815 * flowanalysis.cs (FlowBranchingType): This is now nested in the
7816 `FlowBranching' class and called `BranchingType'.
7818 2003-08-07 Martin Baulig <martin@ximian.com>
7820 * flowanalysis.cs: Moved all the control flow analysis code into
7823 2003-08-07 Martin Baulig <martin@ximian.com>
7825 * assign.cs (Assign.DoResolve): `target' must either be an
7826 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
7829 2003-08-07 Miguel de Icaza <miguel@ximian.com>
7831 * expression.cs (BinaryMethod): This kind of expression is created by the
7832 Binary class if it determines that the operator has to be handled
7835 (BinaryDelegate): This kind of expression is created if we are
7836 dealing with a + or - operator on delegates.
7838 (Binary): remove method, argumetns, and DelegateOperator: when
7839 dealing with methods,
7841 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
7843 * statement.cs (Block): use bitfields for the three extra booleans
7844 we had in use. Remove unused topblock parameter.
7846 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
7848 * assign.cs: Drop extra unneeded tests.
7850 2003-08-06 Miguel de Icaza <miguel@ximian.com>
7852 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
7854 * statement.cs (Foreach): Use VariableStorage instead of
7857 * codegen.cs (VariableStorage): New class used by clients that
7858 require a variable stored: locals or fields for variables that
7859 need to live across yield.
7861 Maybe provide a convenience api for EmitThis+EmitLoad?
7863 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
7866 2003-08-05 Miguel de Icaza <miguel@ximian.com>
7868 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
7869 RemapParameterLValue): New methods that are used to turn a
7870 precomputed FieldInfo into an expression like this:
7874 The idea is to use this instead of making LocalVariableReference
7875 have more than one meaning.
7877 * cs-parser.jay: Add error production to BASE.
7879 * ecore.cs: Deal with TypeManager.GetField returning null, which
7880 is now a valid return value.
7882 (FieldExprNoAddress): New expression for Fields whose address can
7885 * expression.cs (LocalVariableReference): During the resolve
7886 phases, create new expressions if we are in a remapping context.
7887 Remove code that dealt with remapping here.
7889 (ParameterReference): same.
7891 (ProxyInstance): New expression, like the `This' expression, but
7892 it is born fully resolved. We know what we are doing, so remove
7893 the errors that are targeted to user-provided uses of `this'.
7895 * statement.cs (Foreach): our variable is now stored as an
7896 Expression; During resolution, follow the protocol, dont just
7897 assume it will return this.
7899 2003-08-06 Martin Baulig <martin@ximian.com>
7901 * support.cs (SeekableStreamReader.cs): New public class.
7903 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
7904 SeekableStreamReader instead of the normal StreamReader.
7906 2003-08-04 Martin Baulig <martin@ximian.com>
7908 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
7909 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
7910 deambiguate casts and delegate invocations.
7911 (parenthesized_expression): Use the new tokens to ensure this is
7912 not a cast of method invocation.
7914 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
7915 when reading a `)' and Deambiguate_CloseParens () was previously
7918 * expression.cs (ParenthesizedExpression): New class. This is
7919 just used for the CS0075 test.
7920 (Binary.DoResolve): Check for CS0075.
7922 2003-07-29 Ravi Pratap <ravi@ximian.com>
7924 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
7925 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
7926 reference comparison.
7928 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
7929 examine the ReturnType for equality - this is necessary in the
7930 cases of implicit and explicit operators whose signature also
7931 includes the return type.
7933 2003-07-26 Miguel de Icaza <miguel@ximian.com>
7935 * namespace.cs: Cache the result of the namespace computation,
7936 instead of computing it every time.
7938 2003-07-24 Miguel de Icaza <miguel@ximian.com>
7940 * decl.cs: Use a global arraylist that we reuse over invocations
7941 to avoid excesive memory consumption. Reduces memory usage on an
7942 mcs compile by one meg (45 average).
7944 * typemanager.cs (LookupTypeReflection): In .NET pointers are
7945 private, work around that.
7947 2003-07-23 Miguel de Icaza <miguel@ximian.com>
7949 * literal.cs (IntLiteral): Define Zero and One static literals.
7951 * cs-parser.jay (integer_literal): use static literals to reduce
7952 memory usage for the most used literals (0, 1 and -1). 211kb
7953 reduced in memory usage.
7955 Replace all calls to `new ArrayList' with `new
7956 ArrayList(4)' which is a good average number for most allocations,
7957 and also requires only 16 bytes of memory for its buffer by
7960 This reduced MCS memory usage in seven megabytes for the RSS after
7963 2003-07-28 Ravi Pratap <ravi@ximian.com>
7965 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
7966 handle params methods the correct way by forming only one
7967 applicable set with params and normal methods in them. Earlier we
7968 were looking at params methods only if we found no normal methods
7969 which was not the correct thing to do.
7971 (Invocation.BetterFunction): Take separate arguments indicating
7972 when candidate and the best method are params methods in their
7975 This fixes bugs #43367 and #46199.
7977 * attribute.cs: Documentation updates.
7979 (CheckAttribute): Rename to CheckAttributeTarget.
7980 (GetValidPlaces): Rename to GetValidTargets.
7982 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
7983 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
7987 2003-07-28 Miguel de Icaza <miguel@ximian.com>
7989 * codegen.cs: Compute IsGeneric correctly.
7991 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
7994 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
7995 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
7996 regressions, and I was chasing more bugs than I required.
7998 * interface.cs: Use expressions for base type names (like classes
7999 and structs have been doing for a while now), and resolve that.
8000 This patch should probably go into head as well.
8002 This makes it one less user of FindType.
8004 2003-07-24 Miguel de Icaza <miguel@ximian.com>
8006 This compiler can not self host currently. Need to fix that.
8008 * Makefile: compile to `gmcs.exe'
8010 * driver.cs: Turn on v2 by default on gmcs.
8012 * generic.cs (ConstructedType): Does no longer take a container
8013 type argument; That will be taken care of later.
8015 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
8016 Use SimpleName to resolve for now, so we can continue the work on
8017 the parser, until we get Type.GetType that understands generics.
8019 (ConstructedType.ToString): Implement
8021 (TypeArguments.Resolve): Resolve the child expressions as types.
8023 * cs-parser.jay: Rename interface_constraints to
8024 type_parameter_constraints
8026 (namespace_or_type_name): Only use constructed types for the basic
8027 construction, we will deal with identifier<...> later.
8029 (type/type_name): No longer call DecomposeQI, as
8030 namespace_or_type_name is always decoded now.
8032 2003-07-22 Ravi Pratap <ravi@ximian.com>
8034 * expression.cs (Invocation.OverloadResolve): Follow the spec more
8035 closely: we eliminate methods in base types when we have an
8036 applicable method in a top-level type.
8038 Please see section 14.5.5.1 for an exact description of what goes
8041 This fixes bug #45127 and a host of other related to corlib compilation.
8043 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
8044 array is the method corresponding to the top-level type (this is
8045 because of the changes made to icall.c) so we change this
8048 (MethodGroupExpr.Name): This too.
8050 * typemanager.cs (GetElementType): New method which does the right
8051 thing when compiling corlib.
8053 * everywhere: Make use of the above in the relevant places.
8055 2003-07-22 Martin Baulig <martin@ximian.com>
8057 * cs-parser.jay (invocation_expression): Moved
8058 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
8059 `cast_expression', but create a InvocationOrCast which later
8060 resolves to either an Invocation or a Cast.
8062 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
8063 method; call this before EmitStatement() to make sure that this
8064 expression can be used as a statement.
8066 * expression.cs (InvocationOrCast): New class; resolves to either
8067 an Invocation or a Cast.
8069 * statement.cs (StatementExpression): Call ResolveStatement() on
8070 the ExpressionStatement before emitting it.
8072 2003-07-21 Martin Baulig <martin@ximian.com>
8074 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
8075 `ref' and `out' attributes match; fixes #46220.
8076 (MemberAccess.ResolveMemberAccess): You can't reference a type
8077 through an expression; fixes #33180.
8078 (Indexers.GetIndexersForType): Don't return the indexers from
8079 interfaces the class implements; fixes #46502.
8081 2003-07-21 Martin Baulig <martin@ximian.com>
8083 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
8084 CS0661 checks; fixes bug #30442.
8086 2003-07-21 Martin Baulig <martin@ximian.com>
8088 * decl.cs (AdditionResult): Added `Error'.
8090 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
8092 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
8093 cs0031.cs actually work.
8095 2003-07-20 Miguel de Icaza <miguel@ximian.com>
8097 * cs-parser.jay (namespace_name): do not use
8098 namespace_or_type_name, use qualified_identifier, because
8099 namespace_or_type_name will soon return a composed expression
8100 instead of a string.
8102 (namespace_or_type_name): Instead of returning a string, now this
8103 production returns an expression.
8105 * codegen.cs (EmitContext): Setup IsGeneric property based on
8106 whether our DeclSpace is generic, our the method is generic.
8108 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
8109 the method is generic.
8111 * cs-parser.jay (type_arguments, opt_type_argument_list,
8112 type_parameters, type_parameter_list, opt_type_parameter_list,
8113 type_parameter,, opt_type_parameter_constraints_clauses,
8114 type_parameter_constraints_clauses,
8115 type_parameter_constraint_clause, type_parameter_constraint,
8116 interface_constraints): Add new production
8118 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
8119 DeclSpace is generic or not.
8121 (DeclSpace.SetParameterInfo): New routine, used to set the
8122 parameter info for a type.
8124 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
8125 returns a GenericTypeExpr
8127 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
8128 generic, lookup the generic argument.
8130 * attribute.cs: Do not allow TypeParameterExpressions in
8133 * class.cs: Do not allow the Main method to be defined in a
8136 * expression.cs (SizeOf): Do not allow generic types to be used as
8137 arguments to sizeof.
8139 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
8140 it: whether a type is generic or not. Only works for types we are
8141 currently building for now.
8143 2003-07-20 Martin Baulig <martin@ximian.com>
8145 * namespace.cs: Fixed that bug which caused a crash when compiling
8148 2003-07-20 Miguel de Icaza <miguel@ximian.com>
8150 * typemanager.cs (LookupTypeReflection): Never expose types which
8151 are NotPublic, NestedPrivate, NestedAssembly, or
8152 NestedFamANDAssem. We used to return these, and later do a check
8153 that would report a meaningful error, but the problem is that we
8154 would not get the real match, if there was a name override.
8156 2003-07-18 Miguel de Icaza <miguel@ximian.com>
8158 * namespace.cs (Namespace, Name): Do not compute the namespace
8159 name dynamically, compute it in the constructor. This reduced
8160 memory usage by 1697 KB.
8162 * driver.cs: Use --pause to pause at the end.
8164 2003-07-17 Peter Williams <peter@newton.cx>
8166 * Makefile: Change the name of the test target so that it doesn't
8167 conflict with the recursive test target.
8169 2003-07-17 Miguel de Icaza <miguel@ximian.com>
8171 * expression.cs (LocalVariableReference.Emit, EmitAssign,
8172 AddressOf): Do not use EmitThis, that was wrong, use the actual
8175 2003-07-15 Miguel de Icaza <miguel@ximian.com>
8177 * class.cs (MethodData.Define): While checking if a method is an
8178 interface implementation, improve the test: If we are not public
8179 (use new test here: use the computed MethodAttributes directly,
8180 instead of the parsed modifier flags) check if the `implementing'
8181 method comes from an interface or not.
8183 * pending.cs (VerifyPendingMethods): Slightly better error
8186 * makefile: add test target that does the mcs bootstrap.
8188 2003-07-16 Ravi Pratap <ravi@ximian.com>
8190 * interface.cs (Define): Do nothing here since there are no
8191 members to populate etc. Move the attribute emission out of here
8192 since this was just totally the wrong place to put it. Attribute
8193 application happens during the 'Emit' phase, not in the 'Define'
8196 (Emit): Add this method and move the attribute emission here
8198 * rootcontext.cs (EmitCode): Call the Emit method on interface
8201 2003-07-14 Ravi Pratap M <ravi@ximian.com>
8203 * expression.cs (OverloadResolve): Report error only if Location
8204 is not 'Null' which means that there was a probe going on.
8206 2003-07-14 Martin Baulig <martin@ximian.com>
8208 * expression.cs (ConditionalLogicalOperator): New public class to
8209 implement user defined conditional logical operators.
8210 This is section 14.11.2 in the spec and bug #40505.
8212 2003-07-14 Martin Baulig <martin@ximian.com>
8214 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
8216 2003-07-14 Martin Baulig <martin@ximian.com>
8218 * codegen.cs (EmitContext.InFixedInitializer): New public field.
8220 * ecore.cs (IVariable.VerifyFixed): New interface method.
8222 * expression.cs (Unary.ResolveOperator): When resolving the `&'
8223 operator, check whether the variable is actually fixed. Fixes bug
8224 #36055. Set a variable definitely assigned when taking its
8225 address as required by the spec.
8227 * statement.cs (LocalInfo.IsFixed): New field.
8228 (LocalInfo.MakePinned): Set `IsFixed' to true.
8230 2003-07-14 Ravi Pratap M <ravi@ximian.com>
8232 * attribute.cs (Attribute.Resolve): While doing a Member lookup
8233 for .ctors, ensure that we only ask for members declared in the
8234 attribute type (BindingFlags.DeclaredOnly).
8238 * expression.cs (Error_WrongNumArguments): Report error 1501
8239 correctly the way CSC does.
8241 2003-07-13 Martin Baulig <martin@ximian.com>
8243 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
8244 lookup on the fully qualified name, to make things like "X.X" work
8245 where "X.X" is a fully qualified type name, but we also have a
8246 namespace "X" in the using list. Fixes #41975.
8248 2003-07-13 Martin Baulig <martin@ximian.com>
8250 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
8251 function. If we're a CompoundAssign, we need to create an embedded
8252 CompoundAssign, not an embedded Assign.
8253 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
8256 2003-07-13 Martin Baulig <martin@ximian.com>
8258 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
8259 work to fix bug #46088.
8261 2003-07-13 Ravi Pratap <ravi@ximian.com>
8263 * class.cs (Operator.Emit): Do not emit attributes here - it is
8264 taken care of by the Method class that we delegate too. This takes
8267 2003-07-10 Martin Baulig <martin@ximian.com>
8269 * expression.cs (TypeOfVoid): New class.
8270 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
8272 2003-07-10 Martin Baulig <martin@ximian.com>
8274 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
8277 2003-07-10 Martin Baulig <martin@ximian.com>
8279 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
8280 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
8282 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
8284 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
8286 2003-07-10 Martin Baulig <martin@ximian.com>
8288 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
8289 of decimal. Fixes #42850.
8291 NOTE: I also fixed the created byte blob, but this doesn't work on
8292 the MS runtime and csc never produces any byte blobs for decimal
8295 2003-07-10 Martin Baulig <martin@ximian.com>
8297 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
8298 structs; fixes #32068.
8299 (Block.AddChildVariableNames): Fixed #44302.
8301 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8303 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
8305 2003-07-07 Miguel de Icaza <miguel@ximian.com>
8307 * attribute.cs: And this test is onger needed.
8309 2003-07-08 Martin Baulig <martin@ximian.com>
8311 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
8312 inaccessible types. Fixes #36313.
8314 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
8316 * namespace.cs (NamespaceEntry): Create implicit entries for all
8317 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
8318 implicit entries for N1.N2 and N1.
8320 2003-07-08 Martin Baulig <martin@ximian.com>
8322 Rewrote the handling of namespaces to fix a lot of the issues
8323 wrt. `using' aliases etc.
8325 * namespace.cs (Namespace): Splitted this class into a
8326 per-assembly `Namespace' and a per-file `NamespaceEntry'.
8328 * typemanager.cs (TypeManager.IsNamespace): Removed.
8329 (TypeManager.ComputeNamespaces): Only compute namespaces from
8330 loaded assemblies here, not the namespaces from the assembly we're
8331 currently compiling.
8333 2003-07-08 Martin Baulig <martin@ximian.com>
8335 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
8337 2003-07-07 Miguel de Icaza <miguel@ximian.com>
8339 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
8342 I thought about the memory savings here, but LookupTypeReflection
8343 is used under already very constrained scenarios. Compiling
8344 corlib or mcs only exposes one hit, so it would not really reduce
8345 any memory consumption.
8347 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8349 * typemanager.cs: fixes bug #45889 by only adding public types from
8350 other assemblies to the list of known types.
8352 2003-07-07 Miguel de Icaza <miguel@ximian.com>
8354 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
8355 on the type we resolved.
8357 2003-07-05 Martin Baulig <martin@ximian.com>
8359 * pending.cs (PendingImplementation.ParentImplements): Don't
8360 create the proxy if the parent is abstract.
8362 * class.cs (TypeContainer.DefineIndexers): Process explicit
8363 interface implementations first. Fixes #37714.
8365 2003-07-04 Miguel de Icaza <miguel@ximian.com>
8367 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
8368 defined recursively; but since we modify the input parameters
8369 (left is set to `this' temporarily), we reset this value if the
8370 left_is_explicit is false, which gives the original semantics to
8373 * literal.cs (NullPointer): new class used to represent a null
8374 literal in a pointer context.
8376 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
8377 type is a pointer, use a NullPointer object instead of a
8378 NullLiteral. Closes 43687
8380 (ExplicitConversion): Convert pointer values using
8381 the conv opcode to the proper type.
8383 * ecore.cs (New): change ValueTypeVariable property into a method,
8384 that returns whether the valuetype is suitable for being used.
8386 * expression.cs (Binary.DoNumericPromotions): Only return if we
8387 the int constant was a valid uint, and we can return both left and
8388 right as uints. If not, we continue processing, to trigger the
8389 type conversion. This fixes 39018.
8391 * statement.cs (Block.EmitMeta): During constant resolution, set
8392 the CurrentBlock property on the emitcontext, so that we resolve
8393 constants propertly.
8395 2003-07-02 Martin Baulig <martin@ximian.com>
8397 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
8398 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
8400 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
8401 than emitting it here.
8403 * statement.cs: Fixed some more flow analysis bugs.
8405 2003-07-02 Martin Baulig <martin@ximian.com>
8407 * class.cs (MethodData.Define): When implementing interface
8408 methods, set Final unless we're Virtual.
8410 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
8411 check work for interface methods.
8413 2003-07-01 Martin Baulig <martin@ximian.com>
8415 * ecore.cs (EmitContext.This): Replaced this property with a
8416 GetThis() method which takes a Location argument. This ensures
8417 that we get the correct error location for a CS0188.
8419 2003-07-01 Miguel de Icaza <miguel@ximian.com>
8421 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
8422 ImplicitStandardConversion.
8424 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
8426 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
8428 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
8431 2003-06-30 Miguel de Icaza <miguel@ximian.com>
8433 * class.cs (Constructor.Define): Turn off initlocals for unsafe
8436 (MethodData.Define): Turn off initlocals for unsafe methods.
8438 2003-06-29 Miguel de Icaza <miguel@ximian.com>
8440 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
8441 complete; Fixes #37521.
8443 * delegate.cs: Use Modifiers.TypeAttr to compute the
8444 TypeAttributes, instead of rolling our own. This makes the flags
8445 correct for the delegates.
8447 2003-06-28 Miguel de Icaza <miguel@ximian.com>
8449 * class.cs (Constructor.Define): Set the private flag for static
8450 constructors as well.
8452 * cs-parser.jay (statement_expression): Set the return value to
8453 null, to avoid a crash when we catch an error.
8455 2003-06-24 Miguel de Icaza <miguel@ximian.com>
8457 * cs-parser.jay: Applied patch from Jackson that adds support for
8458 extern and unsafe modifiers to destructor declarations.
8460 * expression.cs: Report error 21 if the user is trying to index a
8463 * driver.cs: Add an error message, suggested by the bug report.
8465 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
8466 if we do not have a ": this ()" constructor initializer. Fixes 45149
8468 2003-06-14 Miguel de Icaza <miguel@ximian.com>
8470 * namespace.cs: Add some information to reduce FAQs.
8472 2003-06-13 Miguel de Icaza <miguel@ximian.com>
8474 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
8475 underlying enumeration types. Fixes #43915.
8477 * expression.cs: Treat ushort/short as legal values to be used in
8480 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
8482 * delegate.cs: transfer custom attributes for paramenters from
8483 the delegate declaration to Invoke and BeginInvoke.
8485 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
8487 * attribute.cs: handle custom marshalers and emit marshal info
8490 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
8492 * makefile.gnu: Added anonymous.cs to the compiler sources.
8494 2003-05-28 Miguel de Icaza <miguel@ximian.com>
8496 * iterators.cs: Change the name of the proxy class to include two
8499 * cs-parser.jay: Update grammar to include anonymous methods.
8501 * anonymous.cs: new file.
8503 2003-05-27 Miguel de Icaza <miguel@ximian.com>
8505 * class.cs (Field.Define): Add missing test for pointers and
8508 2003-05-27 Ravi Pratap <ravi@ximian.com>
8510 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
8511 we use the stobj opcode.
8513 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
8514 since it wasn't the correct fix.
8516 It still is puzzling that we are required to use stobj for IntPtr
8517 which seems to be a ValueType.
8519 2003-05-26 Miguel de Icaza <miguel@ximian.com>
8521 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
8522 during regular simple name resolution. Now, the trick is that
8523 instead of returning for processing the simplename, we do a
8524 TypeManager.LookupType (ie, a rooted lookup as opposed to a
8525 contextual lookup type). If a match is found, return that, if
8526 not, return for further composition.
8528 This fixes long-standing 30485.
8530 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8531 using the address to initialize an object, do an Stobj instead of
8532 using the regular Stelem.
8534 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
8535 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
8536 Because if we are a BaseIndexerAccess that value will be true.
8539 * statement.cs (GotoCase.Resolve): Return after reporting an
8540 error, do not attempt to continue.
8542 * expression.cs (PointerArithmetic.Emit): If our operand is a
8543 long, convert our constants to match the operand before
8544 multiplying. Convert to I type before adding. Fixes 43670.
8546 2003-05-14 Ravi Pratap <ravi@ximian.com>
8548 * enum.cs (ImplicitConversionExists) : Rename to
8549 ImplicitEnumConversionExists to remove ambiguity.
8551 * ecore.cs (NullCast): New type of cast expression class which
8552 basically is very similar to EmptyCast with the difference being
8553 it still is a constant since it is used only to cast a null to
8557 * convert.cs (ImplicitReferenceConversion): When casting a null
8558 literal, we return a NullCast.
8560 * literal.cs (NullLiteralTyped): Remove - I don't see why this
8561 should be around anymore.
8563 The renaming (reported was slightly wrong). Corrections:
8565 ConvertImplicitStandard -> ImplicitConversionStandard
8566 ConvertExplicitStandard -> ExplicitConversionStandard
8568 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
8569 before passing them in !
8571 * convert.cs (ImplicitConversionStandard): When comparing for
8572 equal expr and target types, ensure that expr is not a
8575 In general, we must not be checking (expr_type ==
8576 target_type) in the top level conversion methods
8577 (ImplicitConversion, ExplicitConversion etc). This checking is
8578 done in the methods that they delegate to.
8580 2003-05-20 Miguel de Icaza <miguel@ximian.com>
8582 * convert.cs: Move Error_CannotConvertType,
8583 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
8584 ImplicitNumericConversion, ImplicitConversionExists,
8585 ImplicitUserConversionExists, StandardConversionExists,
8586 FindMostEncompassedType, FindMostSpecificSource,
8587 FindMostSpecificTarget, ImplicitUserConversion,
8588 ExplicitUserConversion, GetConversionOperators,
8589 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
8590 TryImplicitIntConversion, Error_CannotConvertImplicit,
8591 ConvertImplicitRequired, ConvertNumericExplicit,
8592 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
8593 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
8596 Perform the following renames:
8598 StandardConversionExists -> ImplicitStandardConversionExists
8599 ConvertImplicit -> ImplicitConversion
8600 ConvertImplicitStandard -> ImplicitStandardConversion
8601 TryImplicitIntConversion -> ImplicitIntConversion
8602 ConvertImplicitRequired -> ImplicitConversionRequired
8603 ConvertNumericExplicit -> ExplicitNumericConversion
8604 ConvertReferenceExplicit -> ExplicitReferenceConversion
8605 ConvertExplicit -> ExplicitConversion
8606 ConvertExplicitStandard -> ExplicitStandardConversion
8608 2003-05-19 Martin Baulig <martin@ximian.com>
8610 * statement.cs (TypeInfo.StructInfo): Made this type protected.
8611 (TypeInfo): Added support for structs having structs as fields.
8613 * ecore.cs (FieldExpr): Implement IVariable.
8614 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
8615 VariableInfo for the field.
8617 2003-05-18 Martin Baulig <martin@ximian.com>
8619 * expression.cs (This.DoResolve): Report a CS0027 if we're
8620 emitting a field initializer.
8622 2003-05-18 Martin Baulig <martin@ximian.com>
8624 * expression.cs (This.ResolveBase): New public function.
8625 (This.DoResolve): Check for CS0188.
8627 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
8630 * ecore.cs (MethodGroupExpr.DoResolve): Set the
8631 `instance_expression' to null if we don't have any non-static
8634 2003-05-18 Martin Baulig <martin@ximian.com>
8636 Reworked the way how local variables and parameters are handled by
8637 the flow analysis code.
8639 * statement.cs (TypeInfo, VariableMap): New public classes.
8640 (VariableInfo): New public class. This is now responsible for
8641 checking whether a variable has been assigned. It is used for
8642 parameters and local variables.
8643 (Block.EmitMeta): Take the InternalParameters as argument; compute
8644 the layout of the flow vectors here.
8645 (Block.LocalMap, Block.ParameterMap): New public properties.
8646 (FlowBranching): The .ctor doesn't get the InternalParameters
8647 anymore since Block.EmitMeta() now computes the layout of the flow
8649 (MyStructInfo): This class is now known as `StructInfo' and nested
8650 in `TypeInfo'; we don't access this directly anymore.
8652 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
8653 property and removed IsAssigned(), IsFieldAssigned(),
8654 SetAssigned() and SetFieldAssigned(); we now call them on the
8655 VariableInfo so we don't need to duplicate this code everywhere.
8657 * expression.cs (ParameterReference): Added `Block block' argument
8659 (LocalVariableReference, ParameterReference, This): The new
8660 VariableInfo class is now responsible for all the definite
8663 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
8664 IsParameterAssigned, SetParameterAssigned): Removed.
8666 2003-05-18 Martin Baulig <martin@ximian.com>
8668 * typemanager.cs (InitCoreTypes): Try calling
8669 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
8670 the 3-args-version. Corlib now also needs our `void_type'.
8671 (GetMethod): Added overloaded version which takes an optional
8672 `bool report_errors' to allow lookups of optional methods.
8674 2003-05-12 Martin Baulig <martin@ximian.com>
8676 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
8677 only used for locals and not for parameters.
8679 2003-05-12 Miguel de Icaza <miguel@ximian.com>
8681 * support.cs (InternalParameters.ParameterType): Return the
8682 ExternalType of the parameter.
8684 * parameter.cs (Parameter.ExternalType): drop the two arguments,
8687 2003-05-11 Miguel de Icaza <miguel@ximian.com>
8689 * class.cs (MethodData.Define): Do not set the `newslot' on
8690 interface members, if they are also flagged as "override".
8692 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
8693 better code for ++i and i++. This only works for static fields
8694 and local variables.
8696 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
8697 want to pull the DeclSpace out of the builder_to_declspace instead
8698 of the TypeBuilder (like in TypeContainer.FindMembers).
8700 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
8701 instead of LookupTypeContainer. Fixes the crash on .NET for
8702 looking up interface members.
8704 * const.cs: Create our own emit context during the Definition
8705 stage, so that constants are evaluated in the proper context, when
8706 a recursive definition happens.
8708 2003-05-11 Martin Baulig <martin@ximian.com>
8710 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
8711 new block for a switch section.
8712 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
8713 the adding/lookup in the switch block. Fixes #39828.
8715 2003-05-09 Miguel de Icaza <miguel@ximian.com>
8717 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
8718 functionality: I needed to convert the data after I had performed
8719 the add/sub operation into the operands type size.
8721 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
8722 pass the type for the box operation, otherwise the resulting
8723 object would have been of type object.
8725 (BoxedCast): Add constructor to specify the type to box as.
8727 2003-05-07 Miguel de Icaza <miguel@ximian.com>
8729 * iterators.cs: I was reusing the `count' variable inadvertently,
8730 take steps to not allow this to happen.
8732 2003-05-06 Miguel de Icaza <miguel@ximian.com>
8734 * attribute.cs (Attribute.Resolve): Params attributes are encoded
8735 by creating an array at the point where the params starts and
8736 putting all those arguments there, then adjusting the size of the
8739 2003-05-05 Miguel de Icaza <miguel@ximian.com>
8741 * expression.cs (New.AddressOf): Implement interface
8742 IMemoryLocation. This is used when the `new' operator is used in
8743 the context of an invocation to a method on a value type.
8745 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
8748 * namespace.cs: Also check the using aliases here.
8750 * driver.cs: Move the test for using validity after the types have
8751 been entered, so we do a single pass that also includes the using
8754 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
8755 in the regular case. CreateSiblingForFinally is doing extra
8758 * attribute.cs (GetAttributeArgumentExpression): Store the result
8759 on an out value, and use the return value to indicate failure
8760 instead of using null (which is a valid return for Constant.GetValue).
8762 * statement.cs: Perform the analysis flow for the increment
8763 portion after the statement, because this will be the real flow of
8764 execution. Fixes #42385
8766 * codegen.cs (EmitContext.EmitArgument,
8767 EmitContext.EmitStoreArgument): New helper functions when the
8768 RemapToProxy flag is set.
8770 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
8773 Add support for remapping parameters.
8775 * iterators.cs: Propagate parameter values; Store parameter
8776 values in the proxy classes.
8778 2003-05-04 Miguel de Icaza <miguel@ximian.com>
8780 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
8781 need a proxy reference; I do not know what I was thinking
8783 * cs-parser.jay (constructor_initializer): catch another error,
8784 and display nice message.
8786 (field_declaration): catch void field declaration
8787 to flag a better error.
8789 * class.cs (MemberBase.CheckBase): Report an error instead of a
8790 warning if a new protected member is declared in a struct.
8791 (Field.Define): catch the error of readonly/volatile.
8793 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
8795 (FieldExpr.AddressOf): ditto. Catch error where the address of a
8796 volatile variable is taken
8798 2003-05-02 Miguel de Icaza <miguel@ximian.com>
8800 * statement.cs (Fixed.Resolve): Report an error if we are not in
8803 2003-05-01 Miguel de Icaza <miguel@ximian.com>
8805 * typemanager.cs: reuse the code that handles type clashes for
8806 delegates and enumerations.
8808 * class.cs (Report28): Always report.
8810 * expression.cs (EncodeAsAttribute): Allow nulls here.
8812 2003-04-28 Miguel de Icaza <miguel@ximian.com>
8814 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
8815 the functionality for testing whether an expression is valid for
8816 an attribute here. Also handle the case of arrays of elements
8819 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
8820 encoding a linear array into an array of objects that are suitable
8821 to be passed to an CustomAttributeBuilder.
8823 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
8825 * ecore.cs: (FieldExpr): Handle field remapping here.
8827 * iteratators.cs: Pass the instance variable (if the method is an
8828 instance method) to the constructors, so we can access the field
8829 variables on the class.
8831 TODO: Test this with structs. I think the THIS variable on
8832 structs might have to be a pointer, and not a refenrece
8834 2003-04-27 Miguel de Icaza <miguel@ximian.com>
8836 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
8837 local variables to fields in a proxy class.
8839 * iterators.cs (PopulateProxy): Rename our internal fields to
8841 Create a <THIS> field if we are an instance method, so we can
8842 reference our parent container variables.
8843 (MapVariable): Called back from the EmitContext code to enter a
8844 new variable to field mapping into the proxy class (we just create
8848 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
8849 for using the remapped locals to fields.
8851 I placed the code here, because that gives the same semantics to
8852 local variables, and only changes the Emit code.
8854 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
8855 statements inside iterators.
8856 (VariableInfo): Add a FieldBuilder for the cases when we are
8857 remapping local variables to fields in a proxy class
8859 * ecore.cs (SimpleNameResolve): Avoid testing two times for
8860 current_block != null.
8862 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
8863 not cope with strings, as it has been moved to the
8864 TableSwitchEmit. Fixed bug in switch generation.
8866 * expression.cs (New.DoResolve): Provide more context for the user
8867 when reporting an error.
8869 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
8872 * expression.cs (MemberAccess.DoResolve): When we get a type back,
8873 check the permissions for it. Note than in a type-resolution
8874 context the check was already present in DeclSpace.ResolveType,
8875 but was missing from the MemberAccess.
8877 (ArrayCreation.CheckIndices): warn if the user has
8878 more nested levels of expressions, but there are no more
8879 dimensions specified. Avoids crash on bug 41906.
8881 2003-04-26 Miguel de Icaza <miguel@ximian.com>
8883 * statement.cs (Block): replace Implicit bool, for a generic
8885 New flag: `Unchecked'. This is used during the EmitMeta phase
8886 (which is out-of-line with the regular Resolve/Emit process for a
8887 statement, as this is done ahead of time, but still gets a chance
8888 to call constant resolve).
8890 (Block.Flags): new enum for adding a new flag.
8892 (Block.EmitMeta): track the state of unchecked.
8894 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
8895 to enable constant resolution to work there as well.
8897 2003-04-22 Miguel de Icaza <miguel@ximian.com>
8899 * typemanager.cs (ienumerable_type): Also look up
8900 System.Collections.IEnumerable.
8902 2003-04-21 Miguel de Icaza <miguel@ximian.com>
8904 TODO: Test more than one conditional per method.
8906 * class.cs (Indexer.Define): Report the location where the user is
8907 referencing the unsupported feature.
8909 (MethodData): Overload the use of `conditionals' to
8910 minimize the creation of needless ArrayLists. This saves roughly
8911 212kb on my machine.
8913 (Method): Implement the new IIteratorContainer interface.
8914 (Method.SetYields): Implement the method by setting the ModFlags
8915 to contain METHOD_YIELDS.
8917 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
8918 which just got set to null.
8920 * iterators.cs: New file.
8922 (Yield, YieldBreak): New statements.
8924 * statement.cs (Return.Resolve): Flag an error if we are used in
8927 * codegen.cs (InIterator): New flag set if the code is being
8928 compiled in an iterator method.
8930 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
8931 internal modifier, and we just use it to avoid adding extra
8932 fields, as this is seldom used.
8934 * cs-parser.jay: Add yield_statement (yield and yield break).
8936 * driver.cs: New flag -v2 to turn on version 2 features.
8938 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
8939 hashtable when v2 is enabled.
8941 2003-04-20 Miguel de Icaza <miguel@ximian.com>
8943 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
8944 there is already a namespace defined with this name.
8946 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
8947 people upgraded their corlibs.
8949 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
8950 always use fully qualified types, no need to use the compiler
8953 (TypeManager.IsNamespace): Use binarysearch.
8955 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
8956 AddDelegate): I did not quite use the new IsValid API properly: I
8957 have to pass the short-name and the fullname. I was passing only
8958 the basename instead of the fullname sometimes.
8960 (TypeContainer.DefineType): call NamespaceClash.
8962 * interface.cs (Interface.DefineType): use NamespaceClash before
8965 * delegate.cs (Delegate.DefineType): use NamespaceClash before
8968 * enum.cs: (Enum.DefineType): use NamespaceClash before
8971 * typemanager.cs (: 3-line patch that gives us some tasty 11%
8972 speed increase. First, use the negative_hits cache when we get a
8973 negative. Second, add the type with its full original name
8974 instead of the new . and + encoded name (reflection uses + to
8975 separate type from a nested type). Use LookupTypeReflection
8976 directly which bypasses the type->name hashtable (that we already
8977 know does not contain the type.
8979 * decl.cs (DeclSpace.ResolveTypeExpr): track the
8980 location/container type.
8982 * driver.cs: When passing utf8, use directly the UTF8Encoding.
8984 2003-04-19 Miguel de Icaza <miguel@ximian.com>
8986 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
8988 * delegate.cs (NewDelegate.Resolve): Test whether an instance
8989 method is being referenced in the method group from a static
8990 context, and report error 120 if so.
8992 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
8995 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
8996 is created, we create the A namespace).
8998 * cs-parser.jay: A namespace also introduces a DeclarationFound.
9001 2003-04-18 Miguel de Icaza <miguel@ximian.com>
9003 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
9004 invocation to ModuleBuilder.GetType with the same values will
9005 return a new type instance, so we need to cache its return
9008 * expression.cs (Binary.ResolveOperator): Only allow the compare
9009 operators on enums if they are of the same type.
9011 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
9012 types of ValueType on their own case. Before we were giving them
9013 the same treatment as objects.
9015 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
9016 fullname. Short name is used to compare against container name.
9017 Fullname is used to check against defined namespace names.
9019 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
9020 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
9022 (Method.CheckBase): Call parent.
9023 (MemberBase.CheckBase): Check for protected members on sealed
9025 (PropertyBase.CheckBase): Call parent.
9026 (Field.Define): Call parent.
9028 * report.cs: Negative error codes are now mapped to 8000 - code,
9029 so that the display is render more nicely.
9031 * typemanager.cs: Do not use try/catch, instead report a regular
9034 (GetPointerType, GetReferenceType): These methods provide
9035 mechanisms to obtain the T* and T& from a T. We had the code
9036 previously scattered around the code base, and it also used
9037 TypeManager.LookupType that would go through plenty of caches.
9038 This one goes directly to the type source.
9040 In some places we did the Type.GetType followed by
9041 ModuleBuilder.GetType, but not in others, so this unifies the
9044 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
9045 statements now that we have namespace information.
9047 * typemanager.cs (IsNamespace): New method, returns whether the
9048 string presented is a namespace or not.
9050 (ComputeNamespaces): New public entry point, computes the list of
9051 available namespaces, using the GetNamespaces API call in Mono, or
9052 the slower version in MS.NET.
9054 Now before we start the semantic analysis phase, we have a
9055 complete list of namespaces including everything that the user has
9058 Deleted old code to cache namespaces in .nsc files.
9060 2003-04-17 Miguel de Icaza <miguel@ximian.com>
9062 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
9063 class/struct location definition Location for the implicit
9064 constructor location.
9066 (Operator.Define): Use the location of the operator for the
9067 implicit Method definition.
9069 (Constructor.Emit): use the constructor location for the implicit
9070 base initializer constructor.
9072 * ecore.cs: Remove ITypeExpression. This interface is now gone,
9073 and the Expression class now contains two new methods:
9075 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
9076 isolate type lookup from the rest of the resolution process.
9078 Since we use Expressions to hold type definitions due to the way
9079 we parse the input we have historically overloaded Resolve to
9080 perform the Type lookups if a special flag is passed. Now this is
9081 eliminated and two methods take their place.
9083 The differences in the two methods between xStep and xTerminal is
9084 that xStep is involved in our current lookup system that uses
9085 SimpleNames to compose a name, while xTerminal is used just to
9086 catch the case where the simplename lookup failed.
9088 2003-04-16 Miguel de Icaza <miguel@ximian.com>
9090 * expression.cs (ResolveMemberAccess): Remove redundant code.
9091 TypeExpr expressions are always born fully resolved.
9093 * interface.cs (PopulateMethod): Do not lookup the types twice.
9094 We were doing it once during SemanticAnalysis and once during
9097 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
9098 in local variable type definitions, were being returned as a
9099 SimpleName (we decomposed everything into a string), that is
9100 because primary_expression was being used instead of a type in the
9101 grammar (reduce/reduce conflicts).
9103 The part that was wrong is that we converted the expression into a
9104 string (an oversimplification in one hand, compounded with primary
9105 expressions doing string concatenation).
9111 Would return "A.B.C[]" as a SimpleName. This stopped things like
9112 using clauses from working on this particular context. And a type
9113 was being matched directly against "A.B.C[]".
9115 We now use the correct approach, and allow for ComposedCast to be
9116 part of the unary expression. So the "A.B.C []" become a composed
9117 cast of "A.B.C" (as a nested group of MemberAccess with a
9118 SimpleName at the end) plus the rank composition "[]".
9122 2003-04-10 Miguel de Icaza <miguel@ximian.com>
9124 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
9125 for the access level checking.
9127 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
9128 `TypeContainer container', because I kept getting confused when I
9129 was debugging this code.
9131 * expression.cs (Indexers): Instead of tracking getters/setters,
9132 we now track them in parallel. We create one arraylist less, but
9133 most importantly it is possible now for the LValue code to find a
9134 matching get for a set.
9136 (IndexerAccess.DoResolveLValue): Update the code.
9137 GetIndexersForType has been modified already to extract all the
9138 indexers from a type. The code assumed it did not.
9140 Also make the code set the correct return type for the indexer.
9141 This was fixed a long time ago for properties, but was missing for
9142 indexers. It used to be void_type.
9144 (Binary.Emit): Test first for doubles instead of
9145 floats, as they are more common.
9147 (Binary.EmitBranchable): Use the .un version of the branch opcodes
9148 when dealing with floats and the <=, >= operators. This fixes bug
9151 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
9152 to load the array value by emitting a load on the foreach variable
9153 type. This was incorrect.
9155 We now emit the code to load an element using the the array
9156 variable type, and then we emit the conversion operator.
9160 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
9162 * attribute.cs: Avoid allocation of ArrayLists in the common case.
9164 2003-04-09 Miguel de Icaza <miguel@ximian.com>
9166 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
9167 test for protection before we test for signatures.
9169 (MethodSignature.ToString): implement.
9171 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
9172 to the case where we reduced into a LongConstant.
9174 * decl.cs (CheckAccessLevel): If the type is an array, we can not
9175 depend on whether the information is acurrate, because the
9176 Microsoft runtime will always claim that the array type is public,
9177 regardless of the real state.
9179 If the type is a pointer, another problem happens: the type is
9180 reported as non-public in Microsoft.
9182 In both cases we have to call CheckAccessLevel recursively with
9183 the underlying type as the argument to be tested.
9185 2003-04-08 Miguel de Icaza <miguel@ximian.com>
9187 * assign.cs (Assign.Emit): If we are dealing with a compound
9188 assignment expression, we should use the code path that stores the
9189 intermediate result in a temporary value. This fixes #40903.
9191 *expression.cs (Indirection.ToString): Provide ToString method for
9194 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
9196 * class.cs: Null out fields holding references to Block objects so
9197 they can be garbage collected.
9199 * expression.cs (OverloadResolve): Remove unused local.
9201 2003-04-07 Martin Baulig <martin@ximian.com>
9203 * codegen.cs (EmitContext.CurrentFile): New public field.
9204 (EmitContext.Mark): Use the CurrentFile to check whether the
9205 location is in the correct file.
9206 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
9208 2003-04-07 Martin Baulig <martin@ximian.com>
9210 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
9212 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
9213 location. [FIXME: The location argument which gets passed to this
9214 method is sometimes wrong!]
9216 2003-04-07 Nick Drochak <ndrochak@gol.com>
9218 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
9220 2003-04-07 Miguel de Icaza <miguel@ximian.com>
9222 * expression.cs (Indirection.EmitAssign): We were using the
9223 temporary, but returning immediately instead of continuing the
9226 2003-04-06 Martin Baulig <martin@ximian.com>
9228 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
9229 if it's a nested child, but also deriving from the outer class.
9232 * typemanager.cs (IsNestedChildOf): Make this work if it's a
9233 nested child, but also deriving from the outer class. See
9235 (FilterWithClosure): We may access private members of the outer
9236 class if we're a nested child and deriving from the outer class.
9237 (RealMemberLookup): Only set `closure_private_ok' if the
9238 `original_bf' contained BindingFlags.NonPublic.
9240 2003-04-05 Martin Baulig <martin@ximian.com>
9242 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
9243 probe if its a type parameter, and if so, flag an error.
9245 * decl.cs: Move here the SetParameterInfo code from class.cs.
9246 Handle IsGeneric here.
9248 Handle a variety of errors in the parameter info definition.
9250 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
9251 type parameters here.
9253 * cs-parser.jay (class_declaration): report errors for parameters
9256 2003-01-21 Miguel de Icaza <miguel@ximian.com>
9258 * generic.cs: New file, contains support code for generics.
9260 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
9261 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
9263 Update parser for the above removals.
9265 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
9266 now taken care of in the parser.
9268 2003-04-02 Miguel de Icaza <miguel@ximian.com>
9270 * class.cs (Event.Define): Do not allow abstract events to have
9273 2003-04-01 Miguel de Icaza <miguel@ximian.com>
9275 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
9276 block in event declarations.
9278 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
9279 value type, get its address.
9281 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
9282 leaving a class on the stack instead of a boolean value (int
9283 0/1). Change the code so we compare against null, and then the
9284 result against zero.
9286 * class.cs (TypeContainer.GetClassBases): We were checking for the
9287 parent class being sealed too late.
9289 * expression.cs (Binary.Emit): For <= and >= when dealing with
9290 floating point values, use cgt.un and clt.un instead of cgt and
9293 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
9295 * statement.cs: Apply the same optimization as MS: skip the
9296 GetEnumerator returning an IEnumerator, and use the one returning a
9297 CharEnumerator instead. This allows us to avoid the try-finally block
9300 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
9302 * cs-parser.jay: Attributes cannot be applied to
9303 namespaces. Fixes #40473
9305 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9308 (Add*): check if the name is valid using the full name for constants,
9309 fields, properties and events.
9311 2003-03-28 Miguel de Icaza <miguel@ximian.com>
9313 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
9314 char constants to be part of the enumeration.
9316 * expression.cs (Conditional.DoResolve): Add support for operator
9317 true. Implements the missing functionality from 14.12
9319 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
9320 operator true/false as required by the spec.
9322 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
9323 implicit conversion to boolean.
9325 * statement.cs (Statement.ResolveBoolean): A boolean expression is
9326 also one where the type implements `operator true'.
9328 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
9329 get an expression that will invoke operator true based on an
9332 (GetConversionOperators): Removed the hack that called op_True
9335 (Expression.ResolveBoolean): Move this from Statement.
9337 2003-03-17 Miguel de Icaza <miguel@ximian.com>
9339 * ecore.cs (FieldExpr): do not allow initialization of initonly
9340 fields on derived classes
9342 2003-03-13 Martin Baulig <martin@ximian.com>
9344 * statement.cs (Block.Emit): Call ig.BeginScope() and
9345 ig.EndScope() when compiling with debugging info; call
9346 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
9348 2003-03-08 Miguel de Icaza <miguel@ximian.com>
9350 * expression.cs (Indexers): Do not construct immediately, allow
9351 for new members to be appended as we go. Fixes 38143
9353 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9355 * expression.cs: save/restore context when resolving an unchecked
9358 2003-03-05 Miguel de Icaza <miguel@ximian.com>
9360 * cfold.cs: Catch division by zero in modulus operator during
9363 2003-03-03 Miguel de Icaza <miguel@ximian.com>
9365 * interface.cs (Interface.DefineMembers): Avoid defining members
9368 2003-02-27 Miguel de Icaza <miguel@ximian.com>
9370 * driver.cs: handle the +/- options for -noconfig
9372 * statement.cs (Unckeched.Resolve): Also track the state of
9373 unchecked in the Resolve phase.
9375 2003-02-27 Martin Baulig <martin@ximian.com>
9377 * ecore.cs (Expression.MemberLookup): Don't create a
9378 MethodGroupExpr for something which is not a method. Fixes #38291.
9380 2003-02-25 Miguel de Icaza <miguel@ximian.com>
9382 * class.cs (MemberBase.CheckParameters): Also check that the type
9383 is unmanaged if it is a pointer.
9385 * expression.cs (SizeOf.Resolve): Add location information.
9387 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
9388 a managed type is declared.
9390 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
9391 parameter modifiers as well. Fixes bug 38606
9393 * class.cs: Very sad. Am backing out the speed up changes
9394 introduced by the ArrayList -> Array in the TypeContainer, as they
9395 were not actually that much faster, and introduced a bug (no error
9396 reports on duplicated methods).
9398 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
9399 source first, this will guarantee that we have a valid expression
9400 before calling in lower levels functions that will require a
9401 resolved object. Then use this original_source in the
9402 target.ResolveLValue instead of the original source that was
9405 Another change. Use target.Resolve instead of LValueResolve.
9406 Although we are resolving for LValues, we will let the Assign code
9407 take care of that (it will be called again from Resolve). This
9408 basically allows code like this:
9410 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
9411 class Y { void A (X x) { x [0] += o; }
9413 The problem was that the indexer was trying to resolve for
9414 set_Item (idx, object o) and never finding one. The real set_Item
9415 was set_Item (idx, X). By delaying the process we get the right
9420 2003-02-23 Martin Baulig <martin@ximian.com>
9422 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
9423 while calling DoEmit ().
9425 * codegen.cs (EmitContext.Mark): Don't mark locations in other
9426 source files; if you use the #line directive inside a method, the
9427 compiler stops emitting line numbers for the debugger until it
9428 reaches the end of the method or another #line directive which
9429 restores the original file.
9431 2003-02-23 Martin Baulig <martin@ximian.com>
9433 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
9435 2003-02-23 Martin Baulig <martin@ximian.com>
9437 * statement.cs (Block.AddChildVariableNames): We need to call this
9438 recursively, not just for our immediate children.
9440 2003-02-23 Martin Baulig <martin@ximian.com>
9442 * class.cs (Event.Define): Always make the field private, like csc does.
9444 * typemanager.cs (TypeManager.RealMemberLookup): Make events
9445 actually work, fixes bug #37521.
9447 2003-02-23 Miguel de Icaza <miguel@ximian.com>
9449 * delegate.cs: When creating the various temporary "Parameters"
9450 classes, make sure that we call the ComputeAndDefineParameterTypes
9451 on those new parameters (just like we do with the formal ones), to
9452 allow them to be resolved in the context of the DeclSpace.
9454 This fixes the bug that Dick observed in Bugzilla #38530.
9456 2003-02-22 Miguel de Icaza <miguel@ximian.com>
9458 * expression.cs (ResolveMemberAccess): When resolving a constant,
9459 do not attempt to pull a constant if the value was not able to
9460 generate a valid constant.
9462 * const.cs (LookupConstantValue): Do not report more errors than required.
9464 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9466 * expression.cs: fixes bug #38328.
9468 2003-02-18 Miguel de Icaza <miguel@ximian.com>
9470 * class.cs: Changed all the various members that can be part of a
9471 class from being an ArrayList to be an Array of the right type.
9472 During the DefineType type_list, interface_list, delegate_list and
9473 enum_list are turned into types, interfaces, delegates and enums
9476 And during the member population, indexer_list, event_list,
9477 constant_list, field_list, instance_constructor_list, method_list,
9478 operator_list and property_list are turned into their real arrays.
9480 Although we could probably perform this operation earlier, for
9481 good error reporting we need to keep the lists and remove the
9482 lists for longer than required.
9484 This optimization was triggered by Paolo profiling the compiler
9485 speed on the output of `gen-sample-program.pl' perl script.
9487 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
9488 not crash in methods like MemberLookupFailed that use this field.
9490 This problem arises when the compiler fails to resolve a type
9491 during interface type definition for example.
9493 2003-02-18 Miguel de Icaza <miguel@ximian.com>
9495 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
9496 inherit from System.Object, so we have to stop at null, not only
9497 when reaching System.Object.
9499 2003-02-17 Miguel de Icaza <miguel@ximian.com>
9501 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
9502 DeclaredOnly because the parent indexer might have had a different
9503 name, but did not loop until the top of the hierarchy was reached.
9505 The problem this one fixes is 35492: when a class implemented an
9506 indexer from an interface, we were getting the interface method
9507 (which was abstract) and we were flagging an error (can not invoke
9510 This also keeps bug 33089 functioning, and test-148 functioning.
9512 * typemanager.cs (IsSpecialMethod): The correct way of figuring
9513 out if a method is special is to see if it is declared in a
9514 property or event, or whether it is one of the predefined operator
9515 names. This should fix correctly #36804.
9517 2003-02-15 Miguel de Icaza <miguel@ximian.com>
9519 The goal here is to remove the dependency on EmptyCast.Peel ().
9520 Killing it completely.
9522 The problem is that currently in a number of places where
9523 constants are expected, we have to "probe" for an EmptyCast, and
9524 Peel, which is not the correct thing to do, as this will be
9525 repetitive and will likely lead to errors.
9527 The idea is to remove any EmptyCasts that are used in casts that
9528 can be reduced to constants, so we only have to cope with
9531 This bug hunt was triggered by Bug 37363 and the desire to remove
9532 the duplicate pattern where we were "peeling" emptycasts to check
9533 whether they were constants. Now constants will always be
9536 * ecore.cs: Use an enumconstant here instead of wrapping with
9539 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
9540 throwing me off. By handling this we can get rid of a few hacks.
9542 * statement.cs (Switch): Removed Peel() code.
9544 2003-02-14 Miguel de Icaza <miguel@ximian.com>
9546 * class.cs: Location information for error 508
9548 * expression.cs (New.DoResolve): Add a guard against double
9549 resolution of an expression.
9551 The New DoResolve might be called twice when initializing field
9552 expressions (see EmitFieldInitializers, the call to
9553 GetInitializerExpression will perform a resolve on the expression,
9554 and later the assign will trigger another resolution
9556 This leads to bugs (#37014)
9558 * delegate.cs: The signature for EndInvoke should contain any ref
9559 or out parameters as well. We were not doing this in the past.
9561 * class.cs (Field.Define): Do not overwrite the type definition
9562 inside the `volatile' group. Turns out that volatile enumerations
9563 were changing the type here to perform a validity test, which
9566 2003-02-12 Miguel de Icaza <miguel@ximian.com>
9568 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
9569 and structs, we do not want to load the instance variable
9571 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
9572 enum_type has to be handled like an object reference (implicit
9573 conversions exists from this to object), but the regular IsClass
9574 and IsValueType tests will never return true for this one.
9576 Also we use TypeManager.IsValueType instead of type.IsValueType,
9577 just for consistency with the rest of the code (this is only
9578 needed if we ever use the construct exposed by test-180.cs inside
9579 corlib, which we dont today).
9581 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
9583 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
9586 2003-02-09 Martin Baulig <martin@ximian.com>
9588 * namespace.cs (Namespace..ctor): Added SourceFile argument.
9589 (Namespace.DefineNamespaces): New static public method; this is
9590 called when we're compiling with debugging to add all namespaces
9593 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
9594 pass it to the Namespace's .ctor.
9596 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
9597 and MethodBase arguments; pass the namespace ID to the symwriter;
9598 pass the MethodBase instead of the token to the symwriter.
9599 (SymbolWriter.DefineNamespace): New method to add a namespace to
9602 2003-02-09 Martin Baulig <martin@ximian.com>
9604 * symbolwriter.cs: New file. This is a wrapper around
9605 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
9606 methods here in near future.
9608 2003-02-09 Martin Baulig <martin@ximian.com>
9610 * codegen.cs (EmitContext.Mark): Just pass the arguments to
9611 ILGenerator.MarkSequencePoint() which are actually used by the
9614 2003-02-09 Martin Baulig <martin@ximian.com>
9616 * location.cs (SourceFile): New public sealed class. This
9617 contains the name and an index which is used in the location's token.
9618 (Location): Reserve an appropriate number of bits in the token for
9619 the source file instead of walking over that list, this gives us a
9620 really huge performance improvement when compiling with debugging.
9622 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
9623 `SourceFile' argument instead of a string.
9624 (Driver.ProcessFile): Add all the files via Location.AddFile(),
9625 but don't parse/tokenize here, we need to generate the list of all
9626 source files before we do that.
9627 (Driver.ProcessFiles): New static function. Parses/tokenizes all
9630 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
9631 instead of a string.
9633 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
9636 2003-02-09 Martin Baulig <martin@ximian.com>
9638 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
9639 filename on `#line default'.
9641 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
9643 * statement.cs: don't clear the pinned var when the fixed statement
9644 returns from the method (fixes bug#37752).
9646 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
9648 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
9651 2003-02-07 Martin Baulig <martin@ximian.com>
9653 * driver.cs: Removed the `--debug-args' command line argument.
9655 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
9656 automatically by the AsssemblyBuilder.
9657 (CodeGen.InitializeSymbolWriter): We don't need to call any
9658 initialization function on the symbol writer anymore. This method
9659 doesn't take any arguments.
9661 2003-02-03 Miguel de Icaza <miguel@ximian.com>
9663 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
9664 from referenced assemblies as well.
9666 2003-02-02 Martin Baulig <martin@ximian.com>
9668 * class.cs (MethodData.Emit): Generate debugging info for external methods.
9670 2003-02-02 Martin Baulig <martin@ximian.com>
9672 * class.cs (Constructor.Emit): Open the symbol writer before
9673 emitting the constructor initializer.
9674 (ConstructorInitializer.Emit): Call ec.Mark() to allow
9675 single-stepping through constructor initializers.
9677 2003-01-30 Miguel de Icaza <miguel@ximian.com>
9679 * class.cs: Handle error 549: do not allow virtual methods in
9682 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
9684 * decl.cs: Check access levels when resolving types
9686 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
9688 * statement.cs: Add parameters and locals set in catch blocks that might
9689 return to set vector
9691 2003-01-29 Miguel de Icaza <miguel@ximian.com>
9693 * class.cs (Operator): Set the SpecialName flags for operators.
9695 * expression.cs (Invocation.DoResolve): Only block calls to
9696 accessors and operators on SpecialName methods.
9698 (Cast.TryReduce): Handle conversions from char constants.
9701 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
9703 * statement.cs: small memory and time optimization in FlowBranching.
9705 2003-01-28 Pedro Mart <yoros@wanadoo.es>
9707 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
9708 problem that the last fix but in the other sid (Set).
9710 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
9711 access when there is no indexer in the hierarchy.
9713 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
9715 * class.cs: Combine some if statements.
9717 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9719 * driver.cs: fixed bug #37187.
9721 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
9723 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
9724 any indexer, it's needed to build a list with all the indexers in the
9725 hierarchy (AllGetters), else we have problems. Fixes #35653.
9727 2003-01-23 Miguel de Icaza <miguel@ximian.com>
9729 * class.cs (MethodData.Define): It is wrong for an interface
9730 implementation to be static in both cases: explicit and implicit.
9731 We were only handling this in one case.
9733 Improve the if situation there to not have negations.
9735 * class.cs (Field.Define): Turns out that we do not need to check
9736 the unsafe bit on field definition, only on usage. Remove the test.
9738 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9740 * driver.cs: use assembly.Location instead of Codebase (the latest
9741 patch made mcs fail when using MS assemblies).
9743 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
9745 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
9746 get the path to *corlib.dll.
9748 2003-01-21 Nick Drochak <ndrochak@gol.com>
9752 * typemanager.cs: Remove compiler warnings
9754 2003-01-20 Duncan Mak <duncan@ximian.com>
9756 * AssemblyInfo.cs: Bump the version number to 0.19.
9758 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9760 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
9762 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
9764 * class.cs (Constructor::Emit): Emit debugging info for constructors.
9766 2003-01-17 Miguel de Icaza <miguel@ximian.com>
9768 * cs-parser.jay: Small fix: we were not comparing the constructor
9769 name correctly. Thanks to Zoltan for the initial pointer.
9771 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
9773 * cs-tokenizer.cs: Set file name when specified with #line
9775 2003-01-15 Miguel de Icaza <miguel@ximian.com>
9777 * cs-parser.jay: Only perform the constructor checks here if we
9778 are named like the class; This will help provider a better
9779 error. The constructor path is taken when a type definition is
9780 not found, but most likely the user forgot to add the type, so
9781 report that rather than the constructor error.
9783 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
9785 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
9788 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9790 * cs-parser.jay: Add cleanup call.
9792 2003-01-13 Duncan Mak <duncan@ximian.com>
9794 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
9795 consistent with other methods.
9797 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
9799 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
9801 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
9803 * attribute.cs: only set GuidAttr to true when we have a
9806 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9810 * typemanager.cs: fixes to allow mcs compile corlib with the new
9811 Type.IsSubclassOf fix.
9813 2003-01-08 Miguel de Icaza <miguel@ximian.com>
9815 * expression.cs (LocalVariableReference.DoResolve): Classify a
9816 constant as a value, not as a variable. Also, set the type for
9819 * cs-parser.jay (fixed_statement): take a type instead of a
9820 pointer_type, so we can produce a better error message later.
9822 * statement.cs (Fixed.Resolve): Flag types that are not pointers
9825 (For.DoEmit): Make inifinite loops have a
9826 non-conditional branch back.
9828 (Fixed.DoEmit): First populate the pinned variables, then emit the
9829 statement, then clear the variables. Before I was emitting the
9830 code once for each fixed piece.
9833 2003-01-08 Martin Baulig <martin@ximian.com>
9835 * statement.cs (FlowBranching.MergeChild): A break in a
9836 SWITCH_SECTION does not leave a loop. Fixes #36155.
9838 2003-01-08 Martin Baulig <martin@ximian.com>
9840 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
9841 lives in the same number space than `param_map'. Fixes #36154.
9843 2003-01-07 Miguel de Icaza <miguel@ximian.com>
9845 * cs-parser.jay (constructor_declaration): Set the
9846 Constructor.ModFlags before probing for it. This makes the
9847 compiler report 514, 515 and 132 (the code was there, but got
9850 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
9851 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
9852 (GotoCase.Resolve): Set `Returns' to ALWAYS.
9854 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
9856 * enum.cs: create the enum static fields using the enum type.
9858 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
9860 * class.cs: don't try to create the ParamBuilder for the return
9861 type if it's not needed (and handle it breaking for the ms runtime
9864 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
9866 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
9868 2002-12-29 Miguel de Icaza <miguel@ximian.com>
9870 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
9871 the command. This showed up while compiling the JANET source
9872 code, which used \r as its only newline separator.
9874 2002-12-28 Miguel de Icaza <miguel@ximian.com>
9876 * class.cs (Method.Define): If we are an operator (because it
9877 reuses our code), then set the SpecialName and HideBySig. #36128
9879 2002-12-22 Miguel de Icaza <miguel@ximian.com>
9881 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
9882 exception, report error 120 `object reference required'.
9884 * driver.cs: Add --pause option, used during to measure the size
9885 of the process as it goes with --timestamp.
9887 * expression.cs (Invocation.DoResolve): Do not allow methods with
9888 SpecialName to be invoked.
9890 2002-12-21 Miguel de Icaza <miguel@ximian.com>
9892 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
9893 number before adding it.
9895 2002-12-21 Ravi Pratap <ravi@ximian.com>
9897 * ecore.cs (StandardImplicitConversion): When in an unsafe
9898 context, we allow conversion between void * to any other pointer
9899 type. This fixes bug #35973.
9901 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
9903 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
9904 is not thrown when extensionless outputs are used
9906 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9908 * rootcontext.cs: fixed compilation of corlib.
9910 2002-12-19 Miguel de Icaza <miguel@ximian.com>
9912 * attribute.cs (Attributes.Contains): Add new method.
9914 * class.cs (MethodCore.LabelParameters): if the parameter is an
9915 `out' parameter, check that no attribute `[In]' has been passed.
9917 * enum.cs: Handle the `value__' name in an enumeration.
9919 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
9921 * decl.cs: Added special case to allow overrides on "protected
9924 2002-12-18 Ravi Pratap <ravi@ximian.com>
9926 * attribute.cs (Attributes.AddAttributeSection): Rename to this
9927 since it makes much more sense.
9929 (Attributes.ctor): Don't require a Location parameter.
9931 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
9933 * attribute.cs (ApplyAttributes): Remove extra Location parameters
9934 since we already have that information per attribute.
9936 * everywhere : make appropriate changes.
9938 * class.cs (LabelParameters): Write the code which actually
9939 applies attributes to the return type. We can't do this on the MS
9940 .NET runtime so we flag a warning in the case an exception is
9943 2002-12-18 Miguel de Icaza <miguel@ximian.com>
9945 * const.cs: Handle implicit null conversions here too.
9947 2002-12-17 Ravi Pratap <ravi@ximian.com>
9949 * class.cs (MethodCore.LabelParameters): Remove the extra
9950 Type [] parameter since it is completely unnecessary. Instead
9951 pass in the method's attributes so that we can extract
9952 the "return" attribute.
9954 2002-12-17 Miguel de Icaza <miguel@ximian.com>
9956 * cs-parser.jay (parse): Use Report.Error to flag errors instead
9957 of ignoring it and letting the compile continue.
9959 * typemanager.cs (ChangeType): use an extra argument to return an
9960 error condition instead of throwing an exception.
9962 2002-12-15 Miguel de Icaza <miguel@ximian.com>
9964 * expression.cs (Unary.TryReduce): mimic the code for the regular
9965 code path. Perform an implicit cast in the cases where we can
9966 implicitly convert to one of the integral types, and then reduce
9967 based on that constant. This fixes bug #35483.
9969 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9971 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
9973 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9975 * namespace.cs: fixed bug #35489.
9977 2002-12-12 Miguel de Icaza <miguel@ximian.com>
9979 * class.cs: Remove some dead code.
9981 * cs-parser.jay: Estimate the number of methods needed
9982 (RootContext.MethodCount);
9984 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
9985 numbers instead of StringBuilders.
9987 * support.cs (PtrHashtable): Add constructor with initial size;
9988 We can now reduce reallocations of the method table.
9990 2002-12-10 Ravi Pratap <ravi@ximian.com>
9992 * attribute.cs (ApplyAttributes): Keep track of the emitted
9993 attributes on a per-target basis. This fixes bug #35413.
9995 2002-12-10 Miguel de Icaza <miguel@ximian.com>
9997 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
9998 default to the Windows 1252 encoding.
10000 (UnixParseOption): Support version, thanks to Alp for the missing
10003 * AssemblyInfo.cs: Add nice assembly information.
10005 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
10008 * cs-parser.jay: Allow a trailing comma before the close bracked
10009 in the attribute_section production.
10011 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
10012 address of the instance was being taken, I will take this out,
10013 because we take the address of the object immediately here.
10015 2002-12-09 Ravi Pratap <ravi@ximian.com>
10017 * typemanager.cs (AreMultipleAllowed): Take care of the most
10018 obvious case where attribute type is not in the current assembly -
10021 2002-12-08 Miguel de Icaza <miguel@ximian.com>
10023 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
10024 definitions, instead of doing that afterwards.
10026 Also we use a nice little hack, depending on the constructor, we
10027 know if we are a "composed" name or a simple name. Hence, we
10028 avoid the IndexOf test, and we avoid
10030 * codegen.cs: Add code to assist in a bug reporter to track down
10031 the source of a compiler crash.
10033 2002-12-07 Ravi Pratap <ravi@ximian.com>
10035 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
10036 types have been emitted for a given element and flag an error
10037 if something which does not have AllowMultiple set is used more
10040 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
10041 attribute types and their corresponding AllowMultiple properties
10043 (AreMultipleAllowed): Check the property for a given type.
10045 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
10046 property in the case we have a TypeContainer.
10048 (Attributes.AddAttribute): Detect duplicates and just skip on
10049 adding them. This trivial fix catches a pretty gross error in our
10050 attribute emission - global attributes were being emitted twice!
10052 Bugzilla bug #33187 is now fixed.
10054 2002-12-06 Miguel de Icaza <miguel@ximian.com>
10056 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
10057 instead of pp_and).
10059 * expression.cs (Binary.ResolveOperator): I can only use the
10060 Concat (string, string, string) and Concat (string, string,
10061 string, string) if the child is actually a concatenation of
10064 2002-12-04 Miguel de Icaza <miguel@ximian.com>
10066 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
10067 context where we need a 2-character lookahead.
10069 * pending.cs (PendingImplementation): Rework so we can keep track
10070 of interface types all the time, and flag those which were
10071 implemented by parents as optional.
10073 2002-12-03 Miguel de Icaza <miguel@ximian.com>
10075 * expression.cs (Binary.ResolveOperator): Use
10076 String.Concat(string,string,string) or
10077 String.Concat(string,string,string,string) when possible.
10079 * typemanager: More helper methods.
10082 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
10084 * pending.cs: remove the bogus return from GetMissingInterfaces()
10085 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
10087 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10089 * namespace.cs: avoid duplicated 'using xxx' being added to
10090 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
10091 when we get more than one 'using' statement for the same namespace.
10092 Report a CS0105 warning for it.
10094 2002-11-30 Miguel de Icaza <miguel@ximian.com>
10096 * cs-tokenizer.cs (consume_identifier): use read directly, instead
10097 of calling getChar/putback, uses internal knowledge of it.
10099 (xtoken): Reorder tokenizer so most common patterns are checked
10100 first. This reduces the compilation time in another 5% (from 8.11s
10101 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
10103 The parsing time is 22% of the compilation in mcs, and from that
10104 64% is spent on the tokenization process.
10106 I tried using a binary search for keywords, but this is slower
10107 than the hashtable. Another option would be to do a couple of
10110 * Not use a StringBuilder, instead use an array of chars,
10111 with a set value. Notice that this way we could catch
10112 the 645 error without having to do it *afterwards*.
10114 * We could write a hand-parser to avoid the hashtable
10115 compares altogether.
10117 The identifier consumption process takes 37% of the tokenization
10118 time. Another 15% is spent on is_number. 56% of the time spent
10119 on is_number is spent on Int64.Parse:
10121 * We could probably choose based on the string length to
10122 use Int32.Parse or Int64.Parse and avoid all the 64-bit
10125 Another 3% is spend on wrapping `xtoken' in the `token' function.
10127 Handle 0xa0 as whitespace (#34752)
10129 2002-11-26 Miguel de Icaza <miguel@ximian.com>
10131 * typemanager.cs (IsCLRType): New routine to tell whether a type
10132 is one of the builtin types.
10134 Maybe it needs to use TypeCodes to be faster. Maybe we could use
10135 typecode in more places instead of doing pointer comparissions.
10136 We could leverage some knowledge about the way the typecodes are
10139 New code to cache namespaces in assemblies, it is currently not
10140 invoked, to be used soon.
10142 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
10144 * expression.cs (Binary.ResolveOperator): specially handle
10145 strings, and do not perform user-defined operator overloading for
10148 2002-11-24 Miguel de Icaza <miguel@ximian.com>
10150 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
10151 internalcall as it is a pretty simple operation; Avoid whenever
10152 possible to call Char.IsLetter.
10154 (consume_identifier): Cut by half the number of
10155 hashtable calls by merging the is_keyword and GetKeyword behavior.
10157 Do not short-circuit, because if we do, we
10158 report errors (ie, #if false && true would produce an invalid
10162 2002-11-24 Martin Baulig <martin@ximian.com>
10164 * expression.cs (Cast.TryReduce): If we're in checked syntax,
10165 check constant ranges and report a CS0221. Fixes #33186.
10167 2002-11-24 Martin Baulig <martin@ximian.com>
10169 * cs-parser.jay: Make this work for uninitialized variable
10170 declarations in the `for' initializer. Fixes #32416.
10172 2002-11-24 Martin Baulig <martin@ximian.com>
10174 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
10175 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
10177 2002-11-24 Martin Baulig <martin@ximian.com>
10179 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
10180 argument; if true, we also check for user-defined conversions.
10181 This is only needed if both arguments are of a user-defined type.
10182 Fixes #30443, added test-175.cs.
10183 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
10185 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
10187 2002-11-24 Martin Baulig <martin@ximian.com>
10189 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
10190 function to get the store opcode.
10191 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
10192 only emit the Ldelema if the store opcode is Stobj. You must run
10193 both test-34 and test-167 to test this. Fixes #34529.
10195 2002-11-23 Martin Baulig <martin@ximian.com>
10197 * ecore.cs (Expression.MemberLookup): Added additional
10198 `qualifier_type' argument which is used when we're being called
10199 from MemberAccess.DoResolve() and null if we're called from a
10201 (Expression.MemberLookupFailed): New method to report errors; this
10202 does the CS1540 check and reports the correct error message.
10204 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
10205 argument for the CS1540 check and redone the way how we're dealing
10206 with private members. See the comment in the source code for details.
10207 (FilterWithClosure): Reverted this back to revision 1.197; renamed
10208 `closure_start_type' to `closure_qualifier_type' and check whether
10209 it's not null. It was not this filter being broken, it was just
10210 being called with the wrong arguments.
10212 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
10213 and pass it the correct `qualifier_type'; this also does the error
10216 2002-11-22 Miguel de Icaza <miguel@ximian.com>
10218 * expression.cs (Invocation.EmitParams): If the we are dealing
10219 with a non-built-in value type, load its address as well.
10221 (ArrayCreation): Use a a pretty constant instead
10222 of the hardcoded value 2. Use 6 instead of 2 for the number of
10223 static initializers.
10225 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
10226 because they are not really value types, just glorified integers.
10228 * driver.cs: Do not append .exe, the CSC compiler does not do it.
10230 * ecore.cs: Remove redundant code for enumerations, make them use
10231 the same code path as everything else, fixes the casting issue
10232 with enumerations in Windows.Forms.
10234 * attribute.cs: Do only cast to string if it is a string, the
10235 validation happens later.
10237 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
10238 people upgrade their corlibs.
10240 * ecore.cs: Oops, enumerations were not following the entire code path
10242 2002-11-21 Miguel de Icaza <miguel@ximian.com>
10244 * typemanager.cs (FilterWithClosure): Commented out the test for
10245 1540 in typemanager.cs, as it has problems when accessing
10246 protected methods from a parent class (see test-174.cs).
10248 * attribute.cs (Attribute.ValidateGuid): new method.
10249 (Attribute.Resolve): Use above.
10251 2002-11-19 Miguel de Icaza <miguel@ximian.com>
10253 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
10255 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
10256 handling for enumerations, as we only needed the TypeContainer
10257 functionality to begin with (this is required for the fix below to
10258 work for enums that reference constants in a container class for
10261 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
10263 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
10264 a valid TypeBuilder to perform lookups on.o
10266 * class.cs (InheritableMemberSignatureCompare): Use true in the
10267 call to GetGetMethod and GetSetMethod, because we are comparing
10268 the signature, and we need to get the methods *even* if they are
10271 (PropertyBase.CheckBase): ditto.
10273 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
10274 GotoCase.Resolve): Use Peel on EmpytCasts.
10276 * ecore.cs (EmptyCast): drop child, add Peel method.
10278 2002-11-17 Martin Baulig <martin@ximian.com>
10280 * ecore.cs (EmptyCast.Child): New public property.
10282 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
10283 label resolved to an EmptyCast. Fixes #34162.
10284 (GotoCase.Resolve): Likewise.
10285 (Block.EmitMeta): Likewise.
10287 2002-11-17 Martin Baulig <martin@ximian.com>
10289 * expression.cs (Invocation.BetterConversion): Prefer int over
10290 uint; short over ushort; long over ulong for integer literals.
10291 Use ImplicitConversionExists instead of StandardConversionExists
10292 since we also need to check for user-defined implicit conversions.
10293 Fixes #34165. Added test-173.cs.
10295 2002-11-16 Martin Baulig <martin@ximian.com>
10297 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
10298 with the `true' and `false' literals. Fixes #33151.
10300 2002-11-16 Martin Baulig <martin@ximian.com>
10302 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
10303 October 22nd; don't do the cs1540 check for static members.
10305 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
10306 now using our own filter here and doing the cs1540 check again.
10308 2002-11-16 Martin Baulig <martin@ximian.com>
10310 * support.cs (InternalParameters): Don't crash if we don't have
10311 any fixed parameters. Fixes #33532.
10313 2002-11-16 Martin Baulig <martin@ximian.com>
10315 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
10316 when looking up static methods to make this work on Windows.
10319 2002-11-16 Martin Baulig <martin@ximian.com>
10321 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
10322 a setter rather than using PropertyInfo.CanWrite.
10324 2002-11-15 Nick Drochak <ndrochak@gol.com>
10326 * class.cs: Allow acces to block member by subclasses. Fixes build
10329 2002-11-14 Martin Baulig <martin@ximian.com>
10331 * class.cs (Constructor.Emit): Added the extern/block check.
10334 2002-11-14 Martin Baulig <martin@ximian.com>
10336 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
10337 iteration while looking for indexers, this is needed because the
10338 indexer may have a different name in our base classes. Fixed the
10339 error reporting (no indexers at all, not get accessor, no
10340 overloaded match). Fixes bug #33089.
10341 (IndexerAccess.DoResolveLValue): Likewise.
10343 2002-11-14 Martin Baulig <martin@ximian.com>
10345 * class.cs (PropertyBase.CheckBase): Make this work for multiple
10346 indexers. Fixes the first part of bug #33089.
10347 (MethodSignature.InheritableMemberSignatureCompare): Added support
10350 2002-11-13 Ravi Pratap <ravi@ximian.com>
10352 * attribute.cs (Attribute.Resolve): Catch the
10353 NullReferenceException and report it since it isn't supposed to
10356 2002-11-12 Miguel de Icaza <miguel@ximian.com>
10358 * expression.cs (Binary.EmitBranchable): Also handle the cases for
10359 LogicalOr and LogicalAnd that can benefit from recursively
10360 handling EmitBranchable. The code now should be nice for Paolo.
10362 2002-11-08 Miguel de Icaza <miguel@ximian.com>
10364 * typemanager.cs (LookupType): Added a negative-hit hashtable for
10365 the Type lookups, as we perform quite a number of lookups on
10366 non-Types. This can be removed once we can deterministically tell
10367 whether we have a type or a namespace in advance.
10369 But this might require special hacks from our corlib.
10373 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
10374 and double which avoids a conversion from an integer to a double.
10376 * expression.cs: tiny optimization, avoid calling IsConstant,
10377 because it effectively performs the lookup twice.
10379 2002-11-06 Miguel de Icaza <miguel@ximian.com>
10381 But a bogus return here to keep the semantics of the old code
10382 until the Mono runtime is fixed.
10384 * pending.cs (GetMissingInterfaces): New method used to remove all
10385 the interfaces that are already implemented by our parent
10386 classes from the list of pending methods.
10388 * interface.cs: Add checks for calls after ResolveTypeExpr.
10390 2002-11-05 Miguel de Icaza <miguel@ximian.com>
10392 * class.cs (Class.Emit): Report warning 67: event not used if the
10393 warning level is beyond 3.
10395 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
10396 being a NullLiteral.
10398 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
10401 * class.cs (TypeContainer.GetClassBases): Cover a missing code
10402 path that might fail if a type can not be resolved.
10404 * expression.cs (Binary.Emit): Emit unsigned versions of the
10407 * driver.cs: use error 5.
10409 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
10411 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
10413 2002-11-01 Miguel de Icaza <miguel@ximian.com>
10415 * cs-parser.jay (switch_section): A beautiful patch from Martin
10416 Baulig that fixed 33094.
10418 2002-10-31 Miguel de Icaza <miguel@ximian.com>
10420 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
10421 Check whether the base is abstract and report an error if so.
10423 * expression.cs (IndexerAccess.DoResolveLValue,
10424 IndexerAccess.DoResolve): ditto.
10426 (Invocation.DoResolve): ditto.
10428 (Invocation.FullMethodDesc): Improve the report string.
10430 * statement.cs (Block): Eliminate IsVariableDefined as it is
10431 basically just a wrapper for GetVariableInfo.
10433 * ecore.cs (SimpleName): Use new
10435 * support.cs (ReflectionParamter.ParameterType): We unwrap the
10436 type, as we return the actual parameter ref/unref state on a
10439 2002-10-30 Miguel de Icaza <miguel@ximian.com>
10441 * support.cs: Return proper flags REF/OUT fixing the previous
10444 * expression.cs: Reverted last patch, that was wrong. Is_ref is
10445 not used to mean `ref' but `ref or out' in ParameterReference
10447 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
10448 full type signature instead of calling TypeManger.CSharpName
10451 * support.cs (InternalParameters.ParameterDesc): Do not compare
10452 directly to the modflags, because REF/OUT will actually be bitsets
10455 * delegate.cs (VerifyMethod): Check also the modifiers.
10457 * cs-tokenizer.cs: Fix bug where floating point values with an
10458 exponent where a sign was missing was ignored.
10460 * driver.cs: Allow multiple assemblies to be specified in a single
10463 2002-10-28 Miguel de Icaza <miguel@ximian.com>
10465 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
10466 because identifiers after a parenthesis would end up in this kind
10467 of production, and we needed to desamiguate it for having casts
10470 (UserDefinedType *) xxx
10472 2002-10-24 Miguel de Icaza <miguel@ximian.com>
10474 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
10475 we should set on the Bindingflags.NonPublic, but not turn on
10476 private_ok. private_ok controls whether a Private member is
10477 returned (this is chekced on the filter routine), while the
10478 BindingFlags.NonPublic just controls whether private/protected
10479 will be allowed. This fixes the problem part of the problem of
10480 private properties being allowed to be used in derived classes.
10482 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
10483 so we can call the children DoResolveLValue method (this will
10484 properly signal errors on lvalue assignments to base properties)
10486 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
10487 getter are null, and we have a property info, we know that this
10488 happened because the lookup failed, so we report an error 122 for
10489 protection level violation.
10491 We also silently return if setter and getter are null in the
10492 resolve functions, this condition only happens if we have flagged
10493 the error before. This is the other half of the problem.
10495 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
10496 not have accessibility information, that is why we were returning
10497 true in the filter function in typemanager.cs.
10499 To properly report 122 (property is inaccessible because of its
10500 protection level) correctly, we report this error in ResolveAccess
10501 by failing if both the setter and the getter are lacking (ie, the
10504 DoResolve and DoLResolve have been modified to check for both
10505 setter/getter being null and returning silently, the reason being
10506 that I did not want to put the knowledge about this error in upper
10509 int old = Report.Errors;
10510 x = new PropertyExpr (...);
10511 if (old != Report.Errors)
10516 So the property expr is returned, but it is invalid, so the error
10517 will be flagged during the resolve process.
10519 * class.cs: Remove InheritablePropertySignatureCompare from the
10520 class, as we no longer depend on the property signature to compute
10521 whether it is possible to implement a method or not.
10523 The reason is that calling PropertyInfo.GetGetMethod will return
10524 null (in .NET, in Mono it works, and we should change this), in
10525 cases where the Get Method does not exist in that particular
10530 class X { public virtual int A { get { return 1; } } }
10532 class Z : Y { public override int A { get { return 2; } } }
10534 Would fail in Z because the parent (Y) would not have the property
10535 defined. So we avoid this completely now (because the alternative
10536 fix was ugly and slow), and we now depend exclusively on the
10539 (PropertyBase.CheckBase): Use a method-base mechanism to find our
10540 reference method, instead of using the property.
10542 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
10543 routines are gone now.
10545 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
10546 names, they were incorrectly named.
10548 * cs-tokenizer.cs: Return are more gentle token on failure.
10550 * pending.cs (PendingImplementation.InterfaceMethod): This routine
10551 had an out-of-sync index variable, which caused it to remove from
10552 the list of pending methods the wrong method sometimes.
10554 2002-10-22 Miguel de Icaza <miguel@ximian.com>
10556 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
10557 CanWrite, because those refer to this particular instance of the
10558 property, and do not take into account the fact that we can
10559 override single members of a property.
10561 Constructor requires an EmitContext. The resolution process does
10562 not happen here, but we need to compute the accessors before,
10563 because the resolution does not always happen for properties.
10565 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
10566 subclass, before we did not update this flag, but we did update
10569 (GetAccessors): Drop this routine, as it did not work in the
10570 presence of partially overwritten set/get methods.
10572 Notice that this broke the cs1540 detection, but that will require
10575 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10579 * driver.cs: issue a warning instead of an error if we don't support
10580 debugging for the platform. Also ignore a couple of errors that may
10581 arise when trying to write the symbols. Undo my previous patch.
10583 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10585 * driver.cs: ignore /debug switch except for Unix platforms.
10587 2002-10-23 Nick Drochak <ndrochak@gol.com>
10589 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
10591 2002-10-21 Miguel de Icaza <miguel@ximian.com>
10593 * driver.cs: Do not make mcs-debug conditional, so we do not break
10594 builds that use it.
10596 * statement.cs (UsageVector.MergeChildren): I would like Martin to
10597 review this patch. But basically after all the children variables
10598 have been merged, the value of "Breaks" was not being set to
10599 new_breaks for Switch blocks. I think that it should be set after
10600 it has executed. Currently I set this to the value of new_breaks,
10601 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
10602 conservative, but I do not understand this code very well.
10604 I did not break anything in the build, so that is good ;-)
10606 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
10608 2002-10-20 Mark Crichton <crichton@gimp.org>
10610 * cfold.cs: Fixed compile blocker. Really fixed it this time.
10612 2002-10-20 Nick Drochak <ndrochak@gol.com>
10614 * cfold.cs: Fixed compile blocker.
10616 2002-10-20 Miguel de Icaza <miguel@ximian.com>
10618 * driver.cs: I was chekcing the key, not the file.
10620 2002-10-19 Ravi Pratap <ravi@ximian.com>
10622 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
10623 message that we were generating - we just need to silently return
10626 2002-10-19 Miguel de Icaza <miguel@ximian.com>
10628 * class.cs (Event.Define): Change my previous commit, as this
10629 breaks the debugger. This is a temporary hack, as it seems like
10630 the compiler is generating events incorrectly to begin with.
10632 * expression.cs (Binary.ResolveOperator): Added support for
10633 "U operator - (E x, E y)"
10635 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
10638 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
10639 init-only variables, but this path did not take into account that
10640 there might be also instance readonly variables. Correct this
10643 This fixes bug 32253
10645 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
10648 * driver.cs: Change the extension for modules to `netmodule'
10650 * cs-parser.jay: Improved slightly the location tracking for
10651 the debugger symbols.
10653 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
10654 modifiers that were specified instead of the hardcoded value
10655 (FamAndAssem). This was basically ignoring the static modifier,
10656 and others. Fixes 32429.
10658 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
10659 fixed a bug in the process (32476)
10661 * expression.cs (ArrayAccess.EmitAssign): Patch from
10662 hwang_rob@yahoo.ca that fixes bug 31834.3
10664 2002-10-18 Miguel de Icaza <miguel@ximian.com>
10666 * driver.cs: Make the module extension .netmodule.
10668 2002-10-16 Miguel de Icaza <miguel@ximian.com>
10670 * driver.cs: Report an error if the resource file is not found
10671 instead of crashing.
10673 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
10674 false, like Emit does.
10676 2002-10-16 Nick Drochak <ndrochak@gol.com>
10678 * typemanager.cs: Remove unused private member. Also reported mcs
10679 bug to report this as a warning like csc.
10681 2002-10-15 Martin Baulig <martin@gnome.org>
10683 * statement.cs (Statement.Emit): Made this a virtual method; emits
10684 the line number info and calls DoEmit().
10685 (Statement.DoEmit): New protected abstract method, formerly knows
10686 as Statement.Emit().
10688 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
10690 2002-10-11 Miguel de Icaza <miguel@ximian.com>
10692 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
10693 have fixed a remaining problem: not every AddXXXX was adding a
10694 fully qualified name.
10696 Now everyone registers a fully qualified name in the DeclSpace as
10697 being defined instead of the partial name.
10699 Downsides: we are slower than we need to be due to the excess
10700 copies and the names being registered this way.
10702 The reason for this is that we currently depend (on the corlib
10703 bootstrap for instance) that types are fully qualified, because
10704 we dump all the types in the namespace, and we should really have
10705 types inserted into the proper namespace, so we can only store the
10706 basenames in the defined_names array.
10708 2002-10-10 Martin Baulig <martin@gnome.org>
10710 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
10711 from bug #31834, see the bug report for a testcase which is
10714 2002-10-10 Martin Baulig <martin@gnome.org>
10716 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
10717 flow analysis code for this.
10719 * statement.cs (Do, While, For): Tell the flow analysis code about
10721 (FlowBranching.UsageVector): Added support for infinite loops.
10722 (Block.Resolve): Moved the dead code elimination here and use flow
10725 2002-10-09 Miguel de Icaza <miguel@ximian.com>
10727 * class.cs (Field.Define): Catch cycles on struct type
10730 * typemanager.cs (IsUnmanagedtype): Do not recursively check
10731 fields if the fields are static. We only need to check instance
10734 * expression.cs (As.DoResolve): Test for reference type.
10736 * statement.cs (Using.ResolveExpression): Use
10737 ConvertImplicitRequired, not ConvertImplicit which reports an
10739 (Using.ResolveLocalVariableDecls): ditto.
10741 * expression.cs (Binary.ResolveOperator): Report errors in a few
10742 places where we had to.
10744 * typemanager.cs (IsUnmanagedtype): Finish implementation.
10746 2002-10-08 Miguel de Icaza <miguel@ximian.com>
10748 * expression.cs: Use StoreFromPtr instead of extracting the type
10749 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
10751 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
10752 an enumeration value to a System.Enum, but System.Enum is not a
10753 value type, but an class type, so we need to box.
10755 (Expression.ConvertExplicit): One codepath could return
10756 errors but not flag them. Fix this. Fixes #31853
10758 * parameter.cs (Resolve): Do not allow void as a parameter type.
10760 2002-10-06 Martin Baulig <martin@gnome.org>
10762 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
10763 if it's a class type and not a struct. Fixes #31815.
10765 2002-10-06 Martin Baulig <martin@gnome.org>
10767 * statement.cs: Reworked the flow analysis code a bit to make it
10768 usable for dead code elimination.
10770 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10772 * cs-parser.jay: allow empty source files. Fixes bug #31781.
10774 2002-10-04 Miguel de Icaza <miguel@ximian.com>
10776 * expression.cs (ComposedCast.DoResolveType): A quick workaround
10777 to fix the test 165, will investigate deeper.
10779 2002-10-04 Martin Baulig <martin@gnome.org>
10781 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
10782 finally blocks actually work.
10783 (Try.Resolve): We don't need to create a sibling for `finally' if
10784 there is no finally block.
10786 2002-10-04 Martin Baulig <martin@gnome.org>
10788 * class.cs (Constructor.Define): The default accessibility for a
10789 non-default constructor is private, not public.
10791 2002-10-04 Miguel de Icaza <miguel@ximian.com>
10793 * class.cs (Constructor): Make AllowedModifiers public, add
10796 * cs-parser.jay: Perform the modifiers test here, as the
10797 constructor for the Constructor class usually receives a zero
10798 because of the way we create it (first we create, later we
10799 customize, and we were never checking the modifiers).
10801 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
10802 is a version of LookupTypeReflection that includes the type-name
10803 cache. This can be used as a fast path for functions that know
10804 the fully qualified name and are only calling into *.GetType() to
10805 obtain a composed type.
10807 This is also used by TypeManager.LookupType during its type
10810 (LookupType): We now also track the real type name, as sometimes
10811 we can get a quey for the real type name from things like
10812 ComposedCast. This fixes bug 31422.
10814 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
10815 complete type fullname, it does not have to go through the type
10816 resolution system to obtain the composed version of the type (for
10817 obtaining arrays or pointers).
10819 (Conditional.Emit): Use the EmitBoolExpression to
10820 generate nicer code, as requested by Paolo.
10822 (ArrayCreation.CheckIndices): Use the patch from
10823 hwang_rob@yahoo.ca to validate the array initializers.
10825 2002-10-03 Miguel de Icaza <miguel@ximian.com>
10827 * class.cs (ConstructorInitializer.Emit): simplify code by using
10828 Invocation.EmitCall, and at the same time, fix the bugs in calling
10829 parent constructors that took variable arguments.
10831 * ecore.cs (Expression.ConvertNumericExplicit,
10832 Expression.ImplicitNumericConversion): Remove the code that
10833 manually wrapped decimal (InternalTypeConstructor call is now gone
10836 * expression.cs (Cast.TryReduce): Also handle decimal types when
10837 trying to perform a constant fold on the type.
10839 * typemanager.cs (IsUnmanagedtype): Partially implemented.
10841 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
10842 that only turned off an error report, and did nothing else.
10844 2002-10-02 Miguel de Icaza <miguel@ximian.com>
10846 * driver.cs: Handle and ignore /fullpaths
10848 2002-10-01 Miguel de Icaza <miguel@ximian.com>
10850 * expression.cs (Binary.ResolveOperator): Catch the case where
10851 DoNumericPromotions returns true,
10853 (Binary.DoNumericPromotions): Simplify the code, and the tests.
10855 2002-09-27 Miguel de Icaza <miguel@ximian.com>
10857 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
10860 2002-09-26 Miguel de Icaza <miguel@ximian.com>
10862 * ecore.cs (ConvertNumericExplicit): It is not enough that the
10863 conversion exists, but it is also required that the conversion be
10864 performed. This manifested in "(Type64Enum) 2".
10866 * class.cs (TypeManager.AddMethod): The fix is not to change
10867 AddEnum, because that one was using a fully qualified name (every
10868 DeclSpace derivative does), but to change the AddMethod routine
10869 that was using an un-namespaced name. This now correctly reports
10870 the duplicated name.
10872 Revert patch until I can properly fix it. The issue
10873 is that we have a shared Type space across all namespaces
10874 currently, which is wrong.
10876 Options include making the Namespace a DeclSpace, and merge
10877 current_namespace/current_container in the parser.
10879 2002-09-25 Miguel de Icaza <miguel@ximian.com>
10881 * cs-parser.jay: Improve error reporting when we get a different
10882 kind of expression in local_variable_type and
10883 local_variable_pointer_type.
10885 Propagate this to avoid missleading errors being reported.
10887 * ecore.cs (ImplicitReferenceConversion): treat
10888 TypeManager.value_type as a target just like object_type. As
10893 Is valid, and needs to result in the int 1 being boxed before it
10894 is assigned to the value type v.
10896 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
10897 to validate the enumeration name.
10899 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
10900 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
10901 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
10903 * ecore.cs (TryImplicitIntConversion): When doing an
10904 implicit-enumeration-conversion, check if the type is 64-bits and
10905 perform a conversion before passing to EnumConstant.
10907 2002-09-23 Miguel de Icaza <miguel@ximian.com>
10909 * decl.cs (Error_AmbiguousTypeReference); New routine used to
10910 report ambiguous type references. Unlike the MS version, we
10911 report what the ambiguity is. Innovation at work ;-)
10913 (DeclSpace.FindType): Require a location argument to
10914 display when we display an ambiguous error.
10916 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
10918 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
10920 * expression.cs (EmitDynamicInitializers): Apply patch from
10921 hwang_rob@yahoo.ca that fixes the order in which we emit our
10924 2002-09-21 Martin Baulig <martin@gnome.org>
10926 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
10927 delegate takes no arguments.
10929 2002-09-20 Miguel de Icaza <miguel@ximian.com>
10931 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
10934 * expression.cs: Extract the underlying type.
10936 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
10938 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
10940 2002-09-19 Miguel de Icaza <miguel@ximian.com>
10942 * class.cs (TypeContainer.DefineType): We can not use the nice
10943 PackingSize with the size set to 1 DefineType method, because it
10944 will not allow us to define the interfaces that the struct
10947 This completes the fixing of bug 27287
10949 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
10950 means also structs. This fixes part of the problem.
10951 (Expresion.ImplicitReferenceConversionExists): ditto.
10953 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
10954 error if there were no errors reported during the type lookup
10955 process, to avoid duplicates or redundant errors. Without this
10956 you would get an ambiguous errors plus a type not found. We have
10957 beaten the user enough with the first error.
10959 (DeclSparce.FindType): Emit a warning if we have an ambiguous
10962 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
10963 during the resolution process, stop the lookup, this avoids
10964 repeated error reports (same error twice).
10966 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
10968 * typemanager.cs (LookupType): Redo the type lookup code to match
10969 the needs of System.Reflection.
10971 The issue is that System.Reflection requires references to nested
10972 types to begin with a "+" sign instead of a dot. So toplevel
10973 types look like: "NameSpace.TopLevelClass", and nested ones look
10974 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
10977 2002-09-19 Martin Baulig <martin@gnome.org>
10979 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
10980 says that a method always returns or always throws an exception,
10981 don't report the CS0161.
10983 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
10984 set `Returns = new_returns'.
10986 2002-09-19 Martin Baulig <martin@gnome.org>
10988 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
10989 to an enum constant, check for a CS0176.
10991 2002-09-18 Miguel de Icaza <miguel@ximian.com>
10993 * class.cs (TypeContainer.CheckPairedOperators): Now we check
10994 for operators that must be in pairs and report errors.
10996 * ecore.cs (SimpleName.DoResolveType): During the initial type
10997 resolution process, when we define types recursively, we must
10998 check first for types in our current scope before we perform
10999 lookups in the enclosing scopes.
11001 * expression.cs (MakeByteBlob): Handle Decimal blobs.
11003 (Invocation.VerifyArgumentsCompat): Call
11004 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
11005 I thought we were supposed to always call this, but there are a
11006 few places in the code where we dont do it.
11008 2002-09-17 Miguel de Icaza <miguel@ximian.com>
11010 * driver.cs: Add support in -linkres and -resource to specify the
11011 name of the identifier.
11013 2002-09-16 Miguel de Icaza <miguel@ximian.com>
11015 * ecore.cs (StandardConversionExists): Sync with the conversion
11016 code: allow anything-* to void* conversions.
11018 (FindMostSpecificSource): Use an Expression argument
11019 instead of a Type, because we might be handed over a Literal which
11020 gets a few more implicit conversions that plain types do not. So
11021 this information was being lost.
11023 Also, we drop the temporary type-holder expression when not
11026 2002-09-17 Martin Baulig <martin@gnome.org>
11028 * class.cs (PropertyBase.CheckBase): Don't check the base class if
11029 this is an explicit interface implementation.
11031 2002-09-17 Martin Baulig <martin@gnome.org>
11033 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
11034 different `IndexerName' attributes.
11036 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
11037 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
11038 virtual CommonResolve().
11040 2002-09-16 Miguel de Icaza <miguel@ximian.com>
11042 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
11043 and convert that to the UnderlyingType.
11045 * statement.cs (Foreach.Resolve): Indexers are just like variables
11046 or PropertyAccesses.
11048 * cs-tokenizer.cs (consume_string): Track line numbers and columns
11049 inside quoted strings, we were not doing this before.
11051 2002-09-16 Martin Baulig <martin@gnome.org>
11053 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
11054 resolve it. This is needed for the definite assignment check of the
11055 instance expression, fixes bug #29846.
11056 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
11058 2002-09-16 Nick Drochak <ndrochak@gol.com>
11060 * parameter.cs: Fix compile error. Cannot reference static member
11061 from an instance object. Is this an mcs bug?
11063 2002-09-14 Martin Baulig <martin@gnome.org>
11065 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
11066 multiple times. Fixes bug #30295, added test-166.cs.
11068 2002-09-14 Martin Baulig <martin@gnome.org>
11070 * statement.cs (Block.Emit): Don't emit unreachable code.
11071 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
11072 `break' statements.
11073 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
11075 2002-09-14 Martin Baulig <martin@gnome.org>
11077 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
11080 2002-09-14 Martin Baulig <martin@gnome.org>
11082 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
11083 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
11084 be false on the ms runtime.
11086 2002-09-13 Martin Baulig <martin@gnome.org>
11088 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
11089 the CS0038 error message.
11091 2002-09-12 Miguel de Icaza <miguel@ximian.com>
11093 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
11094 constant inside, return it.
11096 2002-09-12 Martin Baulig <martin@gnome.org>
11098 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
11099 implicit conversion can be done between enum types.
11101 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
11102 check whether an implicit conversion to the current enum's UnderlyingType
11103 exists and report an error if not.
11105 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
11106 without debugging support.
11108 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
11109 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
11111 2002-09-12 Martin Baulig <martin@gnome.org>
11113 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
11115 * ecore.cs (IMemberExpr.DeclaringType): New property.
11116 (SimpleName.SimpleNameResolve): Check whether we're accessing a
11117 nonstatic member of an outer type (CS0038).
11119 2002-09-11 Miguel de Icaza <miguel@ximian.com>
11121 * driver.cs: Activate the using-error detector at warning level
11122 4 (at least for MS-compatible APIs).
11124 * namespace.cs (VerifyUsing): Small buglett fix.
11126 * pending.cs (PendingImplementation): pass the container pointer.
11128 * interface.cs (GetMethods): Allow for recursive definition. Long
11129 term, I would like to move every type to support recursive
11130 definitions, not the current ordering mechanism that we have right
11133 The situation is this: Attributes are handled before interfaces,
11134 so we can apply attributes to interfaces. But some attributes
11135 implement interfaces, we will now handle the simple cases
11136 (recursive definitions will just get an error).
11138 * parameter.cs: Only invalidate types at the end if we fail to
11141 2002-09-09 Martin Baulig <martin@gnome.org>
11143 * ecore.cs (PropertyExpr.Emit): Also check for
11144 TypeManager.system_int_array_get_length so this'll also work when
11145 compiling corlib. Fixes #30003.
11147 2002-09-09 Martin Baulig <martin@gnome.org>
11149 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
11150 and throw an exception if we can't get the type's size. Fixed #30040,
11153 2002-09-09 Martin Baulig <martin@gnome.org>
11155 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
11157 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
11158 context. Fixes bug #30027.
11160 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
11161 virtual functions. Fixes bug #30043, added test-164.cs.
11163 2002-09-08 Ravi Pratap <ravi@ximian.com>
11165 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
11167 2002-09-08 Nick Drochak <ndrochak@gol.com>
11169 * driver.cs: Use an object to get the windows codepage since it's not a
11172 2002-09-08 Miguel de Icaza <miguel@ximian.com>
11174 * statement.cs (For.Emit): for infinite loops (test == null)
11175 return whether there is a break inside, not always "true".
11177 * namespace.cs (UsingEntry): New struct to hold the name of the
11178 using definition, the location where it is defined, and whether it
11179 has been used in a successful type lookup.
11181 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
11186 2002-09-06 Ravi Pratap <ravi@ximian.com>
11188 * attribute.cs : Fix incorrect code which relied on catching
11189 a NullReferenceException to detect a null being passed in
11190 where an object was expected.
11192 2002-09-06 Miguel de Icaza <miguel@ximian.com>
11194 * statement.cs (Try): flag the catch variable as assigned
11196 * expression.cs (Cast): Simplified by using ResolveType instead of
11197 manually resolving.
11199 * statement.cs (Catch): Fix bug by using ResolveType.
11201 2002-09-06 Ravi Pratap <ravi@ximian.com>
11203 * expression.cs (BetterConversion): Special case for when we have
11204 a NullLiteral as the argument and we have to choose between string
11205 and object types - we choose string the way csc does.
11207 * attribute.cs (Attribute.Resolve): Catch the
11208 NullReferenceException and report error #182 since the Mono
11209 runtime no more has the bug and having this exception raised means
11210 we tried to select a constructor which takes an object and is
11213 2002-09-05 Ravi Pratap <ravi@ximian.com>
11215 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
11216 message (1502, 1503) when we can't locate a method after overload
11217 resolution. This is much more informative and closes the bug
11220 * interface.cs (PopulateMethod): Return if there are no argument
11221 types. Fixes a NullReferenceException bug.
11223 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
11224 expressions too. Previously we were checking only in one place for
11225 positional arguments leaving out named arguments.
11227 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
11228 type to the enum type is not allowed. Remove code corresponding to
11231 (ConvertNumericExplicit): Allow explicit conversions from
11232 the underlying type to enum type. This precisely follows the spec
11233 and closes a bug filed by Gonzalo.
11235 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11238 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
11240 2002-09-03 Miguel de Icaza <miguel@ximian.com>
11242 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
11243 it was important that we stored the right value after the
11244 reduction in `converted'.
11246 2002-09-04 Martin Baulig <martin@gnome.org>
11248 * location.cs (Location.SymbolDocument): Use full pathnames for the
11251 2002-08-30 Miguel de Icaza <miguel@ximian.com>
11253 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
11254 of the expression resolve mechanism, because that will catch the
11255 SimpleName error failures.
11257 (Conditional): If we can not resolve the
11258 expression, return, do not crash.
11260 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11263 (location): display token name instead of its number.
11265 2002-08-28 Martin Baulig <martin@gnome.org>
11267 * expression.cs (Binary.ResolveOperator): Don't silently return
11268 but return an error if an operator cannot be applied between two
11271 2002-08-28 Martin Baulig <martin@gnome.org>
11273 * class.cs (Constructor.Define): Set the permission attributes
11274 correctly instead of making all constructors public.
11276 2002-08-28 Martin Baulig <martin@gnome.org>
11278 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
11279 for private members before reporting a CS0103; if we find anything,
11282 2002-08-28 Martin Baulig <martin@gnome.org>
11284 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
11285 to check whether `closure_start_type == closure_invocation_type',
11286 we also need to check whether `m.DeclaringType == closure_invocation_type'
11287 before bypassing the permission checks. We might be accessing
11288 protected/private members from the base class.
11289 (TypeManager.RealMemberLookup): Only set private_ok if private
11290 members were requested via BindingFlags.NonPublic.
11292 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
11294 * expression.cs (MemberAccess.ResolveMemberAccess): Set
11295 MethodGroupExpr.IsExplicitImpl if appropriate.
11296 (Invocation.DoResolve): Don't report the CS0120 for explicit
11297 interface implementations.
11299 2002-08-27 Martin Baulig <martin@gnome.org>
11301 * expression.cs (Invocation.DoResolve): If this is a static
11302 method and we don't have an InstanceExpression, we must report
11305 2002-08-25 Martin Baulig <martin@gnome.org>
11307 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
11308 `==' between a valuetype and an object.
11310 2002-08-25 Miguel de Icaza <miguel@ximian.com>
11312 * ecore.cs (TypeExpr): Provide a ToString method.
11314 2002-08-24 Martin Baulig <martin@gnome.org>
11316 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
11317 now called proggie.dbg and it's a binary file.
11319 2002-08-23 Martin Baulig <martin@gnome.org>
11321 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
11323 2002-08-23 Martin Baulig <martin@gnome.org>
11325 * struct.cs (MyStructInfo.ctor): Make this work with empty
11326 structs; it's not allowed to use foreach() on null.
11328 2002-08-23 Martin Baulig <martin@gnome.org>
11330 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
11331 writer the full pathname of the generated assembly.
11333 2002-08-23 Martin Baulig <martin@gnome.org>
11335 * statements.cs (FlowBranching.UsageVector.MergeChildren):
11336 A `finally' block never returns or breaks; improved handling of
11339 2002-08-23 Martin Baulig <martin@gnome.org>
11341 * statement.cs (Throw.Resolve): Allow `throw null'.
11343 2002-08-23 Martin Baulig <martin@gnome.org>
11345 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
11346 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
11347 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
11348 MemberLookup would return a wrong event if this is an explicit
11349 interface implementation and the class has an event with the same
11352 2002-08-23 Martin Baulig <martin@gnome.org>
11354 * statement.cs (Block.AddChildVariableNames): New public method.
11355 (Block.AddChildVariableName): Likewise.
11356 (Block.IsVariableNameUsedInChildBlock): Likewise.
11357 (Block.AddVariable): Check whether a variable name has already
11358 been used in a child block.
11360 * cs-parser.jay (declare_local_variables): Mark all variable names
11361 from the current block as being used in a child block in the
11364 2002-08-23 Martin Baulig <martin@gnome.org>
11366 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
11367 find the symbol writer.
11369 * driver.cs: csc also allows the arguments to /define being
11370 separated by commas, not only by semicolons.
11372 2002-08-23 Martin Baulig <martin@gnome.org>
11374 * interface.cs (Interface.GetMembers): Added static check for events.
11376 2002-08-15 Martin Baulig <martin@gnome.org>
11378 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
11379 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
11381 * ecore.cs (Expression.MemberLookup): Added documentation and explained
11382 why the MethodData.EmitDestructor() change was necessary.
11384 2002-08-20 Martin Baulig <martin@gnome.org>
11386 * class.cs (TypeContainer.FindMembers): Added static check for events.
11388 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
11390 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
11391 use Type.GetEvents(), not Type.FindMembers().
11393 2002-08-20 Martin Baulig <martin@gnome.org>
11395 * decl.cs (MemberCache): Added a special method cache which will
11396 be used for method-only searched. This ensures that a method
11397 search will return a MethodInfo with the correct ReflectedType for
11400 2002-08-20 Martin Baulig <martin@gnome.org>
11402 * decl.cs (DeclSpace.FindMembers): Made this public.
11404 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11406 * delegate.cs: fixed build on windows.
11407 [FIXME: Filed as bug #29150: MCS must report these errors.]
11409 2002-08-19 Ravi Pratap <ravi@ximian.com>
11411 * ecore.cs (StandardConversionExists): Return a false
11412 if we are trying to convert the void type to anything else
11413 since that is not allowed.
11415 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
11416 we flag error 70 in the event an event is trying to be accessed
11417 directly from outside the declaring type.
11419 2002-08-20 Martin Baulig <martin@gnome.org>
11421 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
11422 MemberCache from typemanager.cs to decl.cs.
11424 2002-08-19 Martin Baulig <martin@gnome.org>
11426 * class.cs (TypeContainer): Implement IMemberContainer.
11427 (TypeContainer.DefineMembers): Create the MemberCache.
11428 (TypeContainer.FindMembers): Do better BindingFlags checking; only
11429 return public members if BindingFlags.Public was given, check
11430 whether members are static.
11432 2002-08-16 Martin Baulig <martin@gnome.org>
11434 * decl.cs (DeclSpace.Define): Splitted this in Define and
11435 DefineMembers. DefineMembers is called first and initializes the
11438 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
11439 DefineMembers() on all our DeclSpaces.
11441 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
11442 but call DefineMembers() on all nested interfaces. We call their
11443 Define() in our new Define() function.
11445 * interface.cs (Interface): Implement IMemberContainer.
11446 (Interface.Define): Moved all code except the attribute stuf to
11448 (Interface.DefineMembers): Initialize the member cache.
11450 * typemanager.cs (IMemberFinder): Removed this interface, we don't
11451 need this anymore since we can use MemberCache.FindMembers directly.
11453 2002-08-19 Martin Baulig <martin@gnome.org>
11455 * typemanager.cs (MemberCache): When creating the cache for an
11456 interface type, add all inherited members.
11457 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
11458 to `out bool used_cache' and documented it.
11459 (TypeManager.MemberLookup): If we already used the cache in the first
11460 iteration, we don't need to do the interfaces check.
11462 2002-08-19 Martin Baulig <martin@gnome.org>
11464 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
11465 here from IMemberFinder and don't implement this interface anymore.
11466 (DeclSpace.MemberCache): Moved here from IMemberFinder.
11468 * typemanager.cs (IMemberFinder): This interface is now only used by
11469 classes which actually support the member cache.
11470 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
11471 since we only put DeclSpaces into this Hashtable.
11472 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
11473 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
11475 2002-08-16 Martin Baulig <martin@gnome.org>
11477 * typemanager.cs (ICachingMemberFinder): Removed.
11478 (IMemberFinder.MemberCache): New property.
11479 (TypeManager.FindMembers): Merged this with RealFindMembers().
11480 This function will never be called from TypeManager.MemberLookup()
11481 so we can't use the cache here, just the IMemberFinder.
11482 (TypeManager.MemberLookup_FindMembers): Check whether the
11483 IMemberFinder has a MemberCache and call the cache's FindMembers
11485 (MemberCache): Rewrote larger parts of this yet another time and
11486 cleaned it up a bit.
11488 2002-08-15 Miguel de Icaza <miguel@ximian.com>
11490 * driver.cs (LoadArgs): Support quoting.
11492 (Usage): Show the CSC-like command line arguments.
11494 Improved a few error messages.
11496 2002-08-15 Martin Baulig <martin@gnome.org>
11498 * typemanager.cs (IMemberContainer.Type): New property.
11499 (IMemberContainer.IsInterface): New property.
11501 The following changes are conditional to BROKEN_RUNTIME, which is
11502 defined at the top of the file.
11504 * typemanager.cs (MemberCache.MemberCache): Don't add the base
11505 class'es members, but add all members from TypeHandle.ObjectType
11506 if we're an interface.
11507 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
11508 is the current type.
11509 (MemberCache.CacheEntry.Container): Removed this field.
11510 (TypeHandle.GetMembers): Include inherited members.
11512 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11514 * typemanager.cs: fixed compilation and added a comment on a field that
11517 2002-08-15 Martin Baulig <martin@gnome.org>
11519 * class.cs (ConstructorInitializer.Resolve): In the
11520 Expression.MemberLookup call, use the queried_type as
11523 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
11524 declared' attribute, it's always true.
11525 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
11526 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
11527 temporary wrapper for FindMembers which tells MemberLookup whether
11528 members from the base classes are included in the return value.
11529 This will go away soon.
11530 (TypeManager.MemberLookup): Use this temporary hack here; once the
11531 new MemberCache is completed, we don't need to do the DeclaredOnly
11532 looping here anymore since the MemberCache will take care of this.
11533 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
11534 (MemberCache): When creating the MemberCache for a class, get
11535 members from the current class and all its base classes.
11536 (MemberCache.CacheEntry.Container): New field. This is a
11537 temporary hack until the Mono runtime is fixed to distinguish
11538 between ReflectedType and DeclaringType. It allows us to use MCS
11539 with both the MS runtime and the unfixed Mono runtime without
11540 problems and without accecting performance.
11541 (MemberCache.SearchMembers): The DeclaredOnly looping from
11542 TypeManager.MemberLookup is now done here.
11544 2002-08-14 Martin Baulig <martin@gnome.org>
11546 * statement.cs (MyStructInfo.MyStructInfo): Don't call
11547 Type.GetFields on dynamic types but get the fields from the
11548 corresponding TypeContainer.
11549 (MyStructInfo.GetStructInfo): Added check for enum types.
11551 * typemanager.cs (MemberList.IsSynchronized): Implemented.
11552 (MemberList.SyncRoot): Implemented.
11553 (TypeManager.FilterWithClosure): No need to check permissions if
11554 closure_start_type == closure_invocation_type, don't crash if
11555 closure_invocation_type is null.
11557 2002-08-13 Martin Baulig <martin@gnome.org>
11559 Rewrote TypeContainer.FindMembers to use a member cache. This
11560 gives us a speed increase of about 35% for the self-hosting MCS
11561 build and of about 15-20% for the class libs (both on GNU/Linux).
11563 * report.cs (Timer): New class to get enhanced profiling. This
11564 whole class is "TIMER" conditional since it remarkably slows down
11567 * class.cs (MemberList): New class. This is an IList wrapper
11568 which we're now using instead of passing MemberInfo[]'s around to
11569 avoid copying this array unnecessarily.
11570 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
11571 (ICachingMemberFinder, IMemberContainer): New interface.
11572 (TypeManager.FilterWithClosure): If `criteria' is null, the name
11573 has already been checked, otherwise use it for the name comparision.
11574 (TypeManager.FindMembers): Renamed to RealMemberFinder and
11575 provided wrapper which tries to use ICachingMemberFinder.FindMembers
11576 if possible. Returns a MemberList, not a MemberInfo [].
11577 (TypeHandle): New class, implements IMemberContainer. We create
11578 one instance of this class per type, it contains a MemberCache
11579 which is used to do the member lookups.
11580 (MemberCache): New class. Each instance of this class contains
11581 all members of a type and a name-based hash table.
11582 (MemberCache.FindMembers): This is our new member lookup
11583 function. First, it looks up all members of the requested name in
11584 the hash table. Then, it walks this list and sorts out all
11585 applicable members and returns them.
11587 2002-08-13 Martin Baulig <martin@gnome.org>
11589 In addition to a nice code cleanup, this gives us a performance
11590 increase of about 1.4% on GNU/Linux - not much, but it's already
11591 half a second for the self-hosting MCS compilation.
11593 * typemanager.cs (IMemberFinder): New interface. It is used by
11594 TypeManager.FindMembers to call FindMembers on a TypeContainer,
11595 Enum, Delegate or Interface.
11596 (TypeManager.finder_to_member_finder): New PtrHashtable.
11597 (TypeManager.finder_to_container): Removed.
11598 (TypeManager.finder_to_delegate): Removed.
11599 (TypeManager.finder_to_interface): Removed.
11600 (TypeManager.finder_to_enum): Removed.
11602 * interface.cs (Interface): Implement IMemberFinder.
11604 * delegate.cs (Delegate): Implement IMemberFinder.
11606 * enum.cs (Enum): Implement IMemberFinder.
11608 * class.cs (TypeContainer): Implement IMemberFinder.
11610 2002-08-12 Martin Baulig <martin@gnome.org>
11612 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
11614 2002-08-12 Martin Baulig <martin@gnome.org>
11616 * ecore.cs (ITypeExpression): New interface for expressions which
11618 (TypeExpression): Renamed to TypeLookupExpression.
11619 (Expression.DoResolve): If we're doing a types-only lookup, the
11620 expression must implement the ITypeExpression interface and we
11621 call DoResolveType() on it.
11622 (SimpleName): Implement the new ITypeExpression interface.
11623 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
11624 hack, the situation that we're only looking up types can't happen
11625 anymore when this method is called. Moved the type lookup code to
11626 DoResolveType() and call it.
11627 (SimpleName.DoResolveType): This ITypeExpression interface method
11628 is now doing the types-only lookup.
11629 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
11630 (ResolveFlags): Added MaskExprClass.
11632 * expression.cs (MemberAccess): Implement the ITypeExpression
11634 (MemberAccess.DoResolve): Added support for a types-only lookup
11635 when we're called via ITypeExpression.DoResolveType().
11636 (ComposedCast): Implement the ITypeExpression interface.
11638 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
11639 Expression.Resolve() with ResolveFlags.Type instead.
11641 2002-08-12 Martin Baulig <martin@gnome.org>
11643 * interface.cs (Interface.Define): Apply attributes.
11645 * attribute.cs (Attribute.ApplyAttributes): Added support for
11646 interface attributes.
11648 2002-08-11 Martin Baulig <martin@gnome.org>
11650 * statement.cs (Block.Emit): Only check the "this" variable if we
11651 do not always throw an exception.
11653 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
11654 whether the property has a set accessor.
11656 2002-08-11 Martin Baulig <martin@gnome.org>
11658 Added control flow analysis support for structs.
11660 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
11661 with control flow analysis turned off.
11662 (IVariable): New interface.
11663 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
11664 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
11665 (FieldExpr.DoResolve): Resolve the instance expression with flow
11666 analysis turned off and do the definite assignment check after the
11667 resolving when we know what the expression will resolve to.
11669 * expression.cs (LocalVariableReference, ParameterReference):
11670 Implement the new IVariable interface, only call the flow analysis
11671 code if ec.DoFlowAnalysis is true.
11672 (This): Added constructor which takes a Block argument. Implement
11673 the new IVariable interface.
11674 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
11675 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
11676 This does the definite assignment checks for struct members.
11678 * class.cs (Constructor.Emit): If this is a non-static `struct'
11679 constructor which doesn't have any initializer, call
11680 Block.AddThisVariable() to tell the flow analysis code that all
11681 struct elements must be initialized before control returns from
11684 * statement.cs (MyStructInfo): New public class.
11685 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
11686 argument to this indexer. If non-zero, check an individual struct
11687 member, not the whole struct.
11688 (FlowBranching.CheckOutParameters): Check struct members.
11689 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
11690 overloaded versions of these methods which take an additional
11691 `int field_idx' argument to check struct members.
11692 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
11693 overloaded versions of these methods which take an additional
11694 `string field_name' argument to check struct member.s
11695 (VariableInfo): Implement the IVariable interface.
11696 (VariableInfo.StructInfo): New public property. Returns the
11697 MyStructInfo instance of the variable if it's a struct or null.
11698 (Block.AddThisVariable): New public method. This is called from
11699 Constructor.Emit() for non-static `struct' constructor which do
11700 not have any initializer. It creates a special variable for the
11701 "this" instance variable which will be checked by the flow
11702 analysis code to ensure that all of the struct's fields are
11703 initialized before control returns from the constructor.
11704 (UsageVector): Added support for struct members. If a
11705 variable/parameter is a struct with N members, we reserve a slot
11706 in the usage vector for each member. A struct is considered fully
11707 initialized if either the struct itself (slot 0) or all its
11708 members are initialized.
11710 2002-08-08 Martin Baulig <martin@gnome.org>
11712 * driver.cs (Driver.MainDriver): Only report an error CS5001
11713 if there were no compilation errors.
11715 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
11716 `UnsafeContext' property to determine whether the parent is in
11717 unsafe context rather than checking the parent's ModFlags:
11718 classes nested in an unsafe class are unsafe as well.
11720 2002-08-08 Martin Baulig <martin@gnome.org>
11722 * statement.cs (UsageVector.MergeChildren): Distinguish between
11723 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
11724 we return. Added test17() and test18() to test-154.cs.
11726 2002-08-08 Martin Baulig <martin@gnome.org>
11728 * typemanager.cs (TypeManager.FilterWithClosure): If we have
11729 Family access, make sure the invoking type isn't a subclass of the
11730 queried type (that'd be a CS1540).
11732 * ecore.cs (Expression.MemberLookup): Added overloaded version of
11733 this method which takes an additional `Type invocation_type'.
11735 * expression.cs (BaseAccess.DoResolve): Use the base type as
11736 invocation and query type.
11737 (MemberAccess.DoResolve): If the lookup failed and we're about to
11738 report a CS0122, try a lookup with the ec.ContainerType - if this
11739 succeeds, we must report a CS1540.
11741 2002-08-08 Martin Baulig <martin@gnome.org>
11743 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
11744 (MethodGroupExpr): Implement the IMemberExpr interface.
11746 * expression (MemberAccess.ResolveMemberAccess): No need to have
11747 any special code for MethodGroupExprs anymore, they're now
11750 2002-08-08 Martin Baulig <martin@gnome.org>
11752 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
11753 Family, FamANDAssem and FamORAssem permissions.
11754 (TypeManager.IsSubclassOrNestedChildOf): New public method.
11756 2002-08-08 Martin Baulig <martin@gnome.org>
11758 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
11759 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
11762 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
11764 * driver.cs: implemented /resource option to embed managed resources.
11766 2002-08-07 Martin Baulig <martin@gnome.org>
11768 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
11769 (FieldBase.HasFieldInitializer): New public property.
11770 (FieldBase.GetInitializerExpression): New public method. Resolves and
11771 returns the field initializer and makes sure it is only resolved once.
11772 (TypeContainer.EmitFieldInitializers): Call
11773 FieldBase.GetInitializerExpression to get the initializer, this ensures
11774 that it isn't resolved multiple times.
11776 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
11777 the resolving process (SimpleName/MemberLookup) that we're currently
11778 emitting a field initializer (which must not access any instance members,
11779 this is an error CS0236).
11781 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
11782 argument, if the `IsFieldInitializer' flag is set, we must report and
11783 error CS0236 and not an error CS0120.
11785 2002-08-07 Martin Baulig <martin@gnome.org>
11787 * ecore.cs (IMemberExpr): New public interface.
11788 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
11789 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
11790 if the expression is an IMemberExpr.
11792 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
11793 to be null, implicitly default to `this' if we're non-static in
11794 this case. Simplified the code a lot by using the new IMemberExpr
11795 interface. Also fixed bug #28176 here.
11797 2002-08-06 Martin Baulig <martin@gnome.org>
11799 * cs-parser.jay (SimpleLookup): Removed. We need to create
11800 ParameterReferences during semantic analysis so that we can do a
11801 type-only search when resolving Cast, TypeOf and SizeOf.
11802 (block): Pass the `current_local_parameters' to the Block's
11805 * class.cs (ConstructorInitializer): Added `Parameters parameters'
11806 argument to the constructor.
11807 (ConstructorInitializer.Resolve): Create a temporary implicit
11808 block with the parameters.
11810 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
11811 references here if we aren't doing a type-only search.
11813 * statement.cs (Block): Added constructor which takes a
11814 `Parameters parameters' argument.
11815 (Block.Parameters): New public property.
11817 * support.cs (InternalParameters.Parameters): Renamed `parameters'
11818 to `Parameters' and made it public readonly.
11820 2002-08-06 Martin Baulig <martin@gnome.org>
11822 * ecore.cs (Expression.Warning): Made this public as well.
11824 * report.cs (Report.Debug): Print the contents of collections.
11826 2002-08-06 Martin Baulig <martin@gnome.org>
11828 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
11829 used to tell Resolve() which kinds of expressions it may return.
11830 (Expression.Resolve): Added overloaded version of this method which
11831 takes a `ResolveFlags flags' argument. This can be used to tell
11832 Resolve() which kinds of expressions it may return. Reports a
11834 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
11835 ResolveFlags.SimpleName.
11836 (Expression.Error118): Added overloaded version of this method which
11837 takes a `ResolveFlags flags' argument. It uses the flags to determine
11838 which kinds of expressions are allowed.
11840 * expression.cs (Argument.ResolveMethodGroup): New public method.
11841 Resolves an argument, but allows a MethodGroup to be returned.
11842 This is used when invoking a delegate.
11844 * TODO: Updated a bit.
11846 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11848 Fixed compilation with csc.
11850 * ecore.cs: Expression.Error made public. Is this correct? Should
11851 Warning be made public too?
11853 * expression.cs: use ea.Location instead of ea.loc.
11854 [FIXME: Filed as bug #28607: MCS must report these errors.]
11856 2002-08-06 Martin Baulig <martin@gnome.org>
11858 * ecore.cs (Expression.loc): Moved the location here instead of
11859 duplicating it in all derived classes.
11860 (Expression.Location): New public property.
11861 (Expression.Error, Expression.Warning): Made them non-static and
11862 removed the location argument.
11863 (Expression.Warning): Added overloaded version which takes an
11864 `int level' argument.
11865 (Expression.Error118): Make this non-static and removed the
11866 expression and location arguments.
11867 (TypeExpr): Added location argument to the constructor.
11869 * expression.cs (StaticCallExpr): Added location argument to
11871 (Indirection, PointerArithmetic): Likewise.
11872 (CheckedExpr, UnCheckedExpr): Likewise.
11873 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
11874 (StringPtr): Likewise.
11877 2002-08-05 Martin Baulig <martin@gnome.org>
11879 * expression.cs (BaseAccess.DoResolve): Actually report errors.
11881 * assign.cs (Assign.DoResolve): Check whether the source
11882 expression is a value or variable.
11884 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
11885 while resolving the corresponding blocks.
11887 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
11888 an error, don't silently return null.
11890 * statement.cs (Block.AddVariable): Do the error reporting here
11891 and distinguish between CS0128 and CS0136.
11892 (Block.DoResolve): Report all unused labels (warning CS0164).
11893 (LabeledStatement): Pass the location to the constructor.
11894 (LabeledStatement.HasBeenReferenced): New property.
11895 (LabeledStatement.Resolve): Set it to true here.
11897 * statement.cs (Return.Emit): Return success even after reporting
11898 a type mismatch error (CS0126 or CS0127), this is what csc does and
11899 it avoids confusing the users with any consecutive errors.
11901 2002-08-05 Martin Baulig <martin@gnome.org>
11903 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
11905 * const.cs (Const.LookupConstantValue): Catch circular definitions.
11907 * expression.cs (MemberAccess.DoResolve): Silently return if an
11908 error has already been reported.
11910 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
11911 error has already been reported.
11913 2002-08-05 Martin Baulig <martin@gnome.org>
11915 * statement.cs (UsageVector): Only initialize the `parameters'
11916 vector if we actually have any "out" parameters.
11918 2002-08-05 Martin Baulig <martin@gnome.org>
11920 * expression.cs (Binary.ResolveOperator): When combining delegates,
11921 they must have the same type.
11923 2002-08-05 Martin Baulig <martin@gnome.org>
11925 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
11926 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
11927 work with the ms runtime and we also don't need it: if we're a
11928 PropertyBuilder and not in the `indexer_arguments' hash, then we
11929 are a property and not an indexer.
11931 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
11932 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
11933 since the latter one doesn't work with the ms runtime.
11935 2002-08-03 Martin Baulig <martin@gnome.org>
11937 Fixed bugs #27998 and #22735.
11939 * class.cs (Method.IsOperator): New public field.
11940 (Method.CheckBase): Report CS0111 if there's already a method
11941 with the same parameters in the current class. Report CS0508 when
11942 attempting to change the return type of an inherited method.
11943 (MethodData.Emit): Report CS0179 if a method doesn't have a body
11944 and it's not marked abstract or extern.
11945 (PropertyBase): New abstract base class for Property and Indexer.
11946 (PropertyBase.CheckBase): Moved here from Property and made it work
11948 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
11949 the same so we can reuse it there.
11950 (Property, Indexer): Derive from PropertyBase.
11951 (MethodSignature.inheritable_property_signature_filter): New delegate
11952 to find properties and indexers.
11954 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
11955 argument and improved error reporting.
11957 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
11958 EmptyReadOnlyParameters and made it a property.
11960 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
11961 version of this method which takes a `PropertyInfo indexer'.
11962 (TypeManager.RegisterIndexer): New method.
11964 * class.cs: Added myself as author of this file :-)
11966 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11968 * class.cs: fixed compilation on windoze.
11970 2002-08-03 Martin Baulig <martin@gnome.org>
11972 * interface.cs (Interface.GetInterfaceBases): Check whether all
11973 base interfaces are at least as accessible than the current one.
11975 * class.cs (TypeContainer.GetClassBases): Check whether base types
11976 are at least as accessible than the current type.
11977 (TypeContainer.AsAccessible): Implemented and made non-static.
11978 (MemberBase.CheckParameters): Report errors if the accessibility
11981 * delegate.cs (Delegate.Delegate): The default visibility is
11982 internal for top-level types and private for nested types.
11983 (Delegate.Define): Report errors if the accessibility checks fail.
11985 * enum.cs (Enum.Enum): The default visibility is internal for
11986 top-level types and private for nested types.
11987 (Enum.DefineType): Compute the correct visibility.
11989 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
11990 function which takes a `bool is_toplevel' instead of a TypeContainer.
11992 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
11995 2002-08-02 Martin Baulig <martin@gnome.org>
11997 * expression.cs (LocalVariableReferenc): Added constructor which
11998 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
11999 (LocalVariableReference.IsReadOnly): New property.
12000 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
12001 variable is readonly, use our own readonly flag to do this; you can
12002 use the new constructor to get a writable reference to a read-only
12005 * cs-parser.jay (foreach_statement, using_statement): Get a writable
12006 reference to the local variable.
12008 2002-08-01 Miguel de Icaza <miguel@ximian.com>
12010 * rootcontext.cs (ResolveCore): Also include System.Exception
12012 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
12013 we reach an EmptyStatement.
12015 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
12018 * expression.cs (Binary.ResolveOperator): Check error result in
12021 use brtrue/brfalse directly and avoid compares to null.
12023 2002-08-02 Martin Baulig <martin@gnome.org>
12025 * class.cs (TypeContainer.Define): Define all nested interfaces here.
12026 Fixes bug #28407, added test-155.cs.
12028 2002-08-01 Martin Baulig <martin@gnome.org>
12030 * class.cs (Event.EmitDefaultMethod): Make this work with static
12031 events. Fixes #28311, added verify-3.cs.
12033 2002-08-01 Martin Baulig <martin@gnome.org>
12035 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
12036 `is_disposable' fields.
12037 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
12038 `hm.is_disposable' if we're using the collection pattern.
12039 (Foreach.EmitCollectionForeach): Use the correct type for the
12040 enumerator's local variable, only emit the try/finally block if
12041 necessary (fixes #27713).
12043 2002-08-01 Martin Baulig <martin@gnome.org>
12045 * ecore.cs (Expression.report118): Renamed to Error118 and made
12048 * statement.cs (Throw.Resolve): Check whether the expression is of
12049 the correct type (CS0118) and whether the type derives from
12050 System.Exception (CS0155).
12051 (Catch.Resolve): New method. Do the type lookup here and check
12052 whether it derives from System.Exception (CS0155).
12053 (Catch.CatchType, Catch.IsGeneral): New public properties.
12055 * typemanager.cs (TypeManager.exception_type): Added.
12057 2002-07-31 Miguel de Icaza <miguel@ximian.com>
12059 * driver.cs: Updated About function.
12061 2002-07-31 Martin Baulig <martin@gnome.org>
12063 Implemented Control Flow Analysis.
12065 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
12066 (EmitContext.CurrentBranching): Added.
12067 (EmitContext.StartFlowBranching): Added.
12068 (EmitContext.EndFlowBranching): Added.
12069 (EmitContext.KillFlowBranching): Added.
12070 (EmitContext.IsVariableAssigned): Added.
12071 (EmitContext.SetVariableAssigned): Added.
12072 (EmitContext.IsParameterAssigned): Added.
12073 (EmitContext.SetParameterAssigned): Added.
12074 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
12075 Added control flow analysis stuff here.
12077 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
12078 resolve the expression as lvalue.
12079 (LocalVariableReference.DoResolve): Check whether the variable has
12080 already been assigned.
12081 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
12082 the parameter as assigned here.
12083 (ParameterReference.DoResolve): Check whether the parameter has already
12085 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
12086 expression as lvalue.
12088 * statement.cs (FlowBranching): New class for the flow analysis code.
12089 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
12090 (LabeledStatement.IsDefined): New public property.
12091 (LabeledStatement.AddUsageVector): New public method to tell flow
12092 analyis that the label may be reached via a forward jump.
12093 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
12095 (VariableInfo.Number): New public field. This is used by flow analysis
12096 to number all locals of a block.
12097 (Block.CountVariables): New public property. This is the number of
12098 local variables in this block (including the locals from all parent
12100 (Block.EmitMeta): Number all the variables.
12102 * statement.cs: Added flow analysis support to all classes.
12104 2002-07-31 Martin Baulig <martin@gnome.org>
12106 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
12107 To get debugging messages, compile mcs with /define:MCS_DEBUG and
12108 then use this argument.
12110 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
12112 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
12113 use this to specify /define options.
12115 2002-07-29 Martin Baulig <martin@gnome.org>
12117 * statement.cs (Fixed): Moved all code that does variable lookups
12118 and resolvings from Emit to Resolve.
12120 * statement.cs (For): Moved all code that does variable lookups
12121 and resolvings from Emit to Resolve.
12123 * statement.cs (Using): Moved all code that does variable lookups
12124 and resolvings from Emit to Resolve.
12126 2002-07-29 Martin Baulig <martin@gnome.org>
12128 * attribute.cs (Attribute.Resolve): Explicitly catch a
12129 System.NullReferenceException when creating the
12130 CustromAttributeBuilder and report a different warning message.
12132 2002-07-29 Martin Baulig <martin@gnome.org>
12134 * support.cs (ParameterData.ParameterName): Added method to
12135 get the name of a parameter.
12137 * typemanager.cs (TypeManager.IsValueType): New public method.
12139 2002-07-29 Martin Baulig <martin@gnome.org>
12141 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
12142 is a flag which specifies that it's either ref or out.
12143 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
12144 the out parameter to `out Parameter.Modifier mod', also set the
12145 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
12147 * support.cs (InternalParameters.ParameterModifier): Distinguish
12148 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12149 Parameter.Modifier.ISBYREF flag if it's either ref or out.
12151 * expression.cs (Argument.GetParameterModifier): Distinguish
12152 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12153 Parameter.Modifier.ISBYREF flag if it's either ref or out.
12155 2002-07-29 Martin Baulig <martin@gnome.org>
12157 * expression.cs (ParameterReference.ParameterReference): Added
12158 `Location loc' argument to the constructor.
12160 * cs-parser.jay: Pass location to ParameterReference.
12162 2002-07-28 Miguel de Icaza <miguel@ximian.com>
12164 * statement.cs (Try): Initialize the location.
12166 * cs-parser.jay: pass location to Try.
12168 * expression.cs (Unary.Reduce): Change the prototype to return
12169 whether a constant fold could be performed or not. The result is
12170 returned in an out parameters. In the case of Indirection and
12171 AddressOf, we want to perform the full tests.
12173 2002-07-26 Miguel de Icaza <miguel@ximian.com>
12175 * statement.cs (Statement.Emit): Flag dead code.
12177 2002-07-27 Andrew Birkett <andy@nobugs.org>
12179 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
12181 2002-07-27 Martin Baulig <martin@gnome.org>
12183 * class.cs (MethodData.Define): Put back call to
12184 TypeManager.AddMethod(), accidentally commented this out.
12186 * report.cs (Debug): New public method to print debugging information,
12187 this is `[Conditional ("DEBUG")]'.
12189 2002-07-26 Martin Baulig <martin@gnome.org>
12191 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
12192 (switch_statement): Push the current_block to the switch_stack and
12193 pop it again when we're done with the switch.
12194 (switch_section): The new block is a child of the current_block.
12195 Fixes bug #24007, added test-152.cs.
12197 2002-07-27 Martin Baulig <martin@gnome.org>
12199 * expression.cs (Invocation.EmitArguments): When calling a varargs
12200 function with only its fixed arguments, we need to pass an empty
12203 2002-07-27 Martin Baulig <martin@gnome.org>
12205 Mono 0.13 has been released.
12207 2002-07-25 Miguel de Icaza <miguel@ximian.com>
12209 * driver.cs: Rename --resource to --linkres, because that is what
12210 we do currently, we dont support --resource yet.
12212 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
12214 2002-07-25 Martin Baulig <martin@gnome.org>
12216 * class.cs (MethodData): New public class. This is a `method builder'
12217 class for a method or one accessor of a Property/Indexer/Event.
12218 (MethodData.GetMethodFlags): Moved here from MemberBase.
12219 (MethodData.ApplyAttributes): Likewise.
12220 (MethodData.ApplyObsoleteAttribute): Likewise.
12221 (MethodData.ApplyConditionalAttribute): Likewise.
12222 (MethodData.ApplyDllImportAttribute): Likewise.
12223 (MethodData.CheckAbstractAndExternal): Likewise.
12224 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
12225 (MethodData.Emit): Formerly known as Method.Emit().
12226 (MemberBase): Moved everything which was specific to a single
12227 accessor/method to MethodData.
12228 (Method): Create a new MethodData and call Define() and Emit() on it.
12229 (Property, Indexer, Event): Create a new MethodData objects for each
12230 accessor and call Define() and Emit() on them.
12232 2002-07-25 Martin Baulig <martin@gnome.org>
12234 Made MethodCore derive from MemberBase to reuse the code from there.
12235 MemberBase now also checks for attributes.
12237 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
12238 (MemberBase.GetMethodFlags): Moved here from class Method and marked
12240 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
12241 `CallingConventions cc' and `Attributes opt_attrs' arguments.
12242 (MemberBase.ApplyAttributes): New virtual method; applies the
12243 attributes to a method or accessor.
12244 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
12245 (MemberBase.ApplyConditionalAttribute): Likewise.
12246 (MemberBase.ApplyDllImportAttribute): Likewise.
12247 (MemberBase.CheckAbstractAndExternal): Likewise.
12248 (MethodCore.ParameterTypes): This is now a property instead of a
12249 method, it's initialized from DoDefineParameters().
12250 (MethodCore.ParameterInfo): Removed the set accessor.
12251 (MethodCore.DoDefineParameters): New protected virtual method to
12252 initialize ParameterTypes and ParameterInfo.
12253 (Method.GetReturnType): We can now simply return the MemberType.
12254 (Method.GetMethodFlags): Override the MemberBase version and add
12255 the conditional flags.
12256 (Method.CheckBase): Moved some code from Define() here, call
12257 DoDefineParameters() here.
12258 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
12259 here to avoid some larger code duplication.
12260 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
12261 ensure that abstract and external accessors don't declare a body.
12263 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
12264 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
12265 lookup in the attribute's parent classes, so we need to abort as soon
12266 as we found the first match.
12267 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
12268 the attribute has no arguments.
12270 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
12273 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12275 * cs-parser.jay: reverted previous patch.
12277 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12279 * cs-parser.jay: fixed bug #22119.
12281 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12283 * attribute.cs: fixed compilation. The error was:
12284 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
12285 be assigned to before control leaves the current method."
12286 [FIXME: Filed as bug #28186: MCS must report this error.]
12288 2002-07-25 Martin Baulig <martin@gnome.org>
12290 * attribute.cs (Attribute.Conditional_GetConditionName): New static
12291 method to pull the condition name ouf of a Conditional attribute.
12292 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
12293 the obsolete message and error flag out of an Obsolete attribute.
12295 * class.cs (Method.GetMethodFlags): New public method to get the
12296 TypeManager.MethodFlags for this method.
12297 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
12299 (Method.Define): Get and apply the Obsolete and Conditional attributes;
12300 if we're overriding a virtual function, set the new private variable
12301 `parent_method'; call the new TypeManager.AddMethod().
12303 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
12304 the MethodBuilder and the Method in a PtrHashtable.
12305 (TypeManager.builder_to_method): Added for this purpose.
12306 (TypeManager.MethodFlags): Added IsObsoleteError.
12307 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
12308 Obsolete and Conditional arguments in MethodBuilders. If we discover
12309 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
12310 the message from the attribute.
12312 2002-07-24 Martin Baulig <martin@gnome.org>
12314 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
12315 preprocessor directives, ensure that the argument to #define/#undef is
12316 exactly one identifier and that it's actually an identifier.
12318 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
12321 2002-07-24 Martin Baulig <martin@gnome.org>
12323 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
12324 initialize it to TypeManager.object_type in the constructor.
12325 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
12326 of the `hm.get_current' method if we're using the collection pattern.
12327 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
12328 for the explicit conversion to make it work when we're using the collection
12329 pattern and the `Current' property has a different return type than `object'.
12332 2002-07-24 Martin Baulig <martin@gnome.org>
12334 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
12335 does not match, but don't report any errors. This method is called in
12336 order for all methods in a MethodGroupExpr until a matching method is
12337 found, so we don't want to bail out if the first method doesn't match.
12338 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
12339 matches, report the 123. Fixes #28070.
12341 2002-07-24 Martin Baulig <martin@gnome.org>
12343 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
12344 TypeManager.TypeToCoreType() to the top of the method so the
12345 following equality checks will work. Fixes #28107.
12347 2002-07-24 Martin Baulig <martin@gnome.org>
12349 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
12350 operand is of type uint, and the other operand is of type sbyte,
12351 short or int, the operands are converted to type long." -
12352 Actually do what this comment already told us. Fixes bug #28106,
12355 2002-07-24 Martin Baulig <martin@gnome.org>
12357 * class.cs (MethodBase): New abstract class. This is now a base
12358 class for Property, Indexer and Event to avoid some code duplication
12359 in their Define() and DefineMethods() methods.
12360 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
12361 generic methods for Define() and DefineMethods().
12362 (FieldBase): Derive from MemberBase, not MemberCore.
12363 (Property): Derive from MemberBase, not MemberCore.
12364 (Property.DefineMethod): Moved all the code from this method to the
12365 new MethodBase.DefineAccessor(), just call it with appropriate
12367 (Property.Define): Call the new Property.DoDefine(), this does some
12368 sanity checks and we don't need to duplicate the code everywhere.
12369 (Event): Derive from MemberBase, not MemberCore.
12370 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
12371 accessors, this will also make them work with interface events.
12372 (Indexer): Derive from MemberBase, not MemberCore.
12373 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
12374 (Indexer.Define): Use the new MethodBase functions.
12376 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
12377 argument to the constructor.
12378 (Interface.FindMembers): Added support for interface events.
12379 (Interface.PopluateEvent): Implemented.
12381 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
12383 2002-07-22 Miguel de Icaza <miguel@ximian.com>
12385 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
12386 but this is required to check for a method name being the same as
12387 the containing class.
12391 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12393 * interface.cs: initialize variable.
12395 2002-07-23 Martin Baulig <martin@gnome.org>
12397 Implemented the IndexerName attribute in interfaces.
12399 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
12400 name if this is an explicit interface implementation.
12401 (Indexer.InterfaceIndexerName): New public variable. If we're
12402 implementing an interface indexer, this is the IndexerName in that
12403 interface. Otherwise, it's the IndexerName.
12404 (Indexer.DefineMethod): If we're implementing interface indexer,
12405 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
12406 and Pending.ImplementIndexer methods.
12407 (Indexer.Define): Also define the PropertyBuilder if we're
12408 implementing an interface indexer and this is neither an explicit
12409 interface implementation nor do the IndexerName match the one in
12412 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
12413 If a method is defined here, then we always need to create a proxy
12414 for it. This is used when implementing interface indexers.
12415 (Pending.IsInterfaceIndexer): New public method.
12416 (Pending.ImplementIndexer): New public method.
12417 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
12418 This is used when implementing interface indexers to define a proxy
12420 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
12421 define a proxy if necessary.
12423 * interface.cs (Interface.IndexerName): New public variable.
12424 (Interface.PopulateIndexer): Set the IndexerName.
12425 (Interface.DefineIndexers): New private method. Populate all the
12426 indexers and make sure their IndexerNames match.
12428 * typemanager.cs (IndexerPropertyName): Added support for interface
12431 2002-07-22 Martin Baulig <martin@gnome.org>
12433 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
12434 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
12435 ret if HasReturnLabel.
12436 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
12439 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
12440 and set the ec.LoopBeginTryCatchLevel.
12441 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
12442 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
12443 the current ec.TryCatchLevel, the branch goes out of an exception
12444 block. In this case, we need to use Leave and not Br.
12446 2002-07-22 Martin Baulig <martin@gnome.org>
12448 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
12449 block unless the block does not always return or it is contained in
12450 another try { ... } catch { ... } block. Fixes bug #26506.
12451 Added verify-1.cs to the test suite.
12453 2002-07-22 Martin Baulig <martin@gnome.org>
12455 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
12456 then we do not always return. Fixes bug #24985.
12458 2002-07-22 Martin Baulig <martin@gnome.org>
12460 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
12461 lookup on a per-class level; ie. walk up the class hierarchy until we
12462 found at least one applicable method, then choose the best among them.
12463 Fixes bug #24463 and test-29.cs.
12465 2002-07-22 Martin Baulig <martin@gnome.org>
12467 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
12468 return types of the methods. The return type is not part of the
12469 signature and we must not check it to make the `new' modifier work.
12470 Fixes bug #27999, also added test-147.cs.
12471 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
12473 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
12474 on the method's return type.
12476 2002-07-21 Martin Baulig <martin@gnome.org>
12478 * assign.cs: Make this work if the rightmost source is a constant and
12479 we need to do an implicit type conversion. Also adding a few more tests
12480 to test-38.cs which should have caught this.
12482 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
12483 target in the makefile for this. The makefile.gnu is primarily intended
12484 for end-users who don't want to debug the compiler.
12486 2002-07-21 Martin Baulig <martin@gnome.org>
12488 * assign.cs: Improved the Assign class so it can now handle embedded
12489 assignments (X = Y = Z = something). As a side-effect this'll now also
12490 consume less local variables. test-38.cs now passes with MCS, added
12491 a few new test cases to that test.
12493 2002-07-20 Martin Baulig <martin@gnome.org>
12495 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
12496 instructions. Fixes bug #27977, also added test-146.cs.
12498 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12500 * cs-tokenizer.cs: fixed getHex ().
12502 2002-07-19 Martin Baulig <martin@gnome.org>
12504 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
12505 not Type.GetType() to lookup the array type. This is needed when
12506 we're constructing an array of a user-defined type.
12507 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
12508 single-dimensional arrays, but also for single-dimensial arrays of
12511 2002-07-19 Martin Baulig <martin@gnome.org>
12513 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
12514 this function is called, it's not allowed to share LocalBuilders
12515 among ILGenerators.
12517 2002-07-19 Martin Baulig <martin@gnome.org>
12519 * expression.cs (Argument.Resolve): Report an error 118 when trying
12520 to pass a type as argument.
12522 2002-07-18 Martin Baulig <martin@gnome.org>
12524 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
12525 Conv_R_Un for the signed `long' type.
12527 2002-07-15 Miguel de Icaza <miguel@ximian.com>
12529 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
12530 `expr' for the temporary result, as that will fail if we do
12531 multiple resolves on the same expression.
12533 2002-07-05 Miguel de Icaza <miguel@ximian.com>
12535 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
12536 ec.TypeContainer for looking up aliases.
12538 * class.cs (TypeContainer): Remove LookupAlias from here.
12540 * decl.cs (DeclSpace); Move here.
12542 2002-07-01 Miguel de Icaza <miguel@ximian.com>
12544 * class.cs (FindMembers): Only call filter if the constructor
12545 bulider is not null.
12547 Also handle delegates in `NestedTypes' now. Now we will perform
12548 type lookups using the standard resolution process. This also
12551 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
12552 This uses Expressions (the limited kind that can be parsed by the
12553 tree) instead of strings.
12555 * expression.cs (ComposedCast.ToString): Implement, used to flag
12556 errors since now we have to render expressions.
12558 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
12561 * ecore.cs (SimpleName.ToString): ditto.
12563 * cs-parser.jay: Instead of using strings to assemble types, use
12564 Expressions to assemble the type (using SimpleName, ComposedCast,
12565 MemberAccess). This should fix the type lookups in declarations,
12566 because we were using a different code path for this.
12568 * statement.cs (Block.Resolve): Continue processing statements
12569 even when there is an error.
12571 2002-07-17 Miguel de Icaza <miguel@ximian.com>
12573 * class.cs (Event.Define): Also remove the `remove' method from
12574 the list of pending items.
12576 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
12577 generate more compact code.
12579 2002-07-17 Martin Baulig <martin@gnome.org>
12581 * const.cs (Const.LookupConstantValue): Add support for constant
12582 `unchecked' and `checked' expressions.
12583 Also adding test case test-140.cs for this.
12585 2002-07-17 Martin Baulig <martin@gnome.org>
12587 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
12588 check whether mi.ReturnType implements the IEnumerator interface; the
12589 `==' and the IsAssignableFrom() will fail in this situation.
12591 2002-07-16 Ravi Pratap <ravi@ximian.com>
12593 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
12596 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12598 * expression.cs: fixed bug #27811.
12600 2002-07-14 Miguel de Icaza <miguel@ximian.com>
12602 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
12603 Molaro: when we are a ref, the value already contains a pointer
12604 value, do not take the address of it.
12606 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
12607 * removed mb-parser.jay and mb-tokenizer.cs
12609 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12611 * expression.cs: check against the building corlib void type.
12613 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
12615 * ecore.cs: fix for valuetype static readonly fields: when
12616 initializing them, we need their address, not the address of a copy.
12618 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
12620 * typemanager.cs: register also enum_type in corlib.
12622 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12624 * class.cs: allow calling this (but not base) initializers in structs.
12626 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
12628 * ecore.cs: make sure we compare against the building base types
12631 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
12633 * typemanager.cs: fix TypeToCoreType() to handle void and object
12634 (corlib gets no more typerefs after this change).
12636 2002-07-12 Miguel de Icaza <miguel@ximian.com>
12638 * expression.cs (ArrayCreation.EmitArrayArguments): use
12639 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
12641 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
12642 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
12643 array indexes, the runtime actually forbids them.
12645 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
12646 for array arguments here.
12648 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
12649 instead of the default for ValueTypes.
12651 (New.DoEmit): Use IsValueType instead of
12652 IsSubclassOf (value_type)
12653 (New.DoResolve): ditto.
12654 (Invocation.EmitCall): ditto.
12656 * assign.cs (Assign): ditto.
12658 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
12659 Statements *are* currently doing part of their resolution during
12662 Expressions do always resolve during resolve, but statements are
12663 only required to propagate resolution to their children.
12665 2002-07-11 Miguel de Icaza <miguel@ximian.com>
12667 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
12669 (LoadAssembly): Do not add the dll if it is already specified
12671 (MainDriver): Add the System directory to the link path at the end,
12672 after all the other -L arguments.
12674 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
12675 wrong opcode for loading bytes and bools (ldelem.i1 instead of
12676 ldelem.u1) and using the opposite for sbytes.
12678 This fixes Digger, and we can finally run it.
12680 * driver.cs (UnixParseOption): Move the option parsing here.
12681 (CSCParseOption): Implement CSC-like parsing of options.
12683 We now support both modes of operation, the old Unix way, and the
12684 new CSC-like way. This should help those who wanted to make cross
12685 platform makefiles.
12687 The only thing broken is that /r:, /reference: and /lib: are not
12688 implemented, because I want to make those have the same semantics
12689 as the CSC compiler has, and kill once and for all the confussion
12690 around this. Will be doing this tomorrow.
12692 * statement.cs (Unsafe.Resolve): The state is checked during
12693 resolve, not emit, so we have to set the flags for IsUnsfe here.
12695 2002-07-10 Miguel de Icaza <miguel@ximian.com>
12697 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
12698 not catch the Error_ObjectRefRequired in SimpleName (as it is
12699 possible to have a class/instance variable name that later gets
12700 deambiguated), we have to check this here.
12702 2002-07-10 Ravi Pratap <ravi@ximian.com>
12704 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
12705 make static and put into Expression.
12707 (Event.Define): Register the private field of the event with the
12708 TypeManager so that GetFieldFromEvent can get at it.
12710 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
12711 keep track of the private field associated with an event which
12714 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
12717 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
12719 2002-07-10 Miguel de Icaza <miguel@ximian.com>
12721 * expression.cs (Binary.EmitBranchable): this routine emits the
12722 Binary expression in a branchable context. This basically means:
12723 we need to branch somewhere, not just get the value on the stack.
12725 This works together with Statement.EmitBoolExpression.
12727 * statement.cs (Statement.EmitBoolExpression): Use
12730 2002-07-09 Miguel de Icaza <miguel@ximian.com>
12732 * statement.cs (For): Reduce the number of jumps in loops.
12734 (For): Implement loop inversion for the For statement.
12736 (Break): We can be breaking out of a Try/Catch controlled section
12737 (foreach might have an implicit try/catch clause), so we need to
12738 use Leave instead of Br.
12740 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
12741 now). If the instace expression supports IMemoryLocation, we use
12742 the AddressOf method from the IMemoryLocation to extract the
12743 address instead of emitting the instance.
12745 This showed up with `This', as we were emitting the instance
12746 always (Emit) instead of the Address of This. Particularly
12747 interesting when This is a value type, as we dont want the Emit
12748 effect (which was to load the object).
12750 2002-07-08 Miguel de Icaza <miguel@ximian.com>
12752 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
12754 * statement.cs (Checked): Set the CheckedState during the resolve
12755 process too, as the ConvCast operations track the checked state on
12756 the resolve process, and not emit.
12758 * cs-parser.jay (namespace_member_declaration): Flag that we have
12759 found a declaration when we do. This is used to flag error 1529
12761 * driver.cs: Report ok when we display the help only.
12763 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
12765 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
12767 2002-07-04 Miguel de Icaza <miguel@ximian.com>
12769 * cs-tokenizer.cs (define): We also have to track locally the
12770 defines. AllDefines is just used for the Conditional Attribute,
12771 but we also need the local defines for the current source code.
12773 2002-07-03 Miguel de Icaza <miguel@ximian.com>
12775 * statement.cs (While, For, Do): These loops can exit through a
12776 Break statement, use this information to tell whether the
12777 statement is the last piece of code.
12779 (Break): Flag that we break.
12781 * codegen.cs (EmitContexts): New `Breaks' state variable.
12783 2002-07-03 Martin Baulig <martin@gnome.org>
12785 * class.cs (TypeContainer.MethodModifiersValid): Allow override
12786 modifiers in method declarations in structs. Otherwise, you won't
12787 be able to override things like Object.Equals().
12789 2002-07-02 Miguel de Icaza <miguel@ximian.com>
12791 * class.cs (Method, Property, Indexer): Do not allow the public
12792 modifier to be used in explicit interface implementations.
12794 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
12795 override modifiers in method declarations in structs
12797 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
12799 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
12800 integer or real overflow, report an error
12802 2002-07-02 Martin Baulig <martin@gnome.org>
12804 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
12805 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
12806 to tell the runtime about our newly created System.Object and
12807 System.ValueType types.
12809 2002-07-02 Miguel de Icaza <miguel@ximian.com>
12811 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
12812 struct instead of Ldarg/Starg.
12814 2002-07-02 Martin Baulig <martin@gnome.org>
12816 * expression.cs (Indirection.Indirection): Call
12817 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
12819 2002-07-02 Martin Baulig <martin@gnome.org>
12821 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
12822 ValueType, call TypeManager.TypeToCoreType() on it.
12823 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
12824 the OpCodes.Newarr argument.
12826 2002-07-02 Martin Baulig <martin@gnome.org>
12828 * expression.cs (Invocation.EmitCall): When compiling corlib,
12829 replace all calls to the system's System.Array type to calls to
12830 the newly created one.
12832 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
12833 System.Array methods.
12834 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
12835 from the system's System.Array type which must be replaced.
12837 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
12839 * typemanager.cs: load unverifiable_code_ctor so we can build
12840 corlib using the correct type. Avoid using GetTypeCode() with
12842 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
12843 TypeManager.object_type to allow building corlib.
12845 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
12847 * ecore.cs: handle System.Enum separately in LoadFromPtr().
12849 2002-07-01 Martin Baulig <martin@gnome.org>
12851 * class.cs: Make the last change actually work, we need to check
12852 whether `ifaces != null' to avoid a crash.
12854 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12856 * class.cs: when we build structs without fields that implement
12857 interfaces, we need to add the interfaces separately, since there is
12858 no API to both set the size and add the interfaces at type creation
12861 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12863 * expression.cs: the dimension arguments to the array constructors
12864 need to be converted if they are a long.
12866 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
12868 * class.cs: don't emit ldarg.0 if there is no parent constructor
12869 (fixes showstopper for corlib).
12871 2002-06-29 Martin Baulig <martin@gnome.org>
12873 MCS now compiles corlib on GNU/Linux :-)
12875 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
12876 ie. check for MethodImplOptions.InternalCall.
12878 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
12879 and TypeManager.attribute_type are null, so we must explicitly check
12880 whether parent is not null to find out whether it's an attribute type.
12881 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
12882 and SetBuilder, not only if the property is neither abstract nor external.
12883 This is necessary to set the MethodImplOptions on the accessor methods.
12884 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
12885 SetBuilder, see Property.Emit().
12887 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
12888 populate "System.Object", "System.ValueType" and "System.Attribute" since
12889 they've already been populated from BootCorlib_PopulateCoreTypes().
12891 2002-06-29 Martin Baulig <martin@gnome.org>
12893 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
12894 is the NullLiteral, we also need to make sure that target_type is not
12897 2002-06-29 Martin Baulig <martin@gnome.org>
12899 * rootcontext.cs (RootContext.ResolveCore): We must initialize
12900 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
12901 before calling BootstrapCorlib_ResolveDelegate ().
12903 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12905 * statement.cs: fixed build-breaker. All tests passed ok.
12907 2002-06-27 Martin Baulig <martin@gnome.org>
12909 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
12910 for System.Decimal when compiling corlib.
12912 2002-06-27 Martin Baulig <martin@gnome.org>
12914 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
12915 switch blocks which contain nothing but a default clause.
12917 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
12919 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
12921 2002-06-27 Martin Baulig <martin@gnome.org>
12923 * ecore.cs (PropertyExpr.PropertyExpr): Call
12924 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
12926 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
12927 is already a TypeBuilder.
12929 2002-06-27 Martin Baulig <martin@gnome.org>
12931 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
12932 `target_type == TypeManager.array_type', not IsAssignableFrom() in
12933 the "from an array-type to System.Array" case. This makes it work
12934 when compiling corlib.
12936 2002-06-27 Martin Baulig <martin@gnome.org>
12938 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
12939 non-static PropertyExpr, set its InstanceExpression. This makes
12940 the `ICollection.Count' property work in System/Array.cs.
12942 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
12944 * driver.cs: Made error handling more consistent. Errors now
12945 tracked by Report class, so many methods which used to return int
12946 now return void. Main() now prints success/failure and
12947 errors/warnings message.
12949 Renamed '--probe' compiler argument to '--expect-error'. Removed
12950 the magic number return values (123 and 124). Now, if the
12951 expected error occurs, the compiler exits with success (exit value
12952 0). If the compilation completes without seeing that particular
12953 error, the compiler exits with failure (exit value 1). The
12954 makefile in mcs/errors has been changed to handle the new behaviour.
12956 * report.cs: Made 'expected error' number a property and renamed
12957 it from 'Probe' to 'ExpectedError'.
12959 * genericparser.cs: Removed error handling support, since it is
12960 now all done by Report class.
12962 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
12963 class, so parse() no longer returns an int.
12965 * namespace.cs: Use Report.Error instead of GenericParser.error
12967 2002-06-22 Miguel de Icaza <miguel@ximian.com>
12969 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
12970 TypeContainer.AddOperator): At the front of the list put the
12971 explicit implementations, so they get resolved/defined first.
12973 2002-06-21 Miguel de Icaza <miguel@ximian.com>
12975 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
12976 interface type is implemented by this TypeContainer. Used during
12977 explicit interface implementation.
12979 (Property.Define, Indexer.Define, Method.Define): Validate that
12980 the given interface in the explicit implementation is one of the
12981 base classes for the containing type.
12983 Also if we are explicitly implementing an interface, but there is
12984 no match in the pending implementation table, report an error.
12986 (Property.Define): Only define the property if we are
12987 not explicitly implementing a property from an interface. Use the
12988 correct name also for those properties (the same CSC uses,
12989 although that is really not needed).
12991 (Property.Emit): Do not emit attributes for explicitly implemented
12992 properties, as there is no TypeBuilder.
12994 (Indexer.Emit): ditto.
12996 Hiding then means that we do not really *implement* a pending
12997 implementation, which makes code fail.
12999 2002-06-22 Martin Baulig <martin@gnome.org>
13001 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
13002 the return value of Object.GetType(). [FIXME: we need to do this whenever
13003 we get a type back from the reflection library].
13005 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
13007 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
13009 2002-06-20 Miguel de Icaza <miguel@ximian.com>
13011 * attribute.cs: Return null if we can not look up the type.
13013 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
13014 the interface types found.
13016 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
13017 interface types found.
13019 * typemanager.cs (GetInterfaces): Make this routine returns alll
13020 the interfaces and work around the lame differences between
13021 System.Type and System.Reflection.Emit.TypeBuilder in the results
13022 result for GetInterfaces.
13024 (ExpandInterfaces): Given an array of interface types, expand and
13025 eliminate repeated ocurrences of an interface. This expands in
13026 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
13029 2002-06-21 Martin Baulig <martin@gnome.org>
13031 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
13034 2002-06-21 Martin Baulig <martin@gnome.org>
13036 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
13037 and called with one of the core types, return the corresponding typebuilder for
13040 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
13043 2002-06-21 Martin Baulig <martin@gnome.org>
13045 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
13046 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
13047 (Expression.ConvertReferenceExplicit): Likewise.
13049 * expression.cs (ElementAccess.DoResolve): Likewise.
13050 (ElementAccess.DoResolveLValue): Likewise.
13052 2002-06-10 Martin Baulig <martin@gnome.org>
13054 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
13055 add the "value" parameter to the parameter list.
13057 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
13060 2002-06-19 Miguel de Icaza <miguel@ximian.com>
13062 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
13063 the argument to an int, uint, long or ulong, per the spec. Also
13064 catch negative constants in array creation.
13066 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
13068 * class.cs: do not allow the same interface to appear twice in
13069 the definition list.
13071 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
13073 * ecore.cs: don't use ldlen with System.Array.
13075 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
13077 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
13079 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
13081 * modifiers.cs: produce correct field attributes for protected
13082 internal. Easy fix so miguel can work on ther harder stuff:-)
13084 2002-06-18 Miguel de Icaza <miguel@ximian.com>
13086 * pending.cs: New file. Move the code from class.cs here.
13087 Support clearning the pending flag for all methods (when not doing
13088 explicit interface implementation).
13090 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
13092 * rootcontext.cs: added a couple more types needed to bootstrap.
13094 2002-06-17 Miguel de Icaza <miguel@ximian.com>
13096 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
13097 constructor in the type, instead of any constructor in the type
13098 hierarchy. Thanks to Paolo for finding this bug (it showed up as
13099 a bug in the Mono runtime when applying the params attribute).
13101 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
13102 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
13104 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
13106 * expression.cs (Unary.ResolveOperator): Use TypeManager
13107 to resolve the type.
13109 2002-06-13 Ravi Pratap <ravi@ximian.com>
13111 * cs-parser.jay (enum_member_declaration): Pass in the attributes
13114 * enum.cs (AddEnumMember): Add support to store the attributes associated
13115 with each member too.
13117 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
13118 field builders too - this takes care of the enum member case.
13120 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
13122 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
13123 address-of operator on both value types and pointers.
13125 2002-06-10 Martin Baulig <martin@gnome.org>
13127 * interface.cs (Interface.PopulateIndexer): Add the indexer's
13128 PropertyBuilder to the `property_builders' list.
13130 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
13131 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
13132 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
13133 find any indexers which are inherited from an interface.
13135 2002-06-09 Martin Baulig <martin@gnome.org>
13137 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
13138 the same type as the constant if necessary. There's also a test-130.cs
13141 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
13143 * typemanager.cs (TypeManager.ChangeType): Previously known as
13144 Enum.ChangeEnumType().
13146 2002-06-09 Martin Baulig <martin@gnome.org>
13148 * expression.cs (Cast.TryReduce): Added support for consts.
13150 2002-06-08 Ravi Pratap <ravi@ximian.com>
13152 * class.cs (Accessor): Hold attributes information so we can pass
13155 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
13156 Modify to pass in attributes attached to the methods.
13158 (add_accessor_declaration, remove_accessor_declaration): Ditto.
13160 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
13161 to handle the Accessor kind :-)
13163 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
13165 2002-06-08 Martin Baulig <martin@gnome.org>
13167 * expression.cs (Unary.TryReduceNegative): Added support for
13170 2002-06-08 Martin Baulig <martin@gnome.org>
13172 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
13173 name can't be found in the `defined_names' - the caller will do a
13174 MemberLookup in this case and thus find methods in System.Enum
13175 such as Enum.IsDefined().
13177 2002-06-08 Martin Baulig <martin@gnome.org>
13179 * enum.cs (Enum.ChangeEnumType): This is a custom version of
13180 Convert.ChangeType() which works with TypeBuilder created types.
13181 (Enum.LookupEnumValue, Enum.Define): Use it here.
13183 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
13184 `TypeBuilder.BaseType != null' check.
13185 (TypeContainer.FindMembers): Only lookup parent members if we
13186 actually have a parent.
13187 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
13188 (ConstructorInitializer.Resolve): Likewise.
13190 * interface.cs (Interface.FindMembers): Added
13191 `TypeBuilder.BaseType != null' check.
13193 * rootcontext.cs (RootContext.ResolveCore): Added
13194 "System.Runtime.CompilerServices.IndexerNameAttribute" to
13195 classes_second_stage.
13197 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
13198 debug_type and trace_type when compiling with --nostdlib.
13200 2002-06-07 Martin Baulig <martin@gnome.org>
13202 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
13203 (AddField): Set it to true when adding a non-static field.
13204 (DefineType): Use `have_nonstatic_fields' to find out whether we
13205 have non-static fields, not `Fields != null'.
13207 2002-06-02 Miguel de Icaza <miguel@ximian.com>
13209 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
13210 dereferencing a null on the static-field code path)
13212 2002-05-30 Martin Baulig <martin@gnome.org>
13214 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
13215 to take command line arguments. Use reflection to call the new
13216 custom `Initialize' function on the symbol writer and pass it the
13217 command line arguments.
13219 * driver.cs (--debug-args): New command line argument to pass command
13220 line arguments to the symbol writer.
13222 2002-05-28 Miguel de Icaza <miguel@ximian.com>
13224 * assign.cs (DoResolve): Forgot to do the implicit conversion to
13225 the target type for indexers and properties. Thanks to Joe for
13228 2002-05-27 Miguel de Icaza <miguel@ximian.com>
13230 * typemanager.cs (MethodFlags): returns the method flags
13231 (Obsolete/ShouldIgnore) that control warning emission and whether
13232 the invocation should be made, or ignored.
13234 * expression.cs (Invocation.Emit): Remove previous hack, we should
13235 not do this on matching a base type, we should do this based on an attribute
13237 Only emit calls to System.Diagnostics.Debug and
13238 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
13239 on the command line.
13241 * rootcontext.cs: Global settings for tracing and debugging.
13243 * cs-tokenizer.cs (define): New utility function to track
13244 defines. Set the global settings for TRACE and DEBUG if found.
13246 2002-05-25 Ravi Pratap <ravi@ximian.com>
13248 * interface.cs (Populate*): Pass in the TypeContainer as well as
13249 the DeclSpace as parameters so that we can create EmitContexts and
13250 then use that to apply attributes etc.
13252 (PopulateMethod, PopulateEvent, PopulateProperty)
13253 (PopulateIndexer): Apply attributes everywhere.
13255 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
13258 (ApplyAttributes): Update accordingly.
13260 We now apply interface attributes for all members too.
13262 2002-05-26 Miguel de Icaza <miguel@ximian.com>
13264 * class.cs (Indexer.Define); Correctly check if we are explicit
13265 implementation (instead of checking the Name for a ".", we
13266 directly look up if the InterfaceType was specified).
13268 Delay the creation of the PropertyBuilder.
13270 Only create the PropertyBuilder if we are not an explicit
13271 interface implementation. This means that explicit interface
13272 implementation members do not participate in regular function
13273 lookups, and hence fixes another major ambiguity problem in
13274 overload resolution (that was the visible effect).
13276 (DefineMethod): Return whether we are doing an interface
13279 * typemanager.cs: Temporary hack until we get attributes in
13280 interfaces (Ravi is working on that) and we get IndexerName
13281 support in interfaces.
13283 * interface.cs: Register the indexers as properties.
13285 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
13286 warning, I have verified that this is a bug in the .NET runtime
13287 (JavaScript suffers of the same problem).
13289 * typemanager.cs (MemberLookup): When looking up members for
13290 interfaces, the parent of an interface is the implicit
13291 System.Object (so we succeed in searches of Object methods in an
13292 interface method invocation. Example: IEnumerable x; x.ToString
13295 2002-05-25 Miguel de Icaza <miguel@ximian.com>
13297 * class.cs (Event): Events should also register if they do
13298 implement the methods that an interface requires.
13300 * typemanager.cs (MemberLookup); use the new GetInterfaces
13303 (GetInterfaces): The code used to lookup interfaces for a type is
13304 used in more than one place, factor it here.
13306 * driver.cs: Track the errors at the bottom of the file, we kept
13309 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
13310 instance if the method we are calling is static!
13312 2002-05-24 Miguel de Icaza <miguel@ximian.com>
13314 * attribute.cs (ApplyAttributes): Make this function filter out
13315 the IndexerName attribute (as that attribute in reality is never
13316 applied) and return the string constant for the IndexerName
13319 * class.cs (TypeContainer.Emit): Validate that all the indexers
13320 have the same IndexerName attribute, and if so, set the
13321 DefaultName attribute on the class.
13323 * typemanager.cs: The return value might contain other stuff (not
13324 only methods). For instance, consider a method with an "Item"
13325 property and an Item method.
13327 * class.cs: If there is a problem with the parameter types,
13330 2002-05-24 Ravi Pratap <ravi@ximian.com>
13332 * ecore.cs (ImplicitConversionExists): Wrapper function which also
13333 looks at user defined conversion after making a call to
13334 StandardConversionExists - we need this for overload resolution.
13336 * expression.cs : Update accordingly the various method calls.
13338 This fixes 2 bugs filed against implicit user defined conversions
13340 2002-05-22 Miguel de Icaza <miguel@ximian.com>
13342 * statement.cs: Track the result of the assignment.
13344 2002-05-21 Miguel de Icaza <miguel@ximian.com>
13346 * expression.cs (MemberAccess): Improved error reporting for
13347 inaccessible members.
13349 2002-05-22 Martin Baulig <martin@gnome.org>
13351 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
13352 itself with debugging support.
13354 2002-05-22 Martin Baulig <martin@gnome.org>
13356 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
13357 Removed, this isn't needed anymore.
13359 2002-05-20 Martin Baulig <martin@gnome.org>
13361 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
13362 be underlying type for an enum.
13364 2002-05-20 Miguel de Icaza <miguel@ximian.com>
13366 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
13367 that splits out the loading of just the core types.
13369 * rootcontext.cs (ResolveCore): Split the struct resolution in
13370 two, so we can load the enumeration underlying types before any
13373 * expression.cs (Is): Bandaid until we fix properly Switch (see
13374 bug #24985 for details).
13376 * typemanager.cs (ImplementsInterface): The hashtable will contain
13377 a null if there are no interfaces implemented.
13379 2002-05-18 Miguel de Icaza <miguel@ximian.com>
13381 * cs-parser.jay (indexer_declarator): It is fine to have array
13384 2002-05-17 Miguel de Icaza <miguel@ximian.com>
13386 * typemanager.cs: (RegisterBuilder): New function used to register
13387 TypeBuilders that implement interfaces. Since
13388 TypeBuilder.GetInterfaces (as usual) does not work with lame
13390 (AddUserType): register interfaces.
13392 (ImplementsInterface): Use the builder_to_ifaces hash if we are
13393 dealing with TypeBuilder. Also, arrays are showing up as
13394 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
13395 methods can not be invoked on them!
13397 * ecore.cs (ExplicitReferenceConversionExists): Made public.
13398 (ImplicitReferenceConversionExists): Split out from
13399 StandardConversionExists.
13401 * expression.cs (As): We were only implementing one of the three
13402 cases for the as operator. We now implement them all.
13403 (Is): Implement the various other cases for Is as well.
13405 * typemanager.cs (CACHE): New define used to control if we want or
13406 not the FindMembers cache. Seems to have a negative impact on
13407 performance currently
13409 (MemberLookup): Nested types have full acess to
13410 enclosing type members
13412 Remove code that coped with instance/static returns for events, we
13413 now catch this in RealFindMembers.
13415 (RealFindMembers): only perform static lookup if the instance
13416 lookup did not return a type or an event.
13418 2002-05-17 Miguel de Icaza <miguel@ximian.com>
13420 * assign.cs (CompoundAssign): We pass more semantic information
13421 now to Compound Assignments than we did before: now we have all
13422 the information at hand, and now we resolve the target *before* we
13423 do the expression expansion, which allows the "CacheValue" method
13424 to have the effect we intended (before, a [x] += 1 would generate
13425 two differen ArrayAccess expressions from the ElementAccess,
13426 during the resolution process).
13428 (CompoundAssign.DoResolve): Resolve target and original_source here.
13430 2002-05-16 Miguel de Icaza <miguel@ximian.com>
13432 * expression.cs (ArrayAccess): dropped debugging information.
13434 * typemanager.cs: Small bug fix: I was always returning i_members,
13435 instead of one of i_members or s_members (depending on which had
13438 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
13439 method is invoked before any code generation takes place, and it
13440 is a mechanism to inform that the expression will be invoked more
13441 than once, and that the method should use temporary values to
13442 avoid having side effects
13444 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
13446 * ecore.cs (Expression.CacheTemporaries): Provide empty default
13449 * expression.cs (Indirection, ArrayAccess): Add support for
13450 CacheTemporaries in these two bad boys.
13452 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
13453 ldobj or ldind_ref.
13454 (StoreFromPtr): Handle stobj as well.
13456 * expression.cs (UnaryMutator): Share more code.
13458 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
13459 down: I was not tracking the Filter function as well, which
13460 was affecting the results of the cache.
13462 2002-05-15 Miguel de Icaza <miguel@ximian.com>
13464 * attribute.cs: Remove the hack to handle the CharSet property on
13467 2002-05-14 Miguel de Icaza <miguel@ximian.com>
13469 * attribute.cs (DoResolve): More uglyness, we now only try to
13470 resolve the attribute partially, to extract the CharSet
13471 information (only if we are a StructLayout attribute). Otherwise
13473 (GetExtraTypeInfo): Add some code to conditionally kill in the
13474 future this. I am more and more convinced that the .NET
13475 framework has special code to handle the attribute setting on
13478 * expression.cs (IsParamsMethodApplicable): Revert my previous
13479 foreach change here, it was wrong.
13481 2002-05-13 Miguel de Icaza <miguel@ximian.com>
13483 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
13484 (pp_expr): do not abort on unknown input, just return.
13485 (eval): abort if there are pending chars.
13487 * attribute.cs (Attribute.Resolve): Positional parameters are
13488 optional. Deal with that case.
13490 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
13491 the Ansi/Unicode/Auto information for the type.
13493 (TypeContainer.DefineType): instantiate the EmitContext here, as
13494 we will be using it during the type definition (to resolve
13495 attributes) and during the emit phase.
13497 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
13498 to pull type information out of the attributes
13500 (Attribute.Resolve): track the constructor builder, and allow for
13501 multiple invocations (structs and classes will use this).
13503 * ecore.cs (MemberLookupFinal): new version with all the
13504 parameters customizable.
13506 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
13507 constructors. Return if the result value is null (as the error
13508 would have been flagged already by MemberLookupFinal)
13510 Do not allow instances of abstract classes or interfaces to be
13513 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
13514 We have to compare the assembly property here when dealing with
13515 FamANDAssem and Assembly access modifiers, because we might be
13516 creating an assembly from *modules* (that means that we are not
13517 getting TypeBuilders for types defined in other modules that are
13518 part of this assembly).
13520 (Method.Emit): If the method is marked abstract and has a body,
13523 (TypeContainer.DefineMembers): If both the defined member and the
13524 parent name match are methods, then do not emit any warnings: let
13525 the Method.Define routine take care of flagging warnings. But if
13526 there is a mismatch (method overrides something else, or method is
13527 overriwritten by something, then emit warning).
13529 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
13530 set to null, this means `do not check for the return type on the
13533 (Method.Define): set the return type for the method signature to
13534 null, so that we get methods with the same name and parameters and
13535 different return types. This is used to flag warning 114 (you are
13536 hiding a method, and you probably want to use the new/override
13539 * typemanager.cs (MemberLookup): Implemented proper access
13540 control, closing a long standing set of bug reports. The problem
13541 was that the Framework only has two bits: Public and NonPublic,
13542 and NonPublic includes private and protected methods, but we need
13543 to enforce the FamANDAssem, FamOrAssem and Family.
13545 2002-05-11 Miguel de Icaza <miguel@ximian.com>
13547 * statement.cs (GotoCase): Return true: Ammounts to giving up
13548 knowledge on whether we return or not, and letting the other case
13549 be responsible for it.
13551 2002-05-10 Miguel de Icaza <miguel@ximian.com>
13553 * driver.cs: Do not load directories for each file processed, only
13554 do it if there is a pattern.
13556 * ecore.cs: Report readonly assigns here as well, as we might have
13557 been resolved only by MemberAccess.
13559 (SimpleName.SimpleNameResolve): Also be useful for LValue
13560 resolution. We need this to propagate assign to local readonly variables
13562 * typemanager.cs: Use a ptrhashtable for the criteria, because we
13563 do not want to reuse potential criteria memory.
13565 * class.cs (MyEventBuilder): Set reflected_type;
13567 * ecore.cs (Constantify): Added support for constifying bools.
13569 (RootContext.LookupType): Added a cache for values looked up in
13570 the declaration space.
13572 * typemanager.cs (FindMembers): Now is a front-end to
13573 RealFindMembers, and provides a two-level hashtable-based cache to
13576 15% performance improvement: from 22.5 to 19.2 seconds.
13578 * expression.cs (IsParamsMethodApplicable): use foreach.
13579 (Invocation.DoResolve): ditto.
13580 (New.DoResolve): ditto.
13581 (ArrayCreation.DoResolve): ditto.
13583 * ecore.cs (FindMostEncompassingType): use foreach.
13585 * delegate.cs (NewDelegate.DoResolve): Use foreach
13587 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
13588 (RemoveMethods): use foreach.
13590 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
13591 nested foreach statements instead of for, and also break out of
13592 the inner loop once a match is found.
13594 (Invocation.OverloadResolve): Use foreach, simplify the code.
13596 2002-05-08 Miguel de Icaza <miguel@ximian.com>
13598 * cfold.cs (BinaryFold): During an enumeration evaluation context,
13599 we actually unwrap the expression to allow for extra information
13602 * expression.cs: Use Shr_Un on unsigned operations.
13604 2002-05-08 Ravi Pratap <ravi@ximian.com>
13606 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
13607 applicable operators was not being considered correctly. This closes
13608 the bug Miguel reported.
13610 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
13612 * attribute.cs: check that the type derives from System.Attribute
13613 and report the correct error in that case (moved the duplicate code to
13614 its own method, too).
13616 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
13618 * attribute.cs: lookup attribute type name as the spec says: first the
13619 bare attribute name and then name + "Attribute" (nant compiles with
13620 mcs after this fix).
13622 2002-05-07 Miguel de Icaza <miguel@ximian.com>
13624 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
13625 Because of the way we parse things, we should try to see if a
13626 UIntConstant can fit in an integer.
13628 2002-05-07 Ravi Pratap <ravi@ximian.com>
13630 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
13631 when we are in an explicit context.
13633 (ConvertReferenceExplicit): When converting from Iface type S to Class
13634 T make sure the rules are implemented as an OR.
13636 * parameter.cs (ParameterType): Make it a property for now although the
13637 purpose really isn't anything immediate.
13639 * expression.cs (Is*Applicable): Do better checking on the parameter type
13640 of a ref/out parameter. The ones from the system assemblies are already
13641 marked with the correct type so we don't need to do any correction.
13643 * ecore.cs (StandardConversionExists): Conversion from Interface types to
13644 the object type is standard too so include that.
13646 2002-05-06 Miguel de Icaza <miguel@ximian.com>
13648 * ecore.cs (StandardConversionExists): Augment with missing code:
13649 deal with IntConstant, LongConstants and Enumerations.
13651 * assign.cs: Report the error, instead of failing silently
13653 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
13654 typecontainer that they are declared, because the
13655 typecontainer/namespace will have the list of using clauses that
13656 need to be applied.
13658 Assembly Attributes were escaping the normal registration
13661 (EmitCode): Apply attributes within an EmitContext that represents
13662 the container they were declared on.
13664 * cs-parser.jay: Track bases for structs. How did I get this wrong?
13666 2002-05-06 Ravi Pratap <ravi@ximian.com>
13668 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
13669 Revamp completely - make much cleaner as we now operate only
13672 (FindMostSpecificSource, FindMostSpecificTarget): New methods
13673 to implement the logic detailed in the spec more correctly.
13675 (UserDefinedConversion): Update accordingly.
13677 2002-05-06 Miguel de Icaza <miguel@ximian.com>
13679 * statement.cs: Return flow analysis information up.
13681 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
13684 (token): Do not consume an extra character before calling
13687 2002-05-06 Piers Haken <piersh@friskit.com>
13689 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
13691 2002-05-06 Miguel de Icaza <miguel@ximian.com>
13693 * class.cs (Constructor.Emit): Set the IsStatic flag in the
13694 EmitContext during the instance constructor initializer
13695 resolution, to stop access to instance variables.
13697 This is mandated by the spec, last paragraph of the `constructor
13698 initializers' section.
13700 2002-05-05 Miguel de Icaza <miguel@ximian.com>
13702 * cs-parser.jay, class.cs (Accessor): new class used to represent
13703 an accessor (get or set). In the past we used `null' to represent
13704 a missing accessor. But this is ambiguous because there was no
13705 way to tell in abstract indexers/properties if one of them was
13708 Now there is a way of addressing that.
13710 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
13711 instead of FindMembers.
13713 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
13714 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
13716 * attribute.cs: Treat indexers and properties as the same in terms
13717 of applying attributes
13719 * ecore.cs (FindMostEncompassedType): Use statically initialized
13720 EmptyExpressions()s like we do elsewhere to avoid creating useless
13721 objects (and we take this out of the tight loop).
13723 (GetConversionOperators): Move the code to extract the actual
13724 operators to a separate routine to clean things up.
13726 2002-05-04 Miguel de Icaza <miguel@ximian.com>
13728 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
13729 events are always registered FieldBuilders.
13731 * class.cs (FieldBase): New class shared by Fields
13733 * delegate.cs: If we are a toplevel delegate, use our full name.
13734 If we are a nested delegate, then only use our tail name.
13736 2002-05-02 Ravi Pratap <ravi@ximian.com>
13738 * expression.cs (IsApplicable): Ensure that we add the "&" to
13739 ref/out types before comparing it with the type of the argument.
13741 (IsParamsMethodApplicable): Ditto.
13743 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
13746 * delegate.cs : Handle the case when we have more than one applicable
13747 method. Flag an error only when we finish checking all.
13749 2002-05-02 Miguel de Icaza <miguel@ximian.com>
13751 * expression.cs: Add support for boolean static initializers.
13753 2002-05-01 Miguel de Icaza <miguel@ximian.com>
13755 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
13757 * parameter.cs (ComputeParameterTypes,
13758 ComputeAndDefineParameterTypes): Better error handling: now we
13759 clear the `types' cache if we fail during any of the type lookups.
13760 We also return the status code correctly to our caller
13762 * delegate.cs: If we fail to define a delegate, abort the extra
13765 * expression.cs (Binary.ResolveOperator): for
13766 operator==(object,object) and operator !=(object, object) we also
13767 have to verify that there is an implicit conversion from one to
13770 (ArrayAccess.DoResolve): Array Access can operate on
13773 2002-04-30 Miguel de Icaza <miguel@ximian.com>
13775 * assign.cs (CompoundAssign): A new class used as a "flag" that
13776 the assignment actually is happening as part of a compound
13777 assignment operator.
13779 During compound assignment, a few new rules exist to enable things
13786 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
13787 to the type of x) if y is implicitly convertible to the type of x,
13788 and the operator is a builtin operator and the return type of the
13789 operator is explicitly convertible to the type of x.
13791 * rootcontext.cs: Reset warning level to 2. 4 catches various
13792 "interesting" features in mcs, we must clean this up at some
13793 point, but currently am trying to kill other bugs ;-)
13795 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
13796 in container classes as well.
13798 * expression.cs (Binary.ResolveOperator): Handle string case
13799 before anything else (as operator overloading does emit an error
13800 before doing anything else).
13802 This code could go away when we move to a table driven model, but
13803 i could not come up with a good plan last night.
13805 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
13807 * typemanager.cs (CSharpName): reimplementation using regex.
13808 * class.cs: added null check for fields in Emit
13809 * rootcontext.cs: set warninglevel to 4
13811 2002-04-29 Miguel de Icaza <miguel@ximian.com>
13813 * typemanager.cs (CSharpName): reimplemented with Lupus
13816 2002-04-28 Miguel de Icaza <miguel@ximian.com>
13818 * statement.cs (If): correclty implement Resolve, because we were
13819 not catching sem errors in there. The same process is needed
13821 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
13824 (Statement.Warning_DeadCodeFound): Factorize code.
13825 (While): Report dead code here too.
13827 (Statement): Added Resolve virtual method to allow
13828 for resolution split from the emit code.
13830 2002-04-26 Miguel de Icaza <miguel@ximian.com>
13832 * statement.cs (EmitBoolExpression): No longer try to resolve the
13834 (MakeBoolean): New utility function that resolve, implicitly
13835 converts to boolean and tags the expression.
13838 (If, Do): Implement dead code elimination.
13839 (While): Implement loop inversion
13841 (Do, While, For, If): Resolve the expression prior to calling our
13844 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
13847 - added method Report28 (warning: program has more than one entry point)
13848 - added method IsEntryPoint, implements paragraph 10.1 of the spec
13849 - modified method Method.Define, the part at the end of the method
13851 * rootcontext.cs: added static public Location EntryPointLocation;
13853 * ../errors/cs0028.cs : Add test case for the above warning.
13856 - modified method CSharpName to allow arrays of primitive type to
13857 be printed nicely (e.g. instead of System.Int32[][] it now prints
13859 - added method CSharpSignature: returns the signature of a method
13860 in string format to be used in reporting errors, warnings, etc.
13862 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
13865 2002-04-26 Ravi Pratap <ravi@ximian.com>
13867 * delegate.cs (Define): Fix extremely silly bug where I was
13868 setting the type of the 'object' parameter of the BeginInvoke
13869 method to System.IAsyncResult instead of System.Object ;-)
13871 2002-04-26 Miguel de Icaza <miguel@ximian.com>
13873 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
13876 (Constructor.Emit): return if we fail to initialize the
13877 constructor. Another door closed!
13879 * expression.cs (New.DoResolve): Improve error message (from -6 to
13880 1501). Use DeclaredOnly lookup to find the exact constructor.
13882 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
13883 loop. This is useful.
13885 * cs-parser.jay: Adjust the default parameters so that destructors
13886 have the proper signature.
13888 2002-04-26 Martin Baulig <martin@gnome.org>
13890 * driver.cs (LoadAssembly): If `assembly' contains any characters
13891 which are only valid in path names and not in assembly names
13892 (currently slash, backslash and point), use Assembly.LoadFrom ()
13893 instead of Assembly.Load () on the `assembly' (before iteration
13894 over the link_paths).
13896 2002-04-26 Martin Baulig <martin@gnome.org>
13898 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
13900 2002-04-25 Miguel de Icaza <miguel@ximian.com>
13902 * class.cs (Property): use the new typemanager.MemberLookup
13904 (TypeContainer.MemberLookup): Implement using the
13905 TypeManager.MemberLookup now.
13907 * typemanager.cs: Make MemberLookup a function of the TypeManager,
13908 and return MemberInfos, so that these can be used without an
13909 EmitContext (what we had before).
13911 2002-04-24 Miguel de Icaza <miguel@ximian.com>
13913 * expression.cs: Fix the case where the argument to params if the
13914 type of the params. I omitted handling this before. Fixed
13916 2002-04-22 Miguel de Icaza <miguel@ximian.com>
13918 * driver.cs: Call BootCorlib_PopulateCoreType
13920 * class.cs (Property.CheckBase): Check for properties only, not
13923 * interface.cs: Temporary hack: try/catch around the
13924 CustomAttributeBuilder, because I am getting an exception that I
13927 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
13928 types whose definitions are required to be there (attributes are
13929 defined before standard types).
13931 Compute definitions as we boot the various types, as they are used
13932 immediately (value_type class will need object_type, but if we do
13933 not initialize object_type, we will pass a null, which will let
13934 the runtime pick the System.Object from the existing corlib, which
13935 is not what we want).
13937 2002-04-22 Patrik Torstensson <totte@labs2.com>
13939 * cs-tokenizer.cs: fixed a number of trim() issues.
13941 2002-04-22 Ravi Pratap <ravi@ximian.com>
13943 * expression.cs (Argument.Type): Ensure that we return the correct
13944 type when we have out or ref parameters [in which case we
13947 2002-04-22 Miguel de Icaza <miguel@ximian.com>
13949 * class.cs (Property, Indexer): Allow extern modifier in there.
13951 * typemanager.cs (InitBaseTypes): Initializes object_type and
13952 value_type, since those will be used early on during the bootstrap
13953 process to compile corlib.
13955 (InitCoreTypes): Move code from here to InitBaseTypes.
13957 2002-04-21 Miguel de Icaza <miguel@ximian.com>
13959 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
13960 single-dimension arrays as using the ldlen opcode.
13962 Daniel Lewis discovered this optimization.
13964 * typemanager.cs: Add signature for System.Array::get_Length
13966 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13968 * statement.cs: report the error when the foreach does not apply to an
13969 array nor a collection.
13971 2002-04-19 Miguel de Icaza <miguel@ximian.com>
13973 * expression.cs: Add implicit conversions to the operator ~.
13975 * constant.cs (DecimalConstant.Emit): Emit decimal value.
13977 * typemanager.cs: Locate the decimal constructor.
13979 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13981 * attribute.cs: use the new property of TypeOf.
13982 * expression.cs: added 'get' property around typearg.
13984 These changes fix a build breaker reported by NickD. Is this the
13985 correct way to fix? If not, please, revert my changes and make it
13988 2002-04-17 Miguel de Icaza <miguel@ximian.com>
13990 * attribute.cs: Add support for typeof in attribute invocations.
13991 I am not sure that this is right though.
13993 2002-04-14 Duncan Mak <duncan@ximian.com>
13995 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
13996 Binary.Operator.Division case.
13998 2002-04-13 Ravi Pratap <ravi@ximian.com>
14000 * class.cs (DefineType): Ensure that we do a proper check on
14001 attribute types and also register it with the TypeManager.
14003 (TypeContainer.Targets): The default for attribute types is
14004 AttributeTargets.All.
14006 * attribute.cs (ApplyAttributes): Registering the attribute type
14007 is done elsewhere, not when we discover we have a Usage attribute.
14009 2002-04-12 Ravi Pratap <ravi@ximian.com>
14011 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
14012 and get rid of is_delegate parameter.
14014 * everywhere : update.
14016 2002-04-12 Ravi Pratap <ravi@ximian.com>
14018 * cs-parser.jay (compilation_unit): Revamp completely to use
14019 some new ideas that I got from Rhys' grammar to solve the problems
14020 with assembly level attributes.
14022 (outer_declaration): New grammar production.
14024 (attribute_sections): Add.
14026 (opt_attributes): Base on attribute_sections
14028 (namespace_declaration): Allow opt_attributes to tackle the case
14029 when we have assembly level attributes - we are clever in this
14032 * attribute.cs (ApplyAttributes): Do not worry about assembly
14033 attributes in the non-global context.
14035 * rootcontext.cs (AddGlobalAttributes): Go back to using this
14036 instead of SetGlobalAttributes.
14038 * class.cs, rootcontext.cs : Ensure we define and generate
14039 attribute types before anything else.
14041 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
14042 and flag the new error -20 for the case when the attribute type
14043 does not have valid targets specified. csc does not catch this.
14045 * ../errors/errors.txt : update for error # -20
14047 2002-04-11 Ravi Pratap <ravi@ximian.com>
14049 * support.cs (InternalParameters.ParameterModifier): Do some null
14050 checking and return sane values.
14052 * class.cs (Method.Define): If we are a PInvoke method, ensure
14053 that we are static and extern. Report error # 601
14055 * ../errors/cs0601.cs : Add test case for the above error.
14057 2002-04-07 Ravi Pratap <ravi@ximian.com>
14059 * rootcontext.cs (attribute_types): We need to keep type of
14060 all attribute types separately and emit code for them first.
14062 (RegisterAttribute) : Implement.
14064 * class.cs (DefineType): Check if the current Type is a custom
14065 attribute type and register it accordingly.
14067 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
14068 adding the first attribute twice and rename to
14070 (SetGlobalAttributes): this.
14072 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
14075 * attribute.cs (ApplyAttributes): Take an additional argument telling us
14076 if we are processing global arguments. Hmm, I am unsure of this.
14078 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14080 * expression.cs: added static array of strings to avoid calling
14081 Enum.ToString () for Operator in Binary. Significant recover of
14084 2002-04-10 Miguel de Icaza <miguel@ximian.com>
14086 * class.cs (FindMembers): Allow the Builders of the various
14087 members to be null. If they are skip them. This only happens
14088 during the PInvoke declaration.
14090 2002-04-09 Miguel de Icaza <miguel@ximian.com>
14092 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
14093 failure, so we do not keep going afterwards.
14095 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
14096 wanted to pass `false' as the `is_delegate' argument. If this is
14097 the case, why not use delegate_type == null to mean `is_delegate =
14098 false' and anything else as is_delegate = true.
14100 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
14102 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
14103 code for the section, not the beginning of the tests.
14105 2002-04-08 Miguel de Icaza <miguel@ximian.com>
14107 * cfold.cs: Handle operator + (Enum x, Underlying x)
14109 * expression.cs (Binary): same. Warn about errors where we have
14110 Enum/Enum in operator + as well.
14112 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
14115 - added support for switch(bool)
14116 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
14117 - add TableSwitchEmit() to handle table-based switch statements
14119 2002-04-05 Ravi Pratap <ravi@ximian.com>
14121 * expression.cs (Invocation.OverloadResolve): Factor out code which
14122 does parameter compatibility checking with arguments so that we can
14123 re-use the code even from Delegate.VerifyApplicability
14125 (VerifyArgumentsCompat): Move above code here.
14127 * delegate.cs (VerifyApplicability): Get rid of duplicate code
14128 and instead make a call to the above method.
14130 2002-03-31 Ravi Pratap <ravi@ximian.com>
14132 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
14133 We use it to keep track of classes which are attribute types.
14135 2002-04-02 Miguel de Icaza <miguel@ximian.com>
14137 * delegate.cs (Delegate.Define): Correctly define the types in the
14138 presence of fixed and array parameters.
14140 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
14143 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
14144 include NonPublic after the first iteration.
14146 * class.cs (Indexer.CheckBase): Only check if both parents are
14149 * cs-parser.jay (accessor_body): If empty, set to null.
14151 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
14152 same code path here to resolve constants names that we did have in
14153 MemberAccess.DoResolve. There is too much code duplicated here.
14155 2002-04-01 Miguel de Icaza <miguel@ximian.com>
14157 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
14159 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
14162 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
14163 tokens, numbers and strings.
14165 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
14168 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
14169 asyncronous parameters and the regular parameters.
14171 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
14172 specify the target directory.
14174 * expression.cs: (This.DoResolve): Simplify
14175 (As.Emit): Optimize, do not generate IsInst if the expression is
14176 always of the given type.
14178 (Is.DoResolve): Bug fix, we were reporting both always/never for
14181 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
14182 creating too many unnecessary arrays.
14184 2002-03-31 Miguel de Icaza <miguel@ximian.com>
14186 * class.cs (EmitFieldInitializer): Use Assign expression to assign
14187 fields instead of rolling our own initializer. Takes care of all
14188 implicit conversions, and drops unnecessary static checks/argument.
14190 2002-03-31 Dick Porter <dick@ximian.com>
14192 * driver.cs: use the GetDirectories() return values properly, and
14193 use "/" as path separator.
14195 2002-03-30 Miguel de Icaza <miguel@ximian.com>
14197 * expression.cs (Unary): Optimize - - expr into expr.
14198 (Binary): Optimize a + (-b) into a -b.
14200 * codegen.cs (CodeGen): Made all methods static.
14202 2002-03-29 Miguel de Icaza <miguel@ximian.com>
14206 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
14207 TypeBuilder property.
14209 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
14212 * tree.cs: Removed the various RecordXXXX, and replaced with a
14213 single RecordDecl. Removed all the accessor methods, and just
14214 left a single access point Type
14216 * enum.cs: Rename DefineEnum to DefineType.
14218 * decl.cs: New abstract method `DefineType' used to unify the
14219 Defines for Enumerations, Interfaces, TypeContainers and
14222 (FindType): Moved LookupInterfaceOrClass here. Moved the
14223 LookupBaseClasses method that used to live in class.cs and
14224 interface.cs here, and renamed to FindType.
14226 * delegate.cs: Implement DefineType. Take advantage of the
14227 refactored pattern for locating the parent builder without taking
14228 the parent_builder argument (which we know does not work if we are
14229 nested, and triggering a toplevel definition).
14231 2002-03-28 Miguel de Icaza <miguel@ximian.com>
14233 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
14234 accessibility of a member has changed during override and report
14237 * class.cs (Method.Define, Property.Define): Only complain on
14238 overrides if the method is private, any other accessibility is
14239 fine (and since we just checked the permission is the same, we are
14242 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
14243 and elif are processed always. The other pre-processing
14244 directives are only processed if we are "taking" the path
14246 2002-03-29 Martin Baulig <martin@gnome.org>
14248 * class.cs (Method.Emit): Only emit symbolic debugging info if the
14249 current location is not Null.
14251 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
14252 a separate method so we can profile it.
14254 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
14255 `span.Seconds' are just seconds, but no minutes or hours.
14256 (MainDriver): Profile the CodeGen.SaveSymbols calls.
14258 2002-03-28 Miguel de Icaza <miguel@ximian.com>
14260 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
14261 Remove the gratuitous set of Final:
14263 // If an interface implementation, then we can set Final.
14264 if (((flags & MethodAttributes.Abstract) == 0) &&
14265 implementing.DeclaringType.IsInterface)
14266 flags |= MethodAttributes.Final;
14268 I do not know what I was smoking when I used that.
14271 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
14272 step into fixing the name resolution issues for delegates and
14273 unifying the toplevel name resolution.
14275 2002-03-28 Martin Baulig <martin@gnome.org>
14277 * class.cs (Method.Emit): If we have a symbol writer, call its
14278 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
14279 tell it about the current method.
14281 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
14282 writer that we're going to emit the first byte of IL code for a new
14283 statement (a new source line).
14284 (EmitContext.EmitTopBlock): If we have a symbol writer, call
14285 EmitContext.Mark() before emitting any code.
14287 * location.cs (SymbolDocument): Return null when we're Null.
14289 * statement.cs (Statement): Moved the `Location loc' variable here.
14290 (Statement.EmitBoolExpression): If we have a symbol writer, call
14291 ec.Mark() before emitting any code to tell it that we're at the
14292 beginning of a new statement.
14293 (StatementExpression): Added `Location' argument to the constructor.
14294 (Block): Added public readonly variable `StartLocation' and public
14295 variable `EndLocation'. The latter is to be set using SetEndLocation().
14296 (Block): Added constructor which takes a start and end location.
14297 (Block.SetEndLocation): New method. This sets the end location.
14298 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
14299 local variables we create.
14300 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
14301 each statement and do also mark the begin and end of the block.
14303 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
14304 tell it the current lexer.Location, use Location.Null for the end of the
14306 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
14307 current block, set its end location using SetEndLocation().
14308 (statement_expression): StatementExpression constructor now takes the
14309 lexer.Location as additional argument.
14310 (for_statement, declare_local_variables): Likewise.
14311 (declare_local_variables): When creating a new implicit block, use the
14312 new Block constructor and pass it the lexer.Location.
14314 2002-03-28 Miguel de Icaza <miguel@ximian.com>
14316 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
14317 members also on the parent interfaces recursively.
14319 2002-03-27 Miguel de Icaza <miguel@ximian.com>
14321 * report.cs: Use new formats, since Gonzalo finished the missing
14324 * expression.cs (Binary.ResolveOperator): added missing operator|
14325 operator& and operator^ for bool/bool.
14327 * cs-parser.jay: CheckDef now takes a Location argument that is
14328 used to report errors more precisly (instead of reporting the end
14329 of a definition, we try to track something which is a lot closer
14330 to the source of the problem).
14332 * cs-tokenizer.cs: Track global token use, so we can properly flag
14333 the use of #define/#undef after the first token has been seen.
14335 Also, rename the reportXXXX to Error_DescriptiveName
14337 * decl.cs (DeclSpace.IsTopLevel): Move property here from
14338 TypeContainer, so that Enum and Interface can use this too.
14340 * class.cs (TypeContainer.LookupInterfaceOrClass,
14341 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
14342 `builder' argument. Typically this was used to pass the parent
14343 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
14346 The problem is that a nested class could trigger the definition of
14347 a toplevel class, and the builder would be obviously wrong in that
14350 So we drop this argument, and we compute dynamically the
14351 TypeBuilder/ModuleBuilder (the correct information was available
14352 to us anyways from DeclSpace.Parent)
14354 * interface.cs (Interface.DefineInterface): Drop builder
14355 parameter cleanup like class.cs
14357 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
14360 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
14363 (Try.Emit): Propagate the returns value from the statement.
14365 (Return.Emit): Even if we are leavning
14367 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
14369 * modifiers.cs: Fix the computation of MethodAttributes flags.
14371 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
14373 * driver.cs: allow compilation of files that start with '/'.
14374 Add a default case when checking the argument of --target.
14376 2002-03-25 Miguel de Icaza <miguel@ximian.com>
14378 * interface.cs: Implement the same search algorithm for types in
14379 the interface code.
14381 * delegate.cs: Do not allow multiple definition.
14383 * Recovered ChangeLog that got accidentally amputated
14385 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
14387 * rootcontext.cs: Load manually enum to allow core classes to
14388 contain enumerations.
14390 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
14391 Update to new static methods in TypeManager.
14393 * typemanager.cs (GetMethod, GetConstructor): Use our
14394 implementation of FindMembers to find the members, since during
14395 corlib compilation, the types are TypeBuilders and GetMethod and
14396 GetConstructor do not work.
14398 Make all methods in TypeManager static.
14400 (InitCodeHelpers): Split the functionality from
14401 the InitCodeTypes function.
14403 * driver.cs: Call InitCodeHelpers after we have populated the
14406 * cs-parser.jay (delegate_declaration): we did not used to compute
14407 the delegate name correctly for void delegates.
14409 2002-03-24 Miguel de Icaza <miguel@ximian.com>
14411 * rootcontext.cs (RootContext): Init the interface_resolve_order
14412 and type_container_resolve_order always.
14414 (ResolveCore, BootstrapCorlib_ResolveClass,
14415 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
14416 compiler when compiling with --nostdlib
14418 * class.cs (TypeContainer.DefineType): Check that our parent is
14419 not null. This test is most important when we are bootstraping
14422 * codegen.cs: Split out the symbol writing code.
14424 2002-03-25 Martin Baulig <martin@gnome.org>
14426 * driver.cs (-g): Made -g an alias for --debug.
14428 2002-03-24 Martin Baulig <martin@gnome.org>
14430 * codegen.cs (SymbolWriter): New public variable. Returns the
14431 current symbol writer.
14432 (CodeGen): Added `bool want_debugging_support' argument to the
14433 constructor. If true, tell the ModuleBuild that we want debugging
14434 support and ask it for the ISymbolWriter.
14435 (Save): If we have a symbol writer, call it's Close() method after
14436 saving the assembly.
14438 * driver.c (--debug): New command line argument to create a
14439 debugger information file.
14441 * location.cs (SymbolDocument): New public property. Returns an
14442 ISymbolDocumentWriter object for the current source file or null
14443 if we don't have a symbol writer.
14445 2002-03-21 Miguel de Icaza <miguel@ximian.com>
14447 * driver.cs (LoadAssembly): Correctly return when all the paths
14448 have been tried and not before.
14450 * statement.cs (Switch.Emit): return the actual coverage for this
14451 statement (returns/not-returns)
14453 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
14454 switch of the statement if we are the last switch section. That
14455 kills two problems: try/catch problems (we used to emit an empty
14456 nop at the end) and switch statements where all branches would
14459 2002-03-19 Miguel de Icaza <miguel@ximian.com>
14461 * driver.cs: Add default assemblies (the equivalent to the
14462 Microsoft CSC.RSP file)
14464 * cs-tokenizer.cs: When updating `cols and setting it to zero,
14465 also update tokens_seen and set it to false.
14467 * driver.cs: Implement --recurse for Mike.
14469 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
14470 correctly splitting out the paths.
14472 2002-03-18 Miguel de Icaza <miguel@ximian.com>
14474 * interface.cs (Interface.PopulateProperty): Instead of using
14475 `parent' as the declaration space for the set parameters, use
14478 * support.cs (InternalParameters): InternalParameters constructor
14479 takes a DeclSpace instead of a TypeContainer.
14481 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
14482 types are being initialized, load the address of it before calling
14485 (New): Provide a mechanism to disable the generation of local
14486 value type temporaries when the caller will be providing us with
14487 an address to store it.
14489 (ArrayCreation.EmitDynamicInitializers): Use it.
14491 2002-03-17 Miguel de Icaza <miguel@ximian.com>
14493 * expression.cs (Invocation.EmitArguments): Only probe for array
14494 property if there is more than one argument. Sorry about that.
14496 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
14497 empty param arrays.
14499 * class.cs (Method.LabelParameters): Fix incorrect code path that
14500 prevented the `ParamArrayAttribute' from being applied to the
14503 2002-03-16 Miguel de Icaza <miguel@ximian.com>
14505 * support.cs (ReflectionParameters): Correctly compute whether the
14506 last argument is a params array. Fixes the problem with
14509 * typemanager.cs: Make the assemblies array always be non-null
14510 (empty, but non-null)
14512 * tree.cs (RecordDecl): New function that abstracts the recording
14513 of names. This reports error 101, and provides a pointer to the
14514 previous declaration. Fixes a crash in the compiler.
14516 * cs-parser.jay (constructor_declaration): Update to new grammar,
14517 and provide a constructor_body that can be empty.
14519 2002-03-15 Miguel de Icaza <miguel@ximian.com>
14521 * driver.cs: Add support for --resources.
14523 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
14524 Make all types for the various array helper methods be integer.
14526 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
14527 CheckState to ConvCast.
14529 (ConvCast): Now it takes a `checked' state argument, to avoid
14530 depending on the emit context for the conversion, and just using
14531 the resolve time setting.
14533 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
14534 instead of Invocation.EmitArguments. We do not emit the original
14535 arguments, instead we emit those which have been converted to
14536 unsigned int expressions.
14538 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
14540 * codegen.cs: ditto.
14542 * expression.cs (LocalVariableReference): Drop the use of the
14543 Store function that depended on the variable index.
14545 * statement.cs (VariableInfo): Drop the `Idx' property from this
14546 class, as this is not taking into account the indexes for
14547 temporaries tat we generate during the execution, getting the
14550 * class.cs: First emit class initializers, then call the parent
14553 * expression.cs (Binary): Fix opcode emision.
14554 (UnaryMutator.EmitCode): Support checked code generation
14556 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
14557 matches for events for both the Static and Instance scans,
14558 pointing to the same element. Fix that.
14560 2002-03-14 Miguel de Icaza <miguel@ximian.com>
14562 * rootcontext.cs (ResolveTree): Always set the
14563 interface_resolve_order, because nested interfaces will be calling
14566 * class.cs (GetInterfaceOrClass): Track the same resolution
14567 process used by TypeManager.LookupType. This fixes the nested
14568 type lookups in class declarations (separate path from
14571 (TypeContainer.DefineType): Also define nested interfaces.
14572 (TypeContainer.RegisterOrder): New public function used to
14573 register the order in which child interfaces need to be closed.
14575 Nested interfaces need to be closed after their parents have been
14578 * interface.cs (InterfaceAttr): Put all the logic for computing
14579 the interface attribute here.
14581 (DefineInterface): Register our interface order with the
14582 RootContext or with the TypeContainer depending on the case.
14584 2002-03-12 Miguel de Icaza <miguel@ximian.com>
14586 * cs-parser.jay: rework foreach statement to work with the new
14587 changes to the policy on SimpleNames.
14589 * report.cs: support Stacktrace on warnings as well.
14591 * makefile: drop --unsafe and /unsafe from the compile.
14593 2002-03-13 Ravi Pratap <ravi@ximian.com>
14595 * ecore.cs (StandardConversionExists): Modify to take an Expression
14596 as the first parameter. Ensure we do null -> reference type conversion
14599 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
14600 temporary Expression objects.
14602 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
14604 * interface.cs: workaround bug in method overloading resolution
14605 (there is already a bugzilla bug for it).
14607 2002-03-12 Miguel de Icaza <miguel@ximian.com>
14609 We could also solve this problem by having a separate path for
14610 performing type lookups, instead of DoResolve, we could have a
14611 ResolveType entry point, and only participating pieces of the
14612 production (simplename, deref, array) would implement this.
14614 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
14615 signal SimpleName to only resolve type names and not attempt to
14616 resolve anything else.
14618 * expression.cs (Cast): Set the flag.
14620 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
14622 * class.cs: Only report 108 if there is no `new' modifier.
14624 * cs-parser.jay: rework foreach statement to work with the new
14625 changes to the policy on SimpleNames.
14627 * report.cs: support Stacktrace on warnings as well.
14629 * makefile: drop --unsafe and /unsafe from the compile.
14631 2002-03-11 Miguel de Icaza <miguel@ximian.com>
14633 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14634 lookups here, instead of doing that at parse time. This means
14635 that our grammar will not introduce `LocalVariableReferences' as
14636 expressions at this point. That solves the problem of code like
14640 static void Main ()
14644 This is only half the fix. The full fix requires parameters to
14645 also be handled in this way.
14647 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
14648 makes the use more obvious of the DeclSpace. The
14649 ec.TypeContainer.TypeBuilder is now only used to pull the
14650 TypeBuilder for it.
14652 My theory is that I can get rid of the TypeBuilder completely from
14653 the EmitContext, and have typecasts where it is used (from
14654 DeclSpace to where it matters).
14656 The only pending problem is that the code that implements Aliases
14657 is on TypeContainer, and probably should go in DeclSpace.
14659 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14660 lookups here, instead of doing that at parse time. This means
14661 that our grammar will not introduce `LocalVariableReferences' as
14662 expressions at this point. That solves the problem of code like
14666 static void Main ()
14670 This is only half the fix. The full fix requires parameters to
14671 also be handled in this way.
14673 * class.cs (Property.DefineMethod): When implementing an interface
14674 method, set newslot, when implementing an abstract method, do not
14675 set the flag (before we tried never setting it, or always setting
14676 it, which is the difference).
14677 (Indexer.DefineMethod): same.
14678 (Method.DefineMethod): same.
14680 * ecore.cs: Only set the status used flag if we get back a Field.
14682 * attribute.cs: Temporary hack, so Paolo can keep working.
14684 2002-03-08 Ravi Pratap <ravi@ximian.com>
14686 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
14687 the unmanaged type in the case we have a MarshalAs attribute.
14689 (Resolve): Handle the case when we are parsing the special MarshalAs
14690 attribute [we need to store the unmanaged type to use later]
14692 * typemanager.cs (marshal_as_attr_type): Built in type for the
14693 MarshalAs Attribute.
14695 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
14696 on parameters and accordingly set the marshalling info.
14698 2002-03-09 Miguel de Icaza <miguel@ximian.com>
14700 * class.cs: Optimizing slightly by removing redundant code after
14701 we switched to the `NoTypes' return value.
14702 (Property.DefineMethod): use NoTypes here too.
14704 This fixes the bug I introduced in my last batch of changes.
14706 2002-03-05 Ravi Pratap <ravi@ximian.com>
14708 * tree.cs (RecordEnum): Add. We now keep track of enums too.
14710 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
14711 Enums since those are types too.
14713 * cs-parser.jay (enum_declaration): Record enums as we parse them.
14715 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
14716 thanks to a call during the lookup process.
14718 2002-03-07 Miguel de Icaza <miguel@ximian.com>
14720 * statement.cs (Foreach): Lots of work to accomodate a particular
14721 kind of foreach statement that I had not kept in mind. It is
14722 possible to have foreachs on classes that provide a GetEnumerator
14723 method that return objects that implement the "pattern" for using
14724 a foreach, there is no need to support GetEnumerator
14727 This is needed to compile nant.
14729 * decl.cs: Only report 114 if the member is not `Finalize' and if
14730 the warning level is at least 2.
14732 * class.cs: Moved the compare function from Method to
14735 (MethodSignature.InheritableMemberSignatureCompare): Add new
14736 filter function that is used to extract inheritable methods from a
14739 (Method.Define): Use the new `inheritable_method_signature_filter'
14742 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
14745 2002-03-06 Miguel de Icaza <miguel@ximian.com>
14747 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
14749 * cs-parser.jay: Add opt_semicolon to the interface declaration.
14751 * expression.cs: Pass location information to
14752 ConvertImplicitStandard.
14754 * class.cs: Added debugging code to track return values from
14757 2002-03-05 Miguel de Icaza <miguel@ximian.com>
14759 * expression.cs (Is.DoResolve): If either side of the `is' is an
14760 interface, do not flag the warning.
14762 * ecore.cs (ImplicitReferenceConversion): We need a separate test
14765 * report.cs: Allow for --fatal to be used with --probe.
14767 * typemanager.cs (NoTypes): Move the definition for the empty Type
14770 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
14772 (TypeContainer.DefineProxy): New function used to proxy to parent
14773 implementations when implementing interfaces.
14774 (TypeContainer.ParentImplements): used to lookup if our parent
14775 implements a public function that is required by an interface.
14776 (TypeContainer.VerifyPendingMethods): Hook this up.
14778 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
14779 `modules' and `assemblies' arraylists into arrays. We only grow
14780 these are the very early start up of the program, so this improves
14781 the speedof LookupType (nicely measured).
14783 * expression.cs (MakeByteBlob): Replaced unsafe code with
14784 BitConverter, as suggested by Paolo.
14786 * cfold.cs (ConstantFold.Binary): Special case: perform constant
14787 folding of string concatenation, but if either side is a string,
14788 and the other is not, then return null, and let the runtime use
14789 the concatenation on the string plus the object (using
14790 `Object.ToString').
14792 2002-03-04 Miguel de Icaza <miguel@ximian.com>
14794 Constant Folding has been implemented now.
14796 * expression.cs (Unary.Reduce): Do not throw an exception, catch
14797 the error instead on types that are not supported in one's
14800 * constant.cs (Constant and all children): New set of functions to
14801 perform implict and explicit conversions.
14803 * ecore.cs (EnumConstant): Implement the new functions to perform
14804 conversion by proxying to the child expression.
14806 * codegen.cs: (ConstantCheckState): Constant evaluation has its
14807 own separate setting that can not be turned off from the command
14808 line using --unchecked or --checked and is only controlled using
14809 the checked/unchecked statements and expressions. This setting is
14810 used by the constant folder to flag errors.
14812 * expression.cs (CheckedExpr, UncheckedExpr): Set the
14813 ConstantCheckState as well.
14815 During Resolve, they also have to flag the state, because the
14816 constant folder runs completely in the Resolve phase.
14818 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
14821 2002-03-01 Miguel de Icaza <miguel@ximian.com>
14823 * cfold.cs: New file, this file contains the constant folder.
14825 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
14826 argument to track whether we are using the resulting address to
14827 load or store a value and provide better error messages.
14829 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
14830 new AddressOf arguments.
14832 * statement.cs (Foreach.EmitCollectionForeach): Update
14834 * expression.cs (Argument.Emit): Call AddressOf with proper
14835 arguments to track usage.
14837 (New.DoEmit): Call AddressOf with new arguments.
14839 (Unary.Emit): Adjust AddressOf call.
14841 2002-03-01 Ravi Pratap <ravi@ximian.com>
14843 * cs-parser.jay (member_access): Change the case for pre-defined types
14844 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
14847 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
14850 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
14851 essentially like methods and apply attributes like MethodImplOptions to them too.
14853 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
14856 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
14857 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
14860 * Update code everywhere accordingly.
14862 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
14864 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
14866 2002-02-28 Ravi Pratap <ravi@ximian.com>
14868 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
14869 try performing lookups against those instead of jumping straight into using
14870 the 'using' clauses.
14872 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
14874 (LookupType): Perform lookups in implicit parents too.
14876 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
14877 sequence as RootContext.LookupType.
14879 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
14880 the various cases of namespace lookups into this method.
14882 2002-03-01 Miguel de Icaza <miguel@ximian.com>
14884 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
14885 in positional arguments)
14887 * class.cs (Operator): Update the AllowedModifiers to contain
14890 * cs-parser.jay: Update operator declaration to allow for the
14891 operator body to be empty.
14893 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
14896 2002-02-27 Miguel de Icaza <miguel@ximian.com>
14898 * class.cs (Method.Emit): Label parameters.
14900 * driver.cs: Return 1 or 0 as the program exit code.
14902 2002-02-26 Miguel de Icaza <miguel@ximian.com>
14904 * expression.cs: Special case the `null' object when trying to
14905 auto-compute the type, as anything can be explicitly converted to
14908 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
14909 spotting this Paolo.
14911 (Expression.ImplicitNumericConversion): Perform comparissions of
14912 the type using the underlying type in the case of an enumeration
14913 rather than using the enumeration type for the compare.
14915 Cope with the underlying == type case, which is not possible to
14918 (Expression.ConvertNumericExplicit): Perform comparissions of
14919 the type using the underlying type in the case of an enumeration
14920 rather than using the enumeration type for the compare.
14922 * driver.cs: If the user does not supply an extension, assume .exe
14924 * cs-parser.jay (if_statement): Rewrote so that we can track the
14925 location for the if statement.
14927 * expression.cs (Binary.ConstantFold): Only concat strings when
14928 the operation is "+", not everything ;-)
14930 * statement.cs (Statement.EmitBoolExpression): Take a location
14932 (If, While, Do): Track location.
14934 * expression.cs (Binary.ResolveOperator): In the object + string
14935 case, I was missing a call to ConvertImplicit
14937 2002-02-25 Ravi Pratap <ravi@ximian.com>
14939 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
14940 Location arguments. Ensure we use RootContext.LookupType to do our work
14941 and not try to do a direct Type.GetType and ModuleBuilder.GetType
14943 * interface.cs (PopulateMethod): Handle the type of the parameter being
14946 * expression.cs (Invocation.BetterFunction): Handle the case when we
14947 have a params method with no fixed arguments and a call is made with no
14950 2002-02-25 Miguel de Icaza <miguel@ximian.com>
14952 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
14953 the verbatim-string-literal
14955 * support.cs (InternalParameters.ParameterModifier): handle null
14957 (InternalParameters.ParameterType): ditto.
14959 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
14960 duplicating the name of the variable parameter.
14961 (GetParameterByName): Fix bug where we were not looking up array
14962 paramters if they were the only present (thanks Paolo!).
14963 (GetParameterInfo): We only have an empty set of types if both
14964 fixed and array are set to null.
14965 (GetParameterInfo-idx): Handle FixedParameter == null
14967 * cs-parser.jay: Handle the case where there is no catch
14968 statements (missing null test).
14970 2002-02-22 Miguel de Icaza <miguel@ximian.com>
14972 * driver.cs (MainDriver): Be conservative on our command line
14975 Catch DirectoryNotFoundException when calling GetFiles.
14977 (SplitPathAndPattern): Used to split the input specification into
14978 a path and a pattern that we can feed to Directory.GetFiles.
14980 2002-02-21 Miguel de Icaza <miguel@ximian.com>
14982 * statement.cs (Fixed): Implement the last case of the Fixed
14983 statement (string handling).
14985 * expression.cs (StringPtr): New class used to return a char * to
14986 a string; Used by the Fixed statement.
14988 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
14990 * expression.cs (Binary.ResolveOperator): Remove redundant
14991 MemberLookup pn parent type.
14992 Optimize union call, we do not need a union if the types are the same.
14993 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
14996 Specialize the use of MemberLookup everywhere, instead of using
14997 the default settings.
14999 (StackAlloc): Implement stackalloc keyword.
15001 * cs-parser.jay: Add rule to parse stackalloc.
15003 * driver.cs: Handle /h, /help, /?
15005 * expression.cs (MakeByteBlob): Removed the hacks we had in place
15006 before we supported unsafe code.
15008 * makefile: add --unsafe to the self compilation of mcs.
15010 2002-02-20 Miguel de Icaza <miguel@ximian.com>
15012 * expression.cs (PointerArithmetic): New class that is used to
15013 perform pointer arithmetic.
15014 (Binary.Resolve): Handle pointer arithmetic
15015 Handle pointer comparission.
15016 (ArrayPtr): Utility expression class that is used to take the
15017 address of an array.
15019 (ElementAccess): Implement array access for pointers
15021 * statement.cs (Fixed): Implement fixed statement for arrays, we
15022 are missing one more case before we are done.
15024 * expression.cs (Indirection): Implement EmitAssign and set the
15025 ExprClass to Variable. This allows pointer dereferences to be
15026 treated as variables, and to have values assigned to them.
15028 * ecore.cs (Expression.StoreFromPtr): New utility function to
15029 store values dereferencing.
15031 2002-02-20 Ravi Pratap <ravi@ximian.com>
15033 * expression.cs (Binary.ResolveOperator): Ensure that we are
15034 not trying to operate on a void type - this fixes the reported
15037 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
15038 the parent implementation is sealed.
15040 * ../errors/cs0239.cs : Add.
15042 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
15044 * typemanager.cs (unverifiable_code_type): Corresponds to
15045 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
15046 which have unsafe code in them.
15048 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
15051 2002-02-19 Miguel de Icaza <miguel@ximian.com>
15053 * cs-tokenizer.cs: Add support for @"litreal strings"
15055 Make tokenizer accept pre-processor directives
15056 on any column (remove the old C-like limitation).
15058 * rootcontext.cs (EmitCode): Emit any global attributes.
15059 (AddGlobalAttributes): Used to keep track of assembly attributes.
15061 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
15063 * cs-parser.jay: Add support for global attributes.
15065 2002-02-17 Miguel de Icaza <miguel@ximian.com>
15067 * expression.cs (Indirection): New helper class. Unary will
15068 create Indirection classes to be able to implement the
15069 IMemoryLocation interface on it.
15071 2002-02-16 Miguel de Icaza <miguel@ximian.com>
15073 * cs-parser.jay (fixed_statement): reference the right statement.
15075 * statement.cs (Fixed.Emit): Finish implementing the fixed
15076 statement for the &x case.
15078 2002-02-14 Miguel de Icaza <miguel@ximian.com>
15080 * class.cs (Property.Define, Method.Define): Remove newslot when
15083 * modifiers.cs: My use of NewSlot when `Abstract' was set was
15084 wrong. NewSlot should only be used if the `new' keyword is present.
15086 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
15087 locating our system dir. Sorry about this.
15089 2002-02-13 Miguel de Icaza <miguel@ximian.com>
15091 * driver.cs (GetSystemDir): Compute correctly the location of our
15092 system assemblies. I was using the compiler directory instead of
15093 the library directory.
15095 2002-02-13 Ravi Pratap <ravi@ximian.com>
15097 * expression.cs (BetterFunction): Put back in what Miguel commented out
15098 since it is the correct fix. The problem is elsewhere ;-)
15100 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
15101 parameters of the parms method are themselves compatible or not !
15103 (StandardConversionExists): Fix very dangerous bug where we were forgetting
15104 to check that a class implements an interface before saying that an implicit
15105 conversion was allowed. Use ImplementsInterface to do the checking.
15107 2002-02-13 Miguel de Icaza <miguel@ximian.com>
15109 * class.cs (Method.Define): Track whether we are an explicit
15110 implementation or not. And only call DefineMethodOverride if we
15111 are an explicit implementation.
15113 (Property.DefineMethod): Ditto.
15115 2002-02-11 Ravi Pratap <ravi@ximian.com>
15117 * expression.cs (BetterFunction): Catch hideous bug which was
15118 preventing us from detecting ambiguous calls due to implicit casts i.e
15121 2002-01-29 Miguel de Icaza <miguel@ximian.com>
15123 * support.cs (Pair): Remove un-needed method. I figured why I was
15124 getting the error in cs-parser.jay, the variable in a foreach loop
15125 is readonly, and the compiler does not really treat this as a variable.
15127 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
15128 instead of EQUALS in grammar.
15130 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
15132 * expression.cs (Unary.DoResolve): Check whether the argument is
15135 2002-01-28 Miguel de Icaza <miguel@ximian.com>
15137 * support.cs: Api for Pair to set a value. Despite the fact that
15138 the variables are public the MS C# compiler refuses to compile
15139 code that accesses the field if the variable is part of a foreach
15142 * statement.cs (Fixed): Begin implementation of the fixed
15145 (Block.AddVariable): Return the VariableInfo on success and null
15146 on failure instead of true/false.
15148 * cs-parser.jay (foreach): Catch errors on variables already
15149 defined (we were ignoring this value before) and properly unwind
15150 the block hierarchy
15152 (fixed_statement): grammar for the fixed statement.
15154 2002-01-25 Miguel de Icaza <miguel@ximian.com>
15156 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
15157 pointer types to be incretemented.
15159 (SizeOf): Implement.
15161 * cs-parser.jay (pointer_member_access): Implement
15162 expr->IDENTIFIER production.
15164 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
15165 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
15168 (Unary): Implement indirection.
15170 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
15171 use in non-unsafe context).
15173 (SimpleName.DoResolve): Check for pointers in field access on safe
15176 (Expression.LoadFromPtr): Factor the load-indirect code in this
15177 function. This was duplicated in UnboxCast and ParameterReference
15179 2002-01-24 Miguel de Icaza <miguel@ximian.com>
15181 * expression.cs (ComposedCast): report an error if a pointer cast
15182 is used in a safe region.
15184 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
15185 pointer type casts in unsafe context.
15187 * codegen.cs (EmitContext): Set up IsUnsafe.
15189 * cs-parser.jay (non_expression_type): Add productions for pointer
15192 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
15193 code. We should not use force into static mode if the method is
15194 not virtual. Fixes bug in MIS
15196 * statement.cs (Do.Emit, While.Emit, For.Emit,
15197 Statement.EmitBoolExpression): Add support to Do and While to
15198 propagate infinite loop as `I do return' semantics.
15200 Improve the For case to also test for boolean constants.
15202 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
15203 to the list of attributes we can add.
15205 Remove `EmitContext' argument.
15207 * class.cs (Method.Define): Apply parameter attributes.
15208 (Constructor.Define): Apply parameter attributes.
15209 (MethodCore.LabelParameters): Move here the core of labeling
15212 * support.cs (ReflectionParameters.ParameterModifier,
15213 InternalParameters.ParameterModifier): Use IsByRef on the type and
15214 only return the OUT bit for these parameters instead of in/out/ref
15217 This is because I miss-understood things. The ParameterInfo.IsIn
15218 and IsOut represent whether the parameter has the [In] and [Out]
15221 2002-01-22 Miguel de Icaza <miguel@ximian.com>
15223 * ecore.cs (FieldExpr.Emit): Release temporaries.
15225 * assign.cs (LocalTemporary.Release): new function.
15227 * codegen.cs (EmitContext.GetTemporaryStorage,
15228 EmitContext.FreeTemporaryStorage): Rework the way we deal with
15229 temporary storage. Now we can "put back" localbuilders when we
15232 2002-01-21 Miguel de Icaza <miguel@ximian.com>
15234 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
15235 need to make a copy of the variable to generate verifiable code.
15237 2002-01-19 Miguel de Icaza <miguel@ximian.com>
15239 * driver.cs: Compute dynamically the system directory.
15241 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
15242 Slower, but more generally useful. Used by the abstract
15243 registering implementation.
15245 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
15246 the rules for the special rule on Type/instances. First check if
15247 we have the same name, and if so, try that special static path
15248 rather than the instance path.
15250 2002-01-18 Miguel de Icaza <miguel@ximian.com>
15252 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
15255 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
15256 Enum, ValueType, Delegate or Array for non-corlib compiles.
15258 * cs-tokenizer.cs: Catch long identifiers (645)
15260 * typemanager.cs (IndexerPropetyName): Ravi never tested this
15263 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
15264 fix, we were returning too early, so we were not registering
15265 pending methods from abstract classes.
15267 Do not register pending methods if the class is abstract.
15269 * expression.cs (Conditional.DoResolve): Report circular implicit
15270 conversions when we neecd to compute it for conditional
15273 (Is.DoResolve): If the expression is always of the provided type,
15274 flag warning 183. If the expression can not ever be of the
15275 provided type flag warning 184.
15277 * class.cs: Catch 169 as well.
15279 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
15282 2002-01-18 Nick Drochak <ndrochak@gol.com>
15284 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
15286 2002-01-17 Miguel de Icaza <miguel@ximian.com>
15288 * interface.cs: (PopulateMethod): Check for pointers being defined
15289 only if the unsafe context is active.
15290 (PopulateProperty): ditto.
15291 (PopulateIndexer): ditto.
15293 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
15294 specified. If pointers are present, make sure that they are
15295 present in an unsafe context.
15296 (Constructor, Constructor.Define): ditto.
15297 (Field, Field.Define): ditto.
15298 (Property, Property.Define): ditto.
15299 (Event, Event.Define): ditto.
15301 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
15302 hashtable if there are classes or structs defined.
15304 * expression.cs (LocalVariableReference.DoResolve): Simplify this
15305 code, as the constant resolution moved.
15307 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
15308 the metadata, so we can flag error 133.
15310 * decl.cs (MemberCore.UnsafeOK): New function to test that a
15311 pointer is being declared in an unsafe context.
15313 2002-01-16 Miguel de Icaza <miguel@ximian.com>
15315 * modifiers.cs (Modifiers.Check): Require a Location argument.
15316 Report error 227 for Unsafe use.
15318 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
15320 * statement.cs (For.Emit): If the test is null, then report that
15321 we do `return', as we wont reach anything afterwards.
15323 (Switch.SwitchGoverningType): Track the expression that matched
15326 * driver.cs: Allow negative numbers as an error code to flag.
15328 * cs-parser.jay: Handle 1551.
15330 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
15332 2002-01-15 Miguel de Icaza <miguel@ximian.com>
15334 * cs-parser.jay: Report 1518 (type declaration can only contain
15335 class, struct, interface, enum or delegate)
15337 (switch_label): Report 1523 (keywords `case' or `default' must
15340 (opt_switch_sections): Report 1522 (empty switch)
15342 * driver.cs: Report 1515 (response file specified multiple times)
15343 Report 1516 (Source file specified multiple times).
15345 * expression.cs (Argument.Resolve): Signal 1510
15347 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
15348 access not allowed in static code)
15350 2002-01-11 Ravi Pratap <ravi@ximian.com>
15352 * typemanager.cs (IsPointerType): Utility method which we are going
15355 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
15356 the object type, so we take care of that.
15358 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
15360 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
15361 added to non-params parameters :-)
15363 * typemanager.cs (CSharpName): Include 'void' type too.
15365 (void_ptr_type): Include in the set of core types.
15367 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
15370 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
15373 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
15374 completely forgotten about it.
15376 2002-01-10 Ravi Pratap <ravi@ximian.com>
15378 * cs-parser.jay (pointer_type): Add. This begins our implementation
15379 of parsing rules for unsafe code.
15381 (unsafe_statement): Implement.
15383 (embedded_statement): Modify to include the above.
15385 * statement.cs (Unsafe): Implement new class for unsafe blocks.
15387 * codegen.cs (EmitContext.InUnsafe): Add. This determines
15388 if the current context is an unsafe one.
15390 * cs-parser.jay (local_variable_pointer_type): Since local variable types
15391 are handled differently, we need separate rules for them.
15393 (local_variable_declaration): Update to use local_variable_pointer_type
15394 to allow variable declarations of unmanaged pointer types.
15396 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
15397 in unsafe contexts.
15399 * ../errors/cs0214.cs : Add.
15401 2002-01-16 Nick Drochak <ndrochak@gol.com>
15403 * makefile: remove 'response' file when cleaning.
15405 2002-01-15 Miguel de Icaza <miguel@ximian.com>
15407 * cs-parser.jay: Report 1524.
15409 2002-01-14 Miguel de Icaza <miguel@ximian.com>
15411 * typemanager.cs (RegisterMethod): drop checking if we have
15412 registered this from here
15414 2002-01-12 Miguel de Icaza <miguel@ximian.com>
15416 * class.cs (Method.EmitDestructor): Implement calling our base
15419 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
15420 value of InFinally.
15422 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
15423 this routine and will wrap the call in a try/catch block. Deal
15426 2002-01-11 Miguel de Icaza <miguel@ximian.com>
15428 * ecore.cs (Expression.MemberLookup): instead of taking a
15429 parameter `same_type' that was used to tell whether we could
15430 access private members we compute our containing type from the
15433 (FieldExpr): Added partial support for volatile fields. This does
15434 not work for volatile fields exposed from assemblies, as I can not
15435 figure out how to extract the modreq from it.
15437 Updated all the source files to use this.
15439 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
15440 because it is referenced by MemberLookup very often.
15442 2002-01-09 Ravi Pratap <ravi@ximian.com>
15444 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
15445 TypeBuilder.GetCustomAttributes to retrieve what we need.
15447 Get rid of redundant default_member_attr_type as this is the same as
15448 default_member_type which already exists.
15450 * interface.cs, attribute.cs : Update accordingly.
15452 2002-01-08 Miguel de Icaza <miguel@ximian.com>
15454 * typemanager.cs: Enable IndexerPropertyName again. It does not
15455 work for TYpeBuilders though. Ravi, can you please fix this?
15457 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
15459 * expression.cs (Argument.Emit): Handle the case of ref objects
15460 being passed to ref functions;
15462 (ParameterReference.EmitLoad): Loads the content of the pointer
15463 without dereferencing.
15465 2002-01-07 Miguel de Icaza <miguel@ximian.com>
15467 * cs-tokenizer.cs: Implemented the pre-processing expressions.
15469 2002-01-08 Ravi Pratap <ravi@ximian.com>
15471 * class.cs (Indexer.DefineMethod): Incorporate the interface
15472 type in the name of the method if we are doing explicit interface
15475 * expression.cs (ConversionExists): Remove as it is completely obsolete.
15477 (BetterConversion): Fix extremely trivial bug where we were referring to
15478 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
15481 * ../errors/bug16.cs : Add although we have fixed it.
15483 2002-01-07 Miguel de Icaza <miguel@ximian.com>
15485 * expression.cs (BaseIndexer): Begin implementation.
15487 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
15489 * cs-parser.jay (indexer_declarator): Use qualified_identifier
15490 production directly to remove a shift/reduce, and implement
15491 explicit interface implementation.
15493 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
15494 after a floating point suffix.
15496 * expression.cs (DoNumericPromotions): Improved the conversion for
15497 uint/uint. If we have a constant, we avoid doing a typecast to a
15500 * class.cs (Indexer): Implement explicit interface implementation
15503 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
15505 * class.cs: make the default instance constructor public and hidebysig.
15507 2001-01-03 Ravi Pratap <ravi@ximian.com>
15509 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
15510 so we can call it from elsewhere.
15512 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
15513 we emit it internally if the class has a defined indexer; otherwise the user
15514 emits it by decorating the class definition with the DefaultMemberAttribute.
15516 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
15517 attribute is not used on a type which defines an indexer.
15519 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
15520 character when we skip whitespace.
15522 * ../errors/cs0646.cs : Add.
15524 2002-01-03 Miguel de Icaza <miguel@ximian.com>
15526 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
15529 * makefile: Add practical target `mcs3.exe' which builds the third
15530 generation compiler.
15532 * expression.cs (New): Fix structures constructor calling.
15534 * class.cs (Property, Method, Indexer): Emit Final flag on the
15535 method if we are an interface implementation and we are not
15538 * ecore.cs (PropertyExpr): New public field `IsBase', tells
15539 whether this property is referencing a `base' method.
15541 * expression.cs (Invocation.EmitCall): take an extra argument:
15542 is_base, this is used to determine whether the `call' or
15543 `callvirt' opcode should be used.
15546 * delegate.cs: update EmitCall.
15548 * class.cs (Method.Define): Set NewSlot for the cases where we are
15549 not implementing an interface method.
15551 (Property.Define): ditto.
15553 2002-01-02 Miguel de Icaza <miguel@ximian.com>
15555 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
15556 'r'. Allows mcs to parse itself fully.
15558 2002-01-02 Ravi Pratap <ravi@ximian.com>
15560 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
15561 of the number of initializers that require the InitializeArray method.
15563 (CheckIndices): Store the Expression in all cases - not the plain value. Also
15564 update the above field where necessary.
15566 (MakeByteBlob): Update accordingly.
15568 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
15571 (EmitDynamicInitializers): Update in accordance with the new optimization.
15573 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
15574 same OpCode applies.
15576 * cs-parser.jay : Fix some glaring errors I introduced.
15578 2002-01-01 Ravi Pratap <ravi@ximian.com>
15580 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
15581 so that we can check for name clashes there too.
15583 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
15584 for interface indexers.
15586 * interfaces.cs (Define): Emit the default member attribute.
15588 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
15589 variable was being referred to while setting the value ;-)
15591 2002-01-01 Miguel de Icaza <miguel@ximian.com>
15593 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
15594 byte-by-byte information when we know the data is zero.
15596 Make the block always a multiple of 4, because
15597 DefineInitializedData has a bug.
15599 * assign.cs: Fix, we should assign from the temporary, not from
15602 * expression.cs (MakeByteBlob): Fix my incorrect code.
15604 2001-12-31 Miguel de Icaza <miguel@ximian.com>
15606 * typemanager.cs (EnumToUnderlying): This function is used to get
15607 the underlying type from an enumeration, because it does not
15610 * constant.cs: Use the I4_S form for values between -128 and 127.
15612 * statement.cs (Block.LookupLabel): Looks up a label.
15613 (Block): Drop support for labeled blocks.
15615 (LabeledStatement): New kind of statement that represents a label
15618 (Goto): Finally implement this bad boy.
15620 * cs-parser.jay: Update to reflect new mechanism to implement
15623 2001-12-30 Miguel de Icaza <miguel@ximian.com>
15625 * codegen.cs (EmitContext.This): a codegen property that keeps the
15626 a single instance of this instead of creating many different this
15629 * delegate.cs (Delegate.DoResolve): Update to use the property;
15631 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
15633 * expression.cs (BaseAccess.DoResolve): Ditto.
15635 2001-12-29 Ravi Pratap <ravi@ximian.com>
15637 * typemanager.cs (methodimpl_attr_type): Add to hold the type
15638 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
15640 (InitCoreTypes): Update accordingly.
15642 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
15643 so we can quickly store the state.
15645 (ApplyAttributes): Set the correct implementation flags
15646 for InternalCall methods.
15648 2001-12-29 Miguel de Icaza <miguel@ximian.com>
15650 * expression.cs (EmitCall): if a method is not virtual, then do
15651 not use callvirt on it.
15653 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
15654 user defined stuff) requires the use of stobj, which takes an
15655 address on the stack instead of an array and an index. So emit
15656 the Ldelema operation for it.
15658 (EmitStoreOpcode): Use stobj for valuetypes.
15660 (UnaryMutator.EmitCode): Use the right 1 value depending on
15661 whether we are dealing with int64/uint64, float or doubles.
15663 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
15664 constructors that I implemented last night.
15666 (Constructor.IsDefault): Fix to work properly for static
15669 * cs-parser.jay (CheckDef): report method signature errors.
15670 Update error number 103 to be 132.
15672 * decl.cs: New AdditionResult enumeration value: MethodExists.
15673 Although we do this check for methods later on in the semantic
15674 analysis, catching repeated default constructors is so easy that
15675 we catch these here.
15677 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
15680 (ParameterReference.EmitAssign, Emit): handle
15683 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
15684 (ArrayAccess.EmitStoreOpcode): ditto.
15686 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
15688 * expression.cs (MakeByteBlob): Complete all the missing types
15689 (uint, short, ushort, byte, sbyte)
15691 * class.cs: Only init instance field initializers on instance
15694 Rename `constructors' to instance_constructors.
15696 (TypeContainer.AddConstructor): Only add constructors to the list
15697 if it is not static.
15699 Make sure that we handle default_static_constructor independently
15700 everywhere where we handle instance_constructors
15702 2001-12-28 Miguel de Icaza <miguel@ximian.com>
15704 * class.cs: Do not lookup or create a base initializer for a
15705 static constructor.
15707 (ConstructorInitializer.Resolve): use the proper type to lookup
15710 * cs-parser.jay: Report error 1585 (modifiers between type and name).
15712 * enum.cs, interface.cs: Remove CloseType, this is taken care by
15715 * decl.cs: CloseType is now an virtual method, the default
15716 implementation just closes this type.
15718 2001-12-28 Ravi Pratap <ravi@ximian.com>
15720 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
15721 to PreserveSig by default. Also emit HideBySig on such methods.
15723 Basically, set the defaults to standard values.
15725 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
15726 argument, if candidate is better, it can't be worse than the best !
15728 (Invocation): Re-write bits to differentiate between methods being
15729 applicable in their expanded form and their normal form - for params
15732 Get rid of use_standard everywhere as only standard conversions are allowed
15733 in overload resolution.
15735 More spec conformance.
15737 2001-12-27 Miguel de Icaza <miguel@ximian.com>
15739 * driver.cs: Add --timestamp, to see where the compiler spends
15742 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
15743 `this' in static code.
15745 (SimpleName.DoResolve): Implement in terms of a helper function
15746 that allows static-references to be passed upstream to
15749 (Expression.ResolveWithSimpleName): Resolve specially simple
15750 names when called by MemberAccess to implement the special
15753 (Expression.ImplicitReferenceConversion): Handle conversions from
15754 Null to reference types before others, as Null's type is
15757 * expression.cs (Invocation.EmitCall): Handle the special case of
15758 calling methods declared on a reference type from a ValueType
15759 (Base classes System.Object and System.Enum)
15761 (MemberAccess.Resolve): Only perform lookups on Enumerations if
15762 the left hand side is a TypeExpr, not on every enumeration.
15764 (Binary.Resolve): If types are reference types, then do a cast to
15765 object on operators != and == of both arguments.
15767 * typemanager.cs (FindMembers): Extract instance and static
15768 members if requested.
15770 * interface.cs (PopulateProperty): Use void_type instead of null
15771 as the return type for the setter method.
15773 (PopulateIndexer): ditto.
15775 2001-12-27 Ravi Pratap <ravi@ximian.com>
15777 * support.cs (ReflectionParameters): Fix minor bug where we
15778 were examining the wrong parameter for the ParamArray attribute.
15780 Cope with requests for the type of the parameter at position
15781 greater than the params parameter's. We now return the element
15782 type of the params array as that makes more sense.
15784 * expression.cs (Invocation.IsParamsMethodApplicable): Update
15785 accordingly as we no longer have to extract the element type
15788 (Invocation.OverloadResolve): Update.
15790 2001-12-27 Miguel de Icaza <miguel@ximian.com>
15792 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
15793 against IEnumerator, test whether the return value is a descendant
15794 of the IEnumerator interface.
15796 * class.cs (Indexer.Define): Use an auxiliary method to implement
15797 the other bits of the method definition. Begin support for
15798 explicit interface implementation.
15800 (Property.DefineMethod): Use TypeManager.void_type instead of null
15801 for an empty return value.
15803 2001-12-26 Miguel de Icaza <miguel@ximian.com>
15805 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
15806 dealing with a FieldExpr which is composed of a FieldBuilder, in
15807 the code path we did extract the constant, but we should have
15808 obtained the underlying value to be able to cast it (otherwise we
15809 end up in an infinite loop, this is what Ravi was running into).
15811 (ArrayCreation.UpdateIndices): Arrays might be empty.
15813 (MemberAccess.ResolveMemberAccess): Add support for section
15814 14.5.4.1 that deals with the special case of E.I when E is a type
15815 and something else, that I can be a reference to a static member.
15817 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
15818 handle a particular array type to create byte blobs, it is just
15819 something we dont generate byteblobs for.
15821 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
15824 * location.cs (Push): remove the key from the hashtable that we
15825 are about to add. This happens for empty files.
15827 * driver.cs: Dispose files after we have parsed them.
15829 (tokenize): new function that only runs the tokenizer on its
15830 input, for speed testing.
15832 2001-12-26 Ravi Pratap <ravi@ximian.com>
15834 * class.cs (Event.Define): Define the private field only if there
15835 are no accessors defined.
15837 * expression.cs (ResolveMemberAccess): If there is no associated
15838 field with the event, that means we have an event defined with its
15839 own accessors and we should flag error cs0070 since transforming
15840 ourselves into a field is not valid in that case.
15842 * ecore.cs (SimpleName.DoResolve): Same as above.
15844 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
15845 and charset to sane values.
15847 2001-12-25 Ravi Pratap <ravi@ximian.com>
15849 * assign.cs (DoResolve): Perform check on events only if they
15850 are being accessed outside the declaring type.
15852 * cs-parser.jay (event_declarations): Update rules to correctly
15853 set the type of the implicit parameter etc.
15855 (add_accessor, remove_accessor): Set current local parameters.
15857 * expression.cs (Binary): For delegate addition and subtraction,
15858 cast the return value from the method into the appropriate delegate
15861 2001-12-24 Ravi Pratap <ravi@ximian.com>
15863 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
15864 of these as the workaround is unnecessary.
15866 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
15867 delegate data - none of that is needed at all.
15869 Re-write bits to extract the instance expression and the delegate method
15872 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
15875 * attribute.cs (ApplyAttributes): New method to take care of common tasks
15876 of attaching attributes instead of duplicating code everywhere.
15878 * everywhere : Update code to do attribute emission using the above method.
15880 2001-12-23 Miguel de Icaza <miguel@ximian.com>
15882 * expression.cs (IsParamsMethodApplicable): if there are not
15883 parameters, return immediately.
15885 * ecore.cs: The 0 literal can be implicity converted to an enum
15888 (SimpleName.DoResolve): First lookup the type, then lookup the
15891 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
15892 want to get its address. If the InstanceExpression is not
15893 addressable, store the result in a temporary variable, then get
15896 * codegen.cs: Only display 219 errors on warning level or above.
15898 * expression.cs (ArrayAccess): Make it implement the
15899 IMemoryLocation interface.
15901 (Binary.DoResolve): handle the operator == (object a, object b)
15902 and operator != (object a, object b) without incurring into a
15903 BoxedCast (because 5 != o should never be performed).
15905 Handle binary enumerator operators.
15907 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
15908 value type, otherwise use Ldelem_ref.
15910 Use precomputed names;
15912 (AddressOf): Implement address of
15914 * cs-parser.jay (labeled_statement): Fix recursive block
15915 addition by reworking the production.
15917 * expression.cs (New.DoEmit): New has a special case:
15919 If we are dealing with a ValueType, we have a few
15920 situations to deal with:
15922 * The target of New is a ValueType variable, that is
15923 easy, we just pass this as the variable reference
15925 * The target of New is being passed as an argument,
15926 to a boxing operation or a function that takes a
15929 In this case, we need to create a temporary variable
15930 that is the argument of New.
15933 2001-12-23 Ravi Pratap <ravi@ximian.com>
15935 * rootcontext.cs (LookupType): Check that current_type is not null before
15936 going about looking at nested types.
15938 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
15939 not implement the IAssignMethod interface any more.
15941 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
15942 where we tranform them into FieldExprs if they are being resolved from within
15943 the declaring type.
15945 * ecore.cs (SimpleName.DoResolve): Do the same here.
15947 * assign.cs (DoResolve, Emit): Clean up code considerably.
15949 * ../errors/bug10.cs : Add.
15951 * ../errors/cs0070.cs : Add.
15953 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
15955 * assign.cs : Get rid of EventIsLocal everywhere.
15957 2001-12-23 Miguel de Icaza <miguel@ximian.com>
15959 * ecore.cs (ConvertIntLiteral): finished the implementation.
15961 * statement.cs (SwitchLabel): Convert the value we are using as a
15962 key before looking up the table.
15964 2001-12-22 Miguel de Icaza <miguel@ximian.com>
15966 * codegen.cs (EmitTopBlock): Require a Location argument now.
15968 * cs-parser.jay (constructor_declarator): We need to setup
15969 current_local_parameters before we parse the
15970 opt_constructor_initializer, to allow the variables to be bound
15971 to the constructor arguments.
15973 * rootcontext.cs (LookupType): First lookup nested classes in our
15974 class and our parents before we go looking outside our class.
15976 * expression.cs (ConstantFold): Extract/debox the values at the
15979 * rootcontext.cs (EmitCode): Resolve the constants first before we
15980 resolve the types. This is not really needed, but it helps debugging.
15982 * statement.cs: report location.
15984 * cs-parser.jay: pass location to throw statement.
15986 * driver.cs: Small bug fix.
15988 * report.cs: Updated format to be 4-zero filled digits.
15990 2001-12-22 Ravi Pratap <ravi@ximian.com>
15992 * expression.cs (CheckIndices): Fix minor bug where the wrong
15993 variable was being referred to ;-)
15995 (DoEmit): Do not call EmitStaticInitializers when the
15996 underlying type is System.Object.
15998 2001-12-21 Ravi Pratap <ravi@ximian.com>
16000 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
16001 and do the usual workaround for SRE.
16003 * class.cs (MyEventBuilder.EventType): New member to get at the type
16004 of the event, quickly.
16006 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
16008 * assign.cs (Assign.DoResolve): Handle the case when the target
16009 is an EventExpr and perform the necessary checks.
16011 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
16014 (SimpleName.MemberStaticCheck): Include check for EventExpr.
16016 (EventExpr): Set the type in the constructor itself since we
16017 are meant to be born fully resolved.
16019 (EventExpr.Define): Revert code I wrote earlier.
16021 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
16022 instance expression is null. The instance expression is a This in that case
16023 or a null, depending on whether it is a static method or not.
16025 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
16026 refers to more than one method.
16028 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
16029 and accordingly flag errors.
16031 2001-12-21 Miguel de Icaza <miguel@ximian.com>
16033 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
16035 2001-12-22 Miguel de Icaza <miguel@ximian.com>
16037 * location.cs (ToString): Provide useful rutine.
16039 2001-12-21 Miguel de Icaza <miguel@ximian.com>
16041 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
16042 objects, return the actual integral boxed.
16044 * statement.cs (SwitchLabel): define an ILLabel for each
16047 (Switch.CheckSwitch): If the value is a Literal, extract
16048 the underlying literal.
16050 Also in the unused hashtable we had, add the SwitchLabel so we can
16051 quickly look this value up.
16053 * constant.cs: Implement a bunch of new constants. Rewrite
16054 Literal based on this. Made changes everywhere to adapt to this.
16056 * expression.cs (Expression.MakeByteBlob): Optimize routine by
16057 dereferencing array only once, and also copes with enumrations.
16059 bytes are two bytes wide, not one.
16061 (Cast): Perform constant conversions.
16063 * ecore.cs (TryImplicitIntConversion): Return literals instead of
16064 wrappers to the literals here.
16066 * expression.cs (DoNumericPromotions): long literals can converted
16067 to ulong implicity (this is taken care of elsewhere, but I was
16068 missing this spot).
16070 * ecore.cs (Expression.Literalize): Make the return type Literal,
16071 to improve type checking.
16073 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
16075 2001-12-20 Miguel de Icaza <miguel@ximian.com>
16077 * literal.cs: Revert code from ravi that checked the bounds. The
16078 bounds are sane by the definition of the type itself.
16080 * typemanager.cs: Fix implementation of ImplementsInterface. We
16081 need to actually look up in our parent hierarchy for interfaces
16084 * const.cs: Use the underlying type for enumerations
16086 * delegate.cs: Compute the basename for the delegate creation,
16087 that should fix the delegate test case, and restore the correct
16088 Type Lookup semantics in rootcontext
16090 * rootcontext.cs: Revert Ravi's last patch. The correct way of
16091 referencing a nested type with the Reflection API is using the "+"
16094 * cs-parser.jay: Do not require EOF token at the end.
16096 2001-12-20 Ravi Pratap <ravi@ximian.com>
16098 * rootcontext.cs (LookupType): Concatenate type names with
16099 a '.' instead of a '+' The test suite passes again.
16101 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
16102 field of the enumeration.
16104 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
16105 the case when the member is an EventExpr.
16107 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
16108 static has an associated instance expression.
16110 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
16112 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
16114 * class.cs (Event.Define): Register event and perform appropriate checks
16117 We define the Add and Remove methods even if the use provides none because
16118 in that case, we provide default implementations ourselves.
16120 Define a private field of the type of the event. This is done by the CSC compiler
16121 and we should be doing it too ;-)
16123 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
16124 More methods we use in code we generate.
16126 (multicast_delegate_type, delegate_type): Two separate types since the distinction
16129 (InitCoreTypes): Update accordingly for the above.
16131 * class.cs (Event.Emit): Generate code for default accessors that we provide
16133 (EmitDefaultMethod): Do the job in the above.
16135 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
16138 2001-12-20 Miguel de Icaza <miguel@ximian.com>
16140 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
16141 builders even if we were missing one.
16143 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
16144 pass the Basename as our class name instead of the Name. The
16145 basename will be correctly composed for us.
16147 * parameter.cs (Paramters): Now takes a Location argument.
16149 * decl.cs (DeclSpace.LookupType): Removed convenience function and
16150 make all the code call directly LookupType in RootContext and take
16151 this chance to pass the Location information everywhere.
16153 * Everywhere: pass Location information.
16155 2001-12-19 Miguel de Icaza <miguel@ximian.com>
16157 * class.cs (Constructor.Define): Updated way of detecting the
16158 length of the parameters.
16160 (TypeContainer.DefineType): Use basename as the type name for
16163 (TypeContainer.Define): Do not recursively define types here, as
16164 definition is taken care in order by the RootContext.
16166 * tree.cs: Keep track of namespaces in a per-file basis.
16168 * parameter.cs (Parameter.ComputeSignature): Update to use
16171 (Parameters.GetSignature): ditto.
16173 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
16174 instead of a TypeContainer.
16176 (Interface.SemanticAnalysis): Use `this' instead of our parent to
16177 resolve names. Because we need to be resolve in our context, not
16180 * driver.cs: Implement response files.
16182 * class.cs (TypeContainer.DefineType): If we are defined, do not
16183 redefine ourselves.
16185 (Event.Emit): Emit the code for add/remove handlers.
16186 (Event.Define): Save the MethodBuilders for add/remove.
16188 * typemanager.cs: Use pair here too.
16190 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
16191 DictionaryEntry requires the first argument to be non-null.
16193 (enum_declaration): Compute full name for registering the
16196 (delegate_declaration): Instead of using
16197 formal_parameter_list, use opt_formal_parameter_list as the list
16200 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
16201 (EventParsing): New property that controls whether `add' and
16202 `remove' are returned as tokens or identifiers (for events);
16204 2001-12-19 Ravi Pratap <ravi@ximian.com>
16206 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
16207 use MyEventBuilder only and let it wrap the real builder for us.
16209 (MyEventBuilder): Revamp constructor etc.
16211 Implement all operations that we perform on EventBuilder in precisely the same
16214 (FindMembers): Update to use the EventBuilder member.
16216 (Event.Emit): Update accordingly.
16218 2001-12-18 Ravi Pratap <ravi@ximian.com>
16220 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
16221 by calling the appropriate methods.
16223 (GetCustomAttributes): Make stubs as they cannot possibly do anything
16226 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
16228 2001-12-17 Ravi Pratap <ravi@ximian.com>
16230 * delegate.cs (Delegate.Populate): Check that the return type
16231 and various parameters types are indeed accessible.
16233 * class.cs (Constructor.Define): Same here.
16235 (Field.Define): Ditto.
16237 (Event.Define): Ditto.
16239 (Operator.Define): Check that the underlying Method defined itself
16240 correctly - so it's MethodBuilder should not be null.
16242 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
16243 expression happens to be null.
16245 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
16246 members but as of now we don't seem to be able to do anything really useful with it.
16248 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
16249 not the EventBuilder.
16251 2001-12-18 Miguel de Icaza <miguel@ximian.com>
16253 * cs-tokenizer.cs: Add support for defines.
16254 Add support for #if, #elif, #else, #endif
16256 (eval_var): evaluates a variable.
16257 (eval): stubbed for evaluating functions.
16259 * cs-parser.jay: Pass the defines information
16261 * driver.cs: Add --define command line option.
16263 * decl.cs: Move MemberCore here.
16265 Make it the base class for DeclSpace. This allows us to catch and
16266 report 108 and 109 for everything now.
16268 * class.cs (TypeContainer.Define): Extract all the members
16269 before populating and emit the warning 108 (new keyword required
16270 to override) instead of having each member implement this.
16272 (MemberCore.Define): New abstract method, we will be using this in
16273 the warning reporting engine in Populate.
16275 (Operator.Define): Adjust to new MemberCore protocol.
16277 * const.cs (Const): This does not derive from Expression, it is a
16278 temporary object we use to create fields, it is a MemberCore.
16280 * class.cs (Method.Define): Allow the entry point to be in a
16283 * driver.cs: Rewrite the argument handler to clean it up a bit.
16285 * rootcontext.cs: Made it just an auxiliary namespace feature by
16286 making everything static.
16288 * driver.cs: Adapt code to use RootContext type name instead of
16291 * delegate.cs: Remove RootContext argument.
16293 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
16296 * class.cs (Event.Define): The lookup can fail.
16298 * cs-tokenizer.cs: Begin implementation of pre-procesor.
16300 * expression.cs: Resolve the this instance before invoking the code.
16302 2001-12-17 Miguel de Icaza <miguel@ximian.com>
16304 * cs-parser.jay: Add a production in element_access that allows
16305 the thing to become a "type" reference. This way we can parse
16306 things like "(string [])" as a type.
16308 Note that this still does not handle the more complex rules of
16312 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
16314 * ecore.cs: (CopyNewMethods): new utility function used to
16315 assemble the list of methods from running FindMembers.
16317 (MemberLookup): Rework FindMembers so that
16319 2001-12-16 Miguel de Icaza <miguel@ximian.com>
16321 * class.cs (TypeContainer): Remove Delegates who fail to be
16324 * delegate.cs (Populate): Verify that we dont get null return
16325 values. TODO: Check for AsAccessible.
16327 * cs-parser.jay: Use basename to emit error 574 (destructor should
16328 have the same name as container class), not the full name.
16330 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
16331 possible representation.
16333 Also implements integer type suffixes U and L.
16335 2001-12-15 Miguel de Icaza <miguel@ximian.com>
16337 * expression.cs (ArrayCreation.DoResolve): We need to do the
16338 argument resolution *always*.
16340 * decl.cs: Make this hold the namespace. Hold the root context as
16342 (LookupType): Move here.
16344 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
16346 * location.cs (Row, Name): Fixed the code, it was always returning
16347 references to the first file.
16349 * interface.cs: Register properties defined through interfaces.
16351 * driver.cs: Add support for globbing on the command line
16353 * class.cs (Field): Make it derive from MemberCore as well.
16356 2001-12-15 Ravi Pratap <ravi@ximian.com>
16358 * class.cs (Event::Define): Check that the type of the event is a delegate
16359 type else flag error #66.
16361 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
16364 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
16365 values of EntryPoint, CharSet etc etc.
16367 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
16369 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
16370 be null and we should ignore this. I am not sure if this is really clean. Apparently,
16371 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
16372 which needs this to do its work.
16374 * ../errors/cs0066.cs : Add.
16376 2001-12-14 Miguel de Icaza <miguel@ximian.com>
16378 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
16381 * class.cs: (MethodSignature.MethodSignature): Removed hack that
16382 clears out the parameters field.
16383 (MemberSignatureCompare): Cleanup
16385 (MemberCore): New base class used to share code between MethodCore
16388 (RegisterRequiredImplementations) BindingFlags.Public requires
16389 either BindingFlags.Instace or Static. Use instance here.
16391 (Property): Refactored code to cope better with the full spec.
16393 * parameter.cs (GetParameterInfo): Return an empty array instead
16396 * class.cs (Property): Abstract or extern properties have no bodies.
16398 * parameter.cs (GetParameterInfo): return a zero-sized array.
16400 * class.cs (TypeContainer.MethodModifiersValid): Move all the
16401 method modifier validation to the typecontainer so we can reuse
16402 this on properties.
16404 (MethodCore.ParameterTypes): return an empty sized array of types.
16406 (Property.Define): Test property modifier validity.
16408 Add tests for sealed/override too.
16410 (Method.Emit): abstract or extern methods have no bodies.
16412 2001-12-14 Ravi Pratap <ravi@ximian.com>
16414 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
16417 (Method::Define, ::Emit): Modify accordingly.
16419 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
16421 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
16423 * makefile: Pass in /unsafe.
16425 2001-12-13 Miguel de Icaza <miguel@ximian.com>
16427 * class.cs (MakeKey): Kill routine.
16429 * class.cs (TypeContainer.Define): Correctly define explicit
16430 method implementations (they require the full interface name plus
16433 * typemanager.cs: Deply the PtrHashtable here and stop using the
16434 lame keys. Things work so much better.
16436 This of course broke everyone who depended on `RegisterMethod' to
16437 do the `test for existance' test. This has to be done elsewhere.
16439 * support.cs (PtrHashtable): A hashtable that avoid comparing with
16440 the object stupid Equals method (because, that like fails all over
16441 the place). We still do not use it.
16443 * class.cs (TypeContainer.SetRequiredInterface,
16444 TypeContainer.RequireMethods): Killed these two routines and moved
16445 all the functionality to RegisterRequiredImplementations.
16447 (TypeContainer.RegisterRequiredImplementations): This routine now
16448 registers all the implementations required in an array for the
16449 interfaces and abstract methods. We use an array of structures
16450 which can be computed ahead of time to reduce memory usage and we
16451 also assume that lookups are cheap as most classes will not
16452 implement too many interfaces.
16454 We also avoid creating too many MethodSignatures.
16456 (TypeContainer.IsInterfaceMethod): Update and optionally does not
16457 clear the "pending" bit if we find that there are problems with
16460 (TypeContainer.VerifyPendingMethods): Update to report errors of
16461 methods that look like implementations but are not.
16463 (TypeContainer.Define): Add support for explicit interface method
16466 2001-12-12 Miguel de Icaza <miguel@ximian.com>
16468 * typemanager.cs: Keep track of the parameters here instead of
16469 being a feature of the TypeContainer.
16471 * class.cs: Drop the registration of parameters here, as
16472 InterfaceMethods are also interface declarations.
16474 * delegate.cs: Register methods with the TypeManager not only with
16475 the TypeContainer. This code was buggy.
16477 * interface.cs: Full registation here.
16479 2001-12-11 Miguel de Icaza <miguel@ximian.com>
16481 * expression.cs: Remove reducer for binary expressions, it can not
16484 * const.cs: Put here the code that used to go into constant.cs
16486 * constant.cs: Put here the code for constants, this is a new base
16487 class for Literals.
16489 * literal.cs: Make Literal derive from Constant.
16491 2001-12-09 Miguel de Icaza <miguel@ximian.com>
16493 * statement.cs (Return.Emit): Report error 157 if the user
16494 attempts to return from a finally block.
16496 (Return.Emit): Instead of emitting a return, jump to the end of
16499 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
16500 LocalBuilder to store the result of the function. ReturnLabel is
16501 the target where we jump.
16504 2001-12-09 Radek Doulik <rodo@ximian.com>
16506 * cs-parser.jay: remember alias in current namespace
16508 * ecore.cs (SimpleName::DoResolve): use aliases for types or
16511 * class.cs (LookupAlias): lookup alias in my_namespace
16513 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
16515 (LookupAlias): lookup alias in this and if needed in parent
16518 2001-12-08 Miguel de Icaza <miguel@ximian.com>
16522 * rootcontext.cs: (ModuleBuilder) Made static, first step into
16523 making things static. I need this to avoid passing the
16524 TypeContainer when calling ParameterType.
16526 * support.cs (InternalParameters.ParameterType): Remove ugly hack
16527 that did string manipulation to compute the type and then call
16528 GetType. Use Parameter.ParameterType instead.
16530 * cs-tokenizer.cs: Consume the suffix for floating values.
16532 * expression.cs (ParameterReference): figure out whether this is a
16533 reference parameter or not. Kill an extra variable by computing
16534 the arg_idx during emission.
16536 * parameter.cs (Parameters.GetParameterInfo): New overloaded
16537 function that returns whether a parameter is an out/ref value or not.
16539 (Parameter.ParameterType): The type of the parameter (base,
16540 without ref/out applied).
16542 (Parameter.Resolve): Perform resolution here.
16543 (Parameter.ExternalType): The full type (with ref/out applied).
16545 * statement.cs (Using.Emit, Using.EmitExpression): Implement
16546 support for expressions on the using statement.
16548 2001-12-07 Miguel de Icaza <miguel@ximian.com>
16550 * statement.cs (Using.EmitLocalVariableDecls): Split the
16551 localvariable handling of the using statement.
16553 (Block.EmitMeta): Keep track of variable count across blocks. We
16554 were reusing slots on separate branches of blocks.
16556 (Try.Emit): Emit the general code block, we were not emitting it.
16558 Check the type of the declaration to be an IDisposable or
16559 something that can be implicity converted to it.
16561 Emit conversions if required.
16563 * ecore.cs (EmptyExpression): New utility class.
16564 (Expression.ImplicitConversionExists): New utility function.
16566 2001-12-06 Miguel de Icaza <miguel@ximian.com>
16568 * statement.cs (Using): Implement.
16570 * expression.cs (LocalVariableReference): Support read only variables.
16572 * statement.cs: Remove the explicit emit for the Leave opcode.
16573 (VariableInfo): Add a readonly field.
16575 2001-12-05 Miguel de Icaza <miguel@ximian.com>
16577 * ecore.cs (ConvCast): new class used to encapsulate the various
16578 explicit integer conversions that works in both checked and
16579 unchecked contexts.
16581 (Expression.ConvertNumericExplicit): Use new ConvCast class to
16582 properly generate the overflow opcodes.
16584 2001-12-04 Miguel de Icaza <miguel@ximian.com>
16586 * statement.cs: The correct type for the EmptyExpression is the
16587 element_type, not the variable type. Ravi pointed this out.
16589 2001-12-04 Ravi Pratap <ravi@ximian.com>
16591 * class.cs (Method::Define): Handle PInvoke methods specially
16592 by using DefinePInvokeMethod instead of the usual one.
16594 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
16595 above to do the task of extracting information and defining the method.
16597 2001-12-04 Ravi Pratap <ravi@ximian.com>
16599 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
16600 of the condition for string type.
16602 (Emit): Move that here.
16604 (ArrayCreation::CheckIndices): Keep string literals in their expression
16607 (EmitDynamicInitializers): Handle strings appropriately.
16609 2001-12-04 Miguel de Icaza <miguel@ximian.com>
16611 * codegen.cs (EmitContext): Replace multiple variables with a
16612 single pointer to the current Switch statement.
16614 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
16617 2001-12-03 Miguel de Icaza <miguel@ximian.com>
16621 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
16624 (Foreach.Emit): Foreach on arrays was not setting
16625 up the loop variables (for break/continue).
16627 (GotoCase): Semi-implented.
16629 2001-12-03 Ravi Pratap <ravi@ximian.com>
16631 * attribute.cs (CheckAttribute): Handle system attributes by using
16632 Attribute.GetAttributes to examine information we need.
16634 (GetValidPlaces): Same here.
16636 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
16638 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
16640 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
16642 (Method::Define): Set appropriate flags if we have a DllImport attribute.
16644 (Method::Emit): Handle the case when we are a PInvoke method.
16646 2001-12-03 Miguel de Icaza <miguel@ximian.com>
16648 * expression.cs: Use ResolveWithSimpleName on compound names.
16650 2001-12-02 Ravi Pratap <ravi@ximian.com>
16652 * constant.cs (EmitConstant): Make sure we resolve the associated expression
16653 before trying to reduce it.
16655 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
16657 * constant.cs (LookupConstantValue): Implement.
16659 (EmitConstant): Use the above in emitting the constant.
16661 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
16662 that are user-defined by doing a LookupConstantValue on them.
16664 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
16667 2001-11-29 Miguel de Icaza <miguel@ximian.com>
16669 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
16671 (BaseAccess.DoResolve): Implement.
16673 (MemberAccess.DoResolve): Split this routine into a
16674 ResolveMemberAccess routine that can be used independently
16676 2001-11-28 Miguel de Icaza <miguel@ximian.com>
16678 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
16679 As that share bits of the implementation. Is returns a boolean,
16680 while As returns the Type that is being probed.
16682 2001-12-01 Ravi Pratap <ravi@ximian.com>
16684 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
16685 instead of a Literal - much easier.
16687 (EnumInTransit): Remove - utterly useless :-)
16689 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
16691 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
16693 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
16694 chain when we have no associated expression.
16696 2001-11-30 Ravi Pratap <ravi@ximian.com>
16698 * constant.cs (Define): Use Location while reporting the errror.
16700 Also emit a warning when 'new' is used and there is no inherited
16703 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
16706 (LookupEnumValue): Implement to lookup an enum member's value and define it
16709 (Populate): Re-write accordingly to use the above routine.
16711 2001-11-27 Miguel de Icaza <miguel@ximian.com>
16713 * expression.cs (This): Fix prototype for DoResolveLValue to
16714 override the base class DoResolveLValue.
16716 * cs-parser.cs: Report errors cs574 and cs575 (destructor
16719 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
16720 (we need to load the address of the field here). This fixes
16723 (FieldExpr.DoResolveLValue): Call the DoResolve
16724 function to initialize the Instance expression.
16726 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
16727 correctly the GetEnumerator operation on a value type.
16729 * cs-parser.jay: Add more simple parsing error catches.
16731 * statement.cs (Switch): Add support for string switches.
16732 Handle null specially.
16734 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
16736 2001-11-28 Ravi Pratap <ravi@ximian.com>
16738 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
16740 (declare_local_constant): New helper function.
16742 * statement.cs (AddConstant): Keep a separate record of constants
16744 (IsConstant): Implement to determine if a variable is a constant.
16746 (GetConstantExpression): Implement.
16748 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
16750 * statement.cs (IsVariableDefined): Re-write.
16752 2001-11-27 Ravi Pratap <ravi@ximian.com>
16754 * class.cs (TypeContainer::FindMembers): Look for constants
16755 in the case when we are looking for MemberTypes.Field
16757 * expression.cs (MemberAccess::DoResolve): Check that in the
16758 case we are a FieldExpr and a Literal, we are not being accessed
16759 by an instance reference.
16761 * cs-parser.jay (local_constant_declaration): Implement.
16763 (declaration_statement): Implement for constant declarations.
16765 2001-11-26 Miguel de Icaza <miguel@ximian.com>
16767 * statement.cs (Switch): Catch double defaults.
16769 (Switch): More work on the switch() statement
16770 implementation. It works for integral values now, need to finish
16774 2001-11-24 Miguel de Icaza <miguel@ximian.com>
16776 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
16777 integer literals into other integer literals. To be used by
16780 2001-11-24 Ravi Pratap <ravi@ximian.com>
16782 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
16785 (EmitDynamicInitializers): Cope with the above since we extract data
16786 directly from ArrayData now.
16788 (ExpectInitializers): Keep track of whether initializers are mandatory
16791 (Bounds): Make it a hashtable to prevent the same dimension being
16792 recorded for every element in that dimension.
16794 (EmitDynamicInitializers): Fix bug which prevented the Set array method
16797 Also fix bug which was causing the indices to be emitted in the reverse
16800 2001-11-24 Miguel de Icaza <miguel@ximian.com>
16802 * expression.cs (ArrayCreation): Implement the bits that Ravi left
16803 unfinished. They do not work, because the underlying code is
16806 2001-11-22 Miguel de Icaza <miguel@ximian.com>
16808 * cs-parser.jay: Remove bogus fixme.
16810 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
16811 on Switch statement.
16813 2001-11-23 Ravi Pratap <ravi@ximian.com>
16815 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
16818 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
16819 parameter. Apparently, any expression is allowed.
16821 (ValidateInitializers): Update accordingly.
16823 (CheckIndices): Fix some tricky bugs thanks to recursion.
16825 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
16826 I was being completely brain-dead.
16828 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
16829 and re-write acordingly.
16831 (DelegateInvocation): Re-write accordingly.
16833 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
16835 (MakeByteBlob): Handle types more correctly.
16837 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
16838 initialization from expressions but it is incomplete because I am a complete
16841 2001-11-22 Miguel de Icaza <miguel@ximian.com>
16843 * statement.cs (If.Emit): Fix a bug that generated incorrect code
16844 on If. Basically, we have to return `true' (ie, we do return to
16845 our caller) only if both branches of the if return.
16847 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
16848 short-circuit operators, handle them as short circuit operators.
16850 (Cast.DoResolve): Resolve type.
16851 (Cast.Cast): Take an expression as the target type.
16853 * cs-parser.jay (cast_expression): Remove old hack that only
16854 allowed a limited set of types to be handled. Now we take a
16855 unary_expression and we resolve to a type during semantic
16858 Use the grammar productions from Rhys to handle casts (this is
16859 not complete like Rhys syntax yet, we fail to handle that corner
16860 case that C# has regarding (-x), but we will get there.
16862 2001-11-22 Ravi Pratap <ravi@ximian.com>
16864 * class.cs (EmitFieldInitializer): Take care of the case when we have a
16865 field which is an array type.
16867 * cs-parser.jay (declare_local_variables): Support array initialization too.
16869 * typemanager.cs (MakeKey): Implement.
16871 (everywhere): Use the above appropriately.
16873 * cs-parser.jay (for_statement): Update for array initialization while
16874 declaring variables.
16876 * ecore.cs : The error message was correct, it's the variable's names that
16877 were misleading ;-) Make the code more readable.
16879 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
16880 the correct type etc.
16882 (ConvertExplicit): Handle Enum types by examining the underlying type.
16884 2001-11-21 Ravi Pratap <ravi@ximian.com>
16886 * parameter.cs (GetCallingConvention): Always return
16887 CallingConventions.Standard for now.
16889 2001-11-22 Miguel de Icaza <miguel@ximian.com>
16891 * expression.cs (Binary.ResolveOperator): Update the values of `l'
16892 and `r' after calling DoNumericPromotions.
16894 * ecore.cs: Fix error message (the types were in the wrong order).
16896 * statement.cs (Foreach.ProbeCollectionType): Need to pass
16897 BindingFlags.Instance as well
16899 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
16900 implicit int literal conversion in an empty cast so that we
16901 propagate the right type upstream.
16903 (UnboxCast): new class used to unbox value types.
16904 (Expression.ConvertExplicit): Add explicit type conversions done
16907 (Expression.ImplicitNumericConversion): Oops, forgot to test for
16908 the target type before applying the implicit LongLiterals to ULong
16911 2001-11-21 Miguel de Icaza <miguel@ximian.com>
16913 * cs-parser.jay (for_statement): Reworked the way For works: now
16914 we declare manually any variables that are introduced in
16915 for_initializer to solve the problem of having out-of-band code
16916 emition (that is what got for broken).
16918 (declaration_statement): Perform the actual variable declaration
16919 that used to be done in local_variable_declaration here.
16921 (local_variable_declaration): Do not declare anything, just pass
16922 the information on a DictionaryEntry
16924 2001-11-20 Ravi Pratap <ravi@ximian.com>
16926 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
16927 re-write of the logic to now make it recursive.
16929 (UpdateIndices): Re-write accordingly.
16931 Store element data in a separate ArrayData list in the above methods.
16933 (MakeByteBlob): Implement to dump the array data into a byte array.
16935 2001-11-19 Ravi Pratap <ravi@ximian.com>
16937 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
16940 * constant.cs (Define): Implement.
16942 (EmitConstant): Re-write fully.
16944 Pass in location info.
16946 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
16949 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
16950 DictionaryEntry since we need location info too.
16952 (constant_declaration): Update accordingly.
16954 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
16955 code into another method : UpdateIndices.
16957 2001-11-18 Ravi Pratap <ravi@ximian.com>
16959 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
16960 some type checking etc.
16962 2001-11-17 Ravi Pratap <ravi@ximian.com>
16964 * expression.cs (ArrayCreation::ValidateInitializers): Implement
16965 bits to provide dimension info if the user skips doing that.
16967 Update second constructor to store the rank correctly.
16969 2001-11-16 Ravi Pratap <ravi@ximian.com>
16971 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
16972 and try to implement.
16974 * ../errors/cs0150.cs : Add.
16976 * ../errors/cs0178.cs : Add.
16978 2001-11-16 Miguel de Icaza <miguel@ximian.com>
16980 * statement.cs: Implement foreach on multi-dimensional arrays.
16982 * parameter.cs (Parameters.GetParameterByName): Also lookup the
16983 name of the params argument.
16985 * expression.cs: Use EmitStoreOpcode to get the right opcode while
16986 initializing the array.
16988 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
16989 we can use this elsewhere.
16991 * statement.cs: Finish implementation of foreach for single
16994 * cs-parser.jay: Use an out-of-band stack to pass information
16995 around, I wonder why I need this.
16997 foreach_block: Make the new foreach_block the current_block.
16999 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
17000 function used to return a static Parameters structure. Used for
17001 empty parameters, as those are created very frequently.
17003 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
17005 2001-11-15 Ravi Pratap <ravi@ximian.com>
17007 * interface.cs : Default modifier is private, not public. The
17008 make verify test passes again.
17010 2001-11-15 Ravi Pratap <ravi@ximian.com>
17012 * support.cs (ReflectionParameters): Fix logic to determine
17013 whether the last parameter is a params one. Test 9 passes again.
17015 * delegate.cs (Populate): Register the builders we define with
17016 RegisterParameterForBuilder. Test 19 passes again.
17018 * cs-parser.jay (property_declaration): Reference $6 instead
17019 of $$ to get at the location.
17021 (indexer_declaration): Similar stuff.
17023 (attribute): Ditto.
17025 * class.cs (Property): Register parameters for the Get and Set methods
17026 if they exist. Test 23 passes again.
17028 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
17029 call to EmitArguments as we are sure there aren't any params arguments.
17030 Test 32 passes again.
17032 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
17033 IndexOutOfRangeException.
17035 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
17036 Test 33 now passes again.
17038 2001-11-15 Miguel de Icaza <miguel@ximian.com>
17040 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
17041 broke a bunch of things. Will have to come up with a better way
17042 of tracking locations.
17044 * statement.cs: Implemented foreach for single dimension arrays.
17046 2001-11-09 Miguel de Icaza <miguel@ximian.com>
17048 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
17049 an error. This removes the lookup from the critical path.
17051 * cs-parser.jay: Removed use of temporary_loc, which is completely
17054 2001-11-14 Miguel de Icaza <miguel@ximian.com>
17056 * support.cs (ReflectionParameters.ParameterModifier): Report
17057 whether the argument is a PARAMS argument or not.
17059 * class.cs: Set the attribute `ParamArrayAttribute' on the
17060 parameter argument.
17062 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
17063 and cons_param_array_attribute (ConstructorInfo for
17064 ParamArrayAttribute).,
17066 * codegen.cs: Emit the return using the `Return' statement, that
17067 way we can report the error correctly for missing return values.
17069 * class.cs (Method.Emit): Clean up.
17071 * expression.cs (Argument.Resolve): Take another argument: the
17072 location where this argument is used. Notice that this is not
17073 part of the "Argument" class as to reduce the size of the
17074 structure (we know the approximate location anyways).
17076 Test if the argument is a variable-reference, if not, then
17077 complain with a 206.
17079 (Argument.Emit): Emit addresses of variables.
17081 (Argument.FullDesc): Simplify.
17083 (Invocation.DoResolve): Update for Argument.Resolve.
17085 (ElementAccess.DoResolve): ditto.
17087 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
17088 method should be virtual, as this method is always virtual.
17090 (NewDelegate.DoResolve): Update for Argument.Resolve.
17092 * class.cs (ConstructorInitializer.DoResolve): ditto.
17094 * attribute.cs (Attribute.Resolve): ditto.
17096 2001-11-13 Miguel de Icaza <miguel@ximian.com>
17098 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
17100 * expression.cs (ParameterReference): Drop IStackStorage and implement
17101 IAssignMethod instead.
17103 (LocalVariableReference): ditto.
17105 * ecore.cs (FieldExpr): Drop IStackStorage and implement
17106 IAssignMethod instead.
17108 2001-11-13 Miguel de Icaza <miguel@ximian.com>
17110 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
17111 enumerations that are used in heavily used structures derive from
17112 byte in a laughable and pathetic attempt to reduce memory usage.
17113 This is the kind of pre-optimzations that you should not do at
17114 home without adult supervision.
17116 * expression.cs (UnaryMutator): New class, used to handle ++ and
17117 -- separatedly from the other unary operators. Cleans up the
17118 code, and kills the ExpressionStatement dependency in Unary.
17120 (Unary): Removed `method' and `Arguments' from this class, making
17121 it smaller, and moving it all to SimpleCall, so I can reuse this
17122 code in other locations and avoid creating a lot of transient data
17123 strucutres when not required.
17125 * cs-parser.jay: Adjust for new changes.
17127 2001-11-11 Miguel de Icaza <miguel@ximian.com>
17129 * enum.cs (Enum.Populate): If there is a failure during
17132 * cs-parser.jay (opt_enum_base): we used to catch type errors
17133 here, but this is really incorrect. The type error should be
17134 catched during semantic analysis.
17136 2001-12-11 Ravi Pratap <ravi@ximian.com>
17138 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
17139 current_local_parameters as expected since I, in my stupidity, had forgotten
17142 * attribute.cs (GetValidPlaces): Fix stupid bug.
17144 * class.cs (Method::Emit): Perform check on applicability of attributes.
17146 (Constructor::Emit): Ditto.
17148 (Field::Emit): Ditto.
17150 (Field.Location): Store location information.
17152 (Property, Event, Indexer, Operator): Ditto.
17154 * cs-parser.jay (field_declaration): Pass in location for each field.
17156 * ../errors/cs0592.cs : Add.
17158 2001-11-12 Ravi Pratap <ravi@ximian.com>
17160 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
17162 (InitCoreTypes): Update accordingly.
17164 (RegisterAttrType, LookupAttr): Implement.
17166 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
17167 info about the same.
17169 (Resolve): Update to populate the above as necessary.
17171 (Error592): Helper.
17173 (GetValidPlaces): Helper to the above.
17175 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
17177 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
17179 2001-11-12 Ravi Pratap <ravi@ximian.com>
17181 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
17183 * ../errors/cs0617.cs : Add.
17185 2001-11-11 Ravi Pratap <ravi@ximian.com>
17187 * enum.cs (Emit): Rename to Populate to be more consistent with what
17188 we expect it to do and when exactly it is called.
17190 * class.cs, rootcontext.cs : Update accordingly.
17192 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
17193 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
17195 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
17197 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
17198 of a fieldinfo using the above, when dealing with a FieldBuilder.
17200 2001-11-10 Ravi Pratap <ravi@ximian.com>
17202 * ../errors/cs0031.cs : Add.
17204 * ../errors/cs1008.cs : Add.
17206 * ../errrors/cs0543.cs : Add.
17208 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
17211 (FindMembers): Implement.
17213 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
17214 enums and delegates too.
17216 (enum_types): Rename to builder_to_enum.
17218 (delegate_types): Rename to builder_to_delegate.
17220 * delegate.cs (FindMembers): Implement.
17222 2001-11-09 Ravi Pratap <ravi@ximian.com>
17224 * typemanager.cs (IsEnumType): Implement.
17226 * enum.cs (Emit): Re-write parts to account for the underlying type
17227 better and perform checking etc.
17229 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
17230 of the underlying type.
17232 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
17235 * enum.cs (error31): Helper to report error #31.
17237 * cs-parser.jay (enum_declaration): Store location of each member too.
17239 * enum.cs (member_to_location): New hashtable.
17241 (AddEnumMember): Update location hashtable.
17243 (Emit): Use the location of each member while reporting errors.
17245 2001-11-09 Miguel de Icaza <miguel@ximian.com>
17247 * cs-parser.jay: A for_initializer if is a
17248 local_variable_declaration really ammount to have an implicit
17249 block with the variable declaration and no initializer for for.
17251 * statement.cs (For.Emit): Cope with null initializers.
17253 This fixes the infinite loop on for initializers.
17255 2001-11-08 Miguel de Icaza <miguel@ximian.com>
17257 * enum.cs: More cleanup.
17259 * ecore.cs: Remove dead code.
17261 * class.cs (Property.Emit): More simplification.
17262 (Event.Emit): ditto.
17264 Reworked to have less levels of indentation.
17266 2001-11-08 Ravi Pratap <ravi@ximian.com>
17268 * class.cs (Property): Emit attributes.
17278 * enum.cs (Emit): Ditto.
17280 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
17283 * class.cs (Field, Event, etc.): Move attribute generation into the
17284 Emit method everywhere.
17286 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
17287 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
17288 as we had no way of defining nested enums !
17290 * rootcontext.cs : Adjust code accordingly.
17292 * typemanager.cs (AddEnumType): To keep track of enum types separately.
17294 2001-11-07 Ravi Pratap <ravi@ximian.com>
17296 * expression.cs (EvalConstantExpression): Move into ecore.cs
17298 * enum.cs (Enum): Rename some members and make them public and readonly
17299 according to our convention.
17301 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
17304 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
17306 (Enum::Emit): Write a simple version for now which doesn't try to compute
17307 expressions. I shall modify this to be more robust in just a while.
17309 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
17311 (TypeContainer::CloseType): Create the Enum types too.
17313 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
17315 * expression.cs (EvalConstantExpression): Get rid of completely.
17317 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
17318 user-defined values and other cases.
17320 (IsValidEnumLiteral): Helper function.
17322 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
17323 out there in the case we had a literal FieldExpr.
17325 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
17327 (Literalize): Revamp a bit to take two arguments.
17329 (EnumLiteral): New class which derives from Literal to wrap enum literals.
17331 2001-11-06 Ravi Pratap <ravi@ximian.com>
17333 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
17335 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
17337 (Resolve): Use the above to ensure we have proper initializers.
17339 2001-11-05 Ravi Pratap <ravi@ximian.com>
17341 * expression.cs (Expression::EvalConstantExpression): New method to
17342 evaluate constant expressions.
17344 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
17346 2001-11-07 Miguel de Icaza <miguel@ximian.com>
17348 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
17351 (Binary.ResolveOperator): Handle operator != (object a, object b)
17352 and operator == (object a, object b);
17354 (Binary.DoNumericPromotions): Indicate whether the numeric
17355 promotion was possible.
17357 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
17360 Made the ArrayAccess implement interface IAssignMethod instead of
17361 IStackStore as the order in which arguments are passed reflects
17364 * assign.cs: Instead of using expr.ExprClass to select the way of
17365 assinging, probe for the IStackStore/IAssignMethod interfaces.
17367 * typemanager.cs: Load InitializeArray definition.
17369 * rootcontext.cs (RootContext.MakeStaticData): Used to define
17370 static data that can be used to initialize arrays.
17372 2001-11-05 Miguel de Icaza <miguel@ximian.com>
17374 * expression.cs: Handle operator== and operator!= for booleans.
17376 (Conditioal.Reduce): Implement reducer for the ?: operator.
17378 (Conditional.Resolve): Implement dead code elimination.
17380 (Binary.Resolve): Catch string literals and return a new
17381 concatenated string.
17383 (Unary.Reduce): Implement reduction of unary expressions.
17385 * ecore.cs: Split out the expression core handling here.
17387 (Expression.Reduce): New method used to perform constant folding
17388 and CSE. This is needed to support constant-expressions.
17390 * statement.cs (Statement.EmitBoolExpression): Pass true and false
17391 targets, and optimize for !x.
17393 2001-11-04 Ravi Pratap <ravi@ximian.com>
17395 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
17396 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
17397 set custom atttributes.
17399 * literal.cs (Literal::GetValue): New abstract method to return the actual
17400 value of the literal, cast as an object.
17402 (*Literal): Implement GetValue method.
17404 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
17405 expressions to the arraylist but objects of type Argument.
17407 * class.cs (TypeContainer::Emit): Emit our attributes too.
17409 (Method::Emit, Constructor::Emit): Ditto.
17411 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
17412 to be ignoring earlier.
17414 2001-11-03 Ravi Pratap <ravi@ximian.com>
17416 * attribute.cs (AttributeSection::Define): Implement to do the business
17417 of constructing a CustomAttributeBuilder.
17419 (Attribute): New trivial class. Increases readability of code.
17421 * cs-parser.jay : Update accordingly.
17423 (positional_argument_list, named_argument_list, named_argument): New rules
17425 (attribute_arguments): Use the above so that we are more correct.
17427 2001-11-02 Ravi Pratap <ravi@ximian.com>
17429 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
17430 to perform all checks for a method with a params parameter.
17432 (Invocation::OverloadResolve): Update to use the above method and therefore
17433 cope correctly with params method invocations.
17435 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
17438 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
17439 constructors in our parent too because we can't afford to miss out on
17442 * attribute.cs (AttributeSection): New name for the class Attribute
17444 Other trivial changes to improve readability.
17446 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
17447 use the new class names.
17449 2001-11-01 Ravi Pratap <ravi@ximian.com>
17451 * class.cs (Method::Define): Complete definition for params types too
17453 (Indexer::Define): Ditto.
17455 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
17456 Cope everywhere with a request for info about the array parameter.
17458 2001-11-01 Ravi Pratap <ravi@ximian.com>
17460 * tree.cs (RecordNamespace): Fix up to check for the correct key.
17462 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
17463 local_variable_type to extract the string corresponding to the type.
17465 (local_variable_type): Fixup the action to use the new helper method.
17467 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
17470 * expression.cs : Clean out code which uses the above.
17472 2001-10-31 Ravi Pratap <ravi@ximian.com>
17474 * typemanager.cs (RegisterMethod): Check if we already have an existing key
17475 and bale out if necessary by returning a false.
17477 (RegisterProperty): Ditto.
17479 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
17480 and print out appropriate error messages.
17482 * interface.cs (everywhere): Ditto.
17484 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
17485 location to constructor.
17487 * class.cs (Property, Event, Indexer): Update accordingly.
17489 * ../errors/cs111.cs : Added.
17491 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
17492 of a method, as laid down by the spec.
17494 (Invocation::OverloadResolve): Use the above method.
17496 2001-10-31 Ravi Pratap <ravi@ximian.com>
17498 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
17499 now take a TypeContainer and a Parameters object.
17501 (ParameterData): Modify return type of ParameterModifier method to be
17502 Parameter.Modifier and not a string.
17504 (ReflectionParameters, InternalParameters): Update accordingly.
17506 * expression.cs (Argument::GetParameterModifier): Same here.
17508 * support.cs (InternalParameters::ParameterType): Find a better way of determining
17509 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
17510 symbol in it at all so maybe this is only for now.
17512 2001-10-30 Ravi Pratap <ravi@ximian.com>
17514 * support.cs (InternalParameters): Constructor now takes an extra argument
17515 which is the actual Parameters class.
17517 (ParameterDesc): Update to provide info on ref/out modifiers.
17519 * class.cs (everywhere): Update call to InternalParameters to pass in
17520 the second argument too.
17522 * support.cs (ParameterData): Add ParameterModifier, which is a method
17523 to return the modifier info [ref/out etc]
17525 (InternalParameters, ReflectionParameters): Implement the above.
17527 * expression.cs (Argument::ParameterModifier): Similar function to return
17528 info about the argument's modifiers.
17530 (Invocation::OverloadResolve): Update to take into account matching modifiers
17533 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
17534 a new SetFormalParameters object which we pass to InternalParameters.
17536 2001-10-30 Ravi Pratap <ravi@ximian.com>
17538 * expression.cs (NewArray): Merge into the ArrayCreation class.
17540 2001-10-29 Ravi Pratap <ravi@ximian.com>
17542 * expression.cs (NewArray): Merge classes NewBuiltinArray and
17543 NewUserdefinedArray into one as there wasn't much of a use in having
17546 * expression.cs (Argument): Change field's name to ArgType from Type.
17548 (Type): New readonly property which returns the proper type, taking into
17549 account ref/out modifiers.
17551 (everywhere): Adjust code accordingly for the above.
17553 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
17554 whether we are emitting for a ref or out parameter.
17556 * expression.cs (Argument::Emit): Use the above field to set the state.
17558 (LocalVariableReference::Emit): Update to honour the flag and emit the
17561 * parameter.cs (Attributes): Set the correct flags for ref parameters.
17563 * expression.cs (Argument::FullDesc): New function to provide a full desc.
17565 * support.cs (ParameterData): Add method ParameterDesc to the interface.
17567 (ReflectionParameters, InternalParameters): Implement the above method.
17569 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
17572 (Invocation::FullMethodDesc): Ditto.
17574 2001-10-29 Miguel de Icaza <miguel@ximian.com>
17576 * cs-parser.jay: Add extra production for the second form of array
17579 * expression.cs (ArrayCreation): Update to reflect the above
17582 * Small changes to prepare for Array initialization.
17584 2001-10-28 Miguel de Icaza <miguel@ximian.com>
17586 * typemanager.cs (ImplementsInterface): interface might be null;
17587 Deal with this problem;
17589 Also, we do store negative hits on the cache (null values), so use
17590 this instead of calling t.GetInterfaces on the type everytime.
17592 2001-10-28 Ravi Pratap <ravi@ximian.com>
17594 * typemanager.cs (IsBuiltinType): New method to help determine the same.
17596 * expression.cs (New::DoResolve): Get rid of array creation code and instead
17597 split functionality out into different classes.
17599 (New::FormArrayType): Move into NewBuiltinArray.
17601 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
17604 (NewBuiltinArray): New class to handle creation of built-in arrays.
17606 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
17607 account creation of one-dimensional arrays.
17609 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
17611 (NewUserdefinedArray::DoResolve): Implement.
17613 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
17615 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
17616 we maintain inside the TypeManager. This is necessary to perform lookups on the
17619 (LookupType): Update to perform GetType on the module builders too.
17621 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
17623 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
17625 2001-10-23 Ravi Pratap <ravi@ximian.com>
17627 * expression.cs (New::DoResolve): Implement guts of array creation.
17629 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
17631 2001-10-27 Miguel de Icaza <miguel@ximian.com>
17633 * expression.cs: Fix bug I introduced lsat night that broke
17636 (Expression.Resolve): Report a 246 error (can not resolve name)
17637 if we find a SimpleName in the stream.
17639 (Expression.ResolveLValue): Ditto.
17641 (Expression.ResolveWithSimpleName): This function is a variant of
17642 ResolveName, this one allows SimpleNames to be returned without a
17643 warning. The only consumer of SimpleNames is MemberAccess
17645 2001-10-26 Miguel de Icaza <miguel@ximian.com>
17647 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
17648 might arrive here. I have my doubts that this is correct.
17650 * statement.cs (Lock): Implement lock statement.
17652 * cs-parser.jay: Small fixes to support `lock' and `using'
17654 * cs-tokenizer.cs: Remove extra space
17656 * driver.cs: New flag --checked, allows to turn on integer math
17659 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
17660 Threading.Monitor.Exit
17662 2001-10-23 Miguel de Icaza <miguel@ximian.com>
17664 * expression.cs (IndexerAccess::DoResolveLValue): Set the
17665 Expression Class to be IndexerAccess.
17667 Notice that Indexer::DoResolve sets the eclass to Value.
17669 2001-10-22 Miguel de Icaza <miguel@ximian.com>
17671 * class.cs (TypeContainer::Emit): Emit code for indexers.
17673 * assign.cs (IAssignMethod): New interface implemented by Indexers
17674 and Properties for handling assignment.
17676 (Assign::Emit): Simplify and reuse code.
17678 * expression.cs (IndexerAccess, PropertyExpr): Implement
17679 IAssignMethod, clean up old code.
17681 2001-10-22 Ravi Pratap <ravi@ximian.com>
17683 * typemanager.cs (ImplementsInterface): New method to determine if a type
17684 implements a given interface. Provides a nice cache too.
17686 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
17689 (ConvertReferenceExplicit): Ditto.
17691 * delegate.cs (Delegate::Populate): Update to define the parameters on the
17692 various methods, with correct names etc.
17694 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
17695 Operator.UnaryNegation.
17697 * cs-parser.jay (operator_declarator): Be a little clever in the case where
17698 we have a unary plus or minus operator.
17700 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
17703 * everywhere : update accordingly.
17705 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
17708 * class.cs (Method::Define): For the case where we are implementing a method
17709 inherited from an interface, we need to set the MethodAttributes.Final flag too.
17710 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
17712 2001-10-21 Ravi Pratap <ravi@ximian.com>
17714 * interface.cs (FindMembers): Implement to work around S.R.E
17717 * typemanager.cs (IsInterfaceType): Implement.
17719 (FindMembers): Update to handle interface types too.
17721 * expression.cs (ImplicitReferenceConversion): Re-write bits which
17722 use IsAssignableFrom as that is not correct - it doesn't work.
17724 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
17725 and accordingly override EmitStatement.
17727 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
17728 using the correct logic :-)
17730 2001-10-19 Ravi Pratap <ravi@ximian.com>
17732 * ../errors/cs-11.cs : Add to demonstrate error -11
17734 2001-10-17 Miguel de Icaza <miguel@ximian.com>
17736 * assign.cs (Assign::Resolve): Resolve right hand side first, and
17737 then pass this as a hint to ResolveLValue.
17739 * expression.cs (FieldExpr): Add Location information
17741 (FieldExpr::LValueResolve): Report assignment to readonly
17744 (Expression::ExprClassFromMemberInfo): Pass location information.
17746 (Expression::ResolveLValue): Add new method that resolves an
17749 (Expression::DoResolveLValue): Default invocation calls
17752 (Indexers): New class used to keep track of indexers in a given
17755 (IStackStore): Renamed from LValue, as it did not really describe
17756 what this did. Also ResolveLValue is gone from this interface and
17757 now is part of Expression.
17759 (ElementAccess): Depending on the element access type
17761 * typemanager.cs: Add `indexer_name_type' as a Core type
17762 (System.Runtime.CompilerServices.IndexerNameAttribute)
17764 * statement.cs (Goto): Take a location.
17766 2001-10-18 Ravi Pratap <ravi@ximian.com>
17768 * delegate.cs (Delegate::VerifyDelegate): New method to verify
17769 if two delegates are compatible.
17771 (NewDelegate::DoResolve): Update to take care of the case when
17772 we instantiate a delegate from another delegate.
17774 * typemanager.cs (FindMembers): Don't even try to look up members
17775 of Delegate types for now.
17777 2001-10-18 Ravi Pratap <ravi@ximian.com>
17779 * delegate.cs (NewDelegate): New class to take care of delegate
17782 * expression.cs (New): Split the delegate related code out into
17783 the NewDelegate class.
17785 * delegate.cs (DelegateInvocation): New class to handle delegate
17788 * expression.cs (Invocation): Split out delegate related code into
17789 the DelegateInvocation class.
17791 2001-10-17 Ravi Pratap <ravi@ximian.com>
17793 * expression.cs (New::DoResolve): Implement delegate creation fully
17794 and according to the spec.
17796 (New::DoEmit): Update to handle delegates differently.
17798 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
17799 because of which we were printing out arguments in reverse order !
17801 * delegate.cs (VerifyMethod): Implement to check if the given method
17802 matches the delegate.
17804 (FullDelegateDesc): Implement.
17806 (VerifyApplicability): Implement.
17808 * expression.cs (Invocation::DoResolve): Update to accordingly handle
17809 delegate invocations too.
17811 (Invocation::Emit): Ditto.
17813 * ../errors/cs1593.cs : Added.
17815 * ../errors/cs1594.cs : Added.
17817 * delegate.cs (InstanceExpression, TargetMethod): New properties.
17819 2001-10-16 Ravi Pratap <ravi@ximian.com>
17821 * typemanager.cs (intptr_type): Core type for System.IntPtr
17823 (InitCoreTypes): Update for the same.
17825 (iasyncresult_type, asynccallback_type): Ditto.
17827 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
17830 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
17833 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
17834 the builders for the 4 members of a delegate type :-)
17836 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
17839 * expression.cs (New::DoResolve): Implement guts for delegate creation.
17841 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
17843 2001-10-15 Miguel de Icaza <miguel@ximian.com>
17845 * statement.cs (Break::Emit): Implement.
17846 (Continue::Emit): Implement.
17848 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
17849 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
17850 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
17851 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
17854 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
17855 properties that track the label for the current loop (begin of the
17856 loop and end of the loop).
17858 2001-10-15 Ravi Pratap <ravi@ximian.com>
17860 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
17861 use of emitting anything at all.
17863 * class.cs, rootcontext.cs : Get rid of calls to the same.
17865 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
17867 (Populate): Define the constructor correctly and set the implementation
17870 * typemanager.cs (delegate_types): New hashtable to hold delegates that
17873 (AddDelegateType): Implement.
17875 (IsDelegateType): Implement helper method.
17877 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
17879 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
17880 and accordingly handle it.
17882 * delegate.cs (Populate): Take TypeContainer argument.
17883 Implement bits to define the Invoke method. However, I still haven't figured out
17884 how to take care of the native int bit :-(
17886 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
17887 Qualify the name of the delegate, not its return type !
17889 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
17892 (StandardConversionExists): Checking for array types turns out to be recursive.
17894 (ConvertReferenceExplicit): Implement array conversion.
17896 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
17898 2001-10-12 Ravi Pratap <ravi@ximian.com>
17900 * cs-parser.jay (delegate_declaration): Store the fully qualified
17901 name as it is a type declaration.
17903 * delegate.cs (ReturnType, Name): Rename members to these. Make them
17906 (DefineDelegate): Renamed from Define. Does the same thing essentially,
17907 as TypeContainer::DefineType.
17909 (Populate): Method in which all the definition of the various methods (Invoke)
17912 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
17915 (CloseDelegate): Finally creates the delegate.
17917 * class.cs (TypeContainer::DefineType): Update to define delegates.
17918 (Populate, Emit and CloseType): Do the same thing here too.
17920 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
17921 delegates in all these operations.
17923 2001-10-14 Miguel de Icaza <miguel@ximian.com>
17925 * expression.cs: LocalTemporary: a new expression used to
17926 reference a temporary that has been created.
17928 * assign.cs: Handle PropertyAccess back here, so that we can
17929 provide the proper semantic access to properties.
17931 * expression.cs (Expression::ConvertReferenceExplicit): Implement
17932 a few more explicit conversions.
17934 * modifiers.cs: `NEW' modifier maps to HideBySig.
17936 * expression.cs (PropertyExpr): Make this into an
17937 ExpressionStatement, and support the EmitStatement code path.
17939 Perform get/set error checking, clean up the interface.
17941 * assign.cs: recognize PropertyExprs as targets, and if so, turn
17942 them into toplevel access objects.
17944 2001-10-12 Miguel de Icaza <miguel@ximian.com>
17946 * expression.cs: PropertyExpr::PropertyExpr: use work around the
17949 * typemanager.cs: Keep track here of our PropertyBuilders again to
17950 work around lameness in SRE.
17952 2001-10-11 Miguel de Icaza <miguel@ximian.com>
17954 * expression.cs (LValue::LValueResolve): New method in the
17955 interface, used to perform a second resolution pass for LValues.
17957 (This::DoResolve): Catch the use of this in static methods.
17959 (This::LValueResolve): Implement.
17961 (This::Store): Remove warning, assigning to `this' in structures
17964 (Invocation::Emit): Deal with invocation of
17965 methods on value types. We need to pass the address to structure
17966 methods rather than the object itself. (The equivalent code to
17967 emit "this" for structures leaves the entire structure on the
17968 stack instead of a pointer to it).
17970 (ParameterReference::DoResolve): Compute the real index for the
17971 argument based on whether the method takes or not a `this' pointer
17972 (ie, the method is static).
17974 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
17975 value types returned from functions when we need to invoke a
17976 method on the sturcture.
17979 2001-10-11 Ravi Pratap <ravi@ximian.com>
17981 * class.cs (TypeContainer::DefineType): Method to actually do the business of
17982 defining the type in the Modulebuilder or Typebuilder. This is to take
17983 care of nested types which need to be defined on the TypeBuilder using
17984 DefineNestedMethod.
17986 (TypeContainer::GetClassBases): Implement. Essentially the code from the
17987 methods in RootContext, only ported to be part of TypeContainer.
17989 (TypeContainer::GetInterfaceOrClass): Ditto.
17991 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
17993 * interface.cs (Interface::DefineInterface): New method. Does exactly
17994 what RootContext.CreateInterface did earlier, only it takes care of nested types
17997 (Interface::GetInterfaces): Move from RootContext here and port.
17999 (Interface::GetInterfaceByName): Same here.
18001 * rootcontext.cs (ResolveTree): Re-write.
18003 (PopulateTypes): Re-write.
18005 * class.cs (TypeContainer::Populate): Populate nested types too.
18006 (TypeContainer::Emit): Emit nested members too.
18008 * typemanager.cs (AddUserType): Do not make use of the FullName property,
18009 instead just use the name argument passed in as it is already fully
18012 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
18013 to TypeContainer mapping to see if a type is user-defined.
18015 * class.cs (TypeContainer::CloseType): Implement.
18017 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
18018 the default constructor.
18020 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
18023 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
18025 * interface.cs (CloseType): Create the type here.
18027 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
18030 Remove all the methods which are now in TypeContainer.
18032 2001-10-10 Ravi Pratap <ravi@ximian.com>
18034 * delegate.cs (Define): Re-write bits to define the delegate
18037 2001-10-10 Miguel de Icaza <miguel@ximian.com>
18039 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
18041 * expression.cs (ImplicitReferenceConversion): handle null as well
18042 as a source to convert to any reference type.
18044 * statement.cs (Return): Perform any implicit conversions to
18045 expected return type.
18047 Validate use of return statement.
18049 * codegen.cs (EmitContext): Pass the expected return type here.
18051 * class.cs (Method, Constructor, Property): Pass expected return
18052 type to EmitContext.
18054 2001-10-09 Miguel de Icaza <miguel@ximian.com>
18056 * expression.cs: Make DoResolve take an EmitContext instead of a
18059 Replaced `l' and `location' for `loc', for consistency.
18061 (Error, Warning): Remove unneeded Tc argument.
18063 * assign.cs, literal.cs, constant.cs: Update to new calling
18066 * codegen.cs: EmitContext now contains a flag indicating whether
18067 code is being generated in a static method or not.
18069 * cs-parser.jay: DecomposeQI, new function that replaces the old
18070 QualifiedIdentifier. Now we always decompose the assembled
18071 strings from qualified_identifier productions into a group of
18074 2001-10-08 Miguel de Icaza <miguel@ximian.com>
18076 * rootcontext.cs: Deal with field-less struct types correctly now
18077 by passing the size option to Define Type.
18079 * class.cs: Removed hack that created one static field.
18081 2001-10-07 Miguel de Icaza <miguel@ximian.com>
18083 * statement.cs: Moved most of the code generation here.
18085 2001-10-09 Ravi Pratap <ravi@ximian.com>
18087 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
18090 (ElementAccess): Remove useless bits for now - keep checks as the spec
18093 2001-10-08 Ravi Pratap <ravi@ximian.com>
18095 * expression.cs (ElementAccess::DoResolve): Remove my crap code
18096 and start performing checks according to the spec.
18098 2001-10-07 Ravi Pratap <ravi@ximian.com>
18100 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
18101 rank_specifiers instead.
18103 (rank_specifiers): Change the order in which the rank specifiers are stored
18105 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
18107 * expression.cs (ElementAccess): Implement the LValue interface too.
18109 2001-10-06 Ravi Pratap <ravi@ximian.com>
18111 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
18112 except that user defined conversions are not included.
18114 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
18115 perform the conversion of the return type, if necessary.
18117 (New::DoResolve): Check whether we are creating an array or an object
18118 and accordingly do the needful.
18120 (New::Emit): Same here.
18122 (New::DoResolve): Implement guts of array creation.
18124 (New::FormLookupType): Helper function.
18126 2001-10-07 Miguel de Icaza <miguel@ximian.com>
18128 * codegen.cs: Removed most of the code generation here, and move the
18129 corresponding code generation bits to the statement classes.
18131 Added support for try/catch/finalize and throw.
18133 * cs-parser.jay: Added support for try/catch/finalize.
18135 * class.cs: Catch static methods having the flags override,
18136 virtual or abstract.
18138 * expression.cs (UserCast): This user cast was not really doing
18139 what it was supposed to do. Which is to be born in fully resolved
18140 state. Parts of the resolution were being performed at Emit time!
18144 2001-10-05 Miguel de Icaza <miguel@ximian.com>
18146 * expression.cs: Implicity convert the result from UserCast.
18148 2001-10-05 Ravi Pratap <ravi@ximian.com>
18150 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
18151 prevented it from working correctly.
18153 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
18154 merely ConvertImplicit.
18156 2001-10-05 Miguel de Icaza <miguel@ximian.com>
18158 * typemanager.cs: Make the LookupTypeContainer function static,
18159 and not per-instance.
18161 * class.cs: Make static FindMembers (the one that takes a Type
18164 * codegen.cs: Add EmitForeach here.
18166 * cs-parser.jay: Make foreach a toplevel object instead of the
18167 inline expansion, as we need to perform semantic analysis on it.
18169 2001-10-05 Ravi Pratap <ravi@ximian.com>
18171 * expression.cs (Expression::ImplicitUserConversion): Rename to
18172 UserDefinedConversion.
18174 (Expression::UserDefinedConversion): Take an extra argument specifying
18175 whether we look for explicit user conversions too.
18177 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
18179 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
18181 (ExplicitUserConversion): Make it a call to UserDefinedConversion
18182 with the appropriate arguments.
18184 * cs-parser.jay (cast_expression): Record location too.
18186 * expression.cs (Cast): Record location info.
18188 (Expression::ConvertExplicit): Take location argument.
18190 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
18191 to determine if we are doing explicit conversions.
18193 (UserCast::Emit): Update accordingly.
18195 (Expression::ConvertExplicit): Report an error if everything fails.
18197 * ../errors/cs0030.cs : Add.
18199 2001-10-04 Miguel de Icaza <miguel@ximian.com>
18201 * modifiers.cs: If the ABSTRACT keyword is present, also set the
18202 virtual and newslot bits.
18204 * class.cs (TypeContainer::RegisterRequiredImplementations):
18205 Record methods we need.
18207 (TypeContainer::MakeKey): Helper function to make keys for
18208 MethodBases, since the Methodbase key is useless.
18210 (TypeContainer::Populate): Call RegisterRequiredImplementations
18211 before defining the methods.
18213 Create a mapping for method_builders_to_methods ahead of time
18214 instead of inside a tight loop.
18216 (::RequireMethods): Accept an object as the data to set into the
18217 hashtable so we can report interface vs abstract method mismatch.
18219 2001-10-03 Miguel de Icaza <miguel@ximian.com>
18221 * report.cs: Make all of it static.
18223 * rootcontext.cs: Drop object_type and value_type computations, as
18224 we have those in the TypeManager anyways.
18226 Drop report instance variable too, now it is a global.
18228 * driver.cs: Use try/catch on command line handling.
18230 Add --probe option to debug the error reporting system with a test
18233 * report.cs: Add support for exiting program when a probe
18234 condition is reached.
18236 2001-10-03 Ravi Pratap <ravi@ximian.com>
18238 * expression.cs (Binary::DoNumericPromotions): Fix the case when
18239 we do a forcible conversion regardless of type, to check if
18240 ForceConversion returns a null.
18242 (Binary::error19): Use location to report error.
18244 (Unary::error23): Use location here too.
18246 * ../errors/cs0019.cs : Check in.
18248 * ../errors/cs0023.cs : Check in.
18250 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
18251 case of a non-null MethodInfo object with a length of 0 !
18253 (Binary::ResolveOperator): Flag error if overload resolution fails to find
18254 an applicable member - according to the spec :-)
18255 Also fix logic to find members in base types.
18257 (Unary::ResolveOperator): Same here.
18259 (Unary::report23): Change name to error23 and make first argument a TypeContainer
18260 as I was getting thoroughly confused between this and error19 :-)
18262 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
18263 (::FindMostEncompassedType): Implement.
18264 (::FindMostEncompassingType): Implement.
18265 (::StandardConversionExists): Implement.
18267 (UserImplicitCast): Re-vamp. We now need info about most specific
18268 source and target types so that we can do the necessary conversions.
18270 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
18271 mathematical union with no duplicates.
18273 2001-10-03 Miguel de Icaza <miguel@ximian.com>
18275 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
18276 in order from base classes to child classes, so that we can in
18277 child classes look up in our parent for method names and
18278 attributes (required for handling abstract, virtual, new, override
18279 constructs: we need to instrospect our base class, and if we dont
18280 populate the classes in order, the introspection might be
18281 incorrect. For example, a method could query its parent before
18282 the parent has any methods and would determine that the parent has
18283 no abstract methods (while it could have had them)).
18285 (RootContext::CreateType): Record the order in which we define the
18288 2001-10-02 Miguel de Icaza <miguel@ximian.com>
18290 * class.cs (TypeContainer::Populate): Also method definitions can
18291 fail now, keep track of this.
18293 (TypeContainer::FindMembers): Implement support for
18294 DeclaredOnly/noDeclaredOnly flag.
18296 (Constructor::Emit) Return the ConstructorBuilder.
18298 (Method::Emit) Return the MethodBuilder.
18299 Check for abstract or virtual methods to be public.
18301 * rootcontext.cs (RootContext::CreateType): Register all the
18302 abstract methods required for the class to be complete and the
18303 interface methods that must be implemented.
18305 * cs-parser.jay: Report error 501 (method requires body if it is
18306 not marked abstract or extern).
18308 * expression.cs (TypeOf::Emit): Implement.
18310 * typemanager.cs: runtime_handle_type, new global type.
18312 * class.cs (Property::Emit): Generate code for properties.
18314 2001-10-02 Ravi Pratap <ravi@ximian.com>
18316 * expression.cs (Unary::ResolveOperator): Find operators on base type
18317 too - we now conform exactly to the spec.
18319 (Binary::ResolveOperator): Same here.
18321 * class.cs (Operator::Define): Fix minor quirk in the tests.
18323 * ../errors/cs0215.cs : Added.
18325 * ../errors/cs0556.cs : Added.
18327 * ../errors/cs0555.cs : Added.
18329 2001-10-01 Miguel de Icaza <miguel@ximian.com>
18331 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
18332 single integer which is really efficient
18334 2001-10-01 Ravi Pratap <ravi@ximian.com>
18336 * expression.cs (Expression::ImplicitUserConversion): Use location
18337 even in the case when we are examining True operators.
18339 * class.cs (Operator::Define): Perform extensive checks to conform
18340 with the rules for operator overloading in the spec.
18342 * expression.cs (Expression::ImplicitReferenceConversion): Implement
18343 some of the other conversions mentioned in the spec.
18345 * typemanager.cs (array_type): New static member for the System.Array built-in
18348 (cloneable_interface): For System.ICloneable interface.
18350 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
18351 we start resolving the tree and populating types.
18353 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
18355 2001-10-01 Miguel de Icaza <miguel@ximian.com>
18357 * expression.cs (Expression::ExprClassFromMemberInfo,
18358 Expression::Literalize): Create literal expressions from
18359 FieldInfos which are literals.
18361 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
18362 type casts, because they were wrong. The test suite in tests
18365 (ImplicitNumericConversion): ushort to ulong requires a widening
18368 Int32 constant to long requires widening cast as well.
18370 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
18371 for integers because the type on the stack is not i4.
18373 2001-09-30 Miguel de Icaza <miguel@ximian.com>
18375 * expression.cs (report118): require location argument.
18377 * parameter.cs: Do not dereference potential null value.
18379 * class.cs: Catch methods that lack the `new' keyword when
18380 overriding a name. Report warnings when `new' is used without
18381 anything being there to override.
18383 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
18385 * class.cs: Only add constructor to hashtable if it is non-null
18386 (as now constructors can fail on define).
18388 (TypeManager, Class, Struct): Take location arguments.
18390 Catch field instance initialization in structs as errors.
18392 accepting_filter: a new filter for FindMembers that is static so
18393 that we dont create an instance per invocation.
18395 (Constructor::Define): Catch errors where a struct constructor is
18398 * cs-parser.jay: Pass location information for various new
18401 * delegate.cs (Delegate): take a location argument.
18403 * driver.cs: Do not call EmitCode if there were problesm in the
18404 Definition of the types, as many Builders wont be there.
18406 * decl.cs (Decl::Decl): Require a location argument.
18408 * cs-tokenizer.cs: Handle properly hex constants that can not fit
18409 into integers, and find the most appropiate integer for it.
18411 * literal.cs: Implement ULongLiteral.
18413 * rootcontext.cs: Provide better information about the location of
18414 failure when CreateType fails.
18416 2001-09-29 Miguel de Icaza <miguel@ximian.com>
18418 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
18421 * expression.cs (Binary::CheckShiftArguments): Add missing type
18423 (Binary::ResolveOperator): Add type to the logical and and logical
18424 or, Bitwise And/Or and Exclusive Or code paths, it was missing
18427 (Binary::DoNumericPromotions): In the case where either argument
18428 is ulong (and most signed types combined with ulong cause an
18429 error) perform implicit integer constant conversions as well.
18431 2001-09-28 Miguel de Icaza <miguel@ximian.com>
18433 * expression.cs (UserImplicitCast): Method should always be
18435 (Invocation::BetterConversion): Simplified test for IntLiteral.
18437 (Expression::ImplicitNumericConversion): Split this routine out.
18438 Put the code that performs implicit constant integer conversions
18441 (Expression::Resolve): Become a wrapper around DoResolve so we can
18442 check eclass and type being set after resolve.
18444 (Invocation::Badness): Remove this dead function
18446 (Binary::ResolveOperator): Do not compute the expensive argumnets
18447 unless we have a union for it.
18449 (Probe::Emit): Is needs to do an isinst and then
18450 compare against null.
18452 (::CanConvert): Added Location argument. If the Location argument
18453 is null (Location.Null), then we do not report errors. This is
18454 used by the `probe' mechanism of the Explicit conversion. We do
18455 not want to generate an error for something that the user
18456 explicitly requested to be casted. But the pipeline for an
18457 explicit cast first tests for potential implicit casts.
18459 So for now, if the Location is null, it means `Probe only' to
18460 avoid adding another argument. Might have to revise this
18463 (ClassCast): New class used to type cast objects into arbitrary
18464 classes (used in Explicit Reference Conversions).
18466 Implement `as' as well.
18468 Reverted all the patches from Ravi below: they were broken:
18470 * The use of `level' as a mechanism to stop recursive
18471 invocations is wrong. That was there just to catch the
18472 bug with a strack trace but not as a way of addressing
18475 To fix the problem we have to *understand* what is going
18476 on and the interactions and come up with a plan, not
18477 just get things going.
18479 * The use of the type conversion cache that I proposed
18480 last night had an open topic: How does this work across
18481 protection domains. A user defined conversion might not
18482 be public in the location where we are applying the
18483 conversion, a different conversion might be selected
18484 (ie, private A->B (better) but public B->A (worse),
18485 inside A, A->B applies, but outside it, B->A will
18488 * On top of that (ie, even if the above is solved),
18489 conversions in a cache need to be abstract. Ie, `To
18490 convert from an Int to a Short use an OpcodeCast', not
18491 `To convert from an Int to a Short use the OpcodeCast on
18492 the variable 5' (which is what this patch was doing).
18494 2001-09-28 Ravi Pratap <ravi@ximian.com>
18496 * expression.cs (Invocation::ConversionExists): Re-write to use
18497 the conversion cache
18499 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
18500 cache all conversions done, not just user-defined ones.
18502 (Invocation::BetterConversion): The real culprit. Use ConversionExists
18503 to determine if a conversion exists instead of acutually trying to
18504 perform the conversion. It's faster too.
18506 (Expression::ConvertExplicit): Modify to use ConversionExists to check
18507 and only then attempt the implicit conversion.
18509 2001-09-28 Ravi Pratap <ravi@ximian.com>
18511 * expression.cs (ConvertImplicit): Use a cache for conversions
18512 already found. Check level of recursion and bail out if necessary.
18514 2001-09-28 Miguel de Icaza <miguel@ximian.com>
18516 * typemanager.cs (string_concat_string_string, string_concat_object_object):
18517 Export standard methods that we expect for string operations.
18519 * statement.cs (Block::UsageWarning): Track usage of variables and
18520 report the errors for not used variables.
18522 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
18525 2001-09-27 Miguel de Icaza <miguel@ximian.com>
18527 * codegen.cs: remove unnneded code
18529 * expression.cs: Removed BuiltinTypeAccess class
18531 Fix the order in which implicit conversions are
18534 The previous fixed dropped support for boxed conversions (adding a
18535 test to the test suite now)
18537 (UserImplicitCast::CanConvert): Remove test for source being null,
18538 that code is broken. We should not feed a null to begin with, if
18539 we do, then we should track the bug where the problem originates
18540 and not try to cover it up here.
18542 Return a resolved expression of type UserImplicitCast on success
18543 rather than true/false. Ravi: this is what I was talking about,
18544 the pattern is to use a static method as a "constructor" for
18547 Also, do not create arguments until the very last minute,
18548 otherwise we always create the arguments even for lookups that
18549 will never be performed.
18551 (UserImplicitCast::Resolve): Eliminate, objects of type
18552 UserImplicitCast are born in a fully resolved state.
18554 * typemanager.cs (InitCoreTypes): Init also value_type
18555 (System.ValueType).
18557 * expression.cs (Cast::Resolve): First resolve the child expression.
18559 (LValue): Add new method AddressOf to be used by
18562 Change the argument of Store to take an EmitContext instead of an
18563 ILGenerator, because things like FieldExpr need to be able to call
18564 their children expression to generate the instance code.
18566 (Expression::Error, Expression::Warning): Sugar functions for
18569 (Expression::MemberLookup): Accept a TypeContainer instead of a
18570 Report as the first argument.
18572 (Expression::ResolvePrimary): Killed. I still want to improve
18573 this as currently the code is just not right.
18575 (Expression::ResolveMemberAccess): Simplify, but it is still
18578 (Unary::Resolve): Catch errors in AddressOf operators.
18580 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
18581 index to a byte for the short-version, or the compiler will choose
18582 the wrong Emit call, which generates the wrong data.
18584 (ParameterReference::Emit, ::Store): same.
18586 (FieldExpr::AddressOf): Implement.
18588 * typemanager.cs: TypeManager: made public variable instead of
18591 * driver.cs: document --fatal.
18593 * report.cs (ErrorMessage, WarningMessage): new names for the old
18594 Error and Warning classes.
18596 * cs-parser.jay (member_access): Turn built-in access to types
18597 into a normal simplename
18599 2001-09-27 Ravi Pratap <ravi@ximian.com>
18601 * expression.cs (Invocation::BetterConversion): Fix to cope
18602 with q being null, since this was introducing a bug.
18604 * expression.cs (ConvertImplicit): Do built-in conversions first.
18606 2001-09-27 Ravi Pratap <ravi@ximian.com>
18608 * expression.cs (UserImplicitCast::Resolve): Fix bug.
18610 2001-09-27 Ravi Pratap <ravi@ximian.com>
18612 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
18613 I had introduced long ago (what's new ?).
18615 * expression.cs (UserImplicitCast::CanConvert): Static method to do
18616 the work of all the checking.
18617 (ConvertImplicit): Call CanConvert and only then create object if necessary.
18618 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
18620 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
18621 that is the right way.
18623 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
18624 overloading resolution. Use everywhere instead of cutting and pasting code.
18626 (Binary::ResolveOperator): Use MakeUnionSet.
18628 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
18629 we have to convert to bool types. Not complete yet.
18631 2001-09-27 Miguel de Icaza <miguel@ximian.com>
18633 * typemanager.cs (TypeManager::CSharpName): support ushort.
18635 * expression.cs (Expression::TryImplicitIntConversion): Attempts
18636 to provide an expression that performsn an implicit constant int
18637 conversion (section 6.1.6).
18638 (Expression::ConvertImplicitRequired): Reworked to include
18639 implicit constant expression conversions.
18641 (Expression::ConvertNumericExplicit): Finished.
18643 (Invocation::Emit): If InstanceExpression is null, then it means
18644 that we perform a call on this.
18646 2001-09-26 Miguel de Icaza <miguel@ximian.com>
18648 * expression.cs (Unary::Emit): Remove some dead code.
18649 (Probe): Implement Resolve and Emit for `is'.
18650 (Expression::ConvertImplicitRequired): Attempt to do constant
18651 expression conversions here. Maybe should be moved to
18652 ConvertImplicit, but I am not sure.
18653 (Expression::ImplicitLongConstantConversionPossible,
18654 Expression::ImplicitIntConstantConversionPossible): New functions
18655 that tell whether is it possible to apply an implicit constant
18656 expression conversion.
18658 (ConvertNumericExplicit): Started work on explicit numeric
18661 * cs-parser.jay: Update operator constants.
18663 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
18664 (Parameters::GetSignature): Hook up VerifyArgs here.
18665 (Parameters::VerifyArgs): Verifies that no two arguments have the
18668 * class.cs (Operator): Update the operator names to reflect the
18669 ones that the spec expects (as we are just stringizing the
18672 * expression.cs (Unary::ResolveOperator): Fix bug: Use
18673 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
18674 previous usage did only work for our methods.
18675 (Expression::ConvertImplicit): Handle decimal implicit numeric
18676 conversions as well.
18677 (Expression::InternalTypeConstructor): Used to invoke constructors
18678 on internal types for default promotions.
18680 (Unary::Emit): Implement special handling for the pre/post
18681 increment/decrement for overloaded operators, as they need to have
18682 the same semantics as the other operators.
18684 (Binary::ResolveOperator): ditto.
18685 (Invocation::ConversionExists): ditto.
18686 (UserImplicitCast::Resolve): ditto.
18688 2001-09-26 Ravi Pratap <ravi@ximian.com>
18690 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
18691 operator, return after emitting body. Regression tests pass again !
18693 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
18694 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
18695 (Invocation::OverloadResolve): Ditto.
18696 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
18698 * everywhere : update calls to the above methods accordingly.
18700 2001-09-26 Miguel de Icaza <miguel@ximian.com>
18702 * assign.cs (Assign): Make it inherit from ExpressionStatement.
18704 * expression.cs (ExpressionStatement): New base class used for
18705 expressions that can appear in statements, so that we can provide
18706 an alternate path to generate expression that do not leave a value
18709 (Expression::Emit, and all the derivatives): We no longer return
18710 whether a value is left on the stack or not. Every expression
18711 after being emitted leaves a single value on the stack.
18713 * codegen.cs (EmitContext::EmitStatementExpression): Use the
18714 facilties of ExpressionStatement if possible.
18716 * cs-parser.jay: Update statement_expression.
18718 2001-09-25 Miguel de Icaza <miguel@ximian.com>
18720 * driver.cs: Change the wording of message
18722 2001-09-25 Ravi Pratap <ravi@ximian.com>
18724 * expression.cs (Binary::ResolveOperator): Had forgottten to set
18725 the type of the expression to the return type of the method if
18726 we have an overloaded operator match ! The regression tests pass again !
18727 (Unary::ResolveOperator): Ditto.
18729 * expression.cs (Invocation::ConversionExists): Correct the member lookup
18730 to find "op_Implicit", not "implicit" ;-)
18731 (UserImplicitCast): New class to take care of user-defined implicit conversions.
18732 (ConvertImplicit, ForceConversion): Take TypeContainer argument
18734 * everywhere : Correct calls to the above accordingly.
18736 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
18737 (ConvertImplicit): Do user-defined conversion if it exists.
18739 2001-09-24 Miguel de Icaza <miguel@ximian.com>
18741 * assign.cs: track location.
18742 (Resolve): Use implicit conversions on assignment.
18744 * literal.cs: Oops. Not good, Emit of short access values should
18745 pass (Bytes) or the wrong argument will be selected.
18747 * expression.cs (Unary::Emit): Emit code for -expr.
18749 (Unary::ResolveOperator): Handle `Substract' for non-constants
18750 (substract from zero from the non-constants).
18751 Deal with Doubles as well.
18753 (Expression::ConvertImplicitRequired): New routine that reports an
18754 error if no implicit conversion exists.
18756 (Invocation::OverloadResolve): Store the converted implicit
18757 expressions if we make them
18759 2001-09-24 Ravi Pratap <ravi@ximian.com>
18761 * class.cs (ConstructorInitializer): Take a Location argument.
18762 (ConstructorBaseInitializer): Same here.
18763 (ConstructorThisInitializer): Same here.
18765 * cs-parser.jay : Update all calls accordingly.
18767 * expression.cs (Unary, Binary, New): Take location argument.
18768 Update accordingly everywhere.
18770 * cs-parser.jay : Update all calls to the above to take a location
18773 * class.cs : Ditto.
18775 2001-09-24 Ravi Pratap <ravi@ximian.com>
18777 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
18778 (Invocation::BetterConversion): Same here
18779 (Invocation::ConversionExists): Ditto.
18781 (Invocation::ConversionExists): Implement.
18783 2001-09-22 Ravi Pratap <ravi@ximian.com>
18785 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
18786 Also take an additional TypeContainer argument.
18788 * All over : Pass in TypeContainer as argument to OverloadResolve.
18790 * typemanager.cs (CSharpName): Update to check for the string type and return
18793 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
18796 2001-09-21 Ravi Pratap <ravi@ximian.com>
18798 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
18799 (Invocation::BetterFunction): Implement.
18800 (Invocation::BetterConversion): Implement.
18801 (Invocation::ConversionExists): Skeleton, no implementation yet.
18803 Okay, things work fine !
18805 2001-09-21 Miguel de Icaza <miguel@ximian.com>
18807 * typemanager.cs: declare and load enum_type, delegate_type and
18810 * expression.cs (Expression::Emit): Now emit returns a value that
18811 tells whether a value is left on the stack or not. This strategy
18812 might be reveted tomorrow with a mechanism that would address
18813 multiple assignments.
18814 (Expression::report118): Utility routine to report mismatches on
18817 (Unary::Report23): Report impossible type/operator combination
18820 (Unary::IsIncrementableNumber): Whether the type can be
18821 incremented or decremented with add.
18822 (Unary::ResolveOperator): Also allow enumerations to be bitwise
18824 (Unary::ResolveOperator): Implement ++, !, ~,
18826 (Invocation::Emit): Deal with new Emit convetion.
18828 * All Expression derivatives: Updated their Emit method to return
18829 whether they leave values on the stack or not.
18831 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
18832 stack for expressions that are statements.
18834 2001-09-20 Miguel de Icaza <miguel@ximian.com>
18836 * expression.cs (LValue): New interface. Must be implemented by
18838 (LocalVariableReference, ParameterReference, FieldExpr): Implement
18841 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
18842 interface for generating code, simplifies the code.
18844 2001-09-20 Ravi Pratap <ravi@ximian.com>
18846 * expression.cs (everywhere): Comment out return statements in ::Resolve
18847 methods to avoid the warnings.
18849 2001-09-20 Miguel de Icaza <miguel@ximian.com>
18851 * driver.cs (parse): Report error 2001 if we can not open the
18854 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
18857 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
18860 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
18861 otherwise nested blocks end up with the same index.
18863 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
18865 * expression.cs: Instead of having FIXMEs in the Resolve
18866 functions, throw exceptions so it is obvious that we are facing a
18869 * cs-parser.jay (invocation_expression): Pass Location information.
18871 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
18872 Use a basename for those routines because .NET does not like paths
18875 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
18878 2001-09-19 Miguel de Icaza <miguel@ximian.com>
18880 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
18881 are loading the correct data types (throws an exception if not).
18882 (TypeManager::InitCoreTypes): Use CoreLookupType
18884 * expression.cs (Unary::ResolveOperator): return the child
18885 expression for expressions which are just +expr.
18886 (Unary::ResolveOperator): Return negative literals for -LITERAL
18887 expressions (otherwise they are Unary {Literal}).
18888 (Invocation::Badness): Take into account `Implicit constant
18889 expression conversions'.
18891 * literal.cs (LongLiteral): Implement long literal class.
18892 (IntLiteral): export the `Value' of the intliteral.
18894 2001-09-19 Ravi Pratap <ravi@ximian.com>
18896 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
18898 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
18899 instead of 'Operator'
18901 * expression.cs (Binary::ResolveOperator): Update accordingly.
18902 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
18905 * cs-parser.jay (unary_expression): Update to use the new names.
18907 * gen-treedump.cs (GetUnary): Same here.
18909 * expression.cs (Unary::Resolve): Implement.
18910 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
18911 operators are found instead of making noise ;-)
18912 (Unary::ResolveOperator): New method to do precisely the same thing which
18913 Binary::ResolveOperator does for Binary expressions.
18914 (Unary.method, .Arguments): Add.
18915 (Unary::OperName): Implement.
18916 (Unary::ForceConversion): Copy and Paste !
18918 * class.cs (Operator::Define): Fix a small bug for the case when we have
18921 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
18922 for the inbuilt operators. Only overloading works for now ;-)
18924 2001-09-18 Miguel de Icaza <miguel@ximian.com>
18926 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
18927 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
18929 * expression.cs (This::Emit): Implement.
18930 (This::Resolve): Implement.
18931 (TypeOf:Resolve): Implement.
18932 (Expression::ResolveSimpleName): Add an implicit this to instance
18934 (MemberAccess::Resolve): Deal with Parameters and Fields.
18935 Bind instance variable to Field expressions.
18936 (FieldExpr::Instance): New field used to track the expression that
18937 represents the object instance.
18938 (FieldExpr::Resolve): Track potential errors from MemberLookup not
18940 (FieldExpr::Emit): Implement.
18942 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
18943 the last instruction contains a return opcode to avoid generating
18944 the last `ret' instruction (this generates correct code, and it is
18945 nice to pass the peverify output).
18947 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
18948 initializer for static and instance variables.
18949 (Constructor::Emit): Allow initializer to be null in the case of
18950 static constructors. Only emit initializer for instance
18953 (TypeContainer::FindMembers): Return a null array if there are no
18956 Also fix the code for the MemberTypes.Method branch, as it was not
18957 scanning that for operators (or tried to access null variables before).
18959 * assign.cs (Assign::Emit): Handle instance and static fields.
18963 * driver.cs: Stop compilation if there are parse errors.
18965 * cs-parser.jay (constructor_declaration): Provide default base
18966 initializer for non-static constructors.
18967 (constructor_declarator): Do not provide a default base
18968 initializers if none was specified.
18969 Catch the fact that constructors should not have parameters.
18971 * class.cs: Do not emit parent class initializers for static
18972 constructors, that should be flagged as an error.
18974 2001-09-18 Ravi Pratap <ravi@ximian.com>
18976 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
18977 Move back code into TypeContainer::Populate.
18979 2001-09-18 Ravi Pratap <ravi@ximian.com>
18981 * class.cs (TypeContainer::AddConstructor): Fix the check to
18982 compare against Name, not Basename.
18983 (Operator::OpType): Change Plus and Minus to Add and Subtract.
18985 * cs-parser.jay : Update accordingly.
18987 * class.cs (TypeContainer::FindMembers): For the case where we are searching
18988 for methods, don't forget to look into the operators too.
18989 (RegisterMethodBuilder): Helper method to take care of this for
18990 methods, constructors and operators.
18991 (Operator::Define): Completely revamp.
18992 (Operator.OperatorMethod, MethodName): New fields.
18993 (TypeContainer::Populate): Move the registering of builders into
18994 RegisterMethodBuilder.
18995 (Operator::Emit): Re-write.
18997 * expression.cs (Binary::Emit): Comment out code path to emit method
18998 invocation stuff for the case when we have a user defined operator. I am
18999 just not able to get it right !
19001 2001-09-17 Miguel de Icaza <miguel@ximian.com>
19003 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
19006 (Expression::MemberLookup): Provide a version that allows to
19007 specify the MemberTypes and BindingFlags.
19009 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
19010 so it was not fetching variable information from outer blocks.
19012 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
19013 Beforefieldinit as it was buggy.
19015 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
19016 that Ravi put here.
19018 * class.cs (Constructor::Emit): Only emit if block is not null.
19019 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
19020 deal with this by semantically definining it as if the user had
19023 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
19024 constructors as we now "emit" them at a higher level.
19026 (TypeContainer::DefineDefaultConstructor): Used to define the
19027 default constructors if none was provided.
19029 (ConstructorInitializer): Add methods Resolve and Emit.
19031 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
19033 2001-09-17 Ravi Pratap <ravi@ximian.com>
19035 * class.cs (TypeContainer::EmitDefaultConstructor): Register
19036 the default constructor builder with our hashtable for methodbuilders
19039 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
19040 and argument_count is 0 in which case we have a match.
19041 (Binary::ResolveOperator): More null checking and miscellaneous coding
19044 2001-09-17 Ravi Pratap <ravi@ximian.com>
19046 * rootcontext.cs (IsNameSpace): Compare against null.
19048 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
19050 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
19051 and Unary::Operator.
19053 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
19056 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
19057 we have overloaded operators.
19058 (Binary::ResolveOperator): Implement the part which does the operator overload
19061 * class.cs (Operator::Emit): Implement.
19062 (TypeContainer::Emit): Emit the operators we have too.
19064 * expression.cs (Binary::Emit): Update to emit the appropriate code for
19065 the case when we have a user-defined operator.
19067 2001-09-17 Miguel de Icaza <miguel@ximian.com>
19069 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
19071 2001-09-16 Ravi Pratap <ravi@ximian.com>
19073 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
19074 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
19075 (Constructor::Emit): Implement.
19076 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
19077 if we have no work to do.
19078 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
19081 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
19082 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
19084 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
19087 2001-09-15 Ravi Pratap <ravi@ximian.com>
19089 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
19091 (Tree::RecordNamespace): Method to do what the name says ;-)
19092 (Tree::Namespaces): Property to get at the namespaces hashtable.
19094 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
19097 * rootcontext.cs (IsNamespace): Fixed it :-)
19099 2001-09-14 Miguel de Icaza <miguel@ximian.com>
19101 * class.cs (TypeContainer::FindMembers): Add support for
19103 (MethodCore): New class that encapsulates both the shared aspects
19104 of a Constructor and a Method.
19105 (Method, Constructor): Factored pieces into MethodCore.
19107 * driver.cs: Added --fatal which makes errors throw exceptions.
19108 Load System assembly as well as part of the standard library.
19110 * report.cs: Allow throwing exceptions on errors for debugging.
19112 * modifiers.cs: Do not use `parent', instead use the real type
19113 container to evaluate permission settings.
19115 * class.cs: Put Ravi's patch back in. He is right, and we will
19116 have to cope with the
19118 2001-09-14 Ravi Pratap <ravi@ximian.com>
19120 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
19121 FamORAssem, not FamANDAssem.
19123 2001-09-14 Miguel de Icaza <miguel@ximian.com>
19125 * driver.cs: Added --parse option that only parses its input files
19128 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
19129 incorrect. IsTopLevel is not used to tell whether an object is
19130 root_types or not (that can be achieved by testing this ==
19131 root_types). But to see if this is a top-level *class* (not
19132 necessarly our "toplevel" container).
19134 2001-09-14 Ravi Pratap <ravi@ximian.com>
19136 * enum.cs (Enum::Define): Modify to call the Lookup method on the
19137 parent instead of a direct call to GetType.
19139 2001-09-14 Ravi Pratap <ravi@ximian.com>
19141 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
19142 Modifiers.TypeAttr. This should just be a call to that method.
19144 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
19145 object so that we can determine if we are top-level or not.
19147 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
19150 * enum.cs (Enum::Define): Ditto.
19152 * modifiers.cs (FieldAttr): Re-write.
19154 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
19155 (TypeContainer::HaveStaticConstructor): New property to provide access
19156 to precisely that info.
19158 * modifiers.cs (MethodAttr): Re-write.
19159 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
19161 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
19162 of top-level types as claimed.
19164 2001-09-13 Miguel de Icaza <miguel@ximian.com>
19166 * expression.cs (MemberLookup): Fruitless attempt to lookup
19167 constructors. Maybe I need to emit default constructors? That
19168 might be it (currently .NET emits this for me automatically).
19169 (Invocation::OverloadResolve): Cope with Arguments == null.
19170 (Invocation::EmitArguments): new function, shared by the new
19171 constructor and us.
19172 (Invocation::Emit): Handle static and instance methods. Emit
19173 proper call instruction for virtual or non-virtual invocations.
19174 (New::Emit): Implement.
19175 (New::Resolve): Implement.
19176 (MemberAccess:Resolve): Implement.
19177 (MethodGroupExpr::InstanceExpression): used conforming to the spec
19178 to track instances.
19179 (FieldExpr::Resolve): Set type.
19181 * support.cs: Handle empty arguments.
19183 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
19184 SimpleLookup): Auxiliary routines to help parse a qualifier
19187 Update qualifier_identifier rule.
19189 * codegen.cs: Removed debugging messages.
19191 * class.cs: Make this a global thing, this acts just as a "key" to
19192 objects that we might have around.
19194 (Populate): Only initialize method_builders_to_methods once.
19196 * expression.cs (PropertyExpr): Initialize type from the
19199 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
19200 Resolve pattern. Attempt to implicitly convert value to boolean.
19203 * expression.cs: Set the type for the int32/int32 argument case.
19204 (Binary::ResolveOperator): Set the return type to boolean for
19205 comparission operators
19207 * typemanager.cs: Remove debugging print code.
19209 (Invocation::Resolve): resolve type.
19211 * class.cs: Allocate a MemberInfo of the correct size, as the code
19212 elsewhere depends on the test to reflect the correct contents.
19214 (Method::) Keep track of parameters, due to System.Reflection holes
19216 (TypeContainer::Populate): Keep track of MethodBuilders to Method
19219 (TypeContainer::FindMembers): Use ArrayList and then copy an array
19220 of the exact size and return that.
19222 (Class::LookupMethodByBuilder): New function that maps
19223 MethodBuilders to its methods. Required to locate the information
19224 on methods because System.Reflection bit us again.
19226 * support.cs: New file, contains an interface ParameterData and
19227 two implementations: ReflectionParameters and InternalParameters
19228 used to access Parameter information. We will need to grow this
19231 * expression.cs (Invocation::GetParameterData): implement a cache
19232 and a wrapper around the ParameterData creation for methods.
19233 (Invocation::OverloadResolve): Use new code.
19235 2001-09-13 Ravi Pratap <ravi@ximian.com>
19237 * class.cs (TypeContainer::EmitField): Remove and move into
19238 (Field::Define): here and modify accordingly.
19239 (Field.FieldBuilder): New member.
19240 (TypeContainer::Populate): Update accordingly.
19241 (TypeContainer::FindMembers): Implement.
19243 2001-09-13 Miguel de Icaza <miguel@ximian.com>
19245 * statement.cs: (VariableInfo::VariableType): New field to be
19246 initialized with the full type once it is resolved.
19248 2001-09-12 Miguel de Icaza <miguel@ximian.com>
19250 * parameter.cs (GetParameterInfo): Use a type cache to compute
19251 things only once, and to reuse this information
19253 * expression.cs (LocalVariableReference::Emit): Implement.
19254 (OpcodeCast::Emit): fix.
19256 (ParameterReference::Resolve): Implement.
19257 (ParameterReference::Emit): Implement.
19259 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
19260 that are expressions need to stay as Expressions.
19262 * typemanager.cs (CSharpName): Returns the C# name of a type if
19265 * expression.cs (Expression::ConvertImplicit): New function that
19266 implements implicit type conversions.
19268 (Expression::ImplicitReferenceConversion): Implements implicit
19269 reference conversions.
19271 (EmptyCast): New type for transparent casts.
19273 (OpcodeCast): New type for casts of types that are performed with
19274 a sequence of bytecodes.
19276 (BoxedCast): New type used for casting value types into reference
19277 types. Emits a box opcode.
19279 (Binary::DoNumericPromotions): Implements numeric promotions of
19280 and computation of the Binary::Type.
19282 (Binary::EmitBranchable): Optimization.
19284 (Binary::Emit): Implement code emission for expressions.
19286 * typemanager.cs (TypeManager): Added two new core types: sbyte
19289 2001-09-12 Ravi Pratap <ravi@ximian.com>
19291 * class.cs (TypeContainer::FindMembers): Method which does exactly
19292 what Type.FindMembers does, only we don't have to use reflection. No
19293 implementation yet.
19295 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
19296 typecontainer objects as we need to get at them.
19297 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
19299 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
19300 typecontainer object.
19302 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
19303 of just a Report object.
19305 2001-09-11 Ravi Pratap <ravi@ximian.com>
19307 * class.cs (Event::Define): Go back to using the prefixes "add_" and
19309 (TypeContainer::Populate): Now define the delegates of the type too.
19310 (TypeContainer.Delegates): Property to access the list of delegates defined
19313 * delegates.cs (Delegate::Define): Implement partially.
19315 * modifiers.cs (TypeAttr): Handle more flags.
19317 2001-09-11 Ravi Pratap <ravi@ximian.com>
19319 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
19321 (Operator::Define): Re-write logic to get types by using the LookupType method
19322 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
19323 (Indexer::Define): Ditto.
19324 (Event::Define): Ditto.
19325 (Property::Define): Ditto.
19327 2001-09-10 Ravi Pratap <ravi@ximian.com>
19329 * class.cs (TypeContainer::Populate): Now define operators too.
19330 (TypeContainer.Operators): New property to access the list of operators
19332 (Operator.OperatorMethodBuilder): New member to hold the method builder
19333 for the operator we are defining.
19334 (Operator::Define): Implement.
19336 2001-09-10 Ravi Pratap <ravi@ximian.com>
19338 * class.cs (Event::Define): Make the prefixes of the accessor methods
19339 addOn_ and removeOn_
19341 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
19342 of the location being passed in too. Ideally, this should go later since all
19343 error reporting should be done through the Report object.
19345 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
19346 (Populate): Iterate thru the indexers we have and define them too.
19347 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
19348 for the get and set accessors.
19349 (Indexer::Define): Implement.
19351 2001-09-09 Miguel de Icaza <miguel@ximian.com>
19353 * expression.cs (Binary::Resolve): Beginning of it. I scratched
19354 my previous implementation, did not work.
19356 * typemanager.cs: Add a couple of missing types (the longs).
19358 * literal.cs: Use TypeManager.bool_type instead of getting it.
19360 * expression.cs (EventExpr): New kind of expressions.
19361 (Expressio::ExprClassFromMemberInfo): finish
19363 2001-09-08 Miguel de Icaza <miguel@ximian.com>
19365 * assign.cs: Emit stores to static fields differently.
19367 2001-09-08 Ravi Pratap <ravi@ximian.com>
19369 * Merge in changes and adjust code to tackle conflicts. Backed out my
19370 code in Assign::Resolve ;-)
19372 2001-09-08 Ravi Pratap <ravi@ximian.com>
19374 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
19375 instead Report.Error and also pass in the location.
19376 (CSharpParser::Lexer): New readonly property to return the reference
19377 to the Tokenizer object.
19378 (declare_local_variables): Use Report.Error with location instead of plain
19382 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
19383 (Operator.CheckBinaryOperator): Ditto.
19385 * cs-parser.jay (operator_declarator): Update accordingly.
19387 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
19388 (CheckBinaryOperator): Same here.
19390 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
19391 on the name without any prefixes of namespace names etc. This is because we
19392 already might have something already fully qualified like
19393 'System.Console.WriteLine'
19395 * assign.cs (Resolve): Begin implementation. Stuck ;-)
19397 2001-09-07 Ravi Pratap <ravi@ximian.com>
19399 * cs-tokenizer.cs (location): Return a string which also contains
19402 * expression.cs (ElementAccess): New class for expressions of the
19403 type 'element access.'
19404 (BaseAccess): New class for expressions of the type 'base access.'
19405 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
19408 * cs-parser.jay (element_access): Implement action.
19409 (base_access): Implement actions.
19410 (checked_expression, unchecked_expression): Implement.
19412 * cs-parser.jay (local_variable_type): Correct and implement.
19413 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
19415 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
19417 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
19418 name and the specifiers.
19420 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
19422 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
19423 making them all public ;-)
19425 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
19428 2001-09-07 Miguel de Icaza <miguel@ximian.com>
19430 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
19432 (FieldExpr, PropertyExprs): New resolved expressions.
19433 (SimpleName::MemberStaticCheck): Perform static checks for access
19434 to non-static fields on static methods. Maybe this should be
19435 generalized for MemberAccesses.
19436 (SimpleName::ResolveSimpleName): More work on simple name
19439 * cs-parser.jay (primary_expression/qualified_identifier): track
19440 the parameter index.
19442 * codegen.cs (CodeGen::Save): Catch save exception, report error.
19443 (EmitContext::EmitBoolExpression): Chain to expression generation
19444 instead of temporary hack.
19445 (::EmitStatementExpression): Put generic expression code generation.
19447 * assign.cs (Assign::Emit): Implement variable assignments to
19448 local variables, parameters and fields.
19450 2001-09-06 Miguel de Icaza <miguel@ximian.com>
19452 * statement.cs (Block::GetVariableInfo): New method, returns the
19453 VariableInfo for a variable name in a block.
19454 (Block::GetVariableType): Implement in terms of GetVariableInfo
19456 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
19457 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
19459 2001-09-06 Ravi Pratap <ravi@ximian.com>
19461 * cs-parser.jay (operator_declaration): Continue on my quest : update
19462 to take attributes argument.
19463 (event_declaration): Ditto.
19464 (enum_declaration): Ditto.
19465 (indexer_declaration): Ditto.
19467 * class.cs (Operator::Operator): Update constructor accordingly.
19468 (Event::Event): Ditto.
19470 * delegate.cs (Delegate::Delegate): Same here.
19472 * enum.cs (Enum::Enum): Same here.
19474 2001-09-05 Ravi Pratap <ravi@ximian.com>
19476 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
19478 * ../tests/cs0658.cs : New file to demonstrate error 0658.
19480 * attribute.cs (Attributes): New class to encapsulate all attributes which were
19481 being passed around as an arraylist.
19482 (Attributes::AddAttribute): Method to add attribute sections.
19484 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
19485 (struct_declaration): Update accordingly.
19486 (constant_declaration): Update.
19487 (field_declaration): Update.
19488 (method_header): Update.
19489 (fixed_parameter): Update.
19490 (parameter_array): Ditto.
19491 (property_declaration): Ditto.
19492 (destructor_declaration): Ditto.
19494 * class.cs (Struct::Struct): Update constructors accordingly.
19495 (Class::Class): Ditto.
19496 (Field::Field): Ditto.
19497 (Method::Method): Ditto.
19498 (Property::Property): Ditto.
19499 (TypeContainer::OptAttribute): update property's return type.
19501 * interface.cs (Interface.opt_attributes): New member.
19502 (Interface::Interface): Update to take the extra Attributes argument.
19504 * parameter.cs (Parameter::Parameter): Ditto.
19506 * constant.cs (Constant::Constant): Ditto.
19508 * interface.cs (InterfaceMemberBase): New OptAttributes field.
19509 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
19510 the attributes as a parameter.
19511 (InterfaceProperty): Update constructor call.
19512 (InterfaceEvent): Ditto.
19513 (InterfaceMethod): Ditto.
19514 (InterfaceIndexer): Ditto.
19516 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
19517 pass the attributes too.
19518 (interface_event_declaration): Ditto.
19519 (interface_property_declaration): Ditto.
19520 (interface_method_declaration): Ditto.
19521 (interface_declaration): Ditto.
19523 2001-09-05 Miguel de Icaza <miguel@ximian.com>
19525 * class.cs (Method::Define): Track the "static Main" definition to
19526 create an entry point.
19528 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
19529 EntryPoint if we find it.
19531 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
19532 (EmitContext::ig): Make this variable public.
19534 * driver.cs: Make the default output file be the first file name
19535 with the .exe extension.
19537 Detect empty compilations
19539 Handle various kinds of output targets. Handle --target and
19540 rename -t to --dumper.
19542 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
19543 methods inherited from Expression return now an Expression. This
19544 will is used during the tree rewriting as we resolve them during
19547 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
19548 the spec. Missing entirely is the information about
19549 accessability of elements of it.
19551 (Expression::ExprClassFromMemberInfo): New constructor for
19552 Expressions that creates a fully initialized Expression based on
19553 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
19556 (Invocation::Resolve): Begin implementing resolution of invocations.
19558 * literal.cs (StringLiteral): Implement Emit.
19560 2001-09-05 Ravi Pratap <ravi@ximian.com>
19562 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
19565 2001-09-04 Ravi Pratap <ravi@ximian.com>
19567 * cs-parser.jay (attribute_arguments): Implement actions.
19568 (attribute): Fix bug in production. Implement action.
19569 (attribute_list): Implement.
19570 (attribute_target): Implement.
19571 (attribute_target_specifier, opt_target_specifier): Implement
19572 (CheckAttributeTarget): New method to check if the attribute target
19574 (attribute_section): Implement.
19575 (opt_attributes): Implement.
19577 * attribute.cs : New file to handle attributes.
19578 (Attribute): Class to hold attribute info.
19580 * cs-parser.jay (opt_attribute_target_specifier): Remove production
19581 (attribute_section): Modify production to use 2 different rules to
19582 achieve the same thing. 1 s/r conflict down !
19583 Clean out commented, useless, non-reducing dimension_separator rules.
19585 * class.cs (TypeContainer.attributes): New member to hold list
19586 of attributes for a type.
19587 (Struct::Struct): Modify to take one more argument, the attribute list.
19588 (Class::Class): Ditto.
19589 (Field::Field): Ditto.
19590 (Method::Method): Ditto.
19591 (Property::Property): Ditto.
19593 * cs-parser.jay (struct_declaration): Update constructor call to
19594 pass in the attributes too.
19595 (class_declaration): Ditto.
19596 (constant_declaration): Ditto.
19597 (field_declaration): Ditto.
19598 (method_header): Ditto.
19599 (fixed_parameter): Ditto.
19600 (parameter_array): Ditto.
19601 (property_declaration): Ditto.
19603 * constant.cs (Constant::Constant): Update constructor similarly.
19604 Use System.Collections.
19606 * parameter.cs (Parameter::Parameter): Update as above.
19608 2001-09-02 Ravi Pratap <ravi@ximian.com>
19610 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
19611 (TypeContainer.delegates): New member to hold list of delegates.
19613 * cs-parser.jay (delegate_declaration): Implement the action correctly
19614 this time as I seem to be on crack ;-)
19616 2001-09-02 Miguel de Icaza <miguel@ximian.com>
19618 * rootcontext.cs (RootContext::IsNamespace): new function, used to
19619 tell whether an identifier represents a namespace.
19621 * expression.cs (NamespaceExpr): A namespace expression, used only
19622 temporarly during expression resolution.
19623 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
19624 utility functions to resolve names on expressions.
19626 2001-09-01 Miguel de Icaza <miguel@ximian.com>
19628 * codegen.cs: Add hook for StatementExpressions.
19630 * class.cs: Fix inverted test for static flag in methods.
19632 2001-09-02 Ravi Pratap <ravi@ximian.com>
19634 * class.cs (Operator::CheckUnaryOperator): Correct error number used
19635 to make it coincide with MS' number.
19636 (Operator::CheckBinaryOperator): Ditto.
19638 * ../errors/errors.txt : Remove error numbers added earlier.
19640 * ../errors/cs1019.cs : Test case for error # 1019
19642 * ../errros/cs1020.cs : Test case for error # 1020
19644 * cs-parser.jay : Clean out commented cruft.
19645 (dimension_separators, dimension_separator): Comment out. Ostensibly not
19646 used anywhere - non-reducing rule.
19647 (namespace_declarations): Non-reducing rule - comment out.
19649 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
19650 with TypeContainer::AddEnum.
19652 * delegate.cs : New file for delegate handling classes.
19653 (Delegate): Class for declaring delegates.
19655 * makefile : Update.
19657 * cs-parser.jay (delegate_declaration): Implement.
19659 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
19661 * class.cs (Event::Define): Implement.
19662 (Event.EventBuilder): New member.
19664 * class.cs (TypeContainer::Populate): Update to define all enums and events
19666 (Events): New property for the events arraylist we hold. Shouldn't we move to using
19667 readonly fields for all these cases ?
19669 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
19671 * class.cs (Property): Revamp to use the convention of making fields readonly.
19672 Accordingly modify code elsewhere.
19674 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
19675 the Define method of the Property class.
19677 * class.cs : Clean up applied patch and update references to variables etc. Fix
19679 (TypeContainer::Populate): Update to define all the properties we have. Also
19680 define all enumerations.
19682 * enum.cs (Define): Implement.
19684 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
19686 * cs-parser.jay (overloadable_operator): The semantic value is an
19687 enum of the Operator class.
19688 (operator_declarator): Implement actions.
19689 (operator_declaration): Implement.
19691 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
19692 validity of definitions.
19693 (Operator::CheckBinaryOperator): Static method to check for binary operators
19694 (TypeContainer::AddOperator): New method to add an operator to a type.
19696 * cs-parser.jay (indexer_declaration): Added line to actually call the
19697 AddIndexer method so it gets added ;-)
19699 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
19700 already taken care of by the MS compiler ?
19702 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
19704 * class.cs (Operator): New class for operator declarations.
19705 (Operator::OpType): Enum for the various operators.
19707 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
19709 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
19710 ostensibly handle this in semantic analysis.
19712 * cs-parser.jay (general_catch_clause): Comment out
19713 (specific_catch_clauses, specific_catch_clause): Ditto.
19714 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
19715 (catch_args, opt_catch_args): New productions.
19716 (catch_clause): Rewrite to use the new productions above
19717 (catch_clauses): Modify accordingly.
19718 (opt_catch_clauses): New production to use in try_statement
19719 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
19720 and re-write the code in the actions to extract the specific and
19721 general catch clauses by being a little smart ;-)
19723 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
19724 Hooray, try and catch statements parse fine !
19726 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
19728 * statement.cs (Block::GetVariableType): Fix logic to extract the type
19729 string from the hashtable of variables.
19731 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
19732 I end up making that mistake ;-)
19733 (catch_clauses): Fixed gross error which made Key and Value of the
19734 DictionaryEntry the same : $1 !!
19736 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
19738 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
19740 * cs-parser.jay (event_declaration): Correct to remove the semicolon
19741 when the add and remove accessors are specified.
19743 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
19745 * cs-parser.jay (IndexerDeclaration): New helper class to hold
19746 information about indexer_declarator.
19747 (indexer_declarator): Implement actions.
19748 (parsing_indexer): New local boolean used to keep track of whether
19749 we are parsing indexers or properties. This is necessary because
19750 implicit_parameters come into picture even for the get accessor in the
19751 case of an indexer.
19752 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
19754 * class.cs (Indexer): New class for indexer declarations.
19755 (TypeContainer::AddIndexer): New method to add an indexer to a type.
19756 (TypeContainer::indexers): New member to hold list of indexers for the
19759 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
19761 * cs-parser.jay (add_accessor_declaration): Implement action.
19762 (remove_accessor_declaration): Implement action.
19763 (event_accessors_declaration): Implement
19764 (variable_declarators): swap statements for first rule - trivial.
19766 * class.cs (Event): New class to hold information about event
19768 (TypeContainer::AddEvent): New method to add an event to a type
19769 (TypeContainer::events): New member to hold list of events.
19771 * cs-parser.jay (event_declaration): Implement actions.
19773 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
19775 * cs-parser.jay (dim_separators): Implement. Make it a string
19776 concatenating all the commas together, just as they appear.
19777 (opt_dim_separators): Modify accordingly
19778 (rank_specifiers): Update accordingly. Basically do the same
19779 thing - instead, collect the brackets here.
19780 (opt_rank_sepcifiers): Modify accordingly.
19781 (array_type): Modify to actually return the complete type string
19782 instead of ignoring the rank_specifiers.
19783 (expression_list): Implement to collect the expressions
19784 (variable_initializer): Implement. We make it a list of expressions
19785 essentially so that we can handle the array_initializer case neatly too.
19786 (variable_initializer_list): Implement.
19787 (array_initializer): Make it a list of variable_initializers
19788 (opt_array_initializer): Modify accordingly.
19790 * expression.cs (New::NType): Add enumeration to help us
19791 keep track of whether we have an object/delegate creation
19792 or an array creation.
19793 (New:NewType, New::Rank, New::Indices, New::Initializers): New
19794 members to hold data about array creation.
19795 (New:New): Modify to update NewType
19796 (New:New): New Overloaded contructor for the array creation
19799 * cs-parser.jay (array_creation_expression): Implement to call
19800 the overloaded New constructor.
19802 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
19804 * class.cs (TypeContainer::Constructors): Return member
19805 constructors instead of returning null.
19807 2001-08-26 Miguel de Icaza <miguel@ximian.com>
19809 * typemanager.cs (InitCoreTypes): Initialize the various core
19810 types after we have populated the type manager with the user
19811 defined types (this distinction will be important later while
19812 compiling corlib.dll)
19814 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
19815 on Expression Classification. Now all expressions have a method
19816 `Resolve' and a method `Emit'.
19818 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
19819 generation from working. Also add some temporary debugging
19822 2001-08-24 Miguel de Icaza <miguel@ximian.com>
19824 * codegen.cs: Lots of code generation pieces. This is only the
19825 beginning, will continue tomorrow with more touches of polish. We
19826 handle the fundamentals of if, while, do, for, return. Others are
19827 trickier and I need to start working on invocations soon.
19829 * gen-treedump.cs: Bug fix, use s.Increment here instead of
19832 * codegen.cs (EmitContext): New struct, used during code
19833 emission to keep a context. Most of the code generation will be
19836 * cs-parser.jay: Add embedded blocks to the list of statements of
19837 this block. So code generation proceeds in a top down fashion.
19839 2001-08-23 Miguel de Icaza <miguel@ximian.com>
19841 * statement.cs: Add support for multiple child blocks.
19843 2001-08-22 Miguel de Icaza <miguel@ximian.com>
19845 * codegen.cs (EmitCode): New function, will emit the code for a
19846 Block of code given a TypeContainer and its ILGenerator.
19848 * statement.cs (Block): Standard public readonly optimization.
19849 (Block::Block constructors): Link children.
19850 (Block::Child): Child Linker.
19851 (Block::EmitVariables): Emits IL variable declarations.
19853 * class.cs: Drop support for MethodGroups here, delay until
19855 (Method::): Applied the same simplification that I did before, and
19856 move from Properties to public readonly fields.
19857 (Method::ParameterTypes): Returns the parameter types for the
19858 function, and implements a cache that will be useful later when I
19859 do error checking and the semantic analysis on the methods is
19861 (Constructor::GetCallingConvention): Renamed from CallingConvetion
19862 and made a method, optional argument tells whether this is a class
19863 or a structure to apply the `has-this' bit.
19864 (Method::GetCallingConvention): Implement, returns the calling
19866 (Method::Define): Defines the type, a second pass is performed
19867 later to populate the methods.
19869 (Constructor::ParameterTypes): implement a cache similar to the
19870 one on Method::ParameterTypes, useful later when we do semantic
19873 (TypeContainer::EmitMethod): New method. Emits methods.
19875 * expression.cs: Removed MethodGroup class from here.
19877 * parameter.cs (Parameters::GetCallingConvention): new method.
19879 2001-08-21 Miguel de Icaza <miguel@ximian.com>
19881 * class.cs (TypeContainer::Populate): Drop RootContext from the
19884 (Constructor::CallingConvention): Returns the calling convention.
19885 (Constructor::ParameterTypes): Returns the constructor parameter
19888 (TypeContainer::AddConstructor): Keep track of default constructor
19889 and the default static constructor.
19891 (Constructor::) Another class that starts using `public readonly'
19892 instead of properties.
19894 (Constructor::IsDefault): Whether this is a default constructor.
19896 (Field::) use readonly public fields instead of properties also.
19898 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
19899 track of static constructors; If none is used, turn on
19900 BeforeFieldInit in the TypeAttributes.
19902 * cs-parser.jay (opt_argument_list): now the return can be null
19903 for the cases where there are no arguments.
19905 (constructor_declarator): If there is no implicit `base' or
19906 `this', then invoke the default parent constructor.
19908 * modifiers.cs (MethodAttr): New static function maps a set of
19909 modifiers flags into a MethodAttributes enum
19910 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
19911 MethodAttr, TypeAttr to represent the various mappings where the
19912 modifiers are used.
19913 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
19915 2001-08-19 Miguel de Icaza <miguel@ximian.com>
19917 * parameter.cs (GetParameterInfo): Fix bug where there would be no
19920 * interface.cs (PopulateIndexer): Implemented the code generator
19921 for interface indexers.
19923 2001-08-17 Miguel de Icaza <miguel@ximian.com>
19925 * interface.cs (InterfaceMemberBase): Now we track the new status
19928 (PopulateProperty): Implement property population. Woohoo! Got
19929 Methods and Properties going today.
19931 Removed all the properties for interfaces, and replaced them with
19932 `public readonly' fields.
19934 2001-08-16 Miguel de Icaza <miguel@ximian.com>
19936 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
19937 initialize their hashtables/arraylists only when they are needed
19938 instead of doing this always.
19940 * parameter.cs: Handle refs and out parameters.
19942 * cs-parser.jay: Use an ArrayList to construct the arguments
19943 instead of the ParameterCollection, and then cast that to a
19946 * parameter.cs: Drop the use of ParameterCollection and use
19947 instead arrays of Parameters.
19949 (GetParameterInfo): Use the Type, not the Name when resolving
19952 2001-08-13 Miguel de Icaza <miguel@ximian.com>
19954 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
19955 and instead use public readonly fields.
19957 * class.cs: Put back walking code for type containers.
19959 2001-08-11 Miguel de Icaza <miguel@ximian.com>
19961 * class.cs (MakeConstant): Code to define constants.
19963 * rootcontext.cs (LookupType): New function. Used to locate types
19966 2001-08-08 Miguel de Icaza <miguel@ximian.com>
19968 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
19969 this System.Reflection code is. Kudos to Microsoft
19971 * typemanager.cs: Implement a type cache and avoid loading all
19972 types at boot time. Wrap in LookupType the internals. This made
19973 the compiler so much faster. Wow. I rule!
19975 * driver.cs: Make sure we always load mscorlib first (for
19976 debugging purposes, nothing really important).
19978 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
19979 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
19981 * rootcontext.cs: Lookup types on their namespace; Lookup types
19982 on namespaces that have been imported using the `using' keyword.
19984 * class.cs (TypeContainer::TypeAttr): Virtualize.
19985 (Class::TypeAttr): Return attributes suitable for this bad boy.
19986 (Struct::TypeAttr): ditto.
19987 Handle nested classes.
19988 (TypeContainer::) Remove all the type visiting code, it is now
19989 replaced with the rootcontext.cs code
19991 * rootcontext.cs (GetClassBases): Added support for structs.
19993 2001-08-06 Miguel de Icaza <miguel@ximian.com>
19995 * interface.cs, statement.cs, class.cs, parameter.cs,
19996 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
19997 Drop use of TypeRefs, and use strings instead.
19999 2001-08-04 Miguel de Icaza <miguel@ximian.com>
20003 * class.cs (Struct::Struct): set the SEALED flags after
20004 checking the modifiers.
20005 (TypeContainer::TypeAttr): new property, returns the
20006 TypeAttributes for a class.
20008 * cs-parser.jay (type_list): Oops, list production was creating a
20009 new list of base types.
20011 * rootcontext.cs (StdLib): New property.
20012 (GetInterfaceTypeByName): returns an interface by type name, and
20013 encapsulates error handling here.
20014 (GetInterfaces): simplified.
20015 (ResolveTree): Encapsulated all the tree resolution here.
20016 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
20019 * driver.cs: Add support for --nostdlib, to avoid loading the
20020 default assemblies.
20021 (Main): Do not put tree resolution here.
20023 * rootcontext.cs: Beginning of the class resolution.
20025 2001-08-03 Miguel de Icaza <miguel@ximian.com>
20027 * rootcontext.cs: Provide better error reporting.
20029 * cs-parser.jay (interface_base): set our $$ to be interfaces.
20031 * rootcontext.cs (CreateInterface): Handle the case where there
20032 are no parent interfaces.
20034 (CloseTypes): Routine to flush types at the end.
20035 (CreateInterface): Track types.
20036 (GetInterfaces): Returns an array of Types from the list of
20037 defined interfaces.
20039 * typemanager.c (AddUserType): Mechanism to track user types (puts
20040 the type on the global type hash, and allows us to close it at the
20043 2001-08-02 Miguel de Icaza <miguel@ximian.com>
20045 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
20046 RecordInterface instead.
20048 * cs-parser.jay: Updated to reflect changes above.
20050 * decl.cs (Definition): Keep track of the TypeBuilder type that
20051 represents this type here. Not sure we will use it in the long
20052 run, but wont hurt for now.
20054 * driver.cs: Smaller changes to accomodate the new code.
20056 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
20059 * rootcontext.cs (CreateInterface): New method, used to create
20060 the System.TypeBuilder type for interfaces.
20061 (ResolveInterfaces): new entry point to resolve the interface
20063 (CodeGen): Property, used to keep track of the code generator.
20065 2001-07-26 Miguel de Icaza <miguel@ximian.com>
20067 * cs-parser.jay: Add a second production for delegate_declaration
20070 (enum_body): Put an opt_comma here instead of putting it on
20071 enum_body or enum_member_declarations so we can handle trailing
20072 commas on enumeration members. Gets rid of a shift/reduce.
20074 (type_list): Need a COMMA in the middle.
20076 (indexer_declaration): Tell tokenizer to recognize get/set
20078 * Remove old targets.
20080 * Re-add the parser target.
20082 2001-07-13 Simon Cozens <simon@simon-cozens.org>
20084 * cs-parser.jay: Add precendence rules for a number of operators
20085 ot reduce the number of shift/reduce conflicts in the grammar.
20087 2001-07-17 Miguel de Icaza <miguel@ximian.com>
20089 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
20092 Get rid of old crufty code.
20094 * rootcontext.cs: Use this to keep track of the parsed
20095 representation and the defined types available to the program.
20097 * gen-treedump.cs: adjust for new convention.
20099 * type.cs: Split out the type manager, and the assembly builder
20102 * typemanager.cs: the type manager will live here now.
20104 * cil-codegen.cs: And the code generator here.
20106 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
20108 * makefile: Fixed up for easy making.
20110 2001-07-13 Simon Cozens <simon@simon-cozens.org>
20112 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
20115 (unary_expression): Expand pre_increment_expression and
20116 post_decrement_expression to reduce a shift/reduce.
20118 2001-07-11 Simon Cozens
20120 * cs-tokenizer.cs: Hex numbers should begin with a 0.
20122 Improve allow_keyword_as_indent name.
20124 2001-06-19 Miguel de Icaza <miguel@ximian.com>
20126 * Adjustments for Beta2.
20128 2001-06-13 Miguel de Icaza <miguel@ximian.com>
20130 * decl.cs: Added `Define' abstract method.
20131 (InTransit): new property, used to catch recursive definitions.
20133 * interface.cs: Implement `Define'.
20135 * modifiers.cs: Map Modifiers.constants to
20136 System.Reflection.TypeAttribute flags.
20138 * class.cs: Keep track of types and user-defined types.
20139 (BuilderInit): New method for creating an assembly
20140 (ResolveType): New function to launch the resolution process, only
20141 used by interfaces for now.
20143 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
20144 that are inserted into the name space.
20146 2001-06-08 Miguel de Icaza <miguel@ximian.com>
20148 * ARGH. I have screwed up my tree so many times due to the use of
20149 rsync rather than using CVS. Going to fix this at once.
20151 * driver.cs: Objetify driver. Load assemblies, use assemblies to
20154 2001-06-07 Miguel de Icaza <miguel@ximian.com>
20156 * Experiment successful: Use System.Type rather that our own
20159 2001-05-25 Miguel de Icaza <miguel@ximian.com>
20161 * cs-parser.jay: Removed nsAliases from here.
20163 Use new namespaces, handle `using XXX;'
20165 * namespace.cs: Reimplemented namespace handling, use a recursive
20166 definition of the class. Now we can keep track of using clauses
20167 and catch invalid using clauses.
20169 2001-05-24 Miguel de Icaza <miguel@ximian.com>
20171 * gen-treedump.cs: Adapted for all the renaming.
20173 * expression.cs (Expression): this class now has a Type property
20174 which returns an expression Type.
20176 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
20177 `Type', as this has a different meaning now in the base
20179 2001-05-22 Miguel de Icaza <miguel@ximian.com>
20181 * interface.cs, class.cs: Removed from all the sources the
20182 references to signature computation, as we can not do method
20183 signature computation during the parsing time, as we are not
20184 trying to solve at that point distinguishing:
20188 void a (NS.Blah x) {}
20191 Which depending on the context might be valid or not, as we do not
20192 know if Blah is the same thing as NS.Blah at that point.
20194 * Redid everything so the code uses TypeRefs now instead of
20195 Types. TypeRefs are just temporary type placeholders, that need
20196 to be resolved. They initially have a pointer to a string and the
20197 current scope in which they are used. This is used later by the
20198 compiler to resolve the reference to an actual Type.
20200 * DeclSpace is no longer a CIR.Type, and neither are
20201 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
20202 are all DeclSpaces, but no Types.
20204 * type.cs (TypeRefManager): This implements the TypeRef manager,
20205 which keeps track of all the types that need to be resolved after
20206 the parsing has finished.
20208 2001-05-13 Miguel de Icaza <miguel@ximian.com>
20210 * ARGH. We are going to have to store `foreach' as a class rather
20211 than resolving it, as we need to verify error 1579 after name
20212 resolution. *OR* we could keep a flag that says `This request to
20213 IEnumerator comes from a foreach statement' which we can then use
20214 to generate the error.
20216 2001-05-10 Miguel de Icaza <miguel@ximian.com>
20218 * class.cs (TypeContainer.AddMethod): we now add methods to the
20219 MethodGroup instead of the method hashtable.
20221 * expression.cs: Add MethodGroup abstraction, which gets us one
20222 step closer to the specification in the way we handle method
20225 * cs-parser.jay (primary_expression): qualified_identifier now
20226 tried to match up an identifier to a local variable reference or
20227 to a parameter reference.
20229 current_local_parameters is now a parser global variable that
20230 points to the current parameters for the block, used during name
20233 (property_declaration): Now creates an implicit `value' argument to
20236 2001-05-09 Miguel de Icaza <miguel@ximian.com>
20238 * parameter.cs: Do not use `param' arguments as part of the
20239 signature, per the spec.
20241 2001-05-08 Miguel de Icaza <miguel@ximian.com>
20243 * decl.cs: Base class for classes, structs and interfaces. This
20244 is the "Declaration Space"
20246 * cs-parser.jay: Use CheckDef for checking declaration errors
20247 instead of having one on each function.
20249 * class.cs: Factor out some code for handling error handling in
20250 accordance to the "Declarations" section in the "Basic Concepts"
20251 chapter in the ECMA C# spec.
20253 * interface.cs: Make all interface member classes derive from
20254 InterfaceMemberBase.
20256 2001-05-07 Miguel de Icaza <miguel@ximian.com>
20258 * Many things: all interfaces are parsed and generated in
20259 gen-treedump. Support for member variables, constructors,
20260 destructors, properties, constants is there.
20262 Beginning of the IL backend, but very little done, just there for
20265 2001-04-29 Miguel de Icaza <miguel@ximian.com>
20267 * cs-parser.jay: Fix labeled statement.
20269 * cs-tokenizer.cs (escape): Escape " and ' always.
20270 ref_line, ref_name: keep track of the line/filename as instructed
20271 by #line by the compiler.
20274 2001-04-27 Miguel de Icaza <miguel@ximian.com>
20276 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
20277 to match the values in System.CodeDOM.
20279 Divid renamed to Divide.
20281 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
20283 (Statements.set): remove.
20285 * System.CodeDOM/CodeCatchClause.cs: always have a valid
20288 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
20289 falseStatements always have valid values.
20291 * cs-parser.jay: Use System.CodeDOM now.