1 2006-11-22 Marek Safar <marek.safar@gmail.com>
4 * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
6 * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
7 only when assembly has missing attribute.
10 2006-11-21 Marek Safar <marek.safar@gmail.com>
12 * cs-tokenizer.cs: Merged with gmcs version.
14 2006-11-20 Marek Safar <marek.safar@gmail.com>
17 * cs-parser.jay: Better error message when partial keyword is misplaced.
19 2006-11-19 Gert Driesen <drieseng@users.sourceforge.net>
22 report.cs: CS1058 only applies to 2.0 profile (gmcs).
23 codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
24 a RuntimeWrappedException by default.
26 2006-11-18 Marek Safar <marek.safar@gmail.com>
29 * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
31 (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
33 2006-11-18 Marek Safar <marek.safar@gmail.com>
35 * driver.cs, namespace.cs: Uses faster IndexOf version.
37 2006-11-17 Marek Safar <marek.safar@gmail.com>
40 * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
42 (Operator.Define): Implicit/Explicit operator of same type is duplicate
43 even if internal name is different.
44 * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
45 (UserDefinedConversion): Simplified as the operators cannot be internal.
46 * ecore.cs (Error_ValueCannotBeConverted): Take account of user
48 (MethodLookup): Replaced EmitContext with parentType.
49 * expression.cs: Updated.
51 2006-11-09 Raja R Harinath <rharinath@novell.com>
53 * driver.cs (BadAssembly): Handle all the ugliness of
54 DefineDynamicAssembly.
56 2006-11-08 Raja R Harinath <rharinath@novell.com>
58 Address parts of #58244 -- most of what's left is in the runtime
59 * driver.cs (LoadAssembly): Simplify slightly. Add CS0009 and
60 CS1509 error checks, and handle them for all assembly loads, not
61 just the first invocation.
62 (LoadModule): Likewise. Move handling of 'adder_method' ...
63 * codegen.cs (AssemblyClass.AddModule): ... here.
65 2006-11-02 Marek Safar <marek.safar@gmail.com>
67 * statement.cs.cs (CollectionForeach.TryType): Issue a error when
68 IEnumerable<T> is ambiguous.
70 2006-10-31 Marek Safar <marek.safar@gmail.com>
73 * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
74 GetEnumerator is ambiguous.
76 * report.cs: Add new warning.
78 2006-10-29 Marek Safar <marek.safar@gmail.com>
81 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
82 to protected member can be nested type.
84 2006-10-28 Marek Safar <marek.safar@gmail.com>
87 ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
88 to protected member must derive from current type.
90 2006-10-27 Marek Safar <marek.safar@gmail.com>
92 assign.cs: Reuses error method.
94 ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
95 instead of type for constants.
96 (Expression.Error_ValueAssignment): Common error method.
98 * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
101 2006-10-27 Marek Safar <marek.safar@gmail.com>
104 * expression.cs (MemberAccess.DoResolve): Check nested type
107 2006-10-27 Atsushi Enomoto <atsushi@ximian.com>
109 * doc.cs : nested delegates were not handled. Fixed bug #79754.
111 2006-10-26 Marek Safar <marek.safar@gmail.com>
114 * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
116 2006-10-26 Marek Safar <marek.safar@gmail.com>
118 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
119 type forwarder of the same type multiple times.
121 2006-10-26 Raja R Harinath <rharinath@novell.com>
124 * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
125 instance as an rvalue, even when we later resolve as an lvalue.
127 2006-10-25 Martin Baulig <martin@ximian.com>
129 * anonymous.cs: Fix #79673.
131 2006-10-24 Marek Safar <marek.safar@seznam.cz>
134 expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
135 ignored when is optimized (= default value) as its value is already set.
137 2006-10-23 Marek Safar <marek.safar@seznam.cz>
140 * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
141 TypeContainer for type lookup.
143 2006-10-23 Marek Safar <marek.safar@seznam.cz>
146 * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
147 * expression.cs (OverloadResolve): Always convert type name for
149 (ResolveNamespaceOrType): Don't confuse a nested type with any
152 2006-10-18 Martin Baulig <martin@ximian.com>
154 * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
156 2006-10-17 Miguel de Icaza <miguel@novell.com>
158 * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
159 an int32, but requesting an int64 from the conversion
161 2006-10-12 Martin Baulig <martin@ximian.com>
164 (AnonymousContainer.Resolve): Inflate the `ReturnType'. Fixes #79592.
166 2006-10-12 Martin Baulig <martin@ximian.com>
169 (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
171 2006-10-11 Miguel de Icaza <miguel@novell.com>
173 * convert.cs: Remove broken code: I was doing the "Existance"
174 tests for Implicit conversions.
176 2006-10-10 Miguel de Icaza <miguel@novell.com>
178 * convert.cs: Added one missing case in
179 ImplicitStandardConversionExists uint64 to intptr.
183 * typemanager.cs (uintptr_type): another core known type.
185 * ecore.cs (OperatorCast): routine used to do cast operations that
186 depend on op_Explicit. We could change some of the Decimal
187 conversions to use this.
189 This one has a probe mechanism that checks both types for an op_
190 which it coudl be used to eliminate two classes: CastToDecimal
193 * convert.cs: Implement the conversions documented in #59800
195 2006-10-10 Martin Baulig <martin@ximian.com>
197 * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
198 before RootScope.ResolveMembers().
200 * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
201 `CurrentType' if appropriate.
203 2006-10-09 Marek Safar <marek.safar@seznam.cz>
206 * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
207 when contains binary operators.
208 * cs-parser.jay: Updated.
210 2006-10-09 Martin Baulig <martin@ximian.com>
213 (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
214 moved that into Define() and also do the other type parameter
215 checks there. Fixes #79094. Added gtest-292.cs.
218 (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
219 since that doesn't include type parameters; don't use `Ldelema'
220 for type parameters. Fixes #78980. Added gtest-293.cs.
222 2006-10-08 Marek Safar <marek.safar@seznam.cz>
225 * convert.cs (ExplicitReferenceConversion): Only enum to enum value
226 conversion is allowed.
228 2006-10-06 Marek Safar <marek.safar@seznam.cz>
230 * ecore.cs (Expression.MemberLookup): Don't register any symbol for
231 error reporting when no error occurs.
233 2006-10-06 Marek Safar <marek.safar@seznam.cz>
235 * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
238 2006-10-06 Raja R Harinath <rharinath@novell.com>
241 * class.cs (DefineTypeBuilder): Check circular dependencies before
242 setting the parent of the TypeBuilder.
243 (CheckRecursiveDefinition): Don't use 'BaseType', since
244 it may not be valid until after DefineTypeBuilder. Use
247 2006-10-04 Martin Baulig <martin@ximian.com>
249 Merged the Anonymous Methods patch.
251 * anonymous.cs, iterators.cs: The new anonymous methods code.
253 * statement.cs (Variable): New public abstract class.
254 (LocalInfo.Variable): New public property.
255 (LocalInfo.ResolveVariable): New public method.
256 (Block.Flags): Add `IsIterator'.
257 (Block.AddVariable): Improved the CS0136 check.
258 (Block.AnonymousChildren): New public property.
259 (Block.AddAnonymousChild): New public method.
260 (ToplevelBlock): Update to use the new anonymous method framework.
261 (ToplevelBlock.ctor): `container' is now a `Block' and not a
262 `ToplevelBlock'; this is required to correctly implement the
264 (Fixed, Using): Use `TemporaryVariable' instead of directly
265 creating the `LocalBuilder'.
267 * parameter.cs (Parameter.ResolveVariable): New public method.
268 (Parameters.ResolveVariable): Likewise.
270 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
272 * class.cs (TypeContainer): Replaced the `iterators' list and
273 corresponding methods with a list of `CompilerGeneratedClass'es.
274 (TypeContainer.ResolveMembers): New public method.
275 (Method): `IIteratorContainer' has been replaced by
278 * expression.cs (VariableReference): New public abstract base
279 class for `LocalVariableReference', `ParameterReference' and
282 * codegen.cs (EmitContext): Removed `capture_context',
283 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
284 (EmitContext.EmitThis): Removed.
286 * cs-parser.jay: Replace `iterator_container' with
289 2006-10-04 Martin Baulig <martin@ximian.com>
291 * generic.cs (GenericMethod): Don't make this abstract.
292 (Constraints.Clone): Added dummy implementation.
294 2006-10-04 Raja R Harinath <harinath@gmail.com>
297 * namespace.cs (LookForAnyGenericType): Avoid nullref on
298 'declspaces'. Avoid allocating arrays willy-nilly.
301 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
302 cases out of the switch.
304 2006-09-28 Marek Safar <marek.safar@seznam.cz>
306 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
307 message when non-generic type is used with the type arguments.
308 * expression.cs: Updated.
310 2006-09-28 Raja R Harinath <rharinath@novell.com>
313 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
314 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
315 Change semantics slightly. Don't insist on having only one
316 temporary EmptyExpression -- just throttle the creation of new ones.
319 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
320 non-interfaces too. If no methods are found, don't try to create
323 2006-09-28 Marek Safar <marek.safar@seznam.cz>
325 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
328 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
329 us produce better error message.
331 2006-09-27 Marek Safar <marek.safar@seznam.cz>
333 * expression.cs (Binary.ResolveOperator): Warn about a side effect
336 * report.cs: A new warning added.
338 2006-09-27 Martin Baulig <martin@ximian.com>
340 * generic.cs (GenericMethod): Don't make this abstract.
342 2006-09-27 Martin Baulig <martin@ximian.com>
345 (InternalErrorException): Added overloaded ctor taking a params array.
347 2006-09-26 Marek Safar <marek.safar@seznam.cz>
349 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
350 Fixed the cases when same error was reported twice.
352 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
353 now report symbol information.
355 2006-09-25 Martin Baulig <martin@ximian.com>
357 * class.cs: Completely unified with the gmcs version.
359 2006-09-25 Martin Baulig <martin@ximian.com>
361 * typemanager.cs (TypeManager.IsNullableType): New public function.
362 (TypeManager.IsNullableTypeOf): Likewise.
363 (TypeManager.IsNullableValueType): Likewise.
365 * class.cs (MethodCore): Added the `GenericMethod' argument from
366 gmcs and also unified all classes derived from `MethodCore' with gmcs.
368 2006-09-24 Raja R Harinath <harinath@gmail.com>
370 * convert.cs: Unify with gmcs version.
372 2006-09-24 Marek Safar <marek.safar@seznam.cz>
374 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
377 * report.cs: New warning.
379 2006-09-24 Marek Safar <marek.safar@seznam.cz>
381 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
382 for anonymous block with out argument.
384 2006-09-24 Marek Safar <marek.safar@seznam.cz>
386 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
387 not used private events only.
389 2006-09-23 Marek Safar <marek.safar@seznam.cz>
391 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
393 * const.cs (Const.Define): Check for constant type.
394 (Const.IsConstantTypeValid): Looks for valid constant types.
396 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
398 * ecore.cs (EmptyConstantCast): New common class for all constant based
401 * expression.cs (Is.DoResolve): Handle null constant especially.
402 (New.DoResolve): Check for new void().
403 (MemberAccess.DoResolve): Cope with all kind of nulls.
405 * literal.cs (NullConstant): Uses EmptyConstantCast.
406 (NullDefault): Based on EmptyConstantCast.
407 (NullLiteral): Uses EmptyConstantCast.
409 * statement.cs (Block.ResolveMeta): Check for constant type.
411 2006-09-22 Martin Baulig <martin@ximian.com>
413 * delegate.cs, attribute.cs: Merged with the gmcs versions.
415 2006-09-22 Raja R Harinath <rharinath@novell.com>
417 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
421 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
422 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
425 2006-09-22 Martin Baulig <martin@ximian.com>
427 * ecore.cs: Merged with the gmcs version.
429 * generic.cs (ConstructedType): New dummy class.
430 (TypeArguments): Don't make this abstract.
433 (TypeManager.IsGenericTypeDefinition): New method.
434 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
436 2006-09-22 Raja R Harinath <rharinath@novell.com>
438 * expression.cs (ComposedCast): Check for arrays of TypedReference
439 before creating the type, not after.
441 2006-09-21 Marek Safar <marek.safar@seznam.cz>
443 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
446 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
447 when constant must be implicitly convertible.
449 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
451 * ecore.cs (NullCast): Derives from NullConstant.
453 * expression.cs (Is.DoResolve): Removed useless variables.
454 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
455 (New.Constantify): Add enum support.
456 (MemberAccess.DoResolve): Add warning when accessing null constant or
459 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
462 * literal.cs (NullConstant): New abstract class with common
463 functionality for all null specializations.
464 (NullDefault): Represents default(X) when result can be
466 (NullLiteral): Updated.
468 * report.cs: Add new warning.
470 2006-09-21 Martin Baulig <martin@ximian.com>
472 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
474 2006-09-21 Martin Baulig <martin@ximian.com>
476 * generic.cs (GenericConstraints): New dummy class.
477 (Constraints): Likewise.
478 (TypeParameter): Likewise.
479 (TypeParameterName): Likewise.
480 (GenericMethod): Likewise.
482 * typemanager.cs (TypeManager.GetGenericArguments): New method.
484 * decl.cs: Merged with the gmcs version.
486 2006-09-21 Raja R Harinath <rharinath@novell.com>
488 * generic.cs (TypeParameter): Implement IMemberContainer.
489 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
491 * rootcontext.cs: Unify with gmcs version.
493 * report.cs: Unify with gmcs version.
494 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
495 from gmcs/generics.cs.
496 * generics.cs (TypeParameter): New dummy class.
498 * support.cs: Unify with gmcs version.
500 2006-09-20 Raja R Harinath <rharinath@novell.com>
502 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
503 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
505 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
506 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
507 * mcs.exe.sources: Add generic.cs.
509 * codegen.cs: Unify with gmcs version.
511 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
512 (EmitContext): Add GenericDeclContainer implementation.
513 * decl.cs (MemberCore, DeclSpace): Likewise.
514 * namespace.cs: Remove #ifdef GMCS_SOURCE.
516 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
517 MCS TypeManager has a corresponding dummy method.
519 2006-09-19 Martin Baulig <martin@ximian.com>
521 * expression.cs: Completely merged with the gmcs version.
523 2006-09-19 Martin Baulig <martin@ximian.com>
525 * expression.cs (Invocation): Merged with the gmcs version.
526 (ArrayAccess.GetStoreOpcode): Likewise.
528 2006-09-19 Martin Baulig <martin@ximian.com>
531 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
532 (TypeManager.IsGenericMethodDefinition): Likewise.
534 2006-09-19 Martin Baulig <martin@ximian.com>
537 (TypeManager.IsEqual): Moved the gmcs implementation here.
538 (TypeManager.DropGenericTypeArguments): Likewise.
539 (TypeManager.DropGenericMethodArguments): Likewise.
540 (TypeManager.GetTypeArguments): Moved here from gmcs.
541 (TypeManager.HasGenericArguments): Likewise.
543 2006-09-19 Martin Baulig <martin@ximian.com>
545 * expression.cs (Binary): Merged with the gmcs version.
547 2006-09-19 Martin Baulig <martin@ximian.com>
549 * expression.cs (Probe, As, Is): Merged with the gmcs version.
551 2006-09-19 Martin Baulig <martin@ximian.com>
553 * typemanager.cs: Merged with the gmcs version.
555 2006-09-16 Raja R Harinath <rharinath@novell.com>
557 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
558 * driver.cs: Likewise.
560 2006-09-16 Marek Safar <marek.safar@seznam.cz>
563 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
564 only if parent type is class.
565 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
568 2006-09-15 Marek Safar <marek.safar@seznam.cz>
571 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
573 * typemanager.cs(CSharpName): Converts NullType to null.
575 2006-09-15 Martin Baulig <martin@ximian.com>
578 (TypeManager.GetMethodName): Added mcs implementation.
579 (TypeManager.IsEqual): Likewise.
582 (SimpleName.RemoveGenericArity): Added dummy implementation.
584 * pending.cs: Merged with the gmcs version.
586 2006-09-15 Martin Baulig <martin@ximian.com>
588 * statement.cs: Merge with the gmcs version.
590 2006-09-15 Martin Baulig <martin@ximian.com>
592 * statement.cs (Switch): Merge with the gmcs implementation
593 (without nullables), which is newer.
595 2006-09-15 Martin Baulig <martin@ximian.com>
597 * statement.cs (Block.Variables): Make this public.
598 (ToplevelBlock.Parameters): Make this a property.
599 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
601 2006-09-15 Martin Baulig <martin@ximian.com>
603 * namespace.cs: Merge with the gmcs version.
605 2006-09-15 Martin Baulig <martin@ximian.com>
607 * decl.cs (MemberName): Minor code cleanups.
609 2006-09-15 Martin Baulig <martin@ximian.com>
611 * parameter.cs: Merge with the gmcs version.
613 2006-09-15 Martin Baulig <martin@ximian.com>
615 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
618 2006-09-15 Martin Baulig <martin@ximian.com>
620 * flowanalysis.cs: Merged from GMCS; added the generics code into
621 a `GMCS_SOURCE' conditional so we can share this file.
623 2006-09-08 Martin Baulig <martin@ximian.com>
625 * typemanager.cs (TypeManager.interlocked_type): New public field.
626 (TypeManager.int_interlocked_compare-exchange): New public field.
627 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
628 enumerator types here and call InitGenericCoreTypes().
629 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
630 after calling InitEnumUnderlyingTypes().
633 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
634 `classes_second_stage'.
636 2006-09-14 Marek Safar <marek.safar@seznam.cz>
638 * assign.cs, ecore.cs, expression.cs: Share error message text.
639 * class.cs (FieldMember.Define): Check for varible of static type.
640 * driver.cs (LoadAssembly): Uses error output for errors.
641 * statement.cs: Updated.
643 2006-09-08 Marek Safar <marek.safar@seznam.cz>
645 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
648 2006-09-07 Martin Baulig <martin@ximian.com>
651 (MainDriver): Revert r62663 from Marek; see #70506 for details.
653 2006-08-29 Miguel de Icaza <miguel@novell.com>
655 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
657 2006-08-17 Miguel de Icaza <miguel@novell.com>
659 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
660 #52019 and #79064, the use of the \uXXXX sequence in source code
661 to represent unicode characters.
663 2006-08-15 Marek Safar <marek.safar@seznam.cz>
665 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
667 * class.cs, ecore.cs, statement.cs: Merged to one error message.
669 2006-08-13 Miguel de Icaza <miguel@novell.com>
671 * assign.cs: Catch attempts to assign to a method groups in += and
674 2006-08-13 Marek Safar <marek.safar@seznam.cz>
677 * cs-parser.jay: Don't destroy current array type by typeof of array's.
679 2006-08-12 Marek Safar <marek.safar@seznam.cz>
681 * class.cs (Method.Define): Issue a warning when generic method looks like
683 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
686 2006-08-09 Marek Safar <marek.safar@seznam.cz>
688 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
690 * decl.cs (MemberCache.FindMembers): When container is interface we need to
691 search all base interfaces as a member can be ambiguous.
692 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
693 Constructor member type filter.
694 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
695 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
696 reporting for returned memberinfos.
697 * report.cs: Updated.
698 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
699 version to work on all runtimes.
700 (TypeManager.RealMemberLookup): Removed members filtering.
702 2006-08-08 Raja R Harinath <rharinath@novell.com>
704 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
705 (PropertyExpr.EmitAssign): Likewise.
706 * expression.cs (Indirection.EmitAssign): Likewise.
707 (LocalVariableReference.EmitAssign): Likewise.
708 (ParameterReference.EmitAssign): Likewise.
709 (Invocation.EmitArguments): Likewise.
710 (ArrayAccess.EmitAssign): Likewise.
711 (IndexerAccess.EmitAssign): Likewise.
712 (This.EmitAssign): Likewise.
713 (ConditionalLogicalOperator.Emit): Likewise.
716 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
717 instead of ArrayList. If the hashtable has a LocalBuilder, don't
718 leave it in after returning it.
719 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
721 2006-08-06 Marek Safar <marek.safar@seznam.cz>
723 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
726 2006-08-03 Raja R Harinath <rharinath@novell.com>
728 Fix cs0146-3.cs and cs0146-4.cs.
729 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
730 enclosing types don't depend on the current type.
732 2006-08-02 Raja R Harinath <rharinath@novell.com>
735 * class.cs (TypeContainer.DoDefineMembers): Use
736 FindBaseMemberWithSameName on Parent, since we're interested in
737 whether we hide inherited members or not.
738 (FindBaseMemberWithSameName): Make slightly more robust.
740 Fix the non-generic testcase from #77396
741 * decl.cs (DeclSpace.DeclContainer): Remove override.
743 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
744 declspaces for doppelgangers too.
745 (UsingEntry): Implement IResolveContext.
746 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
747 'this' as the resolve context.
748 (LocalAliasEntry): Likewise.
750 Implement parts of #77403
751 * roottypes.cs (RootDeclSpace): New. Used to represent the
752 toplevel declaration space. Each namespace declaration introduces
753 a "partial" root declaretion space.
754 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
755 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
756 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
757 from 'current_namespace.SlaveDeclSpace'.
758 (namespace_declaration): Likewise.
759 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
760 check. It can't happen now.
761 * decl.cs (DeclSpace.LookupType): Likewise.
762 * driver.cs (MainDriver): Sanity check.
764 2006-08-01 Raja R Harinath <rharinath@novell.com>
766 * decl.cs (DeclSpace.FindNestedType): Remove.
767 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
768 LookupTypeContainer to get the container of the nested type.
769 * class.cs (TypeContainer.FindNestedType): Make non-override.
771 2006-07-31 Raja R Harinath <rharinath@novell.com>
773 * decl.cs (DeclSpace.PartialContainer): Move field from ...
774 * class.cs (TypeContainer.PartialContainer): ... here.
775 (TypeContainer.AddBasesForPart): New helper.
776 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
778 * cs-parser.jay (current_class): Convert to DeclSpace.
779 (struct_declaration, interface_declaration, class_declaration):
780 Use AddBasesForPart instead of .Bases directly.
781 * const.cs, iterators.cs: Update to changes.
783 2006-07-28 Raja R Harinath <rharinath@novell.com>
785 * class.cs (TypeContainer.AddMemberType): Rename from
787 (TypeContainer.AddMember): Rename from AddToMemberContainer.
788 (AddTypeContainer): New. Combine AddClassOrStruct and
790 (AddPartial): Update. Add 'is_partial' argument.
791 * roottypes.cs: Update to changes.
792 * cs-parser.jay (push_current_class): New helper for handling
793 current_container and current_class.
794 (struct_declaration, interface_declaration, class_declaration):
797 2006-07-26 Raja R Harinath <rharinath@novell.com>
799 * roottypes.cs: Rename from tree.cs.
801 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
802 * tree.cs (Tree, ITreeDump): Remove types.
803 * rootcontext.cs (tree, Tree): Remove fields.
804 (root, ToplevelTypes): New.
805 * *.cs: Update to rename.
807 * tree.cs (Tree.RecordDecl): Remove.
808 (RootTypes.AddToTypeContainer): Record the toplevel type in its
810 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
812 2006-07-23 Raja R Harinath <harinath@gmail.com>
814 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
815 DoFlowAnalysis and OmitStructFlowAnalysis here.
816 (ec.With): Rename from WithUnsafe and generalize.
817 (ec.WithCheckState): Remove. All users can be handled by 'With'.
818 (ec.WithFlowAnalyis): New.
819 * ecore.cs, expression.cs, statement.cs: Update.
821 2006-07-22 Raja R Harinath <harinath@gmail.com>
823 * statement.cs (Block.ResolveMeta): Simplify slightly.
825 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
826 multiple boolean fields. Convert InUnsafe, constant_check_state,
827 check_state to flags.
828 (CheckState, ConstantCheckState): Update.
829 (InUnsafe): New read-only property.
830 (FlagsHandle): Rename from CheckStateHandle and convert to handle
832 (WithUnsafe): New helper similar to WithCheckState.
833 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
834 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
836 2006-07-21 Raja R Harinath <rharinath@novell.com>
838 Make comparisons use the same IL irrespective of whether they're
839 in a 'checked' or 'unchecked' context: one of the issues in #78899
840 * codegen.cs (EmitContext.CheckState): Make read-only property.
841 (EmitContext.ConstantCheckState): Likewise.
842 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
843 helper that implement a save/restore stack for CheckState
844 values. This is the only way to change check-state.
845 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
846 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
847 (CheckedExpr.EmitBranchable): New forwarding method.
848 (UnCheckedExpr): Likewise.
849 * statement.cs (Block.ResolveMeta): Use WithCheckState.
850 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
851 (Checked.Resolve, checked.DoEmit): Likewise.
853 2006-07-20 Miguel de Icaza <miguel@novell.com>
855 * anonymous.cs: Cache the resolved anonymous delegate, and return
856 this so that the ResolveTopBlock is only triggered once, not
859 Currently we trigger ResolvetopBlock twice due to a first pass of
860 argument check compatibility, and a second pass that does the
863 2006-07-15 Marek Safar <marek.safar@seznam.cz>
865 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
867 * rootcontext.cs (Reset): Add helper_classes.
869 2006-07-15 Marek Safar <marek.safar@seznam.cz>
872 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
875 2006-07-13 Miguel de Icaza <miguel@novell.com>
877 * statement.cs (Lock): Handle expressions of type
878 TypeManager.null_type specially. Fixes #78770
880 2006-07-08 Marek Safar <marek.safar@seznam.cz>
882 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
885 2006-07-08 Marek Safar <marek.safar@seznam.cz>
887 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
888 for accessors as well.
889 * ecore.cs (EventExpr): Add AccessorTable.
891 2006-07-01 Marek Safar <marek.safar@seznam.cz>
894 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
895 for CS0122 where appropriate.
896 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
898 (Filter): Assembly can be null in the case of top level attributes.
900 2006-06-25 Marek Safar <marek.safar@seznam.cz>
904 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
905 is done at global level.
907 2006-06-24 Marek Safar <marek.safar@seznam.cz>
909 A fix for #77002, Implemented TypeForwarder support.
911 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
912 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
913 * typemanager.cs (): Add type_forwarder_attr_type.
915 2006-06-24 Marek Safar <marek.safar@seznam.cz>
917 * report.cs: Add CS0469 warning.
919 2006-06-21 Martin Baulig <martin@ximian.com>
921 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
922 the `try'-block, so we also report CS0016 etc. there.
924 2006-06-21 Martin Baulig <martin@ximian.com>
927 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
929 2006-06-21 Martin Baulig <martin@ximian.com>
931 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
932 also report CS1686 for parameters.
934 2006-06-21 Martin Baulig <martin@ximian.com>
936 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
937 instead of an error if the value is not implicitly convertible to
938 the switch types; fixes #77964.
940 2006-06-21 Raja R Harinath <rharinath@novell.com>
943 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
944 FieldBuilder is null.
947 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
948 'left' and 'right' before error-checking.
950 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
952 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
954 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
955 (FieldExpr.DoResolve): likewise.
956 (PropertyExpr.InstanceResolve): likewise.
957 (EventExpr.InstanceResolve): likewise.
959 2006-06-04 Marek Safar <marek.safar@seznam.cz>
961 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
962 attribute applicable tests for attribute argument.
964 2006-06-02 Raja R Harinath <rharinath@novell.com>
967 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
968 (Binary.OverloadResolve_PredefinedIntegral): New.
969 (Binary.OverloadResolve_PredefinedFloating): New.
970 (Binary.OverloadResolve_PredefinedString): New.
971 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
972 Follow the standard more closely, and treat numeric promotions in
973 terms of overload resolution.
974 (Binary.CheckShiftArguments): Simplify.
976 2006-06-01 Raja R Harinath <rharinath@novell.com>
978 * flowanalysis.cs (MyBitVector): Simplify representation.
979 (MyBitVector.Clone): Avoid allocating BitArray.
980 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
981 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
982 (*): Update. Change all references to MyBitVector.And and
983 MyBitVector.Or to &= and |=.
985 2006-05-29 Raja R Harinath <rharinath@novell.com>
988 * cs-parser.jay (formal_parameter_list): Extend the pattern below
989 to param arguments too.
991 2006-05-26 Miguel de Icaza <miguel@novell.com>
993 * cs-parser.jay: Catch another parsing form for arglist being
994 followed by other arguments. Fixes #78313.
996 2006-05-24 Raja R Harinath <rharinath@novell.com>
998 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
999 checking of out parameters to ...
1000 (FlowBranchingToplevel.Merge): ... here.
1001 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
1002 set, propagate the origin upward, and only complain if there was
1004 (FlowBranchingException.AddContinueOrigin): Likewise.
1005 (FlowBranchingException.AddReturnOrigin): Likewise.
1006 (FlowBranchingException.AddGotoOrigin): Likewise.
1008 2006-05-23 Raja R Harinath <rharinath@novell.com>
1010 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
1011 unreachable, skip it.
1012 (FlowBranchingException.Merge): Always propagate jumps, even if
1013 the finally block renders subsequent code unreachable.
1015 2006-05-18 Raja R Harinath <rharinath@novell.com>
1018 * statement.cs (Goto.Resolve): Move responsibility for resolving
1019 'goto' to FlowBranching.AddGotoOrigin.
1020 (Goto.SetResolvedTarget): New. Callback to set the
1021 LabeledStatement that's the target of the goto.
1022 (Goto.DoEmit): Use Leave instead of Br when crossing an
1023 unwind-protect boundary.
1024 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
1025 LookupLabel and adjust to new semantics.
1026 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
1027 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
1028 Goto.SetResolvedTarget to update target.
1029 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
1030 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
1031 AddBreakOrigin & co. Delay propagation until ...
1032 (FlowBranchingException.Merge): ... this.
1034 * statement.cs (Block.Resolve): Always depend on flow-branching to
1035 determine unreachability. Kill workaround that originally emitted
1036 only one statement after an "unreachable" label (see infloop in
1039 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
1040 This is still "wrong", but anything better would probably need a
1041 multi-pass algorithm.
1042 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
1043 usage vector. Force current usage vector to be reachable, to
1044 optimistically signify backward jumps.
1045 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
1047 (FlowBranchingLabeled.Merge): New. If no backward jump was
1048 detected, return the original salted-away usage vector instead,
1049 updated with appropriate changes. Print unreachable warning if
1051 * statement.cs (Block.Resolve): Don't print unreachable warning on
1052 a labeled statement.
1054 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
1056 * driver.cs: Pass filename without path to AssemblyBuilder's
1057 AddResourceFile. Fixes bug #78407.
1059 2006-05-17 Raja R Harinath <rharinath@novell.com>
1061 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
1062 * flowanalysis.cs (FlowBranchingLabeled): ... here.
1063 (FlowBranching.MergeChild): Overwrite
1064 reachability information from Labeled branchings too.
1066 2006-05-16 Raja R Harinath <rharinath@novell.com>
1068 * statement.cs (Goto.Resolve): Merge jump origins here ...
1069 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
1071 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
1072 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
1073 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
1074 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
1076 * statement.cs (Goto.Resolve): ... not here.
1077 (Goto.Emit): Remove CS1632 check.
1079 2006-05-14 Marek Safar <marek.safar@seznam.cz>
1081 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
1084 2006-05-11 Raja R Harinath <rharinath@novell.com>
1086 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
1087 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
1088 (FlowBranchingException.Label): Likewise.
1090 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
1092 (MyBitVector.Or): Use it to avoid losing information (Count).
1093 (FlowBranching.MergeOrigins): Likewise.
1095 * flowanalysis.cs (UsageVector.IsDirty): Remove.
1096 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
1097 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
1098 (UsageVector.ToString): Simplify.
1099 (UsageVector.MergeSiblings): Move here from ...
1100 (FlowBranching.Merge): ... here.
1101 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
1104 2006-05-10 Raja R Harinath <rharinath@novell.com>
1106 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
1107 null bitvector is treated as all-true.
1109 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
1110 (MyBitVector): Rationalize invariants. 'vector != null' implies
1111 that we have our own copy of the bitvector. Otherwise,
1112 'InheritsFrom == null' implies all inherited bits are true.
1114 2006-05-09 Marek Safar <marek.safar@seznam.cz>
1116 * statement.cs (LocalInfo): Add IsConstant.
1117 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
1118 local variable for constants.
1120 2006-05-09 Raja R Harinath <rharinath@novell.com>
1122 * flowanalysis.cs (MyBitVector.Empty): New.
1123 (MyBitVector): Don't allow InheritedFrom to be null.
1124 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
1125 (UsageVector, FlowBranching): Update to changes.
1127 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
1128 recursion. The 'Parent == null' condition isn't sufficient for
1130 (FlowBranching.AddBreakOrigin): Likewise.
1131 (FlowBranching.AddContinueOrigin): Likewise.
1132 (FlowBranching.AddReturnOrigin): Likewise.
1133 (FlowBranching.StealFinallyClauses): Likewise.
1134 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
1135 (FlowBranching.CheckOutParameters): Likewise.
1136 (FlowBranchingToplevel): Terminate all the above recursions here.
1137 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
1138 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
1140 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
1142 (FlowBranchingToplevel): New. Empty for now.
1143 (FlowBranching.MergeTopBlock): Update.
1144 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
1145 branching for the anonymous delegate.
1146 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
1148 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
1149 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
1150 information at the start of the merge. Reorganize.
1152 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1154 * class.cs (MethodData.Define): Method cannot implement interface accessor.
1156 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1158 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
1159 to newly introduced ctor.
1161 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
1162 message to one place.
1163 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
1166 2006-05-07 Marek Safar <marek.safar@seznam.cz>
1168 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
1170 * ecore.cs (Expression.ResolveAsConstant): Updated.
1172 * statement.cs (ResolveMeta): Updated.
1174 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1176 * cs-parser.jay: __arglist cannot be used in initializer.
1178 2006-05-06 Marek Safar <marek.safar@seznam.cz>
1181 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
1184 2006-05-05 Raja R Harinath <rharinath@novell.com>
1186 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
1187 (LabeledStatement): Add 'name' parameter.
1188 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
1189 (Block.AddLabel): Update to changes.
1190 * cs-parser.jay (labeled_statement): Likewise.
1192 * flowanalysis.cs (BranchingType.Labeled): New.
1193 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
1194 (FlowBranchingLabeled): New. Does nothing for now, but will
1195 eventually handle 'goto' flows.
1196 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
1197 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
1198 that's terminated ...
1199 (Block.Resolve): ... here.
1201 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
1202 (UsageVector.MergeFinallyOrigins): Likewise.
1203 (FlowBranching.InTryOrCatch): Likewise.
1204 (FlowBranching.AddFinallyVector): Likewise.
1205 (FlowBranchingException): Update to changes.
1208 * statement.cs (Return.Resolve): Move error checking to ...
1209 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
1210 (FlowBranchingException): Handle return origins like break and
1212 (FlowBranching.UsageVector.CheckOutParameters): Remove.
1214 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1217 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
1220 2006-05-04 Marek Safar <marek.safar@seznam.cz>
1223 * class.cs (MethodData.Define): Do public accessor check only when method
1224 implements an interface.
1226 2006-05-04 Raja R Harinath <rharinath@novell.com>
1228 Remove special handling of 'break'
1229 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
1230 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
1231 (UsageVector.Break): Remove.
1232 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
1234 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
1236 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
1237 UsageVector.Breaks (). Don't set NeedsReturnLabel.
1239 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1242 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
1243 be the interface member.
1245 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1248 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1249 for emitting small (int) values.
1251 2006-05-03 Raja R Harinath <rharinath@novell.com>
1254 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1255 control-flow passes through the 'finally' after merging-in all the
1256 control-flows from 'try' and the 'catch' clauses.
1258 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1259 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
1260 always true at the only non-recursive entry point.
1261 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1262 FlowBranchingBreakable.
1263 (FlowBranchingLoop): Remove.
1264 * statement.cs (Return.DoResolve): Update to changes.
1267 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1268 (FlowBranching.CreateBranching): Handle it: create a
1269 FlowBranchingContinuable.
1270 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1271 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1272 except that it handles the 'continue' command.
1273 (FlowBranching.UsageVector.MergeOrigins): Rename from
1275 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1276 except that it overrides AddContinueOrigin.
1277 (FlowBranchingException): Override AddContinueOrigin, similar to
1279 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1280 Create a new branching around the embedded statement.
1281 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
1282 control flow after the embedded statement.
1283 (Continue.Resolve): Move all error checking to AddContinueOrigin.
1285 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1286 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1287 FlowBranchingBreakable.
1288 (FlowBranchingSwitch): Remove.
1291 * statement.cs (Break.Resolve): Simplify. Move responsibility for
1292 error reporting to ...
1293 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1294 Rename from 'AddBreakVector'. Add new location argument. Return
1295 a bool indicating whether the 'break' crosses an unwind-protect.
1296 (FlowBranchingException.AddBreakOrigin): Add.
1297 (FlowBranchingException.Merge): Propagate 'break's to surrounding
1298 flowbranching after updating with the effects of the 'finally'
1300 (FlowBranchingBreakable): New common base class for
1301 FlowBranchingLoop and FlowBranchingSwitch.
1303 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1305 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1307 2006-05-02 Raja R Harinath <rharinath@novell.com>
1309 * statement.cs (Do.Resolve): If the loop is infinite, set the
1311 (While.Resolve, For.Resolve): Set a barrier after the embedded
1312 statement. There's no direct control flow that goes from the end
1313 of the embedded statement to the end of the loop.
1314 * flowanalysis.cs (FlowBranching.Infinite): Remove.
1315 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
1316 above ensure that the reachability is correctly computed.
1318 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1319 (UsageVector.MergeBreakOrigins): If the current path is
1320 unreachable, treat it as if all parameters/locals are initialized.
1321 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
1322 infinite loops before merging-in break origins.
1324 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1325 (Reachability.Reachable): Split part into ...
1326 (Reachability.Unreachable): ... this. Simplify.
1327 (Reachability.IsUnreachable): Use 'Unreachable' instead.
1329 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1330 (Reachability.SetThrowsSometimes): Likewise.
1331 (FlowBranchingBlock.MergeTopBlock): Don't compare against
1332 TriState.Always, use corresponding property.
1333 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1334 (Block.Resolve): Likewise. Remove some redundant checks.
1336 2006-05-02 Raja R Harinath <harinath@gmail.com>
1338 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1339 (Reachability.Meet): Don't bother checking AlwaysThrows --
1340 barrier is always set.
1341 (FlowBranchingBlock.Merge): Likewise.
1343 2006-05-01 Raja R Harinath <harinath@gmail.com>
1345 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1346 checks for unreachable.
1348 2006-05-01 Marek Safar <marek.safar@seznam.cz>
1351 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1353 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1354 whether field is really assigned.
1356 2006-04-30 Raja R Harinath <harinath@gmail.com>
1358 * flowanalysis.cs (Reachability): Make 4-argument constructor
1360 (Reachability.Meet): Rename from 'And'. Remove static variant.
1361 (Reachability.Always): Rename from the highly misleading
1362 'Reachability.Never'.
1363 (FlowBranching.Merge): Update to changes. Mark an impossible
1364 situation with a 'throw'.
1365 (*): Update to changes.
1367 2006-04-29 Raja R Harinath <harinath@gmail.com>
1369 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1371 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1372 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1373 (*): Update to changes.
1374 * statement.cs: Update to changes.
1376 2006-04-28 Marek Safar <marek.safar@seznam.cz>
1379 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1381 2006-04-28 Raja R Harinath <harinath@gmail.com>
1383 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1386 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1387 argument to two arguments: an usage-vector and a bool. Move call
1388 to FlowBranching.Merge () ...
1389 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1391 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1392 handling of loop and switch reachability to ...
1393 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1395 2006-04-27 Raja R Harinath <harinath@gmail.com>
1397 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1398 handling to FlowBranchingLoop.InLoop.
1399 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1401 2006-04-26 Marek Safar <marek.safar@seznam.cz>
1404 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1405 anonymous method is allowed from AnonymousContainer here.
1407 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1409 2006-04-24 Raja R Harinath <rharinath@novell.com>
1412 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1414 2006-04-23 Marek Safar <marek.safar@seznam.cz>
1417 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1418 (DoubleConstant.Reduce): Ditto.
1420 2006-04-23 Raja R Harinath <rharinath@novell.com>
1422 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1423 Remove 'lvalue_right_side' argument. Move parts to ...
1424 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1425 (LocalVariable.DoResolveLValue): ... these.
1427 2006-04-21 Raja R Harinath <rharinath@novell.com>
1430 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1431 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1432 (LocalVariableReference.DoResolveBase): Use it to implement new
1434 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1435 (Argument.Resolve): Simplify. Move CS1510 check ...
1436 * ecore.cs (Expression.ResolveLValue): ... here.
1437 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1438 (PropertyExpr.DoResolveLValue): Likewise.
1439 (FieldExpr.Report_AssignToReadonly): Likewise.
1440 (FieldExpr.DoResolve): Add 'out_access' argument. Use
1441 LValueMemberAccess or LValueMemberOutAccess on instance depending
1443 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1444 DoResolve as appropriate.
1446 2006-04-20 Raja R Harinath <rharinath@novell.com>
1449 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1450 implicit conversions on 'out' and 'ref' arguments.
1452 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1453 improve clarity. Remove dead code.
1456 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1457 (Catch.Resolve): Resolve VarBlock if it exists.
1459 2006-04-19 Miguel de Icaza <miguel@novell.com>
1461 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1462 twice, this was some residual code, the enumerator was emitted
1463 properly in the two branche of if later.
1465 2006-04-19 Raja R Harinath <rharinath@novell.com>
1467 * expression.cs (Cast.ResolveLValue): Remove. The result of a
1468 cast is never an lvalue.
1469 (Cast.DoResolve, Cast.ResolveRest): Combine.
1470 (Argument.Emit): Simplify slightly. Move 'Expr is
1471 IMemoryLocation' check ...
1472 (Argument.Resolve): ... here.
1473 (Argument.Error_LValueRequired): Remove. Inline into only user.
1475 Simplifications. Fix cs0191-2.cs
1476 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1477 CS1649 and CS1651 to ...
1478 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
1479 the actual selection of the error code and message to a lookup
1480 table. Add a dummy return value to simplify callsites.
1481 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1482 readonly fields of other instances of the same type. Move CS0197
1484 * expression.cs (Argument.Resolve): ... here. Simplify code.
1485 Ensure that ec.InRefOutArgumentResolving is only set during LValue
1486 resolution of an out or ref argument. The code simplification
1487 above uses this invariant.
1489 2006-04-18 Raja R Harinath <rharinath@novell.com>
1491 Possibly fix #77752. Fix cs1690-[4-7].cs.
1492 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1493 CheckMarshallByRefAccess. Drop parameter.
1494 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
1496 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1498 * report.cs (AllWarnings): Add CS1690.
1499 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1501 (LocalVariableReference.DoResolveBase): Update.
1503 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1505 * class.cs (MethodOrOperator): Moved common parts from method class.
1506 detect obsolete attributes.
1507 (Method.Define): Simplified as it reuses code from base.
1508 (Constructor.ValidAttributeTargets): Fixed issue found during
1510 (Destructor.ValidAttributeTargets): Fixed issue found during
1512 (Operator): Finished refactoring set off by #78020. Operator class is now
1513 ordinary method class.
1515 * anonymous.cs: Updated.
1517 * decl.cs (DeclSpace): Add IsGeneric
1519 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1521 * class.cs (Constructor.Emit): Don't emit the attributes twice.
1523 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1525 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1526 detect obsolete attributes.
1527 (Method.CreateEmitContext): Moved to MethodOrOperator.
1529 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1532 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1533 customized exception to make crash detection easier.
1534 (MethodOrOperator): Started to work on new base class for methods and
1536 (Method): Derives from MethodOrOperator.
1537 (Constructor.Emit): Emits its own attributes.
1538 (AbstractPropertyEventMethod.Emit): Ditto.
1539 (Operator): Derives from MethodOrOperator, will refactor fully in extra
1541 (Operator.Emit): It's temporary more tricky than should be.
1543 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1545 * report.cs (InternalErrorException): Add ctor with inner exception.
1547 2006-04-08 Marek Safar <marek.safar@seznam.cz>
1550 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1553 2006-04-07 Marek Safar <marek.safar@seznam.cz>
1556 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1559 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1561 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1562 attribute is present and Guid not.
1563 (Interface.ApplyAttributeBuilder): Ditto.
1565 * attribute.cs: Add error message.
1567 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1571 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1572 sources (it's composite) so hold them in extra array as they are used in
1573 Emit phase only. It worked in the previous versions by mistake.
1574 (Attribute.Emit): Emit attribute for more owners when exist.
1576 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1577 it has now different behaviour.
1579 2006-04-04 Marek Safar <marek.safar@seznam.cz>
1581 * constant.cs (Constant.IsDefaultInitializer): New method.
1583 * class.cs: Updated.
1585 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1586 re-initialize default values. It saves KBs almost for every assembly.
1587 Thanks Zoltan for the idea.
1588 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1589 (ArrayCreation.DoResolve): Resolve only once.
1590 (ArrayCreation.Emit): Emit static initializer only when it is faster.
1591 (ArrayCreation.GetAttributableValue): Cope with optimized values.
1593 2006-04-03 Zoltan Varga <vargaz@gmail.com>
1595 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1598 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1600 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1601 in an embedded statement too.
1603 2006-04-01 Raja R Harinath <rharinath@novell.com>
1606 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1608 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1612 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1615 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1617 2006-03-31 Marek Safar <marek.safar@seznam.cz>
1619 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1622 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1623 LocalTemporary change.
1625 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1627 (ClassOrStruct.DefineFieldInitializers): Implemented static field
1628 initializers optimization.
1629 (ClassOrStruct.TypeAttr): Moved from modifiers.
1630 (Constructor.CheckBase): Don't crash when static ctor has parameters.
1631 (FieldBase.ResolveInitializer): Resolves initializer.
1632 (FieldBase.HasDefaultInitializer): New property.
1634 * cs-parser.jay: Removed message.
1636 * expression.cs (CompilerGeneratedThis): New specialization.
1638 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1640 2006-03-28 Marek Safar <marek.safar@seznam.cz>
1642 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1644 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1646 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1647 be now EnumConstants only.
1649 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1651 * attribute.cs, driver.cs: Reset more caches.
1653 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1655 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1657 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1659 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1660 for easier reuse. Updated all overrides.
1661 (IntegralConstant): New base class for all integral constants.
1662 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1663 of the constant range, report custom error.
1664 (UIntConstant.Reduce): Fixed uint conversion.
1666 * ecore.cs, literal.cs: Reduce updates.
1668 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1672 * class.cs (Constructor.Define): Removed extra if for default ctors.
1673 A patch from Atsushi Enomoto.
1675 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1677 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1678 GetAttributableValue.
1680 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1683 * convert.cs (ImplicitConversionRequired): Error message moved to
1686 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1687 automatic implicit conversion of an output value.
1688 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1690 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1692 (TypeOf.GetAttributableValue): Add extra handling for object type.
1694 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1695 special error message.
1697 2006-03-25 Marek Safar <marek.safar@seznam.cz>
1699 * class.cs (Constructor.Emit): Don't crash when struct ctor is
1701 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1702 compatible with MS runtime.
1704 2006-03-23 Marek Safar <marek.safar@seznam.cz>
1706 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1707 attribute arguments here.
1709 * class.cs (Indexer.Define): The check was moved to attribute class.
1711 2006-03-22 Marek Safar <marek.safar@seznam.cz>
1713 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
1714 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
1717 2006-03-22 Raja R Harinath <rharinath@novell.com>
1719 Support ParameterDefaultValueAttribute in gmcs. Also applied to
1720 mcs to keep code differences small.
1721 * attribute.cs (Attribute.GetParameterDefaultValue): New.
1722 * typemanager.cs (parameter_default_value_attribute_type): New.
1723 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
1726 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1728 * expression.cs (StringConcat.Append): Reverted back to no warning state.
1730 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1732 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1734 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1737 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
1739 * doc-bootstrap.cs : fix build.
1741 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1743 * expression.cs (StringConcat.Append): Issue a warning when empty string
1746 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1748 * assign.cs (CompoundAssign.ResolveSource): Removed.
1750 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1753 * class.cs (TypeContainer.FindMethods): Removed.
1754 (TypeContainer.CheckMemberUsage): Made static.
1756 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1758 * constant.cs (CheckRange): Removed unused type argument.
1759 (CheckUnsigned): Removed unused type argument.
1761 * cs-parser.jay: Updated after MemberAccess clean up.
1762 Uses Length for empty string test.
1764 * cs-tokenizer.cs: Uses Length for empty string test.
1765 (IsCastToken): Made static.
1766 (is_hex): Made static.
1767 (real_type_suffix): Made static.
1769 * decl.cs (SetupCache): Made static.
1770 (OnGenerateDocComment): Removed unused ds argument.
1772 * delegate.cs (VerifyDelegate): Removed unused argument.
1774 * doc.cs: Uses Length for empty string test.
1776 * driver.cs: Uses Length for empty string test.
1778 * enum.cs (IsValidEnumType): Made static
1780 * expression.cs (EnumLiftUp): Removed unused argument.
1781 (ResolveMethodGroup): Ditto.
1782 (BetterConversion): Ditto.
1783 (GetVarargsTypes): Ditto.
1784 (UpdateIndices): Ditto.
1785 (ValidateInitializers): Ditto.
1786 (MemberAccess.ctor): Ditto.
1787 (GetIndexersForType): Ditto.
1789 * flowanalysis.cs: (MergeFinally): Removed unused argument.
1791 * iterators.cs: Updated after MemberAccess clean up.
1793 * location.cs: Uses Length for empty string test.
1795 * namespace.cs: Uses Length for empty string test.
1797 * report.cs (CheckWarningCode): Made static.
1799 * statement.cs (LabeledStatement): Removed unused argument.
1801 * typemanager.cs (FilterNone): Removed.
1803 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1805 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1808 * class.cs: Updated.
1810 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1812 * cs-parser.jay.cs: __arglist is not allowed for delegates.
1814 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1818 * expression.cs (VerifyArgumentsCompat): Reverted to double error
1819 reporting, it's more tricky than I thought.
1821 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1825 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
1827 (AnonymousMethod.ImplicitStandardConversionExists): New method.
1828 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1829 Add more error reporting; Fixed issue with params.
1831 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1833 * cs-parser.jay: AnonymousMethod requires host container.
1835 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1837 2006-03-18 Raja R Harinath <harinath@gmail.com>
1839 * class.cs: Change 'TypeContainer ds' constructor argument to
1840 'DeclSpace parent'. Some classes were missed below due to
1841 different naming convention.
1843 * class.cs (MemberCore.Parent): Delete. This makes the
1844 ParentContainer changes below enforceable by the compiler.
1846 Treat pointers to enclosing declaration space as 'DeclSpace', not
1848 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1849 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1851 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1853 (Block.AddThisVariable): Likewise.
1854 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1855 (AbstractPropertyEventMethod.Emit): Likewise.
1856 (AbstractPropertyEventMethod.EmitMethod): Likewise.
1857 (GetMethod.Define, SetMethod.Define): Likewise.
1858 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1859 (DelegateMethod.EmitMethod): Likewise.
1861 Fix regression test-partial-13.cs.
1862 Rationalize use of PartialContainer. Ensure that the partial
1863 class semantics can be tied to type-correctness, i.e., any
1864 violation will cause a compile error.
1865 * class.cs, const.cs: Access all fields that belong to class
1866 TypeContainer via ParentContainer. Arguments of EmitContexts and
1867 Resolve()-like functions still use 'Parent'.
1869 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1870 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1871 (PropertyMethod.CheckModifiers): Remove unused argument.
1872 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1875 2006-03-17 Raja R Harinath <harinath@gmail.com>
1877 Make semantics of PartialContainer simpler.
1878 * decl.cs (DeclSpace.IsPartial): Remove.
1879 * class.cs (TypeContainer.IsPartial): Likewise.
1880 (TypeContainer..ctor): Set PartialContainer to point to self.
1881 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1882 (TypeContainer.FindNestedType): Likewise.
1883 (MemberCore.ParentContainer): Simplify. Remove deprecation.
1885 2006-03-17 Marek Safar <marek.safar@seznam.cz>
1887 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1889 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1891 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1894 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1896 * class.cs (Operator.Define): An error for base conversion was not
1899 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
1901 * iterator.cs : yield break is allowed in try statement which has
1902 catch clauses. Fixed bug #77767.
1904 2006-03-13 Marek Safar <marek.safar@seznam.cz>
1906 A fix for #77593, #77574.
1908 * class.cs (MethodCore.CheckBase): Another if for operator.
1910 2006-03-09 Marek Safar <marek.safar@seznam.cz>
1912 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1915 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1916 (DelegateCreation.ImplicitStandardConversionExists): New method for just
1919 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1922 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
1923 Updated after another emitcontext usage was clean up. It should help us to
1924 synchronize with gmcs easier.
1926 2006-03-04 Marek Safar <marek.safar@seznam.cz>
1930 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1931 (Event.Define): ditto
1932 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1934 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1935 Removed redundant code and set NewSlot for Invoke method too.
1937 * parameter.cs (Parameters.ctor): Add custom, type ctor.
1938 (Parameters.MergeGenerated): New method. Use this method when you merge
1939 compiler generated argument with user arguments.
1941 2006-03-03 Marek Safar <marek.safar@seznam.cz>
1943 * attribute.cs (ResolveAsTypeTerminal): Removed.
1945 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1946 specialization for predefined types; 30% speed up.
1947 Finally placed obsolete check to right place.
1948 (Expression.ResolveType): Removed.
1950 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1951 Updated after ResolveType was removed.
1953 * expression.cs (Cast.ctor): Check void cast.
1954 (Binary.ResolveAsTypeTerminal): Is never type.
1955 (Conditional.ResolveAsTypeTerminal): Is never type.
1957 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1959 2006-03-01 Raja R Harinath <rharinath@novell.com>
1962 * expression.cs (ParameterReference.DoResolveBase): Change return
1964 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1968 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1971 * typemanager.cs (GetFullNameSignature): Don't nullref on
1972 protected accessors.
1974 2006-02-27 Marek Safar <marek.safar@seznam.cz>
1976 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1977 these two separated members to simplify the code.
1978 (Attribute.Resolve): Refactored to use new fields and methods.
1979 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1980 implemented obsolete attribute checking.
1981 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1982 implemented obsolete checking again. It look line never ending quest ;-)
1983 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1985 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1987 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1989 *class.cs (Property.Define): Add RegisterProperty call.
1991 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1992 argument groups (only 2).
1994 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1995 encoding expression to arguments.
1996 (Expression.ExprClassToResolveFlags): Just turned to property.
1998 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1999 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
2000 optimized as well as implemented support for zero-length attributes.
2002 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
2003 Add caching of PropertyInfo's.
2005 2006-02-25 Marek Safar <marek.safar@seznam.cz>
2007 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
2008 error multiple times.
2010 2006-02-25 Marek Safar <marek.safar@seznam.cz>
2012 New partial class implementation.
2013 A fix for #77027, #77029, #77403
2015 * attribute.cs (Attributable): Made attributes protected.
2017 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
2018 the replacements of ClassPart and PartialContainer.
2019 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
2020 (TypeContainer.AddInterface): Ditto.
2021 (TypeContainer.AddPartial): The main method for partial classes. It checks
2022 for errors and merges ModFlags and attributes. At the end class is added to
2024 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
2026 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
2027 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
2028 from the rest of partial classes.
2029 (TypeContainer.GetClassBases): Simplified.
2030 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
2032 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
2033 (TypeContainer.HasExplicitLayout): Uses Flags now.
2034 (PartialContainer): Removed.
2035 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
2036 (StaticClass): Was merged with Class.
2037 (Class.GetClassBases): class and static class bases are verified here.
2038 (Class.TypeAttr): Added static attributes when class is static.
2039 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
2040 (MemberBase): In some cases we need to call parent container for partial
2041 class. It should be eliminated but it's not easy now.
2043 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
2045 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
2046 partial classed to accumulate class comments.
2047 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
2049 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
2051 * driver.cs (MainDriver): Tree.GetDecl was removed.
2053 * modifiers.cs (Modifiers): Add partial modifier.
2055 * tree.cs (Tree.decl): Removed.
2056 (RootTypes): Started to use this class more often for root types
2059 2006-02-22 Marek Safar <marek.safar@seznam.cz>
2063 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
2064 external interface does not have an attribute.
2066 2006-02-22 Marek Safar <marek.safar@seznam.cz>
2068 Another prerequisites for new partial classs implementation.
2070 * attribute.cs (Attribute.Equal): Implemented.
2071 (Attribute.Emit): Changed as attributes can be applied more than twice.
2072 (Attributes.Emit): Check for duplicate attributes here.
2074 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
2075 as a parameter, clean-up.
2077 2006-02-11 Marek Safar <marek.safar@seznam.cz>
2081 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
2082 contains obsolete attribute check which can in some cases look for base
2083 type of current class which is not initialized yet.
2084 (TypeContainer.BaseType): Replacement of ptype.
2086 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
2088 2006-02-11 Marek Safar <marek.safar@seznam.cz>
2090 First of prerequisites for new partial classs implemention.
2092 * attribute.cs (Attributable): Extended by ResolveContext;
2093 Attributes finally have correct context for resolving in all cases.
2094 (AttachTo): Attribute owner is assigned here.
2096 * codegen.cs (IResolveContext): Introduce new interface to hold
2097 all information needed in resolving phase.
2098 (EmitContext): Implements IResolveContext; more clean-up needed here.
2100 * decl.cs (MemberCore): Implemented IResolveContext.
2102 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
2103 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
2104 parameter.cs, statement.cs, tree.cs, typemanager.cs:
2105 Refactored to use new IResolveContext instead of EmitContext; cleanup
2107 2006-02-06 Miguel de Icaza <miguel@novell.com>
2109 * codegen.cs (EmitScopeInitFromBlock): check here the
2110 capture_context, there is no need to make two calls to the
2113 * anonymous.cs: Add some debugging messages that might help me
2114 track other instances of this problem in the future (the
2115 regression of test 467).
2117 * cs-parser.jay: track the variable block, as we need to initalize
2118 any captured variables declared in this block for the "catch"
2119 portion of the "Try" statement.
2121 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
2122 scope initialization for captured variables.
2124 Also, move the emit for the variables after the block location has
2127 2006-02-06 Marek Safar <marek.safar@seznam.cz>
2129 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
2131 2006-02-02 Miguel de Icaza <miguel@novell.com>
2133 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
2134 commit yesterday, the initialization for the roots is necessary.
2135 What is not necessary is the scope activation.
2137 2006-02-02 Raja R Harinath <rharinath@novell.com>
2139 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
2140 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
2142 (Argument.Resolve): Remove CS0206 checks.
2144 2006-02-01 Miguel de Icaza <miguel@novell.com>
2146 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
2147 scopes for all the roots, the scopes will now be emitted when the
2148 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
2150 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
2151 code. This reduces a lot of existing cruft.
2153 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
2154 that the ScopeInfo is generated as we enter the scope, not at the
2155 time of use, which is what we used to do before.
2157 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
2158 every time a Block is about to be emitted if we have a
2161 2006-02-01 Raja R Harinath <rharinath@novell.com>
2163 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
2165 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
2167 * typemanager.cs (cons_param_array_attribute): Make private.
2168 (Reset): Set it to null.
2169 (InitCoreHelpers): Don't initialize it.
2170 (ConsParamArrayAttribute): New. Initialize it as needed.
2171 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
2173 2006-01-31 Miguel de Icaza <miguel@novell.com>
2175 * expression.cs: There might be errors reported during the
2176 selection of applicable methods. If there are errors, do not
2177 continue execution as it will lead the compiler to crash.
2179 2006-01-30 Miguel de Icaza <miguel@novell.com>
2181 * expression.cs: Member access is not allowed on anonymous
2182 methods. Fixes #77402.
2184 2006-01-30 Raja R Harinath <rharinath@novell.com>
2187 * cs-parser.jay (VariableDeclaration): Don't set
2188 current_array_type to null.
2189 (field_declaration, event_declaration, declaration_statement):
2190 Set it to null here.
2192 2006-01-28 Raja R Harinath <harinath@gmail.com>
2194 * typemanager.cs (GenericParameterPosition): New.
2197 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
2199 * doc.cs : To process "include" elements, first we should create
2200 another list than XmlNodeList, because it could result in node
2201 removal, which could result in that the XmlNodeList gives up
2204 (Also made code identical to gmcs again.)
2206 2006-01-25 Miguel de Icaza <miguel@novell.com>
2208 * ecore.cs: Introduce an error report that we were not catching
2209 before, if not silent, we must report the error. Gonzalo ran into
2212 2006-01-23 Miguel de Icaza <miguel@novell.com>
2214 A fix for bug: #76957
2216 * iterators.cs (MoveNextMethod.CreateMethodHost): call
2217 ComputeMethodHost before creating the method, this is a new
2220 * anonymous.cs (AnonymousContainer): Now we track all the scopes
2221 that this method references (RegisterScope). The actual scope
2222 where the method is hosted is computed with the ComputeMethodHost
2223 before we create the method.
2225 Moved the Deepest routine here.
2227 (AnonymousContainer.ComputeMethodHost): New routine used to
2228 compute the proper ScopeInfo that will host the anonymous method.
2230 (ScopeInfo): Deal with multiple roots. The problem was that we
2231 did not have a unique root where all ScopeInfos could be hanged
2232 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
2235 Remove AdjustMethodScope which is now computed at the end. Remove
2236 LinkScope which did a partial link, instead link all ScopeInfos
2237 before code generation from the new "LinkScopes" routine.
2239 Simplify all the Add* routines as they no longer need to maintain
2240 the tree, they just need to record that they are using variables
2243 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
2244 routines to produce the forest of ScopeInfo trees.
2246 * class.cs (TypeContainer.AppendMethod): This is just like
2247 AddMethod, but ensures that an interface implementation method
2248 (IEnumerable.XXX) is not inserted at the beginning of the queue of
2249 methods, but at the end.
2251 We use this functionality to ensure that the generated MoveNext
2252 method in the iterator class is resolved/emitted before the
2253 enumerator methods created.
2255 This is required because the MoveNext method computes the right
2256 ScopeInfo for the method. And the other methods will eventually
2257 need to resolve and fetch information computed from the anonymous
2260 2006-01-21 Raja R Harinath <harinath@gmail.com>
2261 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2264 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2266 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2267 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2269 2006-01-18 Raja R Harinath <rharinath@novell.com>
2271 Fix #76656, cs0231-2.cs.
2272 * cs-parser.jay (formal_parameter_list): Make error case catch
2274 (parenthesized_expression_0): Add CS1026 check.
2275 (invocation_expression): Remove unused { $$ = lexer.Location }.
2277 2006-01-17 Raja R Harinath <rharinath@novell.com>
2280 * cs-parser.jay (statement_expression): Don't list out the
2281 individual statement-expressions. Convert syntax error into
2284 2006-01-16 Raja R Harinath <rharinath@novell.com>
2287 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2288 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
2289 CheckIntermediateModification.
2290 (FieldExpr.DoResolve): Add new two-argument version that
2291 allows us to resolve the InstanceExpression as an lvalue.
2292 The one-argument variant is now just a wrapper.
2293 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2294 Resolve the lhs as an lvalue if the it has a value type.
2295 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2296 from Assign.DoResolve.
2297 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2298 resolved as an lvalue.
2299 (PropertyExpr.DoResolve): Update.
2300 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2301 has a value type. Move CS1612 check here from
2302 CheckIntermediateModification.
2303 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2304 * expression.cs (EmptyExpression.OutAccess): New. Used as the
2305 'right_side' of a ResolveLValue on an 'out' argument.
2306 (EmptyExpression.LValueMemberAccess): New. Used as the
2307 'right_side' of a propagated ResolveLValue on a value type.
2308 (LocalVariableReference.DoResolveBase): Recognize
2309 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2311 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2312 EmptyExpression.Null.
2314 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
2316 * typemanager.cs : added IsGenericParameter(). In mcs it always
2318 * doc.cs : for generic parameters, use GenericParameterPosition,
2321 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
2323 * expression.cs: Fix Console.WriteLine ((this = x).foo);
2325 2006-01-12 Miguel de Icaza <miguel@novell.com>
2327 This fixes the problem where we used ldfld instead of ldflda to
2328 load the "THIS" pointer on captured parameters, when THIS is a
2329 value type. See bug #77205.
2331 * iterators.cs (CapturedThisReference.Emit): Pass false to
2332 EmitThis (we do not need the address).
2334 * codegen.cs (EmitThis): it needs to know whether we need the
2335 address of `this' or not. This is used by value types.
2337 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2338 every other call passes false.
2340 2006-01-12 Raja R Harinath <rharinath@novell.com>
2343 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2345 * expression.cs (Invocation.OverloadResolve): Update.
2346 (Invocation.DoResolve): Avoid double resolution of invocation.
2348 2006-01-11 Raja R Harinath <rharinath@novell.com>
2351 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2352 unary negation of floating point types as 0-expr; negation cannot
2353 overflow in floating point types.
2356 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2357 on operands of 'void' type.
2360 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2361 and ExclusiveOr for boolean constants too.
2363 2006-01-09 Raja R Harinath <rharinath@novell.com>
2366 * expression.cs (Invocation.OverloadResolve): Replace reflected
2367 override methods with their base virtual methods, rather than
2369 * typemanager.cs (TypeManager.GetOverride): New.
2371 2006-01-05 Jb Evain <jbevain@gmail.com>
2373 * class.cs (Property.Define, Indexer.Define): do not tag the
2374 properties as SpecialName | RTSpecialName.
2376 2006-01-04 Miguel de Icaza <miguel@novell.com>
2378 * class.cs (MethodCore.IsDuplicateImplementation): This method was
2379 doing a low-level comparission of parameter types. It was lacking
2380 a check for __argslist.
2382 2005-12-30 Miguel de Icaza <miguel@novell.com>
2384 * expression.cs (ParameterReference.DoResolveBase): Allow
2385 reference parameters if they are local to this block.
2387 This allows the ref and out parameters of a delegate to be used in
2388 an anonymous method, for example:
2390 delegate void set (out int x);
2392 set s = delegate (out int x){
2396 This is used by functionality introduced late in the C# language.
2398 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2399 method that take ref and out parameters.
2401 Fixes #77119 which was a late change in the spec.
2403 2005-12-23 Miguel de Icaza <miguel@novell.com>
2405 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2406 parent if its the same scope. Fixes #77060.
2408 2005-12-21 Miguel de Icaza <miguel@novell.com>
2410 * driver.cs: Report the case of no source files and no -out:
2413 2005-12-20 Raja R Harinath <rharinath@novell.com>
2416 * expression.cs (ComposedCast.GetSignatureForError): Define.
2418 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2422 * namespace.cs (NamespaceEntry): Add extern_aliases as a
2423 ListDictionary, to contain the ExternAliasEntry entries (in
2424 addition to the NamespaceEntry.aliases hashtable). This field is
2425 shared between the original entry and its doppelganger (bodyless
2427 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2428 extern_aliases field.
2429 (NamespaceEntry.Lookup): Move the IsImplicit check after the
2430 lookup in extern_aliases.
2432 2005-12-16 Raja R Harinath <rharinath@novell.com>
2435 * class.cs (TypeContainer.Mark_HasEquals): New.
2436 (TypeContainer.Mark_HasGetHashCode): New.
2437 (ClassPart): Override them.
2438 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2441 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2442 'parent' argument to the base constructor.
2444 Remove all mention of TypeContainer from decl.cs.
2445 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2446 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2447 (DeclSpace.DeclSpace): Likewise.
2448 (DeclSpace.DefineMembers): Remove unused argument.
2449 * cs-parser.jay (pop_current_class): Update to changes. Simplify
2450 debugging check -- we don't care if the debug code throws an
2451 InvalidCastException instead of an InternalErrorException.
2452 * class.cs (TypeContainer.DefineMembers): Update to changes.
2453 (TypeContainer.DoDefineMembers): Likewise.
2454 (TypeContainer.GetMethods): Likewise.
2455 (PropertyMember.Define): Likewise.
2456 (MemberBase.Parent): New property that forwards to
2457 MemberCore.Parent, but ensures that we get a TypeContainer.
2458 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2459 (RootContext.PopulateTypes): Likewise. Remove special case code
2460 for !RootContext.StdLib: DefineMembers is idempotent.
2462 2005-12-14 Miguel de Icaza <miguel@novell.com>
2464 * convert.cs (ExplicitConversionCore): Check the return value from
2465 ExplicitConversionCore which can return null on failure. Fixes #76914
2467 2005-12-13 Marek Safar <marek.safar@seznam.cz>
2469 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2471 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
2473 * doc.cs : The search for referenced namespace was insufficient to
2474 get global one as it used to do. Fixed bug #76965.
2476 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
2478 * doc.cs : check name in cref in the last phase that whether it is
2481 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2483 * cs-tokenizer.cs : reverted the latest change: it somehow broke
2486 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2488 * doc.cs : so it turned out that we cannot skip override check for
2489 interface members. Fixed bug #76954.
2491 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2493 * cs-tokenizer.cs : fixed bug #75984:
2494 - #warning and #error should not be handled when the source line
2496 - #line is not checked strictly when the source line is disabled.
2497 - #define and #undef is on the other hand checked strictly at any
2500 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
2502 * cs-tokenizer.cs : missing Location (actually, filename) in one of
2505 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2507 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2509 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2511 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2512 (FieldBase.Initializer): Initializer is now optional.
2513 (EventField.Define): Only event field can have initializer.
2515 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2517 * const.cs (Const): Reuse initializer.
2519 * cs-parser.jay: Updated after FieldBase changes.
2520 Added current_array_type to simplify array initializers.
2522 * ecore.cs (NullCast.IsDefaultValue): Implemented.
2524 * expression.cs, iterators.cs: Updated.
2526 * namespace.cs (NamespaceEntry): Made UsingFound private.
2528 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2530 * parameterCollection.cs: Obsolete, removed.
2531 * parser.cs: Obsolete, removed.
2533 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2536 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2538 * enum.cs (Enum.Define): Set obsolete context here.
2540 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2543 - FindDocumentedMember() now expects 1) paramList as null
2544 when "we don't have to check the number of parameters" and
2545 2) Type.EmptyTypes when "there is no arguments".
2546 - Introduced FoundMember struct to hold the exact type which was
2547 used to find the documented member (the above change broke
2548 test-xml-044; it might be better just to use DeclaringType than
2549 what MS does, like this change does, but it depends on usage.)
2551 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2553 * doc.cs : documented member might be from DeclaringType for nested
2554 types. Fixed bug #76782.
2556 2005-12-03 Ben Maurer <bmaurer@ximian.com>
2558 * anonymous.cs: Have the param code handle leaving copies on the
2559 stack etc. Allows anonymous params to take part in the assignment
2560 code (++, +=, etc). Fixes bug #76550
2562 * expression.cs: Handle the prepare_for_load/leave_copy by passing
2563 it down to the anon code.
2565 * iterators.cs: Use dummy var here
2567 * codegen.cs: Handle new vars
2569 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2572 * class.cs (MethodData.Define): Set proper Obsolete context.
2574 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2576 (FieldExpr.DoResolve): Ditto.
2578 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2581 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2582 parent is not obsolete.
2584 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
2586 * doc.cs : (FindDocumentedMember) find parameterless members first
2587 and get CS0419 in the early stage. Fixed first case of bug #76727.
2589 2005-11-30 Marek Safar <marek.safar@seznam.cz>
2592 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2593 no error was reported.
2595 *expression.cs (Binary.DoResolve): left can be null.
2597 2005-11-22 Marek Safar <marek.safar@seznam.cz>
2600 * class.cs (MethodData.Emit): Parameters should be labeled first.
2602 2005-11-21 Marek Safar <marek.safar@seznam.cz>
2605 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2607 2005-11-18 Marek Safar <marek.safar@seznam.cz>
2609 * attribute.cs (AreParametersCompliant): Moved to Parameter.
2611 * class.cs (MethodCore): Parameter clean up.
2612 (IMethodData): Added ParameterInfo.
2613 (MethodData): Parameter clean up.
2614 (Indexer.Define): Parameter clean up.
2626 * typemanager.cs: Parameter clean up.
2628 * delegate.cs (Define): Get rid of duplicated code.
2630 * expression.cs (ParameterReference): Removed useless parameters
2632 (Invocation): Ditto.
2634 * parameter.cs (ParamsParameter): New class, params specialization.
2635 (ArglistParameter): Attemp to separate arglist.
2636 (Parameter): Refactored to be reusable and faster.
2637 (Parameter.Modifier): Made understandable.
2638 (Parameters): Changed to be used as a class for `this' assembly
2639 parameters. Refactored to use new specialized classes.
2641 * support.cs (ParameterData): Added Types property.
2642 (InternalParameters): Deleted.
2644 2005-08-20 Martin Baulig <martin@ximian.com>
2646 Merging this patch from GMCS to fix #75867.
2648 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2649 scope if we don't already have it.
2651 2005-11-17 Martin Baulig <martin@ximian.com>
2654 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2655 inherit the scope from our parent. Fixes #76653.
2657 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2659 * doc.cs : the previous patch does not actually fix the bug.
2660 PropertyInfo override check is now implemented and really fixed it.
2661 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2663 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2665 * doc.cs : apply "override filter" also to properties.
2668 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2670 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2671 no need to check overrides. For classes, omit those results from
2672 interfaces since they must exist in the class. Fixed bug #76726.
2674 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2676 * typemanager.cs : (GetFullNameSignature) differentiate indexers
2677 with different parameters. Fixed the second problem in #76685.
2679 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2681 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2682 get expected 'protected' access in CheckValidFamilyAccess()).
2685 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2687 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2688 Fixed bug #76705. CS1569 was incorrectly commented out.
2690 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2692 * doc.cs : use Invocation.IsOverride() to do real override check.
2693 * expression.cs : made Invocation.IsOverride() internal.
2695 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2697 * doc.cs : use TypeManager.FindMembers() instead of (possible)
2698 TypeBuilder.FindMembers() and filter overriden base members out.
2701 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2703 * doc.cs : ref/out parameters are represented as '@' (instead of
2704 '&' in type FullName). Fixed bug #76630 (additionally crefs).
2706 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2708 * doc.cs : when there was no '.' in cref to methods in doc comment,
2709 then parameters were missing in the output. Fixed bug #76691.
2711 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2713 * driver.cs : don't output docs when there is an error.
2716 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2719 Now it should detect indexers. Fixed primary concern in bug #76685.
2720 Fixed CS0419 message to not show the identical member signature in
2723 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2725 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2726 instead of Type.FindMembers() since it does not handle events.
2729 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
2731 * codegen.cs: Fixed typo (speficied -> specified).
2733 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2736 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2738 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2740 * attribute.cs: Changed error message.
2742 * cs-tokenizer.cs: One more check.
2744 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2746 * statement.cs (Block.Resolve): Ignore empty statement.
2748 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2750 * report.cs: Made error/warning methods more strict to avoid
2753 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2754 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2755 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2756 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2758 2005-11-08 Marek Safar <marek.safar@seznam.cz>
2760 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2761 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2763 * class.cs (TypeContainer.IsComImport): New property.
2764 (Constructor.Define): Create proper ctor for ComImport types.
2766 * expression.cs (New.CheckComImport): Fixed.
2768 2005-11-07 Miguel de Icaza <miguel@novell.com>
2770 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2771 that a parameter has been captured does not mean that we do not
2772 have to do the rest of the processing. This fixes the second part
2773 of #76592. If there was another anonymous method capturing
2774 values in the past, the Scope would never be set for the second
2775 method that captured the same parameter.
2777 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2778 properly manipulate the stack. Second part of fix for #76592.
2780 * expression.cs (New): Add support for invoking "new" on
2781 interfaces that have been flagged with the ComImport attribute and
2782 the CoClass. Fixes #76637
2784 * statement.cs (Try.DoEmit): When a variable is captured, do not
2785 try to emit the vi.LocalBuilder variable as it has been captured.
2786 Create a temporary variable and store the results on the
2787 FieldBuilder. Fixes #76642
2789 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2791 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2793 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2795 * expression.cs (Binary.DoResolve): Added && optimalization.
2797 * typemanager.cs (AddUserType): Removed useless argument.
2799 2005-11-04 Marek Safar <marek.safar@seznam.cz>
2801 * statement.cs (Block.variables): Uses ListDictionary.
2803 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2806 * class.cs (PartialContainer.EmitType): Customized to emit
2807 security attributes.
2808 (ClassPart.ApplyAttributeBuilder): Transform security attribute
2809 for partial classes.
2811 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2814 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2815 access has to be fixed.
2817 * typemanager.cs (IsUnmanagedType): Wrong common field type.
2819 2005-11-01 Marek Safar <marek.safar@seznam.cz>
2822 * ecore.cs (NullCast.Reduce): Implemented.
2824 * expression.cs (ArrayCreation.CheckIndices): Correcly check
2827 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2829 (Foreach.Resolve): Catch null properly.
2831 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2833 * cs-tokenizer.cs: Warning text fix.
2835 * driver.cs: AllWarningNumbers exposed on public interface.
2837 * report.cs (): Reviewed warning numbers.
2838 (IsValidWarning): Use binary search.
2840 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2842 * driver.cs: Implemeted resource visibility.
2843 (Resources): New class for code sharing between /res: and
2846 2005-10-28 Marek Safar <marek.safar@seznam.cz>
2849 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2852 * convert (Convert.ImplicitReferenceConversion): NullCast holds
2855 * ecore.cs (NullCast): Child is contant only.
2857 * literal.cs (NullLiteral.Reduce): null can be converted to any
2860 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
2862 * driver.cs: Use Encoding.Default as default code page instead
2865 2005-10-27 Raja R Harinath <rharinath@novell.com>
2868 * expression.cs (Invocation.Error_InvalidArguments): Handle
2869 __arglist parameters.
2870 (Invocation.VerifyArgumentsCompat): Likewise.
2871 * support.cs (ReflectionParameters.GetSignatureForError): Print
2872 __arglist parameters.
2873 (InternalParamters.GetSignatureForError): Likewise.
2874 * parameter.cs (Parameters.GetSignatureForError): Likewise.
2876 2005-10-26 Marek Safar <marek.safar@seznam.cz>
2878 * attribute.cs (GetPropertyValue): Made public.
2880 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2882 Add new property WrapNonExceptionThrows to handle 2.0 assembly
2884 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2887 * driver.cs: Reflect method name change.
2889 * statement.cs (Try.Resolve): Warn when try has both general
2892 * typemanager.cs: runtime_compatibility_attr_type new predefined
2895 2005-10-26 Raja R Harinath <harinath@gmail.com>
2898 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2899 treat it as an empty parameter list.
2901 2005-10-26 Raja R Harinath <rharinath@novell.com>
2904 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
2905 ResolveAsTypeStep silent.
2906 * statement.cs (Block.AddConstant): Mark block as used.
2907 (Block.ResolveMeta): Avoid piling on error messages
2908 if a constant initializer resolution fails.
2910 2005-10-25 Raja R Harinath <rharinath@novell.com>
2912 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2914 (NamespaceEntry.VerifyAllUsing): New.
2915 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
2916 behaviour. Delegates actual resolution of alias to ...
2917 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
2918 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2920 * driver.cs (Driver.MainDriver): Update.
2922 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2923 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2925 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2927 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2928 RootNamespace.DefineNamespacesForAll.
2930 2005-10-24 Raja R Harinath <harinath@gmail.com>
2932 * typemanager.cs (assemblies, external_aliases, modules)
2933 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2934 (ComputeNamespaces, GetRootNamespace): Remove extra staging
2935 overhead. Move resposibility ...
2936 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
2937 * driver.cs, attribute.cs, codegen.cs: Update to changes.
2939 2005-10-23 Raja R Harinath <harinath@gmail.com>
2941 * namespace.cs (RootNamespace.all_namespaces): Renamed from
2942 cached_namespaces. Improve usage.
2943 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2944 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2945 Move from GlobalRootNamespace and simplify.
2946 (RootNamespace.Global): Make instance variable.
2947 (RootNamespace.RootNamespace): Add "alias name" parameter.
2948 (GlobalRootNamespace): Simplify drastically.
2949 (Namespace.Lookup): Don't use GetNamespace.
2950 * typemanager.cs (GetRootNamespace): Rename from
2951 ComputeNamespaceForAlias.
2952 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2954 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2956 * anonymous.cs (AnonymousContainer): Don't crash when container
2959 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2961 * expression.cs (Binary.DoResolve): Warn when comparing same
2964 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2967 * expression.cs (Binary.DoResolve): It looks like there are no
2968 convetsion rules in enum context.
2970 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2972 Add support for extern alias qualifiers.
2973 * typemanager.cs: Move some LookupTypeReflection code
2974 to namespace.cs, to have cleaner code. Added some methods
2975 to help us keep track of the extern aliased references.
2976 * driver.cs: Add suport for extern alias assemblies on command
2977 line and check for their warnings/errors. Also keep track of the
2978 extern aliased assemblies.
2979 * namespace.cs: Move the global functionality of Namespace
2980 to GlobalRootNamespace/RootNamespace. Now the global namespace
2981 is GlobalRootNamespace.Globa. Also the code moved from
2982 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
2983 Finally added LocalAliasEntry (AliasEntry before) and
2984 ExternAliasEntry, to handle alias statements.
2985 * cs-parser.jay: Add support in the grammar for extern alias
2987 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
2988 Update callings to Namespace (now in GlobalRootNamespace).
2990 2005-10-18 Raja R Harinath <rharinath@novell.com>
2993 * class.cs (TypeContainer.DefineType): Move updating of
2994 topological sort earlier in the code.
2995 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2997 2005-10-18 Marek Safar <marek.safar@seznam.cz>
3000 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
3002 * constant.cs (Constant.TryReduce): Moved from Cast class.
3003 (Reduce): Made little bit more OO and fixed missing conversions.
3005 * ecore.cs (Reduce): Implemented.
3006 (Binary.EnumLiftUp): New method to upgrade values to enum values.
3008 * literal.cs (Reduce): Implemented.
3010 * class.cs: Reverted Miguel's wrong commit.
3012 2005-10-14 Miguel de Icaza <miguel@novell.com>
3014 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
3016 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
3018 * cs-parser.jay, expression.cs : CS0214 was missing error location
3019 for constants. Fixed bug #76404.
3021 2005-10-11 Marek Safar <marek.safar@seznam.cz>
3024 * convert.cs (ExplicitConversionCore): Fixed object->enum
3027 2005-10-10 Raja R Harinath <rharinath@novell.com>
3029 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
3031 (PropertyExpr.EmitCall): Likewise.
3032 * expression.cs (Invocation.EmitArguments): Handle case where
3034 (Invocation.EmitCall): Avoid allocating temporary variable if
3035 there are no arguments.
3037 2005-10-07 Raja R Harinath <rharinath@novell.com>
3040 * convert.cs (ImplicitConversionStandard): Move conversion of
3041 void* to arbitrary pointer types ...
3042 (ExplicitConversionStandard): .. here.
3043 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
3044 error to always print typenames.
3046 2005-10-07 Raja R Harinath <rharinath@novell.com>
3048 * convert.cs (GetConversionOperator): Rename from
3049 GetConversionOperators. Move operator selection code from ...
3050 (UserDefinedConversion): ... here.
3052 2005-10-06 Marek Safar <marek.safar@seznam.cz>
3054 * convert.cs (ExplicitConversionCore): Removed duplicate enum
3057 2005-10-05 Marek Safar <marek.safar@seznam.cz>
3059 * assign.cs (Assign.DoResolve): Error method changed.
3061 * cfold.cs (DoConstantNumericPromotions): Error method changed.
3063 * const.cs (ResolveValue): Reset in_transit immediately.
3065 * constant.cs: Error method changed.
3067 * convert.cs: Removed useless location parameter.
3068 (ExplicitNumericConversion): Don't do double enum check.
3069 (ExplicitConversionCore): Renamed from ExplicitConversion.
3070 (ExplicitUnsafe): Extracted from ExplicitConversion.
3071 (ExplicitConversion): Uses for error reporting.
3073 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3075 (ResolveBoolean): Uses common error method.
3076 (CastToDecimal): Get rid of ec.
3077 (CastFromDecimal): Optimized.
3078 (ConvCast): Get rid of ec.
3080 * enum.cs (ResolveValue): Reset in_transit immediately.
3081 (Emit): Return after first error.
3083 * expression.cs: Convert changes.
3085 * literal.cs: Error method changed.
3087 * statement.cs: Error method changed.
3089 2005-10-03 Raja R Harinath <rharinath@novell.com>
3091 * support.cs (SeekableStreamReader.Position): Don't error out when
3092 the requested position is just beyond the end of the current
3095 2005-09-28 Raja R Harinath <rharinath@novell.com>
3097 * support.cs (SeekableStreamReader): Simplify drastically. Don't
3098 try to keep in sync with the byte count of the underlying Stream.
3099 However, this limits us to a window size of 2048 characters: i.e.,
3100 the maximum lookahead of our lexer/parser can be 2048 characters.
3102 2005-09-28 Marek Safar <marek.safar@seznam.cz>
3105 * driver.cs: Fix compilation files with full root path.
3107 2005-09-25 Miguel de Icaza <miguel@novell.com>
3109 * report.cs (SymbolRelatedToPreviousError): Format the output so
3110 it does not use an open parenthesis that is never closed.
3112 * driver.cs: Follow coding guidelines
3114 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3117 * const.cs (Const.ResolveValue): Check for assigning non-null
3118 value to reference type.
3120 2005-09-27 Marek Safar <marek.safar@seznam.cz>
3122 * anonymous.cs: Implemented ExprClassName.
3124 * assign.cs (Assign.DoResolve): Don't chrash when type is not
3127 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3130 * class.cs (StaticClass.DefineContainerMembers): Report protected
3133 * codegen.cs: if(ed) PRODUCTION.
3135 * convert.cs (Error_CannotImplicitConversion): Better error
3138 * cs-parser.jay: More error checks.
3140 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3142 * driver.cs (CSCParseOption): Enabled wrong option check.
3144 * ecore.cs (Expression.ExprClassName): Turned to property.
3145 (MemberExpr.CheckIntermediateModification): For checking boxed
3146 value types modification.
3148 * statement.cs (Fixed.Resolve): Expression type must be
3149 convertible to fixed type.
3150 (CollectionForeach.GetEnumeratorFilter,TryType):
3151 Small refactoring for easier error checking.
3153 2005-09-26 Marek Safar <marek.safar@seznam.cz>
3155 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3158 * class.cs (GeneratedBaseInitializer): New class for customization
3159 compiler generated initializers.
3160 (MemberBase.DoDefine): Check Obsolete attribute here.
3161 (FieldMember.DoDefine): Ditto.
3163 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3166 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3167 (MemberCore.GetObsoleteAttribute): Removed argument.
3168 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3169 (MemberCore.CheckObsoleteType): New helper.
3173 * statement.cs: Updates after MemberCore changes.
3175 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3176 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3178 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3179 obsolete attribute for compiler construct.
3180 (As.DoResolve): Cache result.
3182 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3184 2005-09-26 Raja R Harinath <rharinath@novell.com>
3187 * expression.cs (This.VerifyFixed): In a value type T, the type of
3188 'this' is T&, iow, 'this' is either an out or ref parameter. In a
3189 value type R, 'this' is treated as a value parameter.
3191 2005-09-22 Miguel de Icaza <miguel@novell.com>
3193 * statement.cs (Lock): Use the TemporaryVariable class instead of
3194 manually using local variables as those do not work when variables
3197 * ecore.cs: Moved the TemporaryVariable class from being a nested
3198 class inside Foreach to be a public class that can be employed in
3201 2005-09-19 Marek Safar <marek.safar@seznam.cz>
3203 * cs-parser.jay: interface_accessors replaced by
3204 accessor_declarations.
3206 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3209 * statement.cs (GotoCase.Resolve): Convert null constant to
3211 (SwitchLabel.ResolveAndReduce): Ditto.
3212 (SwitchLabel.NullStringCase): Custom null stamp.
3213 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3215 typemanager.cs (CSharpSignature): Don't skip first argument
3218 2005-09-18 Miguel de Icaza <miguel@novell.com>
3220 * driver.cs: Set InEmacs based on the environment variable EMACS.
3222 * location.cs (InEmacs): in this mode, do not report column
3223 location as it confuses Emacs.
3225 2005-09-16 Marek Safar <marek.safar@seznam.cz>
3227 * cfold.cs, constant.cs, convert.cs, ecore.cs,
3228 expression.cs, iterators.cs, literal.cs: Store constants and
3231 * class.cs (MemberBase.ShortName): Pass location.
3233 * cs-parser.jay: Some location fixes.
3235 * ecore.cs (Expression.Location): Made virtual.
3237 2005-09-05 Miguel de Icaza <miguel@novell.com>
3239 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3240 if the underlying types are the same, otherwise we need to produce
3241 code that will do the proper cast.
3243 This was exposed by Marek's constant rewrite which produced
3244 invalid code for the call site:
3247 void Method (X v) {}
3251 This fixes test-49.cs
3253 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3255 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3256 Type/Object should be allowed as well. Fixed bug #75968.
3258 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3260 * expression.cs : (Binary.DoResolve): when one is enum constant and
3261 another is constant 0, then return enum one *as enum type*.
3264 2005-09-02 Raja R Harinath <rharinath@novell.com>
3266 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3270 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3271 flow-branching for LocalVariableReferences in case we were invoked
3272 from a MemberAccess.
3273 * expression.cs (LocalVariableReference.VerifyAssigned): New.
3275 (LocalVariableReference.DoResolveBase): ... this.
3276 (MemberAccess.Resolve): Do the check that was disabled during
3279 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3282 (PartialContainer.Create): check abstract/sealed/static strictly
3283 but abstract/sealed can exist only at one side. Fixed bug #75883.
3285 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
3288 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3289 specified, don't default to UnmanagedType.I4.
3291 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3293 * expression.cs : conditional operator should check possibly
3294 incorrect assign expression. Fixed bug #75946.
3296 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
3298 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
3299 Reverting the change. gmcs is much complex than mcs on this matter.
3301 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
3303 * cs-tokenizer.cs : To read another token ahead of the actual
3304 consumption, use new SavedToken and cache token instead of moving
3305 back the stream with SeekableStreamReader (it seemed problematic).
3307 driver.cs : Thus use StreamReader directly.
3308 * support.cs : Thus removed SeekableStreamReader.
3310 2005-08-30 Raja R Harinath <rharinath@novell.com>
3313 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3314 (ScopeInfo.EmitScopeType): Use it to construct field names from
3315 names of captured locals.
3318 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3319 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3320 Pass 'target_type' to BoxedCast. Don't default to 'object'.
3321 (ExplicitConversion): Remove enum cases already handled by
3322 implicit conversion. Move implicit conversion check to the beginning.
3323 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3324 * expression.cs (ArrayCreation.EmitDynamicInitializers):
3325 Don't treat System.Enum as a struct.
3327 2005-08-30 Jb Evain <jbevain@gmail.com>
3329 * attribute.cs: handles as expression in parameters.
3331 2005-08-30 Raja R Harinath <rharinath@novell.com>
3334 * class.cs (TypeContainer.VerifyClsName): Don't use a
3335 PartialContainer when verifying CLS compliance.
3336 (AbstractPropertyEventMethod): Set Parent here, ...
3337 (PropertyMethod): ... not here.
3339 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
3341 * attribute.cs : escaped attribute name should not be allowed to be
3342 resolved (e.g. @class as classAttribute). Fixed bug #75930.
3344 2005-08-29 Raja R Harinath <rharinath@novell.com>
3347 * convert.cs (ImplicitStandardConversionExists): Allow zero also
3348 when converting a long constant to unsigned long.
3349 * expression.cs (Invocation.OverloadResolve): Add sanity check to
3350 detect where IsApplicable and VerifyArgumentsCompat disagree.
3352 2005-08-29 Raja R Harinath <rharinath@novell.com>
3353 and Carlos Alberto Cortez <carlos@unixmexico.org>
3356 * class.cs (TypeContainer.CanElideInitializer): New helper.
3357 (TypeContainer.EmitFieldInitializers): Use it to determine if we
3358 can safely emitting the initializer of a field.
3360 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3362 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3363 allowed inside a switch (without loop). Fixed bug #75433.
3365 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3367 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3368 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3370 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3372 * driver.cs : kinda reverting the default encoding changes (not exact
3373 revert since I noticed that "codepage:reset" might not work fine).
3375 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3377 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3378 Location. Now getter and setter store location correctly.
3379 (errors/cs0111-12.cs now reports the expected location.)
3381 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3383 * driver.cs : Use default encoding on the environment.
3384 Removed (now that) extra parameter for SeekableStreamReader.
3385 * support.cs : (SeekableStreamReader) third .ctor() argument for
3386 StreamReader is not required (always true). preamble size could
3387 be acquired in simpler and safe way.
3389 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
3391 * cs-parser.jay: report CS0642 at warning level 3
3392 and report CS0642 for an if else statement also
3393 fixes bug #74745. Patch by John Luke (and a bit
3395 Removed extra CS0642 warning check for "while",
3397 * statement.cs: In Block.Resolve(), CS0642 check
3398 is reimplemented to check a sequence of an empty
3399 statement and a block.
3401 Both fix bug #66777.
3403 2005-08-24 Marek Safar <marek.safar@seznam.cz>
3405 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3406 detection until I fix it.
3408 * cs-tokenizer.cs: Changed error message.
3410 * cs-parser.jay: Fixed 2 error locations.
3412 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3413 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3416 * enum.cs (GetSignatureForError): Fixed.
3418 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3422 * typemanager.cs (RegisterProperty): Removed.
3424 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3426 2005-08-24 Raja R Harinath <rharinath@novell.com>
3429 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3430 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3432 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3434 * expression.cs : tiny fix is required for not warning positive ulong.
3437 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3439 * expression.cs : add CS0652 check for constant and integral
3440 expression. Fixed bug #53974.
3442 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3444 * expression.cs : in DoNumericPromotions(), check if there is implicit
3445 conversion overload for string (to check CS0034). Fixed bug #52492.
3447 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3449 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3451 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3453 * ecore.cs : report location when it is *not* Null.
3455 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3461 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3462 correctly. Fixed bug #75721.
3464 2005-08-23 Raja R Harinath <rharinath@novell.com>
3466 * support.cs (SeekableStreamReader.Position): Avoid an expensive
3467 loop that performs 'min (pos, char_count)'.
3470 * expression.cs (Unary.ResolveOperator): Don't discard implicit
3471 converted value in Operator.OnesComplement.
3473 2005-08-22 Ben Maurer <bmaurer@ximian.com>
3475 * anonymous.cs: If the anon method is pulled into a helper class,
3476 it needs to be `internal' not `private'. Fixes runtime behavior on
3479 2005-08-20 Martin Baulig <martin@ximian.com>
3481 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3482 scope if we don't already have it.
3484 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3485 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3488 2005-08-17 Marek Safar <marek.safar@seznam.cz>
3491 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3494 2005-08-16 Marek Safar <marek.safar@seznam.cz>
3496 The big constants rewrite
3497 Fix #75746, #75685 and more
3498 As a side effect saved 1MB for MWF ;-)
3500 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3501 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3502 enum based for corlib compilation.
3504 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3507 * class.cs (FixedField.Define): Use ResolveAsConstant.
3509 * const.cs (IConstant): Interface constants and enums.
3510 (Const.ResolveValue): New method for constant resolvning.
3511 (ExternalConstant): Constants from imported assemblies.
3513 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3514 conversion; like enums.
3515 (Constant.ToType): Converts this constant to different type.
3516 (Constant.Increment): Adds 1.
3518 * convert.cs (ImplicitConversionRequired): Simplified.
3520 * cs-parser.jay: Create EnumMember directly.
3522 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3524 * doc.cs (GenerateEnumDocComment): Removed.
3526 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3527 (ConvertIntLiteral): Removed.
3528 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3530 * enum.cs (EnumMember): Implement IConstant.
3531 (Enum.IsValidEnumConstant): Removed.
3532 (Enum.GetNextDefaultValue): Removed.
3533 (Enum.FindMembers): Updated.
3534 (Enum.GenerateDocComment): Iterate enum members.
3536 * expression.cs (Cast.TryReduce): Handle enums correctly.
3537 (New.Constantify): Made public.
3538 (MemberAccess.DoResolve): Removed contant specific if(s).
3540 * literal.cs (NullLiteral): Implement new abstract methods.
3542 * statement.cs (GotoCase.Resolve): Use new constant methods.
3543 (SwitchLabel.ResolveAndReduce): Use new constant methods.
3545 * typemanager.cs (LookupEnum): Removed.
3546 (IsEnumType): Fixed to work with corlib.
3547 (RegisterConstant): Removed.
3548 (LookupConstant): Removed.
3549 (GetConstant): Changed to work with IConstant.
3551 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
3553 * location.cs : Fixed overflown (>255) column number.
3555 2005-08-03 Raja R Harinath <rharinath@novell.com>
3557 First cut of the qualified-alias-member feature.
3558 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3560 * cs-parser.jay (DOUBLE_COLON): New token.
3561 (namespace_or_type_name): Add rule for recognizing
3562 qualified-alias-members.
3563 (primary_expression): Likewise.
3564 (element_access): Allow QualifiedAliasMember as a possible
3565 type-bearing expression.
3566 (local_variable_type, local_variable_pointer_type): Likewise.
3567 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
3568 aliases in the current and enclosing namespace declarations.
3569 (NamespaceEntry.UsingAlias): Add CS0440 warning.
3570 * decl.cs (MemberName.is_double_colon): New.
3571 (MemberName.MemberName): Add new constructor for alias-member.
3572 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3573 * expression.cs (QualifiedAliasMember): New expression type.
3575 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3577 * location.cs : it borked when no argument was specified.
3579 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3581 * location.cs : tiny ToString() format fix.
3583 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3585 * statement.cs : oops, it was missing.
3587 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3589 A set of fixes for precise line/column location.
3592 "token" field now holds a file/line "delta", a line number offset
3593 from the segment, and a column number. See also:
3594 http://lists.ximian.com/pipermail/mono-devel-list/2004-
3595 December/009508.html
3596 Removed static IsNull. Use instance IsNull property instead.
3598 For some tokens it stores Location. For Identifier it stores
3599 LocatedToken which is a pair of string name and location.
3600 Column numbers are adjusted only at getChar().
3602 Use Location.ToString() for reporting (it now contains column).
3604 Largely modified to use LocatedToken instead of
3605 string (IDENTIFIER), and to acquire Location from some tokens.
3606 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3607 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3609 Now MemberName holds Location. DeclSpace.ctor() receives Location
3610 as a parameter. Removed extra parameters to all derived classes.
3611 Replaced Location.IsNull() with instance property.
3612 * assign.cs, expression.cs :
3613 Added .ctor() overload that omits Location.
3615 Added "nameEscaped" flag that indicates the identifier was escaped
3616 in the source file. This fixes bug #57047.
3618 2005-08-02 Marek Safar <marek.safar@seznam.cz>
3620 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3621 New method, looking for lo-case imported cls type.
3623 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3626 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3628 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3630 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3632 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3634 Optimized to save 3.5 MB for SWF compilation.
3636 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3638 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3639 (PartialContainer.Create): Moved logic AddToContainer.
3640 (PartialContainer.MarkForDuplicationCheck): Shares name.
3642 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3645 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3647 (Namespace.GetSignatureForError): New method.
3649 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3650 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3652 2005-08-01 Raja R Harinath <rharinath@novell.com>
3655 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3656 member lookup rather than qualifier_type, since qualifier_type can
3659 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3661 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3664 2005-07-31 Miguel de Icaza <miguel@novell.com>
3666 * statement.cs: Copy the local exception into the exception
3667 captured local. Fixes 75674
3669 2005-07-31 Raja R Harinath <harinath@gmail.com>
3672 * expression.cs (Invocation.OverloadResolve): Don't report error
3673 CS1501 if error CS1502 has been reported.
3674 (New.DoResolve): Delegate CS1501 reporting to
3675 Invocation.OverloadResolve.
3678 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3679 invariant-meaning-in-block property in an enclosing block if
3682 2005-07-29 Marek Safar <marek.safar@seznam.cz>
3684 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3685 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3686 (Switch.CheckSwitch): Just save 50kb for SWF.
3688 2005-07-27 Martin Baulig <martin@ximian.com>
3690 * anonymous.cs (CaptureContext.AddField): Added
3691 `AnonymousContainer am' argument; compute its toplevel scope if
3692 it's not already computed. Fixes #75649.
3694 2005-07-26 Raja R Harinath <rharinath@novell.com>
3697 * class.cs (Constructor.Emit): Reset block to null if the block
3700 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3702 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3704 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3706 * class.cs (MethodData.Define): Check whether accessor implementing
3707 interface is public.
3709 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3711 2005-07-22 Marek Safar <marek.safar@seznam.cz>
3714 * namespace.cs (LookupType): Moved same type check to...
3716 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3719 2005-07-21 Raja R Harinath <rharinath@novell.com>
3721 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3722 already found a typebuilder.
3723 * class.cs (MethodCore.IsDuplicateImplementation): Compare
3724 MemberNames, not strings.
3726 * const.cs (Error_ExpressionMustBeConst):
3727 Rename from Error_EpressionMustBeConst.
3728 * const.cs, class.cs, statement.cd: Update.
3730 2005-07-21 Marek Safar <marek.safar@seznam.cz>
3734 * const.cs (Const.LookupConstantValue): Report missing contant expression
3736 (Error_EpressionMustBeConstant): Only one error method.
3738 * class.cs, statement.c: Updated.
3740 2005-07-20 Raja R Harinath <rharinath@novell.com>
3742 * statement.cs (Block.Flags): Add back HasVarargs.
3743 (Block.flags): Make protected.
3744 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3746 * typemanager.cs (types, typecontainers, user_types): Remove.
3747 (UserTypes, TypeContainers): Likewise.
3748 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3749 (CleanUp, Reset): Update.
3750 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
3751 (GetNestedType): Use Type.GetNestedType.
3752 (CoreLookupType): Take two arguments, the namespace and the
3753 basename of the type. Update to use the Namespace.Lookup
3755 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3756 (RealMemberLookup): Use IsNestedChildOf instead of playing with
3757 string concatenation and substring matches.
3758 * class.cs, enum.cs, delegate.cs: Update to changes.
3760 2005-07-20 Marek Safar <marek.safar@seznam.cz>
3762 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3763 Expression and made virtual.
3765 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3766 (ImplicitStandardConversionExists): Fixed `byte' typo ?
3768 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3770 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3773 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3776 2005-07-18 Marek Safar <marek.safar@seznam.cz>
3779 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3780 AssemblyCultureAttribute is not used on executable.
3783 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3785 2005-07-16 Raja R Harinath <rharinath@novell.com>
3788 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3789 New. Reports CS0252/CS0253.
3790 Mostly taken from preliminary patch by Duncak Mak.
3791 (Binary.DoResolveOperator): Store results of operator lookup.
3792 Use them to detect if we need to warn about unintended reference
3795 2005-07-15 Raja R Harinath <rharinath@novell.com>
3798 * namespace.cs (Namespace.Lookup): Add back location parameter.
3799 (Namespace.LookupType): Add CS0436 report. Add location parameter.
3800 * delegate.cs, ecore.cs, expression.cs: Update to changes.
3802 * codegen.cs (EmitContext.DeclSpace): Make readonly.
3803 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3804 (Namespace.LookupType): ... this.
3805 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3807 * typemanager.cs (LookupTypeReflection): Remove buggy code that
3808 purported to handle pointers.
3809 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3812 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3814 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3817 2005-07-15 Raja R Harinath <rharinath@novell.com>
3819 * namespace.cs (Namespace.Lookup): Drop location parameter.
3820 (NamespaceEntry.LookupAlias): Remove. Merge into ...
3821 (NamespaceEntry.Lookup): ... this.
3822 (NamespaceEntry.Error_AmbiguousTypeReference):
3823 Move here from DeclSpace.
3824 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3826 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3827 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3828 Move to NamespaceEntry.
3829 * delegate.cs, expression.cs: Update to changes.
3831 2005-07-14 Marek Safar <marek.safar@seznam.cz>
3833 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3834 CheckAttributeType and refactored.
3835 (Attribute.ResolvePossibleAttributeType): Changed to reuse
3836 ResolveAsTypeTerminal error handling.
3837 (ResolveAsTypeTerminal): Introduced because of global attributes extra
3839 (GetSignatureForError): Print errors in same way.
3842 * codegen.cs: Reflect attribute GetSignatureForError change.
3845 * expression.cs: Add silent parameter to ResolveAsTypeStep.
3847 * namespace.cs (UsingEntry): Refactored to make fields private.
3850 statement.cs: Error_UnexpectedKind has extra parameter.
3852 2005-07-14 Raja R Harinath <rharinath@novell.com>
3854 * ecore.cs (IAlias): Remove.
3855 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
3856 that implement the interface.
3857 * namespace.cs (Namespace): Likewise.
3858 (Namespace.declspaces): Renamed from 'defined_names'.
3859 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
3860 DeclSpace instead of an IAlias.
3861 * tree.cs (Tree.AddDecl): Update.
3863 2005-07-12 Raja R Harinath <rharinath@novell.com>
3865 * statement.cs (Block.Flags); Remove HasVarargs.
3866 (Block.HasVarargs): Move to ToplevelBlock.
3867 (Block.ThisVariable, Block.AddThisVariable): Likewise.
3868 (Block.Variables): Make protected. Initialize variable hashtable
3870 (Block.AddVariable): Update.
3871 (Block.Resolve): Update to changes.
3872 (ToplevelBlock.HasVarargs): New boolean.
3873 (ToplevelBlock.ThisVariable): Move here from Block.
3874 (ToplevelBlock.AddThisVariable): Likewise.
3875 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
3876 * expression.cs (This.ResolveBase): Update to changes.
3877 (ArglistAccess.DoResolve): Likewise.
3879 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3882 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3884 * class.cs (TypeContainer.VerifyMembers): Distinguish between
3885 not used and not used & assigned.
3886 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3888 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3891 * expression.cs (Is.DoResolve): null is never provided type.
3893 2005-07-08 Marek Safar <marek.safar@seznam.cz>
3896 * cs-parser.jay: Less strict event error rule to catch more errors.
3898 2005-07-08 Martin Baulig <martin@ximian.com>
3900 Fix test-iter-10.cs - distinguish whether we `yield' in a property
3901 gettter (allowed) or setter (not allowed).
3903 * class.cs (Accessor): Implement IIteratorContainer.
3904 (Accessor.Yields): New public field.
3905 (PropertyBase.PropertyMethod.Define): Handle iterators on a
3909 (get_accessor_declaration, set_accessor_declaration): Set the
3910 `yields' flag on the accessor, not the property.
3911 (property_declaration): Do the iterators check on a per-accessor
3912 basis and not for the whole property.
3914 2005-07-08 Martin Baulig <martin@ximian.com>
3916 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3917 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3919 2005-07-07 Marek Safar <marek.safar@seznam.cz>
3922 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3923 (ExtractSecurityPermissionSet): Cope with self referencing security
3924 attributes properly.
3926 * driver.cs (SetOutputFile): Made public property OutputFile.
3928 2005-07-07 Raja R Harinath <rharinath@novell.com>
3931 * class.cs (TypeContainer.first_nonstatic_field): Rename from
3932 has_nonstatic_fields. Make into a FieldBase pointer.
3933 (TypeContainer.AddField): Add CS0282 check.
3934 (TypeContainer.EmitType): Update.
3936 2005-07-06 Miguel de Icaza <miguel@novell.com>
3938 * cs-tokenizer.cs (consume_identifier): Do not create strings to
3939 compare if they start with __.
3941 2005-07-06 Raja R Harinath <rharinath@novell.com>
3943 * statement.cs (Switch.SwitchGoverningType): Only look at
3944 UserCasts that don't need implicit standard conversions to one of
3945 the allowed switch types (Fixes test-322.cs).
3946 (LocalInfo.Resolve): Re-enable sanity-test.
3948 2005-07-06 Marek Safar <marek.safar@seznam.cz>
3950 * cs-tokenizer.cs (consume_identifier): Detect double undescores
3952 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3954 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3956 2005-07-06 Raja R Harinath <rharinath@novell.com>
3959 * ecore.cs (SimpleName.GetSignatureForError): Add.
3960 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3961 (MemberAccess.GetSignatureForError): Add.
3963 2005-07-05 Marek Safar <marek.safar@seznam.cz>
3965 The big error and warning messages review.
3995 * typemanager.cs: Updated.
3997 * class.cs: (MethodCore.SetYields): Moved here to share.
3998 (PropertyMethod.Define): Moved iterator setup here.
4000 * iterators.cs: Add orig_method to have full access to parent
4003 2005-07-05 Raja R Harinath <rharinath@novell.com>
4005 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4006 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4007 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4008 variable of struct type.
4009 * expression.cs (Unary.ResolveOperator): Update to change.
4010 (Indirection.VerifyFixed): Likewise.
4011 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4012 (ParameterReference.VerifyFixed): Value parameters are fixed.
4013 (This.VerifyFixed): Treat 'this' as a value parameter.
4014 * statement.cs (LocalInfo.IsFixed): Remove.
4016 2005-07-01 Martin Baulig <martin@ximian.com>
4018 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4019 `ec.EmitThis ()' to get the correct scope.
4021 2005-07-01 Martin Baulig <martin@ximian.com>
4023 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4024 instance is a ParameterReference; fixes #75299.
4026 2005-07-01 Martin Baulig <martin@ximian.com>
4028 Reverted Marek's latest patch (r46725):
4029 - it contains structural changes which are neither mentioned in
4030 the ChangeLog nor explained anywhere; for example the additional
4031 argument of EmitContext's and Iterator's .ctor's and the
4032 TypeContainer.DefineMembers() change.
4033 - structural changes like this should go in in seperate patches
4034 and not be hidden in a huge patch which just seems to affect
4035 warnings and errors.
4036 a big and hard to understand patch.
4037 - it breaks iterators and causes regressions, for instance in
4040 2005-06-30 Raja R Harinath <rharinath@novell.com>
4043 * expression.cs (Indexers.map): Remove.
4044 (Indexers.Append): Filter out inaccessible setters and getters.
4045 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4048 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
4050 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4051 (FieldExpr.Emit, PropertyExpr.Emit): Update.
4052 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4053 * expression.cs (Invocation.EmitCall): Add CS0120 check.
4055 2005-06-30 Marek Safar <marek.safar@seznam.cz>
4058 * class.cs (FieldBase.GetInitializerExpression): One more field
4061 2005-06-28 Miguel de Icaza <miguel@novell.com>
4063 * pending.cs: Do not define a proxy if the base method is virtual,
4064 it will be picked up by the runtime (bug 75270).
4066 2005-06-08 Martin Baulig <martin@ximian.com>
4068 The big Iterators rewrite :-)
4070 * iterators.cs: Rewrite this to use the anonymous methods framework.
4072 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4073 before the TypeContainers; see 2test-21.cs.
4076 (TypeContainer.DefineType): Don't create a new EmitContext if we
4077 already have one (this only happens if we're an Iterator).
4078 (TypeContainer.Define): Also call Define() on all our iterators.
4079 (Method.CreateEmitContext): Added support for iterators.
4082 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4083 (AnonymousContainer.CreateMethodHost): Moved here from
4084 AnonymousMethod and made abstract.
4085 (AnonymousContainer.CreateScopeType): New abstract method.
4086 (AnonymousContainer.IsIterator): New public property.
4087 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4088 get the ScopeTypeBuilder rather than manually defining it here.
4089 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4092 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4093 before RootContext.DefineTypes().
4095 * codegen.cs (EmitContext.RemapToProxy): Removed.
4096 (EmitContext.CurrentAnonymousMethod): Changed type from
4097 AnonymousMethod -> AnonymousContainer.
4098 (EmitContext.ResolveTopBlock): Protect from being called twice.
4099 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4100 (EmitContext.EmitThis): Removed the iterators hacks; use the
4101 anonymous methods framework for that.
4104 (ToplevelBlock.Container): Make this a property, not a field.
4105 (ToplevelBlock.ReParent): New public method; move the
4106 ToplevelBlock into a new container.
4107 (Foreach.TemporaryVariable): Simplify.
4109 2005-06-05 Martin Baulig <martin@ximian.com>
4111 * statement.cs (LocalInfo.CompilerGenerated): New flag.
4112 (Block.AddTemporaryVariable): New public method; creates a new
4113 `LocalInfo' for a temporary variable.
4114 (Block.EmitMeta): Create the LocalBuilders for all the temporary
4116 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4117 non-iterator variables.
4119 2005-06-05 Martin Baulig <martin@ximian.com>
4121 * statement.cs (Foreach.TemporaryVariable): Create the
4122 LocalBuilder in the Emit phase and not in Resolve since in some
4123 situations, we don't have an ILGenerator during Resolve; see
4124 2test-19.cs for an example.
4126 2005-06-04 Martin Baulig <martin@ximian.com>
4128 **** Merged r45395 from GCS ****
4130 The big Foreach rewrite - Part II.
4132 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4133 with `PropertyInfo ienumerator_getcurrent'.
4135 * codegen.cs (VariableStorage): Removed.
4138 (Foreach): Derive from Statement, not ExceptionStatement.
4139 (Foreach.CollectionForeach): New nested class. Moved all the code
4140 dealing with collection foreach here.
4141 (Foreach.ForeachHelperMethods): Removed.
4142 (Foreach.TemporaryVariable): Implement IMemoryLocation.
4144 2005-05-23 Martin Baulig <martin@ximian.com>
4146 * statement.cs (Try.DoResolve): Don't create a `finally' if we
4147 don't need to. Fix #75014.
4149 2005-05-20 Martin Baulig <martin@ximian.com>
4151 Merged r44808 from GMCS.
4153 * class.cs (TypeContainer.CircularDepException): Removed.
4154 (TypeContainer.DefineType): Removed the `InTransit' stuff.
4155 (TypeContainer.CheckRecursiveDefinition): Check for circular class
4156 (CS0146) and interface (CS0529) dependencies here.
4158 2005-06-21 Raja R Harinath <rharinath@novell.com>
4160 * expression.cs (Invocation.EmitCall): Fix initialization
4161 'this_call' to reflect current behaviour. Fix indentation.
4163 * convert.cs (FindMostEncompassedType): Add two trivial special
4164 cases (number_of_types == 0 || number_of_types == 1).
4165 (FindMostEncompasingType): Likewise.
4167 2005-06-17 Raja R Harinath <rharinath@novell.com>
4169 Some cleanups preparing for the fix of #75283.
4170 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4172 (EventExpr.InstanceResolve): Likewise.
4173 (EventExpr.DoResolve): Remove redundant checks.
4175 2005-06-10 Duncan Mak <duncan@novell.com>
4177 * cs-tokenizer.cs (process_directives): New flag for controlling
4178 the processing of preprocessor directives.
4179 (x_token): After seeing a '#', return Token.NONE instead of going
4180 to handle_preprocessing_directive() when not processing
4181 directives. This avoids unnecessary processing during the token peek in
4186 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
4187 the existing error reporting methods instead of Report.Error.
4189 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
4190 after Raja's rewrite.
4192 2005-06-08 Miguel de Icaza <miguel@novell.com>
4194 * class.cs: Small fix.
4196 2005-06-08 Raja R Harinath <rharinath@novell.com>
4199 * class.cs (GetPartialBases): Fix return value check of
4202 2005-06-07 Raja R Harinath <rharinath@novell.com>
4204 Ensure that partial classes are registered in their enclosing
4205 namespace. Initial part of fix of #75160.
4206 * tree.cs (Tree.RecordDecl): Add new namespace argument.
4207 Register declspace with namespace here, not in
4208 DeclSpace.RecordDecl.
4209 * cs-parser.jay: Pass namespace to RecordDecl.
4210 * class.cs (PartialContainer.Create): Likewise.
4211 (ClassPart.DefineType): New sanity-check. Throws an exception if
4213 * decl.cs (Declspace.RecordDecl): Remove.
4214 * namespace.cs (NamespaceEntry.DefineName): Remove.
4216 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4218 * rootcontext.cs: Reset TargetExt as well.
4220 2005-06-03 Raja R Harinath <rharinath@novell.com>
4222 * ecore.cs (Expression.Resolve): Emit CS0654 error when
4225 2005-06-02 Raja R Harinath <rharinath@novell.com>
4227 Fix #75080, cs0119.cs.
4228 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
4230 (Expression.Resolve): ... this. Use it. Remove bogus code
4231 allowing ExprClass.Type and ExprClass.Namespace for
4232 ResolveFlags.VariableOrValue.
4233 (Expression.Resolve) [1-argument variant]: Change default resolve
4234 flags based on language version.
4235 (Expression.Error_UnexpectedKind): Use a simple string array
4236 rather than an ArrayList.
4237 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4239 (TypeOfVoid.DoResolve): Likewise.
4240 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
4241 flags argument -- it always has the same value.
4243 2005-05-31 Raja R Harinath <rharinath@novell.com>
4246 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4247 Use it in the error message.
4248 * assign.cs, expression.cs, statement.cs: Update.
4250 2005-05-30 Raja R Harinath <rharinath@novell.com>
4253 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4254 the "almostMatchedMember" case too.
4255 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4256 that failed the accessibility checks to 'almost_match'.
4258 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
4260 * attribute.cs: Use internal MethodBuilder methods to set
4261 ExactSpelling and SetLastError on PInvoke methods, instead
4262 of passing them via charset. Fixes #75060.
4264 2005-05-27 Raja R Harinath <rharinath@novell.com>
4266 * parameter.cs (Parameter): Remove TODO comment.
4267 (Parameter.DefineParameter): Remove Location parameter.
4268 (Parameters.LabelParameters): Likewise.
4269 * class.cs (Constructor.Emit): Update to change.
4270 (MethodData.Emit): Likewise.
4271 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
4272 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4274 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
4277 Removed Parameters.Location and added Parameter.Location instead.
4278 Removed Location parameter from Emit() and GetSignature().
4285 Modified all related calls.
4287 2005-05-26 Raja R Harinath <rharinath@novell.com>
4289 Improve user-defined conversion handling.
4290 * convert.cs (GetConversionOperators): Rewrite. Return only the
4291 applicable operators.
4292 (AddConversionOperators): New. Helper for GetConversionOperators.
4293 (FindMostEncompassedType, FindMostEncompassingType): Verify that
4294 there is only one most encompassed/encompassing type.
4295 (FindMostSpecificSource, FindMostSpecificTarget): Remove
4296 "applicable operator" handling.
4297 (UserConversion): Move cache here from GetConversionOperators.
4298 Directly cache the chosen operator, rather than the whole
4300 (ExplicitNumericConversion): Fix buggy implementation of Decimal
4301 case. Allow conversion of decimal to sbyte and byte too.
4302 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4303 New static methods. Used to avoid allocating EmptyExpressions in
4306 2005-05-24 Duncan Mak <duncan@novell.com>
4308 * ecore.cs (CastFromDecimal): New class for casting a decimal to
4309 another class, used in Convert.ExplicitNumericConversion.
4310 (CastToDecimal): New class, similar to above, but casts to
4311 System.Decimal, used in Convert.ImplicitNumericConversion and also
4312 in explicit convesion from double/float to decimal.
4314 * convert.cs (ImplicitNumericConversion): Handle implicit
4315 conversions to System.Decimal.
4316 (ExplicitNumericConversion): handle explicit conversions to
4321 2005-05-20 Miguel de Icaza <miguel@novell.com>
4323 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
4324 know the type at this stage, just break through. Fixes #75008
4326 2005-05-19 Martin Baulig <martin@ximian.com>
4329 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4330 to disable error reporting.
4332 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4333 here since we don't want to report an error; see the new test-336.cs.
4335 2005-05-19 Raja R Harinath <rharinath@novell.com>
4337 * statement.cs (ToplevelBlock.GetParameterReference)
4338 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4339 Move here from class Block.
4340 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4341 * expression.cs (ParameterReference.DoResolveBase): Likewise.
4343 2005-05-18 Martin Baulig <martin@ximian.com>
4348 (FlowBranching.Reachability): Add non-static public And() and Or()
4350 (FlowBranchingSwitch): New class; do the `break_origins' thing
4351 like in FlowBranchingLoop.
4352 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4353 reachability, not just locals and parameters.
4354 (FlowBranching.MergeChild): Remove some of the hacks for loop and
4355 switch; MergeBreakOrigins() now takes care of that.
4357 2005-05-18 Martin Baulig <martin@ximian.com>
4359 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4360 a loop and may leave it, reset the barrier; fixes #74974.
4362 2005-05-17 Marek Safar <marek.safar@seznam.cz>
4364 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4367 * cs-parser.jay: Catch more lexical errors.
4369 * report.cs: Add one more Error method.
4372 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4374 2005-05-17 Martin Baulig <martin@ximian.com>
4376 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4379 2005-05-16 Raja R Harinath <rharinath@novell.com>
4381 Fix test-382.cs. Emit values of decimal constants.
4382 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4384 (TypeContainer.AddField): ... this.
4385 (TypeContainer.EmitFieldInitializers): Allow the list of fields
4386 with initializers to include 'Const's.
4387 (ClassPart.RegisterFieldForInitialization): Forward to
4389 * const.cs (Const.Const): Pass initializer to base class.
4390 (Const.Define): In case of decimal constants, register them for
4391 initialization in a static constructor.
4393 2005-05-14 Martin Baulig <martin@ximian.com>
4395 * statement.cs (Block.Resolve): Correctly handle unreachable code;
4396 do not call ResolveUnreachable() on unreachable statements in
4397 here, see the comment in the source code.
4399 2005-05-13 Raja R Harinath <rharinath@novell.com>
4402 * expression.cs (BinaryResolveOperator): If one of the operands of
4403 an equality comparison is 'null' and the other is a pointer type,
4404 convert the null to a NullPointer.
4405 * convert.cs (ImplicitReferenceConversion): If the expression is a
4406 NullLiteral and the target type is a pointer type, return a
4407 NullPointer instead.
4408 (ImplicitConversionStandard): Likewise.
4410 2005-05-13 Marek Safar <marek.safar@seznam.cz>
4412 * cs-parser.jay: Set readonly context based on special constructs.
4414 * expression.cs (LocalVariableReference.DoResolveBase): Improved
4415 readonly variable error handling.
4417 * rootcontext.cs (EmitCode): Don't verify members when error
4420 * statement.cs (LocalInfo): Add reaodnly context information.
4421 (SetReadOnlyContext, GetReadOnlyContext): New methods.
4423 2005-05-13 Raja R Harinath <rharinath@novell.com>
4425 * statement.cs (Block.Resolve): Revert change below. Modify fix
4426 for #74041 to initialize 'resolved' to false only for explicit
4427 blocks. Fixes #74873.
4429 2005-05-12 Raja R Harinath <harinath@gmail.com>
4432 * typemanager.cs (unmanaged_enclosing_types): New.
4433 (IsUnmanagedType): Avoid infloops by using
4434 'unmanaged_enclosing_types' to talk with recursive invocations.
4436 2005-05-13 Martin Baulig <martin@ximian.com>
4438 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4439 instance variable, not a local. Fix #74873.
4440 (Block.ResolveUnreachable): Set it to true here.
4442 2005-05-11 Duncan Mak <duncan@novell.com>
4444 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4445 continuing to process for 'arg'.
4446 (handle_preprocessing_directive): Check the argument of the #endif
4447 directive and report error CS1025 if there are any trailing
4450 According to the C# spec, having even whitespace after the #endif
4451 directive is illegal; however, because we call arg.TrimEnd ()
4452 beforehand, we have the same behavior as csc, allowing whitespace
4453 after the directive.
4457 2005-05-11 Marek Safar <marek.safar@seznam.cz>
4461 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4462 (Constructor.GetObsoleteAttribute): Implemented correctly.
4464 2005-05-10 Martin Baulig <martin@ximian.com>
4466 * support.cs (ReflectionParameters.ParameterModifier): Use
4467 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4468 and `ParameterAttributes.In'. Fixes #74884.
4470 2005-05-10 Marek Safar <marek.safar@seznam.cz>
4472 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4474 * expression.cs (Argument.GetParameterModifier): Turned to property.
4475 (Invocation.Error_InvalidArguments): Add more descriptive errors.
4477 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4480 2005-05-09 Raja R Harinath <rharinath@novell.com>
4483 * decl.cs (MemberCache.AddMethods): Register override methods,
4484 rather than non-override methods.
4485 * typemanager.cs (RegisterOverride): New.
4486 (IsOverride): Update.
4488 2005-05-09 Marek Safar <marek.safar@seznam.cz>
4492 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4493 recursive declaration.
4495 * statement.cs (Block.ResolveMeta): Report any error in resolving.
4497 2005-05-06 Marek Safar <marek.safar@seznam.cz>
4499 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4501 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4503 2005-05-05 Raja R Harinath <rharinath@novell.com>
4506 * decl.cs (DeclSpace.FamilyAccessible):
4507 Use TypeManager.IsNestedFamilyAccessible.
4509 Fix reopened #64812.
4510 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4513 2005-05-04 Raja R Harinath <rharinath@novell.com>
4514 Abin Thomas <projectmonokochi@rediffmail.com>
4515 Anoob V E <projectmonokochi@rediffmail.com>
4516 Harilal P R <projectmonokochi@rediffmail.com>
4519 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4520 allow access to all static members.
4522 2005-05-04 Martin Baulig <martin@ximian.com>
4524 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4526 2005-05-04 Martin Baulig <martin@ximian.com>
4530 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4531 section at the end; make things work if `default' is not the last
4534 2005-05-04 Martin Baulig <martin@ximian.com>
4538 * statement.cs (Switch): Replaced the `got_default' field with a
4539 `default_section' one.
4540 (Switch.CheckSwitch): Set `default_section' here.
4541 (Switch.Resolve): If we're a constant switch and the constant is
4542 not found, use the default section.
4544 2005-05-03 Martin Baulig <martin@ximian.com>
4546 * expression.cs (ArrayAccess.EmitGetLength): New public method.
4548 * statement.cs (Foreach.ArrayForeach): New nested class.
4549 (Foreach.TemporaryVariable): New nested class.
4550 (Foreach.EmitArrayForeach): Removed; this is now in the new
4553 2005-05-03 Raja R Harinath <rharinath@novell.com>
4555 * pending.cs (BaseImplements): Move the #74773 fix here. This is
4557 (VerifyPendingMethods): Revert change below.
4559 * typemanager.cs (IsOverride, RegisterNonOverride): New.
4560 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4561 that used to trigger warning -28. Remove warning -28.
4562 * expression.cs (Invocation.OverloadResolve): Use
4563 TypeManager.IsOverride to distinguish override methods.
4566 * pending.cs (VerifyPendingMethods): If a base type implements the
4567 requested interface, don't bother checking individual methods of
4568 the base type. As a side-effect, this prevents the creation of
4569 unnecessary proxies.
4571 2005-05-02 Martin Baulig <martin@ximian.com>
4575 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4576 Also `And' the locals if the old vector is null.
4577 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4578 null; in this case we basically reset all the variables.
4580 2005-05-02 Martin Baulig <martin@ximian.com>
4584 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4585 Added `FlowBranching branching' argument; always `and' the
4586 variables instead of `or'ing them unless we're an infinite loop.
4588 * statement.cs (While.Resolve): Create a new sibling unless we're
4591 2005-05-02 Martin Baulig <martin@ximian.com>
4595 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4596 arguments; use it instead of creating a new TopLevelBlock.
4597 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4598 our ConstructorInitializer.
4601 (TopLevelBlock.TopLevelBranching): New public property.
4602 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4603 and create our `TopLevelBranching'.
4605 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4606 anonymous method host, use `block.TopLevelBranching' rather than
4607 creating a new branching.
4609 2005-04-20 Miguel de Icaza <miguel@novell.com>
4611 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4612 a ScopeInfo, if any of the current children is a child of the new
4613 entry, move those children there.
4615 2005-04-30 Martin Baulig <martin@ximian.com>
4617 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4618 at the beginning of a SwitchSection. Fix #73335.
4620 2005-04-27 Marek Safar <marek.safar@seznam.cz>
4623 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4625 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4626 (FieldExpr.DoResolve): Obsolete members are ignored for field
4629 2005-04-26 Marek Safar <marek.safar@seznam.cz>
4631 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4632 of arrays detection.
4634 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4636 (Field.VerifyClsCompliance): Volatile fields are not compliant.
4638 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4641 2005-04-25 Ben Maurer <bmaurer@ximian.com>
4643 * cs-parser.jay: Use the prefered version of -unsafe in error
4646 2005-04-22 Marek Safar <marek.safar@seznam.cz>
4648 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4651 2005-04-20 John Luke <john.luke@gmail.com>
4653 * driver.cs: fix typo in error message, --outout to --output
4655 2005-04-20 Marek Safar <marek.safar@seznam.cz>
4657 * codegen.cs (InRefOutArgumentResolving): New field.
4659 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4660 fields outside contructor.
4662 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4664 2005-04-19 Miguel de Icaza <miguel@novell.com>
4666 * anonymous.cs (CaptureContext.EmitParameterInstance): The
4667 parameter code was not completed ever, so it was not as up-to-date
4668 as local variables. Must finish it.
4670 The bug fix was to compare the Toplevel of the block, not the
4671 current block. Thanks for Ben for pointing this out.
4673 2005-04-19 Raja R Harinath <rharinath@novell.com>
4675 * decl.cs (AddMethods): Use the declaring type of the problem
4676 method to determine if we want to squash a warning.
4678 2005-04-19 Marek Safar <marek.safar@seznam.cz>
4680 * attribute.cs: Removed debug output.
4682 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4684 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4687 2005-04-18 Raja R Harinath <rharinath@novell.com>
4690 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4691 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4692 all null comparisons against reference types.
4694 2005-04-18 Marek Safar <marek.safar@seznam.cz>
4697 * class.cs (TypeContainer.CircularDepException) New nested
4699 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4700 (TypeContainer.DefineType): Removed error, reset InTransit before
4702 (Class.DefineType): Throw exception when is in Transit.
4703 Catch exception and report error.
4704 (Struct.DefineType): Throw exception when is in Transit.
4705 Catch exception and report error.
4706 (Interface.DefineType): Throw exception when is in Transit.
4707 Catch exception and report error.
4709 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4710 handle nested exception handlers.
4712 * flowanalysis.cs (InTryWithCatch): New method, search for try with
4715 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4716 InFinally and InCatch storage.
4718 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4719 (Catch.Resolve): Set and Restore ec.InCatch.
4720 (Try.Resolve): Set and Restore ec.InFinally.
4721 (Try.HasCatch): True when try has catch.
4723 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
4725 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4726 for the same event member, so exclude such cases from warning 419.
4729 2005-04-16 Miguel de Icaza <miguel@novell.com>
4731 * expression.cs (Binary.ResolveOperator): Apply patch from John
4732 Luke to fix bug 59864: operators &, | and ^ on enumerations
4733 require that the same enum type on both sides.
4735 * driver.cs: Add warnings to old flag usage, this is to assist
4736 people who produce Makefiles and hope that the Makefiles will be
4739 * class.cs (TypeContainer.EmitType): Moved the definition of the
4740 special $PRIVATE$ field from the resolve phase to the Emit phase.
4741 During resolve we do not know if we are a struct with
4742 HasExplicitLayout, we know this only after the attributes for the
4745 Set the FieldOffset to zero on the dummy field that we create for
4746 the class. Fixes 74590.
4748 2005-04-16 Raja R Harinath <rharinath@novell.com>
4751 * ecore.cs (PropertyExpr.resolved): New.
4752 (DoResolve): Use it to handle a case of double resolution here.
4753 Handle a case of identical-name-and-type-name.
4754 * expression.cs (ArrayCreation.CheckIndices): Avoid double
4755 resolution by storing the results of expression resolution back
4756 into the "probes" array.
4758 2005-04-15 Raja R Harinath <rharinath@novell.com>
4760 Fix cs0208-7.cs and cs0208-8.cs.
4761 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4762 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
4763 error reporting to point out the reason a struct is not unmanaged.
4765 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4767 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
4768 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4770 2005-04-13 Raja R Harinath <rharinath@novell.com>
4773 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4774 IdenticalNameAndTypeName here.
4775 (EventExpr.InstanceResolve): Likewise.
4777 2005-04-13 Marek Safar <marek.safar@seznam.cz>
4779 C# 2.0 DefaultCharSetAttribute implementation
4781 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4782 which allows us to set GlobalNamespace for every resolve.
4783 (Attribute.ResolveArguments): Cut from Resolve.
4784 (Attribute.GetCharSetValue): Returns CharSet named argument.
4785 (Attribute.DefinePInvokeMethod): Gets default charset from
4787 (GlobalAttribute.ResolveAsTypeStep): Override.
4788 (GlobalAttribute.ResolveArguments): Override.
4790 * class.cs (TypeAttr): Is protected.
4792 * codegen.cs (ModuleClass.DefaultCharSet): New member.
4793 (ModuleClass.DefaultCharSetType): New memeber.
4794 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4796 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4797 charset from module.
4799 * delegate.cs (TypeAttr): Override.
4800 (Delegate.DefineType): Use this TypeAttr.
4802 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4803 at very early stage (before types are defined) to resolve model
4804 module attributes. It will probably not work with corlib but it
4807 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4808 charset from module.
4810 * typemanager.cs (default_charset_type): New type.
4812 2005-04-13 Raja R Harinath <rharinath@novell.com>
4814 * decl.cs (MemberCache.AddMethods): Don't warn if
4815 System.Object.Finalize has buggy MethodAttributes.
4817 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4820 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4822 * doc.cs : detect ambiguous reference to overloaded members.
4823 Fixed bug #71603. MS 1.1 csc does not detect it.
4825 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4827 * doc.cs : delegates must not be referenced with parameters.
4830 2005-04-12 Miguel de Icaza <miguel@novell.com>
4832 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4834 2005-04-10 Miguel de Icaza <miguel@novell.com>
4836 * driver.cs (MainDriver): Stop processing if the CLS stage found
4839 (CompilerCallableEntryPoint.InvokeCompiler): Always
4840 reset after execution; Take a TextWriter argument for the
4843 * report.cs: Use the error stream instead of hardcoding stderr.
4845 2005-04-09 Miguel de Icaza <miguel@novell.com>
4847 * class.cs: Reduce code paths to test, too small of an
4848 optimization to make it worth the extra testing. Always perform
4851 2005-04-08 Raja R Harinath <rharinath@novell.com>
4854 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4855 operators that had errors reported on them.
4857 2005-04-08 Marek Safar <marek.safar@seznam.cz>
4859 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4861 (Attribute.Resolve): Add named argument type checking.
4863 * class.cs (FixedField.Define): Use IsPrimitiveType
4865 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4867 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4868 unsafe parameter types.
4870 * statement.cs (Using.ResolveExpression): Add better error description.
4872 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4874 2005-04-08 Raja R Harinath <rharinath@novell.com>
4877 * attribute.cs (Attribute.GetAttributeUsage): Resolve
4878 AttributeUsageAttribute in the emitcontext of the attribute class,
4879 not in the emitcontext of the attributable entity it was attached to.
4880 * cs-parser.jay: Use 'current_class', not 'current_container',
4881 when creating a GlobalAttribute.
4883 2005-04-08 Alp Toker <alp@atoker.com>
4885 * pending.cs: The fix to #58413 failed to compile methods implementing
4886 interfaces with/without params modifiers and vice versa, even though
4887 params modifiers aren't part of the signature. Make the modifier check
4888 less strict as in csc.
4890 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
4891 Anoob V E <projectmonokochi@rediffmail.com>
4892 Harilal P R <projectmonokochi@rediffmail.com>
4895 * pending.cs (TypeAndMethods.mods): New. Store the parameter
4896 modifiers of pending methods.
4897 (PendingImplementation.PendingImplementation): Initialize it.
4898 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4899 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4900 with ParameterData. Add check for modifiers.
4901 * class.cs (MethodData.Define): Update to changes.
4903 2005-04-07 Raja R Harinath <rharinath@novell.com>
4905 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4907 2005-04-07 Marek Safar <marek.safar@seznam.cz>
4909 * class.cs (PropertyMethod.Define): Check private accessor in abstract
4912 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4915 * typemanager.cs: Registered RequiredAttributeAttribute.
4917 2005-04-06 Marek Safar <marek.safar@seznam.cz>
4919 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4920 Warning CS0169 is back at level 3.
4921 (IMethodData.SetMemberIsUsed): New method.
4923 * decl.cs (IsUsed): New value; moved from FieldBase.Status
4924 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4926 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4928 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4930 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4933 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4936 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4937 to avoid the problems with nested types.
4939 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
4940 Anoob V.E <projectmonokochi@rediffmail.com>
4941 Harilal P.R <projectmonokochi@rediffmail.com>
4942 Raja R Harinath <rharinath@novell.com>
4945 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4947 * typemanager (GetConstructor): Make public.
4949 2005-04-05 John Luke <john.luke@gmail.com>
4950 Raja R Harinath <rharinath@novell.com>
4953 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4954 struct too. Return false quicker in a few cases.
4955 (VerifyUnManaged): Use it.
4957 2005-04-05 Raja R Harinath <rharinath@novell.com>
4960 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4961 not 'unreachable_seen'.
4963 2005-04-04 Marek Safar <marek.safar@seznam.cz>
4965 * attribute.cs (Attribute.GetValue): Removed unused.
4967 * codegen.cs (CodeGen.TrimExt): Removed unused.
4969 * cs-parser.jay (output): Removed unused.
4971 * cs-tokenizer.cs (hex_digits): Removed unused.
4973 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4975 * expression.cs (Indirection.LoadExprValue): Removed unused.
4976 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4978 * iterators.cs (Iterator.param_types): Removed unused.
4980 * statement.cs (Goto.block): Removed unused.
4981 (ToplevelBlock.did): Removed unused.
4982 (Switch.ResolveConstantSwitch): Removed unused.
4984 2005-04-01 Ben Maurer <bmaurer@ximian.com>
4986 * rootcontext.cs: Allow mcs to bootstrap with the compilation
4989 2005-04-01 Raja R Harinath <rharinath@novell.com>
4991 Fix #74232 and cs0208-3.cs.
4992 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4993 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4994 unmanaged type. Don't use FieldBuilders when 't' is a
4995 TypeBuilder. Use ModFlags and MemberType fields.
4996 * class.cs (MemberBase.member_type): Rename from MemberType.
4997 (MemberBase.MemberType): New property. Determines member_type on
4999 (MemberBase.DoDefine): Don't initialize MemberType here.
5000 (FieldMember.Define): Likewise.
5002 2005-04-01 Marek Safar <marek.safar@seznam.cz>
5005 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5006 Attributes are emitted there.
5008 2005-04-01 Raja R Harinath <rharinath@novell.com>
5010 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5011 keyword in 'partial enum' too.
5012 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5014 Report from Kamil Skalski <nazgul@omega.pl>.
5017 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5018 have partial containers too.
5020 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5021 in block' checks to Block.CheckInvariantMeaningInBlock.
5022 * statement.cs (Block.GetKnownVariableInfo): Make private.
5023 (Block.IsVariableUsedInChildBlock): Remove.
5024 (Block.IsVariableUsedInBlock): Likewise.
5025 (Block.CheckInvariantMeaningInBlock): New. Show location of
5026 conflicting declaration.
5027 (Block.AddVariable): Make error messages less long-winded and more
5028 specific. Show location of conflicting declaration.
5029 * parameter.cs (Parameters.Location): New readonly property.
5031 2005-03-31 Raja R Harinath <rharinath@novell.com>
5033 Clean up semantics of invoking ResolveMemberAccess.
5034 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5035 can have an instance, ensure that we pass in a non-TypeExpression
5036 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
5037 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5038 argument. Update to changes and simplify.
5039 (FieldExpr.Emitinstance): Remove CS0120 check.
5040 (PropertyExpr.EmitInstance): Likewise.
5041 * expression.cs (Argument.Resolve): Likewise.
5042 (Invocation.DoResolve): Update to changes in semantics of
5045 2005-03-31 Marek Safar <marek.safar@seznam.cz>
5048 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5051 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5053 2005-03-31 Raja R Harinath <rharinath@novell.com>
5055 Fix difference in behaviour with commandline invocation.
5056 * driver.cs (Driver.Reset): New.
5057 (CompilerCallableEntryPoint): Call it.
5059 * statement.cs (If.Resolve): Avoid spurious "uninitialized
5060 variable" warnings if the boolean expression failed to resolve.
5062 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
5064 * attribute.cs: Fix the union of several permissions when some of them
5065 are unrestricted (so the result isn't an unrestricted permission set).
5068 2005-03-30 Raja R Harinath <rharinath@novell.com>
5070 * ecore.cs (MemberExpr): New class. Convert from interface
5072 (MemberExpr.ResolveMemberAccess): Refactor and move here from
5073 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
5075 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5076 (MethodGroupExpr.IsExplicitImpl): Remove.
5077 (Expression.GetFieldFromEvent): Remove.
5078 (SimpleName.MemberStaticCheck): Remove.
5079 (SimpleName.DoSimpleNameResolve): Update to changes.
5080 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5081 (MemberAccess.IdenticalNameAndTypeName): Remove.
5082 (MemberAccess.error176): Move to MemberExpr.
5083 (MemberAccess.DoResolve): Update to changes.
5084 (BaseAccess.DoResolve): Likewise.
5086 2005-03-30 Marek Safar <marek.safar@seznam.cz>
5088 C# 2.0 Conditional attribute class implementation
5090 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5091 Analyzes class whether it has attribute which has ConditionalAttribute
5092 and its condition is not defined.
5094 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5095 (Class.IsExcluded): New method. Search for at least one defined
5096 condition in ConditionalAttribute of attribute class.
5098 2005-03-30 Raja R Harinath <rharinath@novell.com>
5100 * ecore.cs (PropertyExpr): Derive from Expression, not
5101 ExpressionStatement.
5102 (PropertyExpr.EmitStatement): Remove.
5104 2005-03-29 Raja R Harinath <rharinath@novell.com>
5107 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5108 internal field "value__" of an enum be private. The examples for
5109 "value__" that I found on MSDN all used FieldAttributes.Private.
5111 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5112 Don't mention IL method attribute names.
5114 Fix #47991. Remove a TODO.
5115 * statement.cs (Block.Toplevel): Make into a field.
5116 (Block.Parameters): Move into ToplevelBlock.
5117 (Block.known_variables): Rename from child_variable_names.
5118 (Block.Block): Remove variants that take Parameters. Initialize
5119 'Toplevel' with the immediately surrounding toplevel block.
5120 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
5121 LocalInfo parameter.
5122 (Block.GetKnownVariableInfo): New.
5123 (Block.IsVariableNameUsedInChildBlock): Update.
5124 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
5125 the block, even though it may not be in scope.
5126 (Block.AddVariable): Remove Parameters parameter. Use
5127 Toplevel.Parameters instead.
5128 (Block.AddConstant): Remove Parameters parameter.
5129 (Block.GetParameterReference): Update to use Toplevel.Parameters.
5130 (Block.IsParamaterReference): Likewise.
5131 (Block.IsLocalParameter): Likewise. Simplify a lot.
5132 (ToplevelBlock.Parameters): New. Moved from Block.
5133 (ToplevelBlock.ToplevelBlock): Update to changes. Always
5134 initialize Parameters to a non-null value.
5135 * cs-parser.jay: Update to changes.
5136 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5137 simple names that mean different things in the same block. Use
5138 Block.IsVariableNameUsedInBlock.
5140 2005-03-28 Raja R Harinath <rharinath@novell.com>
5142 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5143 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5144 GetTypeHandle. It is possible for a reflected type to derive from
5145 a TypeBuilder (e.g., int[] derives from the TypeBuilder
5146 System.Array during mscorlib compilation).
5147 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5148 contain a method_hash, don't create one either. Don't create a
5149 deep copy of the base cache's method_hash.
5150 (MemberCache.SetupCache): Rename back from DeepCopy.
5151 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5152 already initialized. If we see an override function, add its
5153 underlying base virtual function to the member_hash too.
5155 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5157 2005-03-26 Raja R Harinath <harinath@acm.org>
5160 * assign.cs (Assign.DoResolve): When the RHS of an assignment
5161 fails to resolve, ensure that the LHS is still resolved as an
5164 2005-03-25 Raja R Harinath <harinath@acm.org>
5166 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5168 (Enum.current_ec): Remove.
5169 (Enum.LookupEnumValue): Remove EmitContext argument.
5170 Just uses the one created during DefineType.
5171 (Enum.FindMembers): Update.
5172 * expression.cs (MemberAccess.DoResolve): Update.
5174 2005-03-22 Marek Safar <marek.safar@seznam.cz>
5176 * assign.cs (Assign.DoResolve): Check for CS1717 when
5177 source and target are same (uses Equals).
5179 * expression.cs (LocalVariableReference, ParameterReference,
5180 This): Implemented Equals, GetHashCode.
5182 * statement.cs (Block.GetParameterReference): Removed useless
5185 2005-03-22 Raja R Harinath <rharinath@novell.com>
5188 * statement.cs (Block.AddVariable): Ensure that we skip implicit
5189 blocks before deciding whether the error is cs0136 or cs0128.
5191 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5192 (using_alias_directive, using_namespace_directive): Pass
5193 MemberName, not an expression to Namespace.UsingAlias and
5195 (MakeName): Use the MemberName of the namespace.
5196 * namespace.cs (Namespace.MemberName): New.
5197 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5198 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5200 * decl.cs (MemberName.Name): Make readonly.
5201 (MemberName.FromDotted): New "constructor".
5202 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5203 (MemberCore.Name): Compute from MemberName on demand.
5204 (MemberCore.SetMemberName): Provide a way to change the
5206 (MemberCore.AddToContainer): Don't take a fullname parameter.
5207 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5208 fully qualified name of the container to the member name.
5209 (TypeContainer.AddToTypeContainer): Use a fully qualified name
5210 only if the type is a member of the root container.
5211 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5212 MemberName.Left rather than searching for an embedded ".".
5213 (PartialContainer.CreatePart): Update to changes in RootContext.
5214 (MemberBase.ShortName): Turn into a property. Use
5215 MemberCore.SetMemberName.
5216 (MemberBase.ExplicitInterfaceName): Remove.
5217 (MemberBase.UpdateMemberName): Remove.
5218 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5219 (PropertyBase.SetMemberName): New override.
5220 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5221 (Tree.GetDecl): New.
5222 (Tree.AllDecls): Rename from Decls.
5223 * attribute.cs, enum.cs, report.cs: Update to changes.
5224 * driver.cs (MainDriver): Use MemberName.FromDotted on
5225 RootContext.MainClass.
5227 2005-03-21 Marek Safar <marek.safar@seznam.cz>
5229 * class.cs (FixedField.Define): Check for CS1664 and more sanity
5232 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5234 2005-03-18 Marek Safar <marek.safar@seznam.cz>
5236 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5237 property accessor modifiers.
5239 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5240 fixed buffer attribute (CS1716).
5241 (PropertyMethod.HasCustomAccessModifier): When property accessor
5242 has custom modifier.
5244 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5246 (PropertyExpr.DoResolveLValue): Add CS0272.
5248 2005-03-17 Miguel de Icaza <miguel@novell.com>
5250 * convert.cs: When converting to a pointer, use the proper Conv.U
5251 or Conv.I depending on the source data type.
5253 * cs-tokenizer.cs: Make the size for large decimal constants,
5256 2005-03-17 Martin Baulig <martin@ximian.com>
5258 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5259 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
5261 2005-03-17 Martin Baulig <martin@ximian.com>
5263 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5264 to bool so we can return an error condition.
5265 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5268 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
5270 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5273 2005-03-16 Raja R Harinath <rharinath@novell.com>
5275 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5276 Refactor to avoid traversing the list of assemblies, and to avoid
5277 string concatenation.
5278 * typemanager.cs (guid_attr_type): Remove.
5279 (negative_hits, pointers, references): Remove hashes.
5281 (GetConstructedType): New. Uses type_hash to handle constructed
5282 types (arrays, references, pointers).
5283 (GetReferenceType, GetPointerType): Use it.
5284 (GetNestedType): New. Uses type_hash to handle nested types of
5286 (LookupType, LookupTypeDirect): Remove.
5287 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
5288 'types' hash and LookupTypeReflection directly.
5289 (params_string, params_object): Use GetConstructedType.
5290 * namespace.cs (Namespace.cached_types): New. Cache of reflected
5292 (Namespace.Lookup): Use cached_types.
5293 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5294 provided by old TypeManager.LookupType.
5295 * rootcontext.cs (MakeFQN): Remove.
5296 * decl.cs (DeclSpace.MakeFQN): Likewise.
5297 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5298 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5299 TypeManager.GetConstructedType.
5300 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5302 2005-03-15 Marek Safar <marek.safar@seznam.cz>
5304 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
5307 * cs-parser.jay: Reports CS1527 for any namespace element.
5309 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5312 * expression.cs (ParameterReference.IsAssigned): Changed error to
5314 (Error_WrongNumArguments): Moved CS0245 detection here.
5316 * statement.cs (Return.Resolve): Add CS1622 report.
5318 2005-03-11 Marek Safar <marek.safar@seznam.cz>
5320 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5322 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
5324 * attribute.cs expression.cs: Get rid of some allocations.
5326 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
5328 * doc.cs : just eliminate the latest change.
5330 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5332 * doc.cs : commented out the latest change. It breaks xml-030.cs
5334 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5336 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5337 fail. So invoke CreateType() in FindDocumentedType().
5339 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5341 * cs-tokenizer.cs : added IsKeyword().
5342 * doc.cs : Detect keyword incorrectly used as identifier.
5343 Allow identifiers prefixed by @.
5345 2005-03-10 Marek Safar <marek.safar@seznam.cz>
5347 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5348 It caused exception in namespace resolving (again!).
5350 * class.cs (Class.ctor): Removed exit.
5351 (PropertyMethod.ctor): ditto.
5353 * codegen.cs (Codegen.Reset): Reset static data.
5354 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5356 * cs-tokenizer.cs (Cleanup): Removed.
5358 * driver.cs (GetSystemDir): Rewrote to one line command.
5359 It caused problem with unloaded dynamic modules.
5360 (UnixParseOption): Removed Exit.
5361 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5362 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5363 Now can be mcs used as library.
5365 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5368 * location.cs (Reset): Reset static data.
5370 * namespace.cs (Reset): Reset static data.
5372 * report.cs (Report.Reset): Reset static data.
5374 * rootcontext.cs (RootContext.Reset): Reset static data.
5376 * tree.cs (RootTypes.ctor): Use Location.Null
5378 * typemanager.cs (TypeManager.Reset): Reset static data.
5379 (CoreLookupType): Removed Exit.
5380 (TypeHandle.Reset): Reset static data.
5382 2005-03-10 Raja R Harinath <rharinath@novell.com>
5385 * typemanager.cs (ComputeNamespaces): Import namespaces from
5386 referenced modules too.
5388 2005-03-09 Raja R Harinath <rharinath@novell.com>
5390 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5393 2005-03-09 Raja R Harinath <rharinath@novell.com>
5395 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5396 enclosing DeclSpace. This ensures that a name-lookup populates
5397 more caches and there are fewer 'TypeExpression's. Carve out
5398 nested type lookup into ...
5399 (LookupNestedTypeInHierarchy): ... this.
5401 2005-03-09 Raja R Harinath <rharinath@novell.com>
5403 Clean up a few partial-class semantics.
5404 Fixes test-357.cs and cs1618-2.cs.
5405 * cs-parser.jay (struct_declaration): Use 'current_class' as
5406 parent of newly-created struct. Remove call to Register ().
5407 Use 'pop_current_class' to complete handing the current struct.
5408 (interface_declaration): Likewise.
5409 (class_declaration): Likewise.
5410 (enum_declaration): Use 'current_class' as parent of newly created
5412 (delegate_declaration): Likewise.
5413 (pop_current_class): New function. This is used to handle closing
5414 up the 'current_class' and 'current_container', and pointing them
5415 to the enclosing class/container.
5416 (CSharpParser): Initialize 'current_class' too.
5417 * decl.cs (MemberCore): Add check for invariant: a partial
5418 container is not a parsed entity, and thus does not enclose any
5420 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5421 (DeclSpace.BaseTypeExpr): Use it.
5422 (DeclSpace.LookupType): Add check for invariant.
5423 * class.cs (TypeContainer): Add check for invariant: a nested
5424 class should have the same NamespaceEntry as its enclosing class.
5425 (TypeContainer.EmitFieldInitializers): Make virtual.
5426 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5428 (TypeContainer.Register): Remove.
5429 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5430 null. Use TypeResolveEmitContext for resolving base types and
5431 interfaces. Move initialization of Parts.TypeBuilder here from
5433 (TypeContainer.DefineNestedTypes): ... here.
5434 (PartialContainer): Take a Namespace not a NamespaceEntry.
5435 (PartialContainer.Create): Don't use Register. Call the
5436 appropriate Add... function directly.
5437 (ClassPart): Take both the PartialContainer and the enclosing
5438 class as constructor arguments.
5439 (ClassPart.EmitFieldInitializers): Override.
5440 (ClassPart.PartFindNestedTypes): Remove.
5441 (FieldBase.GetInitializerExpression): Resolve the initializer
5442 expression in the emit context of the enclosing class.
5443 * tree.cs (RootTypes): Remove Register ().
5445 2005-03-08 Marek Safar <marek.safar@seznam.cz>
5447 * cs-parser.jay: Removed CS0134.
5449 * driver.cs: Removed CS1901.
5451 * expression.cs (SizeOf.DoResolve): Don't report CS0233
5452 for predefined types.
5454 2005-03-07 Duncan Mak <duncan@novell.com>
5456 * codegen.cs (Save): Catch UnauthorizedAccessException as
5457 well. Fixes bug #73454.
5459 2005-03-07 Marek Safar <marek.safar@seznam.cz>
5461 * cs-tokenizer.cs (xtoken): Add CS1035.
5463 * class.cs (MethodData.Define): Add CS0683.
5464 (FieldMember.ctor): Add CS0681.
5466 2005-03-07 Raja R Harinath <rharinath@novell.com>
5468 * ecore.cs (SimpleName.DoResolve): Rename from
5469 SimpleName.DoResolveAllowStatic.
5470 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5471 Pass 'intermediate' flag to MemberStaticCheck.
5472 (SimpleName.MemberStaticCheck): Skip "static check" only in case
5473 of "intermediate" lookups via MemberAccess.
5474 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
5475 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5477 2005-03-07 Raja R Harinath <rharinath@novell.com>
5480 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5481 slipped in because of variable names that are identical to a
5482 builtin type's BCL equivalent ('string String;', 'int Int32;').
5483 (PropertyExpr.EmitInstance): Likewise.
5485 2005-03-04 Marek Safar <marek.safar@seznam.cz>
5487 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5489 * report.cs (warning_ignore_table): Made public.
5491 2005-03-04 Raja R Harinath <rharinath@novell.com>
5494 * class.cs (MethodData.Emit): Pass 'container' to
5495 container.GetObsoleteAttribute instead of 'container.Parent'.
5497 2005-03-03 Marek Safar <marek.safar@seznam.cz>
5499 * cs-parser.jay: Add 1534 error test.
5501 * iterators.cs (Yield.CheckContext): Add error 1629.
5502 (Iterator.ctor): Save unsafe modifier.
5503 (MoveNextMethod.DoEmit): Restore unsafe context.
5505 * namespace.cs (UsingAlias): Better error message.
5507 2005-03-03 Dan Winship <danw@novell.com>
5509 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5510 the warning message [#73219]
5512 2005-03-03 Raja R Harinath <rharinath@novell.com>
5514 Fix compile with MCS 1.0.0.0.
5515 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5516 w_restore to not depend on string constant folding.
5518 2005-03-03 Raja R Harinath <rharinath@novell.com>
5520 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
5521 CS0246 check to users who passed 'silent = false'.
5522 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5524 (SimpleName.SimpleNameResolve): Update.
5525 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5526 (MemberAccess.IdenticalNameAndTypeName): Update.
5527 * doc.cs (FindDocumentedTypeNonArray): Update.
5529 2005-03-03 Raja R Harinath <rharinath@novell.com>
5531 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5532 * parameters.cs (ComputeAndDefineParameters): Remove.
5533 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5534 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5535 Use GetParameterInfo.
5537 2005-03-02 Marek Safar <marek.safar@seznam.cz>
5539 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5541 2005-03-02 Raja R Harinath <rharinath@novell.com>
5543 Unify DeclSpace.LookupType and DeclSpace.FindType.
5544 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
5545 is in charge of defining nested types on demand.
5546 (DeclSpace.LookupType): Use it when the current_type is a
5547 TypeBuilder. Use LookupTypeDirect for reflected types.
5548 (DeclSpace.FindType): Remove.
5549 (DeclSpace.LookupInterfaceOrClass): Likewise.
5550 (DeclSpace.DefineTypeAndParents): Likewise.
5551 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5552 DeclSpace.LookupType.
5553 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5554 * typemanager.cs (LookupType): Simplify.
5555 (AddUserType): Remove type from negative_hits.
5556 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5557 * class.cs (TypeContainer.FindMembers): Move handling of nested
5559 (TypeContainer.FindMembers_NestedTypes): ... here.
5560 (TypeContainer.FindNestedType): Implement override.
5561 (ClassPart.FindNestedType): Delegate to PartialContainer.
5562 (ClassPart.PartFindNestedType): Looks up the nested types of the
5565 2005-03-02 Martin Baulig <martin@ximian.com>
5567 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5568 static constructor in static classes.
5570 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
5572 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5573 sizeParamIndex is not specified.
5575 2005-03-01 Marek Safar <marek.safar@seznam.cz>
5578 * report.cs (WarningMessage.IsEnabled): Missing null check.
5580 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5582 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5583 in the fields and not in the properties.
5585 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
5587 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
5590 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5592 * attribute.cs: Small refactoring (improved robustness).
5593 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5594 (ValidateGuid): Removed.
5595 (Resolve): Removed referenced to above mentioned.
5596 (GetAttributeUsage): Made private and changed to work without
5598 (GetIndexerAttributeValue): Don't crash.
5599 (GetConditionalAttributeValue): Ditto.
5600 (GetClsCompliantAttributeValue): Ditto.
5601 (ExtractSecurityPermissionSet): All attributes exceptions are
5603 (GetPropertyValue): New helper.
5604 (GetMethodImplOptions): New method.
5605 (DefinePInvokeMethod): Reuse common code. Implemented handling of
5606 some missing properties.
5608 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5609 (Method.ApplyAttributeBuilder): Updated.
5611 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5614 2005-02-28 Raja R Harinath <rharinath@novell.com>
5617 * report.cs (Report.SymbolRelatedToPreviousError): Handle
5618 non-simple types (array, pointer, reference).
5620 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5622 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5624 * class.cs (MethodCore.IsDuplicateImplementation): Special error
5626 (Method.CheckBase): Catch wrong destructor here.
5627 (MethodData.Define): Add errors 550, 668.
5629 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5631 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5633 * pending.cs (VerifyPendingMethods): Add error 551.
5635 * typemanager.cs (CSharpName): Next error report helper.
5637 2005-02-25 Marek Safar <marek.safar@seznam.cz>
5639 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5640 attributes. Removed useless attribute double check.
5641 It saves almost 2MBs for corlib.
5643 2005-02-25 Raja R Harinath <rharinath@novell.com>
5646 * statement.cs (ExpressionStatement.Resolve): Make robust to being
5647 called twice in case of error.
5649 2005-02-23 Chris Toshok <toshok@ximian.com>
5651 Fix compiler portions of #72827.
5652 * statement.cs (Block.Emit): call Begin/EndScope on the
5653 EmitContext instead of the ILGenerator.
5655 * codegen.cs (EmitContext.BeginScope): new method, call
5656 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5658 (EmitContext.BeginScope): same, but EndScope and CloseScope
5660 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5661 offset and call the superclass's OpenScope(int) with it.
5662 (SymbolWriter.CloseScope): get the current il
5663 offset and call superclass's CloseScope(int) with it.
5665 2005-02-23 Marek Safar <marek.safar@seznam.cz>
5667 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5668 CS1677 for out and ref as well.
5670 * class.cs (Method.Define): Add error CS1599 detection.
5672 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5674 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5676 * delegate.cs (Delegate.Define): Add error CS1599 detection.
5678 * support.cs.cs (ModifierDesc): New helper method.
5680 2005-02-23 Raja R Harinath <rharinath@novell.com>
5681 Abin Thomas <projectmonokochi@rediffmail.com>
5682 Anoob V E <projectmonokochi@rediffmail.com>
5683 Harilal P R <projectmonokochi@rediffmail.com>
5686 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5687 MemberLookup (used for error reporting) actually returns a result.
5688 Fix error report number (122, not 112).
5690 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
5691 Anoob V E <projectmonokochi@rediffmail.com>
5692 Harilal P R <projectmonokochi@rediffmail.com>
5695 * pending.cs (PendingImplementation.GetAbstractMethods):
5696 Find NonPublic members too.
5698 2005-02-22 Marek Safar <marek.safar@seznam.cz>
5700 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5703 * class.cs (MethodCore.CheckMethodAgainstBase):
5704 Add error 239 report.
5706 2005-02-21 Raja R Harinath <rharinath@novell.com>
5709 * expression.cs (Invocation.IsApplicable): Make public.
5710 (Invocation.IsParamsMethodApplicable): Likewise.
5711 * delegate.cs (Delegate.VerifyApplicability): Don't use
5712 Invocation.VerifyArgumentCompat for parameter applicability
5713 testing. Use Invocation.IsApplicable and
5714 Invocation.IsParamsMethodApplicable.
5716 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5718 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5720 * class.cs (Operator.Define): Add error 217 report.
5722 2005-02-21 Raja R Harinath <rharinath@novell.com>
5724 * namespace.cs (UsingEntry.Resolve): Undo change below.
5726 2005-02-21 Raja R Harinath <rharinath@novell.com>
5729 * ecore.cs (Expression.MemberLookupFailed): Add argument to
5730 disable the error message when the extended MemberLookup also
5732 (Expression.MemberLookupFinal): Update.
5733 (SimpleName.DoSimpleNameResolve): Update.
5734 * expression.cs (MemberAccess.ResolveNamespaceOrType):
5735 Don't use MemberLookupFinal.
5736 (New.DoResolve): Update.
5737 (BaseAccess.CommonResolve): Update.
5739 2005-02-21 Raja R Harinath <rharinath@novell.com>
5742 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5743 occured previously, don't resolve again.
5745 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5748 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5749 argument. Call ResolveAttributeUsage for unresolved.
5750 when types doesn't match ctor arguments.
5752 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5753 for nested attribute classes.
5754 (Class.attribute_usage): Removed.
5755 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5756 for attribute class.
5758 * ecore.cs (IsAttribute): Removed.
5760 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5762 * rootcontext.cs (RegisterAttribute): Removed, attributes are
5764 (attribute_types): Removed.
5765 (EmitCode): Global attributes are emited as the latest.
5767 2005-02-18 Marek Safar <marek.safar@seznam.cz>
5769 * class.cs (EmitFieldInitializers): Don't emit field initializer
5770 for default values when optimilization is on.
5772 * constant.cs (Constant.IsDefaultValue): New property.
5774 * driver.cs: Add /optimize handling.
5778 * literal.cs: Implement new IsDefaultValue property.
5780 * rootcontext.cs (Optimize): New field, holds /optimize option.
5782 2005-02-18 Raja R Harinath <rharinath@novell.com>
5784 Fix crasher in re-opened #72347.
5785 * namespace.cs (Namespace.Lookup): Return null if
5786 DeclSpace.DefineType returns null.
5789 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5791 2005-02-18 Raja R Harinath <rharinath@novell.com>
5793 Fix remainder of #63202. Change semantics of DoResolveLValue: it
5794 now returns null if it cannot resolve to an lvalue.
5795 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5796 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5797 returned null. Remove check for SimpleName.
5798 (EventExpr.DoResolveLValue): New.
5799 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5800 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
5802 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
5804 (Unary.ResolveOperator): Move CS0211 check ...
5805 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
5807 (Unary.DoResolveLValue): Simplify.
5808 (AddressOf.DoResolveLValue): New.
5809 (ArrayAccess.DoResolveLValue): New.
5811 2005-02-16 Marek Safar <marek.safar@seznam.cz>
5813 * attribute.cs (Attribute.Resolve): Add arguments casting for
5814 when types doesn't match ctor arguments.
5816 2005-02-16 Raja R Harinath <rharinath@novell.com>
5818 Fix parts of #63202.
5819 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5820 lookup of operator in base type. Ensure that all checks happen
5821 when the operator resolves to an "op_..." method.
5823 2005-02-15 Raja R Harinath <rharinath@novell.com>
5826 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5827 'ignore_cs0104' parameter. Pass it to ...
5828 (NamespaceEntry.Lookup): ... this.
5829 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5830 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5831 (TypeLookupExpression.DoResolveAsTypeStep): Update.
5832 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5833 Update. Request that cs0104 errors be ignored.
5834 (ComposedCast.ResolveAsTypeStep): Update.
5836 2005-02-14 Raja R Harinath <rharinath@novell.com>
5839 * expression.cs (Invocation.BetterFunction): Remove support for
5840 comparing virtual functions and their overrides.
5841 (Invocation.IsOverride): New.
5842 (Invocation.OverloadResolve): Don't consider 'override' functions
5843 during candidate selection. Store them in a lookaside list.
5844 If the selected method is a 'virtual' function, use the list to
5845 find any overrides that are closer to the LHS type.
5847 2005-02-14 Marek Safar <marek.safar@seznam.cz>
5849 * expression.cs (New.DoResolve): Add complex core type reduction.
5850 (New.Constantify): Converts complex core type syntax like 'new int ()'
5853 2005-02-14 Raja R Harinath <rharinath@novell.com>
5855 * decl.cs (EntryType.EntryType): New constructor to create an
5856 updated copy of a cache entry.
5857 (MemberCache.AddMethods): Use it.
5858 (MemberCache.ClearDeclaredOnly): Remove.
5859 (MemberCache.MemberCache): Update.
5861 2005-02-11 Miguel de Icaza <miguel@novell.com>
5863 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5864 variable. This one is represents the actual low-level declaration
5865 of the method, as opposed to the semantic level `IsStatic'.
5867 An anonymous method which is hosted into a static method might be
5868 actually an instance method. IsStatic would reflect the
5869 container, while MethodIsStatic represents the actual code
5872 * expression.cs (ParameterReference): Use the new MethodIsStatic
5873 instead of IsStatic.
5875 * anonymous.cs (AnonymousMethod.Compatible): Pass the
5876 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5877 set on the current EmitContext.
5879 * expression.cs (Cast): Overload DoResolveLValue so we can pass
5880 resolve our casted expression as an LValue. This triggers the
5881 proper LValue processing that is later required by Assign.
5885 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5887 2005-02-11 Marek Safar <marek.safar@seznam.cz>
5889 C# 2.0 Fixed buffer implementation
5891 * anonymous.cs: Update after RegisterHelperClass renaming.
5893 * attribute.cs (AttributeTester.fixed_buffer_cache):
5894 Cache of external fixed buffers.
5895 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5896 implementation if field is fixed buffer else null.
5899 (TypeContainer.AddField): Accept FieldMember instead of Field.
5900 (FieldBase.IsFieldClsCompliant): Extracted code from
5901 VerifyClsCompliance descendant customization.
5902 (FixedField): New class handles fixed buffer fields.
5903 (FixedFieldExternal): Keeps information about imported fixed
5905 (IFixedField): Make access to internal or external fixed buffer
5908 * cs-parser.jay: Add fixed buffer parsing.
5910 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5913 * expression.cs (Indirection): Extended implementation to accept
5915 (PointerArithmetic.Emit): Get element from fixed buffer as well.
5916 (ElementAccess.MakePointerAccess): Get type as parameter.
5917 (DoResolve): Add fixed buffer field expression conversion.
5918 (DoResolveLValue): Ditto.
5919 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5920 (ArrayPtr): Derives from FixedBufferPtr.
5921 (ArrayPtr.Emit): Add extra emit for array elements.
5923 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5925 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5926 for compiler generated types.
5927 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5929 * statement.cs (Fixed): Refactored to be easier add fixed buffer
5930 and consume less memory.
5931 (Fixed.Resolve): Add fixed buffer case.
5933 * typemanager.cs (compiler_generated_attr_ctor,
5934 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5935 (HasElementType): Add our own implementation to work on every
5938 2005-02-11 Miguel de Icaza <miguel@novell.com>
5940 * anonymous.cs (CaptureContext): Track whether `this' has been
5943 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
5944 only captured `this' if it was implicitly done (instance
5945 methods/variables were used).
5947 * codegen.cs (EmitContext.CaptureThis): New method to flag that
5948 `this' must be captured.
5950 2005-01-30 Miguel de Icaza <miguel@novell.com>
5952 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5953 is null it means that there has been no need to capture anything,
5954 so we just create a sibling.
5956 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5958 Just a partial fix. The other half is fairly elusive.
5960 2005-02-10 Raja R Harinath <rharinath@novell.com>
5962 Fix #52586, cs0121-4.cs.
5963 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
5964 and return a hashtable.
5965 (MemberCache.ClearDeclaredOnly): New.
5966 (MemberCache.MemberCache): Update to change. Make a deep copy of
5967 the method_hash of a base type too.
5968 (MemberCache.AddMethods): Adapt to having a deep copy of the base
5969 type methods. Overwrite entries with the same MethodHandle so
5970 that the ReflectedType is correct. The process leaves in base
5971 virtual functions and their overrides as distinct entries.
5972 (CacheEntry): Now a class instead of a struct. It shouldn't alter
5973 matters since it was boxed in a ArrayList before.
5974 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5976 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
5977 case of a virtual function and its override (choose the overload
5979 (Invocation.OverloadResolve): Avoid 'override' members during
5980 'applicable_type' calculation.
5982 2005-02-09 Raja R Harinath <rharinath@novell.com>
5984 Combine two near-redundant caches.
5985 * typemanager.cs (method_params): Rename from method_internal_params.
5986 (TypeManager.GetParameterData): New. Replace
5987 Invocation.GetParameterData.
5988 (TypeManager.LookupParametersByBuilder): Remove.
5989 * expression.cs (Invocation.method_parameter_cache): Remove.
5990 (Invocation.GetParameterData): Remove.
5992 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5995 2005-02-08 Raja R Harinath <rharinath@novell.com>
5998 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5999 TypeManager.multicast_delegate_type is null, resolve it by looking
6000 up "System.MulticastDelegate".
6001 * rootcontext.cs (RootContext.ResolveCore): Simplify.
6003 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
6004 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
6005 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
6008 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6009 (LabeledStatement.AddReference): New. Set 'referenced'.
6010 (Goto.Resolve): Use it.
6012 2005-02-05 John Luke <john.luke@gmail.com>
6014 * driver.cs: remove duplicate -doc line in Usage ()
6016 2005-02-04 Raja R Harinath <rharinath@novell.com>
6018 * location.cs (Location.AddFile): Fix CS2002 error report.
6020 2005-02-02 Martin Baulig <martin@ximian.com>
6022 * delegate.cs (Delegate.DefineType): Report an internal error if
6023 TypeManager.multicast_delegate_type is null. See bug #72015 for
6026 2005-02-02 Raja R Harinath <rharinath@novell.com>
6028 Fix a crasher in a variant of #31984.
6029 * const.cs (Constant.CheckBase): New override that defers the
6030 new-or-override check in case the base type hasn't been populated
6032 (Constant.Define): Ensure the new-or-override check is performed.
6034 2005-02-01 Duncan Mak <duncan@ximian.com>
6036 * const.cs (LookupConstantValue): Check that `ce' is not null
6037 before calling GetValue ().
6039 2005-02-01 Raja R Harinath <rharinath@novell.com>
6041 Fix test-334.cs (#69519).
6042 * cs-parser.jay (using_alias_directive): Pass in an expression to
6043 NamespaceEntry.UsingAlias.
6044 (using_namespace_directive): Pass in an expression to
6045 NamespaceEntry.Using.
6046 (namespace_name): Don't flatten to a string.
6047 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6048 (NamespaceEntry.AliasEntry.Resolve): Lookup using
6050 (NamespaceEntry.UsingEntry): Likewise.
6051 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6053 (NamespaceEntry.LookupForUsing): Remove.
6054 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6056 (NamespaceEntry.Lookup): Remove support for dotted names.
6058 2005-02-01 Raja R Harinath <rharinath@novell.com>
6060 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6062 (NamespaceEntry.ImplicitParent): Compute on demand.
6063 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6064 parallels the current.
6065 (NamespaceEntry.LookupForUsing): Use it.
6066 (NamespaceEntry.Lookup): If the current namespace-entry is
6067 implicit, don't search aliases and using tables.
6069 2005-02-01 Raja R Harinath <rharinath@novell.com>
6072 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6074 (TypeContainer.BaseCache): Compute on demand.
6075 (TypeContainer.FindMembers): Define constants and types if they're
6076 not already created.
6077 (FieldMember.Define): Move resetting of ec.InUnsafe before error
6079 * const.cs (Constant.Define): Make idempotent.
6081 2005-01-29 Miguel de Icaza <miguel@novell.com>
6083 * pending.cs: Produce better code (no nops produced by using Ldarg
6086 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6087 i - 1' it should be arg + 1.
6091 2005-01-28 Raja R Harinath <rharinath@novell.com>
6093 * attribute.cs (Attribute.CheckAttributeType): Make private
6095 (Attribute.ResolveType): Make virtual.
6096 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6097 handling of RootContext.Tree.Types.
6099 2005-01-27 Raja R Harinath <rharinath@novell.com>
6101 Update attribute-handling to use the SimpleName/MemberAccess
6103 * cs-parser.jay (attribute): Pass in an expression to the
6104 constructors of Attribute and GlobalAttribute.
6105 * attribute.cs (Attribute): Take an expression for the name.
6106 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
6107 passed in attribute name expression.
6108 (Attribute.CheckAttributeType): Use it.
6109 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6110 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6111 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
6112 argument to prevent error messages if the lookup fails.
6114 2005-01-27 Marek Safar <marek.safar@seznam.cz>
6116 * expression.cs (Indirection): Implemented IVariable interface
6117 to support indirection in AddressOf operator.
6118 (PointerArithmetic.Emit): Add optimalization for case where
6119 result can be precomputed.
6121 2005-01-26 Martin Baulig <martin@ximian.com>
6123 * class.cs (TypeContainer.AttributeTargets): Return the correct
6124 AttributeTargets depending on our `Kind' instead of throwing an
6125 exception; fixes #71632.
6127 2005-01-26 Marek Safar <marek.safar@seznam.cz>
6130 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6133 2005-01-25 Raja R Harinath <rharinath@novell.com>
6136 * expression.cs (MemberAccess.DoResolve): Don't complain with
6137 cs0572 when the LHS of a member access has identical name and type
6140 2005-01-25 Marek Safar <marek.safar@seznam.cz>
6143 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6145 Create custom PermissionSet only for PermissionSetAttribute.
6147 2005-01-24 Marek Safar <marek.safar@seznam.cz>
6150 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6151 delegates in static class.
6153 2005-01-24 Martin Baulig <martin@ximian.com>
6155 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6156 merging an implicit block, just use its reachability.
6158 * statement.cs (Block.Resolve): Make the unreachable code check
6159 work wrt. implicit blocks; see test-337 from #63842.
6161 2005-01-21 Alp Toker <alp@atoker.com>
6163 * cs-parser.jay: destructor_declaration's container is PartialContainer
6164 not Class when partial types are used, so use Kind prop instead of
6167 2005-01-22 Miguel de Icaza <miguel@ximian.com>
6169 * cs-parser.jay: Improve error reporting when an interface
6172 2005-01-20 Dick Porter <dick@ximian.com>
6174 * support.cs: SeekableStreamReader fix from Sandor Dobos
6175 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6176 chars are read. Fixes bug 70369.
6178 2005-01-20 Raja R Harinath <rharinath@novell.com>
6180 * cs-parser.jay (catch_clause): Simplify current_block handling
6183 2005-01-17 Miguel de Icaza <miguel@ximian.com>
6185 * convert.cs (ImplicitStandardConversionExists): Synchronize the
6186 code with ImplicitStandardConversion to handle the implicit
6187 conversion of method groups into valid delegate invocations.
6189 The problem is that in parameter handling we were using this code
6190 path. Fixes bug #64698
6192 2005-01-19 Raja R Harinath <rharinath@novell.com>
6194 * cs-parser.jay: Fix several infelicities.
6195 - Avoid assigning to the parser value stack. Code like
6196 '$3 = null' is unclean. Synthesize a value for the code block
6198 - Avoid using oob_stack for storing location information. Use ...
6199 (_mark_): ... this. New (empty) rule. Saves the current location
6201 (foreach_statement): Avoid using oob_stack for current_block
6202 handling. Use technique used in for_statement and
6203 using_statement. Synthesize a value for the code block to store
6204 additional intermediate information.
6206 2005-01-13 Miguel de Icaza <miguel@ximian.com>
6208 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6209 of a different type is only allowed to private fields of a
6210 containing type, not on fields of a base class.
6212 See test-174.cs and error cs0122-9.cs
6214 2005-01-13 Raja R Harinath <rharinath@novell.com>
6216 Fix test-335.cs (bug #58126).
6217 * cs-parser.jay (argument): Split out non-expression parts of the
6218 rule into 'non_simple_argument'.
6219 (invocation_expression): Support parenthesized invocations with
6220 multiple arguments, and with single non-simple arguments.
6222 2005-01-13 Raja R Harinath <rharinath@novell.com>
6224 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6227 2005-01-12 Raja R Harinath <rharinath@novell.com>
6229 Fix cs0038-1.cs, cs1640-6.cs.
6230 * ecore.cs (Expression.Resolve): Remove special-case for
6231 SimpleName in error-handling.
6232 (Expression.almostMatchedMembers): Relax access permission to
6234 (Expression.MemberLookupFailed): Handle duplicates in
6235 almostMatchedMembers list.
6236 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6237 * expression.cs (New.DoResolve): Report CS1540 for more cases.
6238 * typemanager.cs (GetFullNameSignature): Use the MethodBase
6239 overload if the passed in MemberInfo is a MethodBase.
6241 2005-01-12 Marek Safar <marek.safar@seznam.cz>
6244 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6245 for non-CAS & merge permission sets properly.
6247 2005-01-11 Raja R Harinath <rharinath@novell.com>
6249 Improve standard-compliance of simple name and member access
6250 resolution. Fixes bugs #52697, #57200, #67520, #69519.
6251 * ecore.cs (FullNamedExpression): New abstract base class
6252 for Namespaces and TypeExpressions.
6253 (ResolveFlags.SimpleName): Remove.
6254 (SimpleName): Remove support for dotted names.
6255 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
6256 DeclSpace.FindType and DeclSpace.LookupType.
6257 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6258 (Expression.ExprClassName): Make member function.
6259 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6260 a namespace. Remove creation of dotted "SimpleName"s.
6261 (MemberAccess.DoResolve): Likewise.
6262 * decl.cs (DeclSpace.Cache): Make private.
6263 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6264 (DeclSpace.FindType): Update.
6265 (DeclSpace.LookupType): Move here from RootContext. Return a
6266 FullNamedExpression.
6267 * namespace.cs (Namespace): Derive from FullNamedExpression
6268 so that it can be part of expression resolution.
6269 (Namespace.Lookup): Return an FullNamedExpression.
6270 (NamespaceEntry.LookupAlias): Lookup aliases only in current
6272 * rootcontext.cs (NamespaceLookup): Remove.
6273 (LookupType): Move to DeclSpace.
6274 * attribute.cs (CheckAttributeType): Update.
6275 * doc.cs (FindDocumentedType): Remove allowAlias argument.
6276 (FindDocumentedTypeNonArray): Likewise.
6278 2005-01-11 Raja R Harinath <rharinath@novell.com>
6280 Fix cs0509.cs, cs1632.cs.
6281 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6282 is the same as IsInterface.
6283 (TypeContainer.GetClassBases): Likewise.
6284 * statement.cs (LabeledStatement.ig): New field.
6285 (LabeledStatement.LabelTarget): Save ILGenerator which created the
6287 (LabeledStatement.DoEmit): Check that the label was created with
6288 the same ILGenerator.
6290 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6293 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6294 accessors to its properties.
6296 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6297 from accessors to property.
6299 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6302 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6305 2005-01-08 Miguel de Icaza <miguel@ximian.com>
6307 * attribute.cs: Check for null and empty strings.
6309 I have lost another battle to Paolo.
6311 2005-01-07 Marek Safar <marek.safar@seznam.cz>
6314 * class.cs (PropertyMethod): Set Parent field in ctors.
6315 (SetMethod.InternalParameters): Add unsafe switch hack.
6316 Override MarkForDuplicationCheck where it is appropriate.
6318 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6319 It says whether container allows members with the same name.
6321 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6322 Removed is_method parameter.
6324 2005-01-06 Duncan Mak <duncan@ximian.com>
6326 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6327 because the previous change led to incorrect reporting of CS1032
6328 ("Cannot define/undefine preprocessor symbols after first token in
6329 file"). Instead of using `tokens_seen' as the only flag that
6330 triggers CS1040, introduce `comments_seen'. This new flag is used
6331 to signify having seen comments on the current line, so it is
6332 unset after a newline.
6334 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6336 * doc.cs : When searching for a type, find nested type too.
6337 This fixes bug #71040.
6339 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6342 - Warn missing member comment on those classes which also does not
6343 have doc comments. Fixed bug #71041.
6344 - Don't warn missing doc comment on default constructor.
6347 2005-01-06 Duncan Mak <duncan@ximian.com>
6349 * cs-tokenizer.cs (xtoken): After handling traditional C-style
6350 comments, set `tokens_seen' to true. This allows us to detect
6351 misplaced preprocessor directives (i.e. not at the beginning of
6352 the a line, nor after whitespaces). In that case, report error
6353 CS1040. This fixes bug #56460.
6355 * cs-parser.jay (interface_member_declaration): Add checks for
6356 IsExplicitImpl, and report CS0541 error if an interface member is
6357 defined as an explicit interface declaration.
6359 2005-01-06 Marek Safar <marek.safar@seznam.cz>
6362 * class.cs (PropertyMethod): Set Parent field in ctors.
6363 (SetMethod.InternalParameters): Add unsafe switch hack.
6365 * decl.cs (MemberCore.Parent): Cannot be readonly.
6367 2005-01-06 Raja R Harinath <rharinath@novell.com>
6369 * decl.cs (DeclSpace.ResolveType): Remove.
6370 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6371 Merge in code from ...
6372 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
6373 * class.cs, enum.cs: Update to changes.
6375 2005-01-06 Miguel de Icaza <miguel@ximian.com>
6377 * anonymous.cs: Ensure that we init the scope of our parent if it
6378 has not been initialized yet.
6380 2004-12-30 Duncan Mak <duncan@ximian.com>
6382 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6383 if field.FieldBuilder is null. Fixes #70758.
6385 * convert.cs: Fixed some typos and updated some of the comments.
6386 (ImplicitStandardConversionExists):
6387 (TryImplicitIntConversion): If `target_type' is an interface and
6388 the type of `ic' implements this interface, return true or a new
6389 BoxedCast instead of null. This fixes #70468.
6391 2004-12-29 Duncan Mak <duncan@ximian.com>
6393 * expression.cs (Argument.Emit): Check that Expr is
6394 IMemoryLocation before casting to it, and report CS1510 otherwise.
6398 2004-12-21 Ben Maurer <bmaurer@ximian.com>
6400 * statement.cs (Block.ThisVariable): remove the recursion here, to
6401 make the --profile more sane.
6403 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
6405 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6406 assembly, by JB Evain.
6408 2004-12-17 Raja R Harinath <rharinath@novell.com>
6410 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
6411 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6412 "parent" refers to enclosing type/class. "base" refers to superclass.
6414 2004-12-17 Raja R Harinath <rharinath@novell.com>
6416 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6417 Ensure that we only have GlobalAttributes.
6418 * attribute.cs (Attribute.Emit): Make non-virtual.
6419 (GlobalAttribute.Emit): Remove.
6420 (Attribute.Resolve): Make virtual.
6421 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
6422 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6423 the argument. Don't create one.
6424 (Attribute.GetObsoleteAttribute): Likewise.
6425 (Attribute.GetClsCompliantAttributeValue): Likewise.
6426 * class.cs, decl.cs: Update to changes.
6428 2004-12-17 Marek Safar <marek.safar@seznam.cz>
6430 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6432 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6434 * statement.cs (Foreach.Resolve): Add error 186 report.
6436 2004-12-16 Marek Safar <marek.safar@seznam.cz>
6438 * expression.cs (Conditional.DoResolve): Add warning 429.
6440 * statement.cs (If.Resolve): Add warning 665.
6442 2004-12-16 Raja R Harinath <rharinath@novell.com>
6444 New invariant: RootContext.Tree.Types.NamespaceEntry == null
6445 except when in the parser, and in GlobalAttribute.
6446 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6447 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6448 RootContext.Tree.Types.NamespaceEntry once work is done.
6449 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
6450 and resets RootContext.Tree.Types.NamespaceEntry.
6452 2004-12-15 Marek Safar <marek.safar@seznam.cz>
6454 * cs-parser.jay: Don't create a block for every variable.
6456 2004-12-14 Miguel de Icaza <miguel@ximian.com>
6458 * location.cs: Provide extra information.
6460 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6461 variables from the captured environment, it is the ldarg_0.
6463 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6465 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6468 * class.cs: Changed warning level for 169 to avoid developer
6469 displeasure from warning flooding. It will be changed back when they
6470 fix most of current BCL warnings.
6472 * RootContext.cs: Pushed default WarningLevel to 3.
6474 * statement.cs: Removed unused variable.
6476 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6478 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6479 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6480 Add error 502 report.
6481 (StaticClass.DefineType): Add error 441 report.
6482 (Class.AllowedModifiersProp): New virtual property as temporary
6483 extension to AllowedModifiers.
6484 (Class.DefineType): Add error 418 report. Moved ModFlags check here
6485 to share implementation with StaticClass and don't call virtual
6488 * driver.cs (MainDriver): Add error 1558 test.
6490 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6491 report. Moved error 36 test here.
6493 * statement.cs (Throw.Resolve): Add error 724 report.
6495 * typemanager.cs: Add out_attribute_type core type.
6497 2004-12-13 Marek Safar <marek.safar@seznam.cz>
6499 * class.cs (TypeContainer.VerifyClsCompliance): Add error
6501 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6503 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6506 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6508 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
6509 Add error 3023 report.
6510 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6512 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6515 2004-12-12 John Luke <john.luke@gmail.com>
6517 * driver.cs (AddArgs): take -- into account when
6518 adding arguments, fixes bug 65710
6520 2004-12-12 Martin Baulig <martin@ximian.com>
6522 * expression.cs (Unary.TryReduceNegative): Added support for
6523 SByteConstant and ByteConstant.
6524 (Unary.Reduce): Check error values from TryReduceNegative().
6526 2004-12-10 Marek Safar <marek.safar@seznam.cz>
6528 * attributes.cs (Attribute.Resolve): Avoid multiple error report
6529 and report exception as error 182.
6531 2004-12-10 Raja R Harinath <rharinath@novell.com>
6533 * driver.cs (Main): Fix message when there are warnings.
6535 2004-12-09 Miguel de Icaza <miguel@ximian.com>
6537 * delegate.cs: Fixed my fix from yesterday, sorry about that.
6539 2004-12-09 Marek Safar <marek.safar@seznam.cz>
6541 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
6542 Reduced number of warnings.
6544 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6546 2004-12-08 Miguel de Icaza <miguel@ximian.com>
6548 * driver.cs: Removed message.
6550 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6552 2004-12-08 <vargaz@freemail.hu>
6554 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6556 2004-12-08 Martin Baulig <martin@ximian.com>
6558 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6559 instead of a CS3002 for properties and indexer.
6561 2004-12-08 Martin Baulig <martin@ximian.com>
6563 * decl.cs (MemberName.ToString): Make this work again.
6565 2004-12-08 Marek Safar <marek.safar@seznam.cz>
6567 * attribute.cs (Resolve): Add error 591 detection.
6569 * class.cs (FieldMember.Define): Add error 1547 detection.
6570 (Indexer.Define): Add error 620 detection.
6571 (Operator.Define): Add error 590 detection.
6573 * ecore.cs: Missing argument for error 79.
6575 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6578 2004-12-07 Marek Safar <marek.safar@seznam.cz>
6581 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6584 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6586 * cs-parser.jay : handle doc comments on implicit/explicit operators.
6587 Some operator comments were suppressed.
6588 * doc.cs : Implicit/explicit operator name in doc comments are like
6589 "op_Explicit(type)~returnType", so added suffix handling.
6591 2004-12-07 Martin Baulig <martin@ximian.com>
6594 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6595 (MemberCore.GetClsCompliantAttributeValue): Likewise.
6596 (DeclSpace.ec): New protected field; store the EmitContext here.
6597 (DeclSpace.EmitContext): New public property; moved here from
6599 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6602 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6603 (Enum.Emit): Don't create a new EmitContext.
6605 * delegate.cs (Delegate.DefineType): Always create the
6608 * iterators.cs (Iterators.DefineIterator): Create a new
6609 EmitContext and store it in `ec'.
6611 2004-08-24 Martin Baulig <martin@ximian.com>
6614 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6615 this for accessibility checks.
6616 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6617 IsNestedFamilyAccessible.
6618 (TypeManager.IsSubclassOf): New method, do what the name actually
6621 2004-12-06 Raja R Harinath <rharinath@novell.com>
6623 Fix crash on cs0657-17.cs.
6624 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6625 Use RootContext.Tree.Types, not 'new RootTypes ()'.
6626 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6627 the case where the NamespaceEntry gets overwritten.
6629 2004-12-06 Marek Safar <marek.safar@seznam.cz>
6631 Fixed #69195, #56821
6632 * ecore.cs (ResolveBoolean): Tiny refactoring.
6634 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6635 of right expression resolving when left is false constant and
6636 operator is LogicalAnd OR true constant and operator is LogicalOr.
6638 * statement.cs (ResolveUnreachable): Always reports warning.
6640 2004-12-05 Miguel de Icaza <miguel@ximian.com>
6642 * class.cs: Distinguish between 1721 and 1722 (just a little help
6643 for the programmer).
6645 2004-12-03 Miguel de Icaza <miguel@ximian.com>
6647 * delegate.cs: Only allow this on new versions of the language.
6649 2004-12-02 Duncan Mak <duncan@ximian.com>
6651 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6653 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6654 here as a static method. Take an additional bool out parameter
6655 `must_do_cs1540_check' for signaling to InstanceResolve.
6656 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6657 member field from PropertyExpr class and made it an argument of
6659 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6660 check for MarshalByRefObject, and report CS0122 instead of CS1540.
6661 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6662 and `remove_accessor' as well as InstanceResolve: report CS0122
6667 2004-12-03 Raja R Harinath <rharinath@novell.com>
6669 Fix test-327.cs, test-328.cs, and put in early infrastructure
6670 for eventually fixing #52697.
6671 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6672 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6674 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6675 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6676 (VerifyUsing, error246): Update.
6677 * rootcontext.cs (RootContext.NamespaceLookup): Just use
6678 'NamespaceEntry.LookupNamespaceOrType'.
6680 2004-12-03 Martin Baulig <martin@ximian.com>
6682 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6683 method as our child, call AnonymousMethod.Compatible() on it.
6685 2004-12-03 Raja R Harinath <rharinath@novell.com>
6687 Disable XML documentation support in 'basic' profile.
6688 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
6689 Redirect XmlElement to System.Object.
6690 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
6691 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
6692 * mcs.exe.sources: Add doc-bootstrap.cs.
6693 * doc-bootstrap.cs: New file. Contains empty stub implementation
6696 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
6698 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6699 comments are allowed.
6701 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6703 * delegate.cs: Add checks for subtypes in paramaters and return values
6704 in VerifyMethod () to add support for Covariance/Contravariance
6707 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6709 * report.cs: Remove extra closing parenthesis.
6711 * convert.cs (Error_CannotImplicitConversion): If the name of the
6712 types are the same, provide some extra information.
6714 * class.cs (FieldBase): Use an unused bit field from the field to
6715 encode the `has_offset' property from the FieldMember. This saves
6716 a couple of Ks on bootstrap compilation.
6718 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6719 method as our child, return the AnonymousMethod resolved
6722 * expression.cs (New.DoResolve): Allow return values from
6723 NewDelegate to also include AnonymousMethods.
6727 2004-12-02 Marek Safar <marek.safar@seznam.cz>
6730 * attribute.cs (Resolve): Improved implementation of params
6731 attribute arguments.
6733 * support.cs (ParameterData): Add HasParams to be faster.
6735 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
6737 all things are for /doc support:
6739 * doc.cs: new file that supports XML documentation generation.
6740 * mcs.exe.sources: added doc.cs.
6742 Handle /doc command line option.
6743 Report error 2006 instead of 5 for missing file name for /doc.
6744 Generate XML documentation when required, after type resolution.
6746 Added support for picking up documentation (/// and /** ... */),
6747 including a new XmlCommentState enumeration.
6749 Added lines to fill Documentation element for field, constant,
6750 property, indexer, method, constructor, destructor, operator, event
6751 and class, struct, interface, delegate, enum.
6752 Added lines to warn incorrect comment.
6754 Added Documentation field (passed only when /doc was specified).
6756 Added DocComment, DocCommentHeader, GenerateDocComment() and
6757 OnGenerateDocComment() and some supporting private members for
6758 /doc feature to MemberCore.
6760 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6762 Added overriden DocCommentHeader.
6764 Added overriden DocCommentHeader and GenerateDocComment().
6766 2004-12-01 Miguel de Icaza <miguel@ximian.com>
6768 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6769 unwrapping the enumeration values, chain to
6770 DoConstantNumericPromotions again, so we can promote things to the
6771 fundamental types (takes care of enums that are bytes, sbytes).
6775 2004-12-01 Raja R Harinath <rharinath@novell.com>
6777 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6778 Fix long-standing bug in type-lookup. Use FindType instead of
6779 LookupType when ec.ResolvingTypeTree.
6780 (Attribute.ResolveType, Attribute.Resolve)
6781 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6783 (Attributes.Search): Remove internal version. Update.
6784 (Attributes.SearchMulti): Update.
6785 (Attributes.GetClsCompliantAttribute): Remove.
6786 (Attributes.GetIndexerNameAttribute): Remove.
6787 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6788 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6789 * class.cs (Indexer.Define): Likewise.
6791 2004-12-01 Marek Safar <marek.safar@seznam.cz>
6794 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6795 MarshallByReference members access.
6797 * expression.cs: Use CheckMarshallByRefAccess;
6798 Better error CS0197 message.
6800 * report.cs: Print whole related error message.
6802 2004-11-30 Raja R Harinath <rharinath@novell.com>
6804 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
6805 the current directory to help debugging.
6807 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6809 * class (GetClassBases): Better error 60 report.
6810 (EventProperty): Disabled warning 67 detection.
6812 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6815 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6817 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6820 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6823 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6825 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6827 2004-11-26 Miguel de Icaza <miguel@ximian.com>
6829 * attribute.cs (Attribute.Resolve): Refine error reporting and
6830 report a cs0117 if the identifier does not exist, to distinguish
6831 from 0617 which is a miss-use of the actual identifier.
6833 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6834 between cs0070 and cs0079.
6836 * class.cs (MemberBase.DoDefine): When reporting a wrong
6837 accessibility level, we use MethodCore to compare instead of
6838 Method (this was a regression in some refactoring effort).
6840 So now we correctly report cs0056 again.
6842 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6843 testing the target_type (which was known to be object_type) and
6844 not the source type (which is anonymous_method).
6846 Fixed reporting of error cs1660.
6848 * expression.cs (UserCast.Source): Expose the underlying cast.
6850 * statement.cs (Switch.SwitchGoverningType): Sort the list of
6851 allowed types to find a match to int32 first (most common).
6853 In addition, it ignores any ImplicitUserConversions that did an
6854 internal implicit conversion (as the switch statement allows only
6855 one integral conversion to exist).
6857 * class.cs (PartialContainer.Create): rename `name' to
6858 `member_name' for clarity. Then replace the string calls with a
6859 call to MemberName.GetPartialName, as now using
6860 MemberName.ToString is an error (this is due to the side effects
6861 it had, that were fixed in the past).
6863 This will restore the error reporting on a number of partial class
6864 errors that were missusing this (and getting an exception as a
6865 results, which is now just a plain textual warning, because
6866 yyparse debug output would crash otherwise).
6868 2004-11-26 Raja R Harinath <rharinath@novell.com>
6870 * Makefile (PROGRAM_INSTALL_DIR): Remove.
6872 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6874 * rootcontext.cs (LookupType): Make sure to cache lookups that
6875 don't give us a negative result. This saves about 5% of corlib
6878 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6880 * report.cs (AbstractMessage.Print): messages are sent to stderr
6882 * class.cs (TypeContainer.GetClassBases): It is an error to have a
6883 non-interface in the list of interfaces (at this point, either
6884 parent was properly set, or a base class is being listed in the
6885 interfaces section).
6887 This flags error 1722, and resolves the crash from bug 69259.
6889 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6891 * statement.cs (Using.EmitExpressionFinally): make this work right
6892 for valuetypes. Fixes 69926.
6894 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6896 * const.cs (Const.ChangeType): Cope with the "0 literal can be
6897 converted to an enum" here, before we try to change the underlying
6898 type. This code exists, but it is a different code path than the
6899 one used while encoding constants.
6901 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6902 old bug: when converting from the null literal to a pointer,
6903 return an EmptyCast, not the NullLiteral.
6905 This fixes #69921, the recent null_type changes probably made this
6908 (ImplicitReferenceConversionExists): In addition, resynchronized
6909 the code here, so it matches the same code in
6910 ImplicitReferenceConversionExists for the `from any class-type S
6911 to any interface-type T'.
6914 2004-11-25 Marek Safar <marek.safar@seznam.cz>
6916 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6918 2004-11-24 Miguel de Icaza <miguel@ximian.com>
6920 * cs-parser.jay: Use verbosity accordingly.
6922 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6924 * expression.cs (Unary.ResolveOperator): Do not report warning;
6925 AddressOf reads from variable.
6927 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6929 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6933 * attribute.cs (Attributable): Removed CheckTargets.
6934 (Attributes.Emit): Explicit attribute targets are tested here.
6936 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6937 not enabled for interfaces.
6939 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6940 (GetAssemblyName): Ouch next bug there.
6942 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6944 * expression.cs: Error 275 added.
6946 2004-11-23 Marek Safar <marek.safar@seznam.cz>
6948 Fix bug #69177 (Implemented decimal constant support)
6950 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6951 (BinaryFold): Add DecimalConstant.
6953 * const.cs (Define): Decimal constant
6955 (ChangeType): Add decimal type handling.
6956 (LookupConstantValue): Don't set value for decimal type but
6957 emit DecimalConstantAttribute. Needed for constant optimization.
6959 * constant.cs (ToDecimal): New method.
6960 (ConvertToDecimal): New method.
6961 (IntConstant): Implemented ConvertToDecimal.
6962 (DecimalConstant.Emit): Emit optimized version for decimals in
6965 * expression.cs (ResolveOperator): Changed order of constant
6966 reduction to work correctly with native types which have
6967 overloaded operators.
6968 (ResolveMemberAccess): Extract constant value from attribute
6971 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6973 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6974 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6975 (ChangeType): Decimal is special.
6976 (TypeToCoreType): Add decimal type.
6978 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6980 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6983 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6985 * class.cs (EventField.ApplyAttributeBuilder): Fix error
6988 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6990 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6992 * pending.cs (PendingImplementation): Grab only interfaces.
6994 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6996 * statement.cs (ForeachHelperMethods): Add location member and
6997 error 202 detection.
6999 2004-11-19 Raja R Harinath <rharinath@novell.com>
7001 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
7002 automatically handled by executable.make.
7003 (PROGRAM): Make profile-specific.
7005 2004-11-18 Marek Safar <marek.safar@seznam.cz>
7007 * expression.cs (DoResolveBase): Fixed wrong warning for out
7010 2004-11-18 Martin Baulig <martin@ximian.com>
7012 Merged latest changes into gmcs. Please keep this comment in
7013 here, it makes it easier for me to see what changed in MCS since
7014 the last time I merged.
7016 2004-11-17 Raja R Harinath <rharinath@novell.com>
7018 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7019 (TypeHandle.GetMemberCache): New.
7020 (TypeHandle.TypeHandle): Update.
7021 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7022 (TypeManager.LookupParentInterfacesCache):
7023 Rename from LookupInterfaceCache. Optimize slightly.
7024 (TypeManager.MemberLookup_FindMembers): Update.
7025 * decl.cs (MemberCache.MemberCache): Set Container to null in the
7027 (AddCacheContents): Rename from AddHashtable.
7028 * class.cs (TypeContainer.parent_container): Remove.
7029 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7030 (TypeContainer.DoDefineMembers): Don't initialize it.
7031 Update to name changes.
7033 2004-11-17 Miguel de Icaza <miguel@ximian.com>
7035 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7036 that factors the code to check access modifiers on override.
7038 (PropertyBase): Use the code here.
7040 Patch from Lluis S'anchez, fixes bug #69361.
7042 2004-11-15 Miguel de Icaza <miguel@ximian.com>
7044 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7045 routine that is used to report the use of a captured variable
7046 whose address has been taken.
7048 There are two checks: one when variables are being captured and
7049 the other check is when the address of a variable is taken.
7051 (because an anonymous methods might be resolved before *or* after
7052 the address has been taken) and
7054 * expression.cs (Conditional.DoResolve): Remove the special
7055 casing that Martin added to trueExpr and falseExpr being both
7056 NullLiteral. We get the right behavior now just by introducing
7057 the null_type into the compiler.
7059 * convert.cs (ExplicitConversion): Change the code to use
7060 null_type instead of testing `expr is NullLiteral'.
7061 (ImplicitConversionStandard): use null_type too.
7062 (ImplicitReferenceConversionExists): use null_type too.
7063 (ImplicitReferenceConversion): use null_type too.
7065 * literal.cs: The type of `NullLiteral' is now null_type instead
7067 (Resolve): Set the type here.
7069 * typemanager.cs: Introduce null_type.
7071 2004-11-17 Martin Baulig <martin@ximian.com>
7073 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7074 direction, like FindMembers() does. Fixes #69546, testcase is in
7077 2004-11-16 Martin Baulig <martin@ximian.com>
7079 This is based on a patch from Marek Safar, see bug #69082.
7080 Fixes bugs #63705 and #67130.
7082 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7083 method; create a MemberCache for an interface type and cache the
7086 * decl.cs (IMemberContainer.ParentContainer): Removed.
7087 (IMemberContainer.ParentCache): New property.
7088 (MemberCache.SetupCacheForInterface): Removed.
7089 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7090 to create a cache for an interface's "parent".
7092 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7095 2004-11-16 Martin Baulig <martin@ximian.com>
7097 Merged back from gmcs; these changes already went into gmcs a
7098 couple of weeks ago.
7101 (TypeManager.AddUserType): Removed the `ifaces' argument.
7102 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
7104 (TypeManager.AddUserInterface): Removed.
7105 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
7107 (TypeManager.GetInterfaces): Likewise.
7108 (TypeManager.GetExplicitInterfaces): Likewise.
7110 * ecore.cs (TypeExpr.GetInterfaces): Removed.
7112 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
7113 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
7115 2004-11-14 Ben Maurer <bmaurer@ximian.com>
7117 * statement.cs: Avoid adding bools to a hashtable.
7119 2004-11-07 Miguel de Icaza <miguel@ximian.com>
7121 * expression.cs (Invocation.OverloadResolve): Flag error if we are
7122 calling an unsafe method from a safe location.
7124 2004-11-06 Marek Safar <marek.safar@seznam.cz>
7127 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7129 2004-11-06 Miguel de Icaza <miguel@ximian.com>
7131 * namespace.cs (VerifyUsing): use GetPartialName instead of
7134 2004-11-05 Miguel de Icaza <miguel@ximian.com>
7136 * statement.cs (Return.Resolve): Fix regression in typo: if
7137 `in_exc', we have to request a NeedReturnLabel, this was a typo
7138 introduced in the anonymous method check-in. Fixes #69131.
7140 * Indexers were using the ShortName when defining themselves,
7141 causing a regression in the compiler bootstrap when applying the
7142 patch from 2004-11-02 (first part), now they use their full name
7143 and the bug is gone.
7145 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
7147 * driver.cs: Strip the path from the names of embedded resources. Fixes
7150 2004-11-04 Raja R Harinath <rharinath@novell.com>
7152 Fix error message regression: cs0104-2.cs.
7153 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7154 (AliasEntry.Resolve): Update.
7155 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
7157 (RootContext.LookupType): Update.
7159 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
7161 * cs-parser.jay: Add support for handling accessor modifiers
7162 * class: Add support port accessor modifiers and error checking,
7163 define PropertyMethod.Define as virtual (not abstract anymore)
7164 * ecore.cs: Add checking for proeprties access with access modifiers
7165 * iterators.cs: Modify Accessor constructor call based in the modified
7167 2004-11-02 Ben Maurer <bmaurer@ximian.com>
7169 * expression.cs (StringConcat): Handle being called twice,
7170 as when we have a concat in a field init with more than two
7173 2004-11-02 Miguel de Icaza <miguel@ximian.com>
7175 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7176 special case explicit implementations, we should always produce
7177 the .property or .event declaration.
7179 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7180 since it will not return correct data if people use this
7181 unresolved in the presence of using statements (see test-313).
7183 * class.cs (MethodData.Define): If we are an explicit interface
7184 implementation, set the method name to the full name of the
7185 interface plus the name of the method.
7187 Notice that using the method.MethodName.GetFullName() does not
7188 work, as it will only contain the name as declared on the source
7189 file (it can be a shorthand in the presence of using statements)
7190 and not the fully qualifed type name, for example:
7194 class D : ICloneable {
7195 object ICloneable.Clone () {
7199 Would produce a method called `ICloneable.Clone' instead of
7200 `System.ICloneable.Clone'.
7202 * namespace.cs (Alias.Resolve): Use GetPartialName.
7204 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7206 * cs-parser.jay: Add error 1055 report.
7208 2004-11-01 Miguel de Icaza <miguel@ximian.com>
7210 * assign.cs (Assign.DoResolve): Only do the transform of
7211 assignment into a New if the types are compatible, if not, fall
7212 through and let the implicit code deal with the errors and with
7213 the necessary conversions.
7215 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7217 * cs-parser.jay: Add error 1031 report.
7219 * cs-tokenizer.cs: Add location for error 1038.
7221 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7223 * cs-parser.jay: Add error 1016 report.
7225 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7227 * cs-parser.jay: Add errors 1575,1611 report.
7229 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7231 * cs-parser.jay: Add error 1001 report.
7233 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7236 * attribute.cs (GetMarshal): Add method argument for
7237 caller identification.
7239 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7240 agument for GetMarshal and RuntimeMissingSupport.
7242 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7244 * attribute.cs (ExtractSecurityPermissionSet): Removed
7245 TypeManager.code_access_permission_type.
7247 * typemanager.cs: Removed TypeManager.code_access_permission_type.
7249 2004-10-27 Miguel de Icaza <miguel@ximian.com>
7251 * expression.cs (LocalVariableReference.DoResolveLValue): Check
7252 for obsolete use of a variable here. Fixes regression on errors
7253 cs0619-25 and cs0619-26.
7255 2004-10-27 Marek Safar <marek.safar@seznam.cz>
7257 Fix #62358, implemented security attribute encoding.
7259 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7260 Tests permitted SecurityAction for assembly or other types.
7261 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7262 data from SecurityPermissionAttribute to PermisionSet class.
7264 * class.cs (ApplyAttributeBuilder): Added special handling
7265 for System.Security.Permissions.SecurityAttribute based types.
7267 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7268 special handling for System.Security.Permissions.SecurityAttribute
7271 * enum.cs (ApplyAttributeBuilder): Added special handling
7272 for System.Security.Permissions.SecurityAttribute based types.
7274 * parameter.cs (ApplyAttributeBuilder): Added special handling
7275 for System.Security.Permissions.SecurityAttribute based types.
7277 * rootcontext.cs: Next 2 core types.
7279 * typemanager.cs (TypeManager.security_permission_attr_type):
7280 Built in type for the SecurityPermission Attribute.
7281 (code_access_permission_type): Build in type.
7283 2004-10-17 Miguel de Icaza <miguel@ximian.com>
7285 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7286 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7287 all of this information into
7288 EmitContext.EmitCapturedVariableInstance.
7290 * codegen.cs (EmitCapturedVariableInstance): move here the
7291 funcionality of emitting an ldarg.0 in the presence of a
7292 remapping. This centralizes the instance emit code.
7294 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7295 then emit a load of this: it means that we have reached the
7296 topmost ScopeInfo: the one that contains the pointer to the
7297 instance of the class hosting the anonymous method.
7299 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7300 captures to the topmost CaptureContext.
7302 2004-10-12 Miguel de Icaza <miguel@ximian.com>
7304 * expression.cs (LocalVariableReference): Move the knowledge about
7305 the iterators into codegen's EmitCapturedVariableInstance.
7307 2004-10-11 Miguel de Icaza <miguel@ximian.com>
7309 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7310 all code paths return a value from an anonymous method (it is the
7311 same as the 161 error, but for anonymous methods).
7313 2004-10-08 Miguel de Icaza <miguel@ximian.com>
7315 The introduction of anonymous methods in the compiler changed
7316 various ways of doing things in the compiler. The most
7317 significant one is the hard split between the resolution phase
7318 and the emission phases of the compiler.
7320 For instance, routines that referenced local variables no
7321 longer can safely create temporary variables during the
7322 resolution phase: they must do so from the emission phase,
7323 since the variable might have been "captured", hence access to
7324 it can not be done with the local-variable operations from the runtime.
7328 (Block.Flags): New flag `IsTopLevel' to indicate that this block
7329 is a toplevel block.
7331 (ToplevelBlock): A new kind of Block, these are the blocks that
7332 are created by the parser for all toplevel method bodies. These
7333 include methods, accessors and anonymous methods.
7335 These contain some extra information not found in regular blocks:
7336 A pointer to an optional CaptureContext (for tracking captured
7337 local variables and parameters). A pointer to the parent
7340 (Return.Resolve): Catch missmatches when returning a value from an
7341 anonymous method (error 1662).
7342 Invoke NeedReturnLabel from the Resolve phase instead of the emit
7345 (Break.Resolve): ditto.
7347 (SwitchLabel): instead of defining the labels during the
7348 resolution phase, we now turned the public ILLabel and ILLabelCode
7349 labels into methods called GetILLabelCode() and GetILLabel() that
7350 only define the label during the Emit phase.
7352 (GotoCase): Track the SwitchLabel instead of the computed label
7353 (its contained therein). Emit the code by using
7354 SwitchLabel.GetILLabelCode ().
7356 (LocalInfo.Flags.Captured): A new flag has been introduce to track
7357 whether the Local has been captured or not.
7359 (LocalInfo.IsCaptured): New property, used to tell whether the
7360 local has been captured.
7362 * anonymous.cs: Vastly updated to contain the anonymous method
7365 The main classes here are: CaptureContext which tracks any
7366 captured information for a toplevel block and ScopeInfo used to
7367 track the activation frames for various local variables.
7369 Each toplevel block has an optional capture context associated
7370 with it. When a method contains an anonymous method both the
7371 toplevel method and the anonymous method will create a capture
7372 context. When variables or parameters are captured, they are
7373 recorded on the CaptureContext that owns them, for example:
7377 MyDelegate d = delegate {
7382 Here `a' will be recorded as captured on the toplevel
7383 CapturedContext, the inner captured context will not have anything
7384 (it will only have data if local variables or parameters from it
7385 are captured in a nested anonymous method.
7387 The ScopeInfo is used to track the activation frames for local
7388 variables, for example:
7390 for (int i = 0; i < 10; i++)
7391 for (int j = 0; j < 10; j++){
7392 MyDelegate d = delegate {
7397 At runtime this captures a single captured variable `i', but it
7398 captures 10 different versions of the variable `j'. The variable
7399 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7400 recorded on a child.
7402 The toplevel ScopeInfo will also track information like the `this'
7403 pointer if instance variables were referenced (this is necessary
7404 as the anonymous method lives inside a nested class in the host
7405 type of the method).
7407 (AnonymousMethod): Expanded to track the Toplevel, implement
7408 `AnonymousMethod.Compatible' to tell whether an anonymous method
7409 can be converted to a target delegate type.
7411 The routine now also produces the anonymous method content
7413 (AnonymousDelegate): A helper class that derives from
7414 DelegateCreation, this is used to generate the code necessary to
7415 produce the delegate for the anonymous method that was created.
7417 * assign.cs: API adjustments for new changes in
7418 Convert.ImplicitStandardConversionExists.
7420 * class.cs: Adjustments to cope with the fact that now toplevel
7421 blocks are of type `ToplevelBlock'.
7423 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7424 insteda of standard blocks.
7426 Flag errors if params arguments are passed to anonymous methods.
7428 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7429 `CurrentAnonymousMethod' which points to the current Anonymous
7430 Method. The variable points to the AnonymousMethod class that
7431 holds the code being compiled. It is set in the new EmitContext
7432 created for the anonymous method.
7434 (EmitContext.Phase): Introduce a variable and an enumeration to
7435 assist in enforcing some rules about when and where we are allowed
7436 to invoke certain methods (EmitContext.NeedsReturnLabel is the
7437 only one that enfonces this right now).
7439 (EmitContext.HaveCaptureInfo): new helper method that returns
7440 whether we have a CapturedContext initialized.
7442 (EmitContext.CaptureVariable): New method used to register that a
7443 LocalInfo must be flagged for capturing.
7445 (EmitContext.CapturedParameter): New method used to register that a
7446 parameters must be flagged for capturing.
7448 (EmitContext.CapturedField): New method used to register that a
7449 field must be flagged for capturing.
7451 (EmitContext.HaveCapturedVariables,
7452 EmitContext.HaveCapturedFields): Return whether there are captured
7453 variables or fields.
7455 (EmitContext.EmitMethodHostInstance): This is used to emit the
7456 instance for the anonymous method. The instance might be null
7457 (static methods), this (for anonymous methods that capture nothing
7458 and happen to live side-by-side with the current method body) or a
7459 more complicated expression if the method has a CaptureContext.
7461 (EmitContext.EmitTopBlock): Routine that drives the emission of
7462 code: it will first resolve the top block, then emit any metadata
7463 and then emit the code. The split is done so that we can extract
7464 any anonymous methods and flag any captured variables/parameters.
7466 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7467 during this phase, the ILGenerator should not be used as labels
7468 and local variables declared here might not be accessible to any
7469 code that is part of an anonymous method.
7471 Exceptions to this include the temporary variables that are
7472 created by some statements internally for holding temporary
7475 (EmitContext.EmitMeta): New routine, in charge of emitting all the
7478 (EmitContext.TemporaryReturn): This method is typically called
7479 from the Emit phase, and its the only place where we allow the
7480 ReturnLabel to be defined other than the EmitMeta. The reason is
7481 that otherwise we would have to duplicate a lot of logic in the
7482 Resolve phases of various methods that today is on the Emit
7485 (EmitContext.NeedReturnLabel): This no longer creates the label,
7486 as the ILGenerator is not valid during the resolve phase.
7488 (EmitContext.EmitThis): Extended the knowledge in this class to
7489 work in anonymous methods in addition to iterators.
7491 (EmitContext.EmitCapturedVariableInstance): This emits whatever
7492 code is necessary on the stack to access the instance to a local
7493 variable (the variable will be accessed as a field).
7495 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7496 EmitContext.EmitAddressOfParameter): Routines to support
7497 parameters (not completed at this point).
7499 Removals: Removed RemapLocal and RemapLocalLValue. We probably
7500 will also remove the parameters.
7502 * convert.cs (Convert): Define a `ConstantEC' which points to a
7503 null. This is just to prefity some code that uses
7504 ImplicitStandardConversion code and do not have an EmitContext
7507 The idea is to flag explicitly that at that point in time, it is
7508 known that the conversion will not trigger the delegate checking
7509 code in implicit conversions (which requires a valid
7512 Everywhere: pass new EmitContext parameter since
7513 ImplicitStandardConversionExists now requires it to check for
7514 anonymous method conversions.
7516 (Convert.ImplicitStandardConversionExists): If the type of an
7517 expression is the anonymous_method_type, and the type is a
7518 delegate, we invoke the AnonymousMethod.Compatible method to check
7519 whether an implicit conversion is possible.
7521 (Convert.ImplicitConversionStandard): Only do implicit method
7522 group conversions if the language level is not ISO_1.
7524 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7525 MethodInfo for the Invoke method. used by Delegate and
7528 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7529 method conversions if the target type is a delegate.
7531 Removed extra debugging nops.
7533 (LocalVariableReference): Turn the `local_info' into a public
7536 Add `prepared' field, the same hack used for FieldExprs to cope
7537 with composed assignments, as Local variables do not necessarily
7538 operate purely on the stack as they used to: they can be captured
7541 Add `temp' for a temporary result, like fields.
7543 Refactor DoResolve and DoResolveLValue into DoResolveBase.
7545 It now copes with Local variables that are captured and emits the
7546 proper instance variable to load it from a field in the captured
7549 (ParameterReference.DoResolveBase): During the resolve phase,
7550 capture parameters if we are in an anonymous method.
7552 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7553 anonymous method, use the EmitContext helper routines to emit the
7554 parameter reference.
7556 * iterators.cs: Set RemapToProxy to true/false during the
7559 * parameters.cs (GetParameterByName): New helper method.
7561 * typemanager.cs (anonymous_method_type) a new type that
7562 represents an anonyous method. This is always an internal type,
7563 used as a fencepost to test against the anonymous-methodness of an
7566 2004-10-20 Marek Safar <marek.safar@seznam.cz>
7568 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7570 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7572 2004-10-18 Martin Baulig <martin@ximian.com>
7574 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7575 `Type' directly, but call ResolveType() on it.
7576 (Catch.Resolve): Likewise.
7577 (Foreach.Resolve): Likewise.
7579 2004-10-18 Martin Baulig <martin@ximian.com>
7581 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7582 `Type' directly, but call ResolveType() on it.
7583 (Probe.DoResolve): Likewise.
7584 (ArrayCreation.LookupType): Likewise.
7585 (TypeOf.DoResolve): Likewise.
7586 (SizeOf.DoResolve): Likewise.
7588 2004-10-18 Martin Baulig <martin@ximian.com>
7590 * expression.cs (Invocation.BetterFunction): Put back
7591 TypeManager.TypeToCoreType().
7593 2004-10-18 Raja R Harinath <rharinath@novell.com>
7595 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7598 2004-10-18 Martin Baulig <martin@ximian.com>
7600 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
7601 `Type' directly, but call ResolveType() on it.
7603 2004-10-18 Martin Baulig <martin@ximian.com>
7605 * class.cs (FieldMember.Define): Don't access the TypeExpr's
7606 `Type' directly, but call ResolveType() on it.
7607 (MemberBase.DoDefine): Likewise.
7609 * expression.cs (New.DoResolve): Don't access the TypeExpr's
7610 `Type' directly, but call ResolveType() on it.
7611 (ComposedCast.DoResolveAsTypeStep): Likewise.
7613 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7614 `Type' directly, but call ResolveType() on it.
7616 2004-10-17 John Luke <john.luke@gmail.com>
7618 * class.cs (Operator.GetSignatureForError): use CSharpName
7620 * parameter.cs (Parameter.GetSignatureForError): Returns
7621 correct name even if was not defined.
7623 2004-10-13 Raja R Harinath <rharinath@novell.com>
7626 * class.cs (TypeContainer.EmitContext): New property.
7627 (DefineNestedTypes): Create an emitcontext for each part.
7628 (MethodCore.DoDefineParameters): Use container's emitcontext.
7629 Pass type array to InternalParameters.
7630 (MemberBase.DoDefine): Use container's emitcontext.
7631 (FieldMember.Define): Likewise.
7632 (Event.Define): Likewise.
7633 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7634 Pass type array to InternalParameters.
7635 (SetIndexerMethod.GetParameterInfo): Likewise.
7636 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7637 * delegate.cs (Define): Pass emitcontext to
7638 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7639 array to InternalParameters.
7640 * expression.cs (ParameterReference.DoResolveBase): Pass
7641 emitcontext to GetParameterInfo.
7642 (ComposedCast.DoResolveAsTypeStep): Remove check on
7643 ec.ResolvingTypeTree.
7644 * parameter.cs (Parameter.Resolve): Change argument to
7645 EmitContext. Use ResolveAsTypeTerminal.
7646 (Parameter.GetSignature): Change argument to EmitContext.
7647 (Parameters.ComputeSignature): Likewise.
7648 (Parameters.ComputeParameterTypes): Likewise.
7649 (Parameters.GetParameterInfo): Likewise.
7650 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7651 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7652 * support.cs (InternalParameters..ctor): Remove variant that takes
7654 * typemanager.cs (system_intptr_expr): New.
7655 (InitExpressionTypes): Initialize it.
7657 2004-10-12 Chris Toshok <toshok@ximian.com>
7659 * cs-parser.jay: fix location for try_statement and catch_clause.
7661 2004-10-11 Martin Baulig <martin@ximian.com>
7663 * report.cs: Don't make --fatal abort on warnings, we have
7664 -warnaserror for that.
7666 2004-10-07 Raja R Harinath <rharinath@novell.com>
7668 More DeclSpace.ResolveType avoidance.
7669 * decl.cs (MemberCore.InUnsafe): New property.
7670 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
7671 with newly created EmitContext.
7672 (FieldMember.Define): Likewise.
7673 * delegate.cs (Delegate.Define): Likewise.
7674 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7675 only if normal name-lookup fails.
7676 (TypeExpr.DoResolve): Enable error-checking.
7677 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7678 (SizeOf.DoResolve): Likewise.
7679 (ComposedCast.DoResolveAsTypeStep): Likewise.
7680 (StackAlloc.DoResolve): Likewise.
7681 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7682 (Block.Unsafe): New property.
7683 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7684 (Unsafe): Set 'unsafe' flag of contained block.
7685 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7686 (Fixed.Resolve): Likewise.
7687 (Catch.Resolve): Likewise.
7688 (Using.ResolveLocalVariableDecls): Likewise.
7689 (Foreach.Resolve): Likewise.
7691 2004-10-05 John Luke <john.luke@gmail.com>
7693 * cs-parser.jay: add location to error CS0175
7695 2004-10-04 Miguel de Icaza <miguel@ximian.com>
7697 * ecore.cs (Expression.Constantity): Add support for turning null
7700 * const.cs (Const.Define): Allow constants to be reference types
7701 as long as the value is Null.
7703 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
7705 * namespace.cs (NamespaceEntry.Using): No matter which warning
7706 level is set, check if this namespace name has already been added.
7708 2004-10-03 Ben Maurer <bmaurer@ximian.com>
7710 * expression.cs: reftype [!=]= null should always use br[true,false].
7713 2004-10-03 Marek Safar <marek.safar@seznam.cz>
7716 * attribute.cs: Enum conversion moved to
7717 GetAttributeArgumentExpression to be applied to the all
7720 2004-10-01 Raja R Harinath <rharinath@novell.com>
7722 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7723 * class.c (TypeContainer.DefineType): Flag error if
7724 base types aren't accessible due to access permissions.
7725 * decl.cs (DeclSpace.ResolveType): Move logic to
7726 Expression.ResolveAsTypeTerminal.
7727 (DeclSpace.ResolveTypeExpr): Thin layer over
7728 Expression.ResolveAsTypeTerminal.
7729 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7730 Refactor code into NestedAccess. Use it.
7731 (DeclSpace.NestedAccess): New.
7732 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7733 argument to silence errors. Check access permissions.
7734 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7735 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7736 (Cast.DoResolve): Likewise.
7737 (New.DoResolve): Likewise.
7738 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7739 (TypeOf.DoResolve): Likewise.
7741 * expression.cs (Invocation.BetterConversion): Return the Type of
7742 the better conversion. Implement section 14.4.2.3 more faithfully.
7743 (Invocation.BetterFunction): Make boolean. Make correspondence to
7744 section 14.4.2.2 explicit.
7745 (Invocation.OverloadResolve): Update.
7746 (Invocation): Remove is_base field.
7747 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
7748 (Invocation.Emit): Likewise.
7750 2004-09-27 Raja R Harinath <rharinath@novell.com>
7752 * README: Update to changes.
7754 2004-09-24 Marek Safar <marek.safar@seznam.cz>
7756 * cs-parser.jay: Reverted 642 warning fix.
7758 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7761 * decl.cs (FindMemberWithSameName): Indexer can have more than
7764 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7766 * expression.cs (LocalVariableReference.DoResolveLValue):
7767 Do not report warning 219 for out values.
7768 (EmptyExpression.Null): New member to avoid extra allocations.
7770 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7772 * cs-parser.jay: Fix wrong warning 642 report.
7774 * cs-tokenizer.cs (CheckNextToken): New helper;
7775 Inspect next character if is same as expected.
7777 2004-09-23 Martin Baulig <martin@ximian.com>
7779 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7780 (Convert.ImplicitReferenceConversionExists): Likewise.
7782 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7784 * class.cs (Operator.Define): Add error 448 and 559 report.
7786 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7788 * class.cs (MemberBase.IsTypePermitted): New protected
7789 method for checking error CS0610.
7791 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7793 * class.cs (TypeContainer.HasExplicitLayout): New property
7794 Returns whether container has StructLayout attribute set Explicit.
7795 (FieldMember): New abstract class for consts and fields.
7796 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7797 (Field): Reuse FieldMember.
7799 * const.cs (Const): Reuse FieldMember.
7801 * rootcontext.cs: EmitConstants call moved to class.
7803 2004-09-22 Martin Baulig <martin@ximian.com>
7805 Thanks to Peter Sestoft for this bug report.
7807 * expression.cs (Conditional): If both the `trueExpr' and the
7808 `falseExpr' is a NullLiteral, return a NullLiteral.
7810 2004-09-22 Martin Baulig <martin@ximian.com>
7812 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7813 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7814 for the "get_Current" call.
7816 2004-09-22 Martin Baulig <martin@ximian.com>
7818 Marek and me just fixed one of our oldest bugs: #28562 :-)
7820 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7822 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7823 we're an EnumConstant, just return that.
7824 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7825 an EnumConstant. In this case, we need to use GetValueAsEnumType()
7826 to get the value which'll actually be written into the attribute.
7827 However, we have to use GetValue() to access the attribute's value
7830 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7832 * constant.cs (Constant.IsNegative): New abstract property
7835 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7836 (StackAlloc.DoResolve): Reused IsNegative.
7838 2004-09-21 Martin Baulig <martin@ximian.com>
7840 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
7841 if we're used in an iterator, we may be called from different
7844 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
7845 we actually have an exception block.
7847 2004-09-20 John Luke <jluke@cfl.rr.com>
7849 * class.cs, cs-parser.jay: Improve the error report for 1520:
7850 report the actual line where the error happens, not where the
7853 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
7854 Pass location information that was available elsewhere.
7856 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
7858 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
7859 runtime to delay sign assemblies.
7861 2004-09-19 Miguel de Icaza <miguel@ximian.com>
7863 * cs-parser.jay: Do not report the stack trace, this is barely
7866 2004-08-22 John Luke <john.luke@gmail.com>
7868 * driver.cs : check that a resource id is not already used
7869 before adding it, report CS1508 if it is, bug #63637
7871 2004-09-19 Miguel de Icaza <miguel@ximian.com>
7873 * ecore.cs: Removed dead code.
7875 2004-09-18 Marek Safar <marek.safar@seznam.cz>
7877 * class.cs: Do not report warning CS0067 on the interfaces.
7879 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7881 * cs-parser.jay: Add error 504 report.
7883 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7885 * rootcontext.cs: WarningLevel is 4 by default now.
7887 * statement.cs (Fixed.Resolve): Do not null
7890 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7893 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
7894 deep search when property is not virtual.
7895 (PropertyExpr.ResolveAccessors): Make one call for both
7898 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7901 * statement.cs: Error 152 report constains also location.
7903 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7906 * const.cs: Explicitly set constant as static.
7908 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7911 * cs-parser.jay: Add error 1017 report.
7913 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7915 Fixed bug #59980, #64224
7916 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
7918 * typemanager.cs (IsSpecialMethod): Simplified
7920 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7922 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
7923 condition with better params.
7925 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7928 * attribute.cs (Resolve): Property has to have both
7931 2004-09-14 Martin Baulig <martin@ximian.com>
7933 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7935 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7938 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7939 called and is obsolete then this member suppress message
7940 when call is inside next [Obsolete] method or type.
7942 * expression.cs: Use TestObsoleteMethodUsage member.
7944 2004-09-14 Martin Baulig <martin@ximian.com>
7946 * cs-parser.jay: Sync a bit with the GMCS version.
7948 2004-09-14 Martin Baulig <martin@ximian.com>
7950 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
7951 (CSharpParser.yacc_verbose_flag): New public field.
7953 * genericparser.cs: Removed.
7955 2004-09-14 Raja R Harinath <rharinath@novell.com>
7957 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
7959 2004-09-13 Marek Safar <marek.safar@seznam.cz>
7961 * class.cs (MethodCore.CheckBase): Fix bug #65757.
7963 2004-09-10 Martin Baulig <martin@ximian.com>
7965 Backported my MemberName changes from GMCS into MCS.
7967 - we are now using a special `MemberName' class instead of using
7968 strings; in GMCS, the `MemberName' also contains the type
7971 - changed the grammar rules a bit:
7972 * the old `member_name' is now a `namespace_or_type_name':
7973 The rule is that we use `namespace_or_type_name' everywhere
7974 where we expect either a "member name" (GetEnumerator) or a
7975 "member name" with an explicit interface name
7976 (IEnumerable.GetEnumerator).
7977 In GMCS, the explicit interface name may include type arguments
7978 (IEnumerable<T>.GetEnumerator).
7979 * we use `member_name' instead of just `IDENTIFIER' for
7981 The rule is that we use `member_name' wherever a member may
7982 have type parameters in GMCS.
7984 * decl.cs (MemberName): New public class.
7985 (MemberCore.MemberName): New public readonly field.
7986 (MemberCore.ctor): Take a `MemberName' argument, not a string.
7987 (DeclSpace): Likewise.
7989 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
7990 * enum.cs (Enum.ctor): Likewise.
7992 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
7994 (AliasEntry.ctor): Take a MemberName, not an Expression.
7995 (AliasEntry.UsingAlias): Likewise.
7997 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
7998 (IMethodData.MemberName): Changed type from string to MemberName.
7999 (MemberBase.ExplicitInterfaceName): Likewise.
8000 (AbstractPropertyEventMethod.SetupName): Make this private.
8001 (AbstractPropertyEventMethod.ctor): Added `string prefix'
8002 argument; compute the member name here.
8003 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
8004 on the `member.MemberName' and the `prefix'.
8006 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
8008 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
8009 thus, we get a `MemberName' instead of a `string'. These
8010 declarations may have type parameters in GMCS.
8011 (interface_method_declaration, delegate_declaration): Likewise.
8012 (class_declaration, interface_declaration): Likewise.
8013 (method_header): Use `namespace_or_type_name' instead of
8014 `member_name'. We may be an explicit interface implementation.
8015 (property_declaration, event_declaration): Likewise.
8016 (member_name): This is now just an `IDENTIFIER', not a
8017 `namespace_or_type_name'.
8018 (type_name, interface_type): Removed.
8019 (namespace_or_type_name): Return a MemberName, not an Expression.
8020 (primary_expression): Use `member_name' instead of `IDENTIFIER';
8021 call GetTypeExpression() on the MemberName to get an expression.
8022 (IndexerDeclaration.interface_type): Changed type from string to
8024 (MakeName): Operate on MemberName's instead of string's.
8026 2004-09-13 Raja R Harinath <rharinath@novell.com>
8029 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
8030 (NamespaceEntry.Lookup): Add new argument to flag if we want the
8031 lookup to avoid symbols introduced by 'using'.
8032 * rootcontext.cs (NamespaceLookup): Update.
8034 2004-09-12 Marek Safar <marek.safar@seznam.cz>
8036 * class.cs (TypeContainer.DoDefineMembers): Do not call
8037 DefineDefaultConstructor for static classes.
8039 2004-09-12 Marek Safar <marek.safar@seznam.cz>
8041 * attribute.cs (Attribute.Resolve): Add error 653 report.
8043 * class.cs (Class.ApplyAttributeBuilder): Add error 641
8045 (Method.ApplyAttributeBuilder): Add error 685 report.
8046 (Operator.Define): Add error 564 report.
8048 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8050 * expression.cs (Invocation.DoResolve): Add error
8053 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8056 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8058 * class.cs (ConstructorInitializer.Resolve):
8059 Wrong error number (515->516).
8061 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8063 * class.cs (Indexer.Define): Add error 631 report.
8065 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8067 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8069 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8071 * expression.cs (Probe.DoResolve): Add error CS0241 report.
8073 2004-09-10 Marek Safar <marek.safar@seznam.cz>
8075 * cs-parser.jay: Added error CS0241 report.
8077 2004-09-10 Raja R Harinath <rharinath@novell.com>
8079 * cs-parser.jay (fixed_statement): Introduce a scope for the
8080 declaration in the 'fixed' statement.
8082 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8084 * cs-parser.jay: Added CS0230 error report.
8086 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8088 * cs-parser.jay: Added errors CS0231 and CS0257 report.
8090 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8092 * expression.cs (Argument.Resolve): Added error CS0192 and
8095 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8097 C# 2.0 #pragma warning feature
8099 * cs-tokenizer.cs (PreProcessPragma): New method;
8100 Handles #pragma directive.
8102 * report.cs (WarningRegions): New class; Support
8103 class for #pragma warning directive. It tests whether
8104 warning is enabled for a given line.
8106 2004-09-08 Miguel de Icaza <miguel@ximian.com>
8108 * const.cs: Add more descriptive error report, tahnks to
8111 2004-09-08 Marek Safar <marek.safar@seznam.cz>
8113 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8115 2004-09-07 Miguel de Icaza <miguel@ximian.com>
8117 * expression.cs: Apply patch from Ben: Remove dead code from
8118 ArrayCreation, and remove the TurnintoConstant call in const.cs,
8119 as that code just threw an exception anwyays.
8121 * const.cs: Remove the call to the turnintoconstant, for details
8124 * literal.cs: The type of the null-literal is the null type; So
8125 we use a placeholder type (literal.cs:System.Null, defined here)
8128 * expression.cs (Conditional.DoResolve): Remove some old code that
8129 is no longer needed, conversions have been fixed.
8131 (ArrayCreationExpression.DoResolve): Return false if we fail to
8132 resolve the inner expression.
8134 2004-09-07 Raja R Harinath <rharinath@novell.com>
8137 * cs-parser.jay (delegate_declaration): Record a delegate
8138 declaration as a type declaration.
8139 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8141 2004-09-06 Miguel de Icaza <miguel@ximian.com>
8143 * parameter.cs: Do not crash if the type can not be resolved.
8145 * expression.cs: Report errors with unsafe pointers, fixes #64896
8147 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
8149 * expression.cs: Pointer arith always needs to do a conv.i
8150 if the operand is a long. fix 65320
8152 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8154 Fixed cs0619-37.cs, cs0619-38.cs
8156 * enum.cs (GetObsoleteAttribute): Removed.
8158 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8159 on Enum member is double staged. The first is tested member
8162 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8164 Fixed #56986, #63631, #65231
8166 * class.cs: (TypeContainer.AddToMemberContainer): New method,
8167 adds member to name container.
8168 (TypeContainer.AddToTypeContainer): New method, adds type to
8170 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8171 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8172 AddOperator): Simplified by reusing AddToMemberContainer.
8173 (TypeContainer.UserDefinedStaticConstructor): Changed to property
8175 (Method.CheckForDuplications): Fixed implementation to test all
8177 (MemberBase): Detection whether member is explicit interface
8178 implementation is now in constructor.
8179 (MemberBase.UpdateMemberName): Handles IndexerName.
8180 (Accessor): Changed to keep also location information.
8181 (AbstractPropertyEventMethod): Is derived from MemberCore.
8182 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8183 will be emited or not.
8184 (PropertyBase.AreAccessorsDuplicateImplementation):
8185 Tests whether accessors are not in collision with some method.
8186 (Operator): Is derived from MethodCore to simplify common
8189 * decl.cs (Flags.TestMethodDuplication): Test for duplication
8191 (DeclSpace.AddToContainer): Adds the member to defined_names
8192 table. It tests for duplications and enclosing name conflicts.
8194 * enum.cs (EnumMember): Clean up to reuse the base structures
8196 2004-09-03 Martin Baulig <martin@ximian.com>
8198 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8199 into TypeContainer, to make partial classes work again.
8201 2004-09-03 Martin Baulig <martin@ximian.com>
8203 * rootcontext.cs (RootContext.V2): Removed.
8205 2004-03-23 Martin Baulig <martin@ximian.com>
8207 * expression.cs (Invocation.OverloadResolve): Added `bool
8208 may_fail' argument and use it instead of the Location.IsNull() hack.
8210 2004-09-03 Martin Baulig <martin@ximian.com>
8212 Merged latest changes into gmcs. Please keep this comment in
8213 here, it makes it easier for me to see what changed in MCS since
8214 the last time I merged.
8216 2004-09-03 Raja R Harinath <rharinath@novell.com>
8219 * expression.cs (BetterConversion): Don't allow either conversion
8220 to be null. Remove redundant implicit conversion test when 'q ==
8221 null' -- when this function is invoked, we already know that the
8222 implicit conversion exists.
8223 (BetterFunction): Assume that 'best' is non-null. Remove
8224 redundant reimplementation of IsApplicable when 'best' is null.
8225 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8226 number of arguments.
8227 (IsAncestralType): Extract from OverloadResolve.
8228 (OverloadResolve): Make robust to the MethodGroupExpr being
8229 unsorted. Implement all the logic of Section 14.5.5.1, and
8230 support overloading of methods from multiple applicable types.
8231 Clean up logic somewhat. Don't pass null methods to BetterFunction.
8233 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8234 (RealError, Warning): Append type of report to related symbol.
8236 2004-09-03 Marek Safar <marek.safar@seznam.cz>
8238 * enum.cs: Fixed CLS-Compliance checks for enum members.
8239 Error tests cs3008-8.cs, cs3014-8.cs
8241 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8243 Fixed bug #62342, #63102
8244 * class.cs: ImplementIndexer uses member.IsExplicitImpl
8245 like ImplementMethod.
8247 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8249 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8252 2004-09-02 Martin Baulig <martin@ximian.com>
8254 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8255 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8258 2004-09-01 Marek Safar <marek.safar@seznam.cz>
8260 C# 2.0 Static classes implemented
8262 * class.cs (TypeContainer): instance_constructors,
8263 initialized_fields, initialized_static_fields,
8264 default_constructor, base_inteface_types are protected to be
8265 accessible from StaticClass.
8266 (TypeContainer.DefineDefaultConstructor): New virtual method
8267 for custom default constructor generating
8268 (StaticClass): New class to handle "Static classes" feature.
8270 * cs-parser.jay: Handle static keyword on class like instance
8273 * driver.cs: Added "/langversion" command line switch with two
8274 options (iso-1, default).
8276 2004-08-31 Marek Safar <marek.safar@seznam.cz>
8278 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8280 2004-08-31 Miguel de Icaza <miguel@ximian.com>
8282 * delegate.cs: Style.
8284 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
8286 * delegate.cs: Add seperate instance expr field for miguel.
8288 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8290 * PointerArithmetic (Resolve): make sure we are not doing
8291 pointer arith on void*. Also, make sure we are resolved
8292 by not setting eclass until resolve.
8294 All callers: Make sure that PointerArithmetic gets resolved.
8296 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8298 * ArrayCreation (LookupType): If the type does not resolve
8299 to an array, give an error.
8301 2004-08-27 Marek Safar <marek.safar@seznam.cz>
8303 * statement.cs (Try.Resolve): Fixed bug #64222
8305 2004-08-27 Martin Baulig <martin@ximian.com>
8308 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8311 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8313 * ecore.cs (Constantify): Get underlying type via
8314 System.Enum.GetUnderlyingType to avoid StackOverflow on the
8315 Windows in special cases.
8317 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8319 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8320 for obtaining also private methods.
8321 (GetRemoveMethod): Used GetRemoveMethod (true)
8322 for obtaining also private methods.
8324 2004-08-24 Martin Baulig <martin@ximian.com>
8326 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8327 MethodAttributes.HideBySig for operators.
8329 2004-08-23 Martin Baulig <martin@ximian.com>
8331 Back to the old error reporting system :-)
8333 * report.cs (Message): Removed.
8334 (Report.MessageData, ErrorData, WarningData): Removed.
8335 (Report.Error, Warning): Back to the old system.
8337 2004-08-23 Martin Baulig <martin@ximian.com>
8339 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8341 * class.cs (TypeContainer.ParentContainer): New public virtual
8342 method; replaces the explicit interface implementation.
8343 (ClassPart.ParentContainer): Override.
8345 2004-08-23 Martin Baulig <martin@ximian.com>
8347 * statement.cs (Switch): Added support for constant switches; see
8348 #59428 or test-285.cs.
8350 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8353 * statement.cs (GetEnumeratorFilter): Removed useless
8354 logic because C# specs is strict. GetEnumerator must be
8357 2004-08-22 Martin Baulig <martin@ximian.com>
8359 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8360 a switch and may break, reset the barrier. Fixes #59867.
8362 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8364 CLS-Compliance speed up (~5% for corlib)
8366 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8367 New method. Tests container for CLS-Compliant names
8369 * class.cs (TypeContainer.VerifyClsName): New method.
8370 Checks whether container name is CLS Compliant.
8371 (Constructor): Implements IMethodData.
8373 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8374 low-case table for CLS Compliance test.
8375 (MemberCache.VerifyClsParameterConflict): New method.
8376 Checks method parameters for CS3006 error.
8378 * enum.cs (EnumMember): Is derived from MemberCore.
8379 (Enum.VerifyClsName): Optimized for better performance.
8381 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8383 * report.cs: Renamed Error_T to Error and changed all
8386 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8388 * class.cs (TypeContainer.IndexerArrayList): New inner class
8389 container for indexers.
8390 (TypeContainer.DefaultIndexerName): New constant for default
8391 indexer name. Replaced all "Item" with this constant.
8392 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8394 * typemanager.cs (TypeManager.default_member_ctor): Cache here
8395 DefaultMemberAttribute constructor.
8397 2004-08-05 Martin Baulig <martin@ximian.com>
8399 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8402 2004-08-05 Marek Safar <marek.safar@seznam.cz>
8404 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8405 multi platforms problem.
8407 * compiler.csproj: Included shared files.
8409 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8411 Fix bug 60333, 55971 in the more general way
8412 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8413 Added arg_type argument for constant conversion.
8414 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8416 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8419 * class.cs (TypeContainer ): New inner classes MethodArrayList,
8420 OperatorArrayList, MethodCoreArrayList for typecontainer
8421 containers. Changed class member types to these new types.
8422 (MethodArrayList.DefineMembers): Added test for CS0659.
8424 2004-08-04 Miguel de Icaza <miguel@ximian.com>
8426 * cfold.cs: Synchronize the folding with the code in expression.cs
8427 Binary.DoNumericPromotions for uint operands.
8429 * attribute.cs: Revert patch from Raja, it introduced a regression
8430 while building Blam-1.2.1 (hard to isolate a test case).
8432 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8436 (TypeContainer.Define): Renamed to DefineContainerMembers because of
8438 (MethodCore.parent_method): New member. The method we're overriding
8439 if this is an override method.
8440 (MethodCore.CheckBase): Moved from Method class and made common.
8441 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8443 (MethodCore.CheckForDuplications): New abstract method. For custom
8444 member duplication search in a container
8445 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8446 method and its return type.
8447 (Event.conflict_symbol): New member. Symbol with same name in the
8451 (MemberCache.FindMemberWithSameName): New method. The method
8452 is looking for conflict with inherited symbols.
8454 2004-08-04 Martin Baulig <martin@ximian.com>
8456 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8458 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8460 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8462 * report.cs (Message): New enum for better error, warning reference in
8464 (MessageData): New inner abstract class. It generally handles printing of
8465 error and warning messages.
8466 Removed unused Error, Warning, Message methods.
8468 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8470 Fix for cs0592-8.cs test
8472 (Attributable.ValidAttributeTargets): Made public.
8473 (Attribute.ExplicitTarget): New member for explicit target value.
8474 (Attribute.CheckTargets): Now we translate explicit attribute
8475 target to Target here.
8477 2004-08-03 Ben Maurer <bmaurer@ximian.com>
8479 * ecore.cs (MethodGroupExpr): new IsBase property.
8481 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8483 * delegate.cs (DelegateCreation): store a MethodGroupExpr
8484 rather than an instance expr.
8486 (DelegateCreation.Emit): Use the method group rather than
8487 the instance expression. Also, if you have base.Foo as the
8488 method for a delegate, make sure to emit ldftn, not ldftnvirt.
8490 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
8492 (NewDelegate.DoResolve): Only check for the existance of Invoke
8493 if the method is going to be needed. Use MethodGroupExpr.
8495 (NewDelegate.Emit): Remove, DelegateCreation implements this.
8497 * expression.cs: For pointer arith., make sure to use
8498 the size of the type, not the size of the pointer to
8501 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8504 * class.cs (Class): Added error CS0502 test.
8506 2004-08-03 John Luke <jluke@cfl.rr.com>
8507 Raja R Harinath <rharinath@novell.com>
8510 * attribute.cs (Attribute.complained_before): New flag.
8511 (Attribute.ResolveType, Attribute.Resolve),
8512 (Attribute.DefinePInvokeMethod): Set it.
8513 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8515 2004-08-03 Martin Baulig <martin@ximian.com>
8517 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8518 use a user-defined operator; we still need to do numeric
8519 promotions in case one argument is a builtin type and the other
8520 one has an implicit conversion to that type. Fixes #62322.
8522 2004-08-02 Martin Baulig <martin@ximian.com>
8524 * statement.cs (LocalInfo.Flags): Added `IsThis'.
8525 (LocalInfo.IsThis): New public property.
8526 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8528 2004-08-01 Martin Baulig <martin@ximian.com>
8530 * class.cs (TypeContainer.GetClassBases): Don't set the default
8531 here since we may get called from GetPartialBases().
8532 (TypeContainer.DefineType): If GetClassBases() didn't return a
8533 parent, use the default one.
8535 2004-07-30 Duncan Mak <duncan@ximian.com>
8537 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
8539 2004-07-30 Martin Baulig <martin@ximian.com>
8541 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8543 * class.cs (SourceMethod): New public class, derive from the
8544 symbol writer's ISourceMethod.
8545 (Method): Use the new symbol writer API.
8547 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8548 as argument and use the new symbol writer.
8551 (SourceFile): Implement the symbol writer's ISourceFile.
8552 (Location.SymbolDocument): Removed.
8553 (Location.SourceFile): New public property.
8555 * symbolwriter.cs: Use the new symbol writer API.
8557 2004-07-30 Raja R Harinath <rharinath@novell.com>
8559 * Makefile (install-local): Remove. Functionality moved to
8562 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
8564 * Makefile: Install mcs.exe.config file together with mcs.exe.
8565 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8566 correct runtime version.
8568 2004-07-25 Martin Baulig <martin@ximian.com>
8571 (TypeContainer.RegisterOrder): Removed, this was unused.
8572 (TypeContainer, interface_order): Removed.
8573 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8574 TypeContainer as argument since we can also be called with a
8575 `PartialContainer' for a partial class/struct/interface.
8576 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8577 of checking whether we're an `Interface' - we could be a
8579 (PartialContainer.Register): Override; call
8580 AddClass()/AddStruct()/AddInterface() on our parent.
8582 * cs-parser.jay (interface_member_declaration): Add things to the
8583 `current_container', not the `current_class'.
8585 * rootcontext.cs (RegisterOrder): The overloaded version which
8586 takes an `Interface' was unused, removed.
8588 * typemanager.cs (TypeManager.LookupInterface): Return a
8589 `TypeContainer', not an `Interface'.
8590 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8591 contain a `PartialContainer' for an interface, so check it's
8592 `Kind' to figure out what it is.
8594 2004-07-25 Martin Baulig <martin@ximian.com>
8596 * class.cs (Class.DefaultTypeAttributes): New public constant.
8597 (Struct.DefaultTypeAttributes): Likewise.
8598 (Interface.DefaultTypeAttributes): Likewise.
8599 (PartialContainer.TypeAttr): Override this and add the
8600 DefaultTypeAttributes.
8602 2004-07-25 Martin Baulig <martin@ximian.com>
8604 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8605 we can just use the `Parent' field instead.
8607 2004-07-25 Martin Baulig <martin@ximian.com>
8609 * class.cs (TypeContainer.Emit): Renamed to EmitType().
8611 2004-07-25 Martin Baulig <martin@ximian.com>
8613 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8614 our parts before defining any methods.
8615 (TypeContainer.VerifyImplements): Make this virtual.
8616 (ClassPart.VerifyImplements): Override and call VerifyImplements()
8617 on our PartialContainer.
8619 2004-07-25 Martin Baulig <martin@ximian.com>
8621 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8623 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8624 argument, we can just use the `Parent' field instead.
8627 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
8628 (MemberBase.DoDefine): Likewise.
8630 2004-07-24 Martin Baulig <martin@ximian.com>
8632 * decl.cs (MemberCore.Parent): New public field.
8633 (DeclSpace.Parent): Moved to MemberCore.
8635 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8636 (MemberBase.ctor): Added TypeContainer argument, pass it to our
8638 (FieldBase, Field, Operator): Likewise.
8639 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8640 (EventField, Event): Likewise.
8642 2004-07-23 Martin Baulig <martin@ximian.com>
8644 * class.cs (PartialContainer): New public class.
8645 (ClassPart): New public class.
8646 (TypeContainer): Added support for partial classes.
8647 (TypeContainer.GetClassBases): Splitted some of the functionality
8648 out into GetNormalBases() and GetPartialBases().
8650 * cs-tokenizer.cs (Token.PARTIAL): New token.
8651 (Tokenizer.consume_identifier): Added some hacks to recognize
8652 `partial', but only if it's immediately followed by `class',
8653 `struct' or `interface'.
8655 * cs-parser.jay: Added support for partial clases.
8657 2004-07-23 Martin Baulig <martin@ximian.com>
8659 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8660 a `DeclSpace' and also made it readonly.
8661 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8662 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8663 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8665 * cs-parser.jay: Pass the `current_class', not the
8666 `current_container' (at the moment, this is still the same thing)
8667 to a new Method, Property, Event, Indexer or Constructor.
8669 2004-07-23 Martin Baulig <martin@ximian.com>
8671 * cs-parser.jay (CSharpParser): Added a new `current_class' field
8672 and removed the `current_interface' one.
8673 (struct_declaration, class_declaration, interface_declaration):
8674 Set `current_class' to the newly created class/struct/interface;
8675 set their `Bases' and call Register() before parsing their body.
8677 2004-07-23 Martin Baulig <martin@ximian.com>
8679 * class.cs (Kind): New public enum.
8680 (TypeContainer): Made this class abstract.
8681 (TypeContainer.Kind): New public readonly field.
8682 (TypeContainer.CheckDef): New public method; moved here from
8684 (TypeContainer.Register): New public abstract method.
8685 (TypeContainer.GetPendingImplementations): New public abstract
8687 (TypeContainer.GetClassBases): Removed the `is_class' and
8688 `is_iface' parameters.
8689 (TypeContainer.DefineNestedTypes): Formerly known as
8691 (ClassOrStruct): Made this class abstract.
8693 * tree.cs (RootTypes): New public type.
8695 2004-07-20 Martin Baulig <martin@ximian.com>
8697 * tree.cs (Tree.RecordNamespace): Removed.
8698 (Tree.Namespaces): Removed.
8700 * rootcontext.cs (RootContext.IsNamespace): Removed.
8702 * cs-parser.jay (namespace_declaration): Just create a new
8703 NamespaceEntry here.
8705 2004-07-20 Martin Baulig <martin@ximian.com>
8707 * statement.cs (ExceptionStatement): New abstract class. This is
8708 now used as a base class for everyone who's using `finally'.
8709 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
8710 our local variables before using them.
8712 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
8713 virtual method. This is used by Yield.Resolve() to "steal" an
8714 outer block's `finally' clauses.
8715 (FlowBranchingException): The .ctor now takes an ExceptionStatement
8718 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
8719 version which takes an ExceptionStatement. This version must be
8720 used to create exception branchings.
8723 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
8724 (Iterator.EmitMoveNext): Added exception support; protect the
8725 block with a `fault' clause, properly handle 'finally' clauses.
8726 (Iterator.EmitDispose): Run all the `finally' clauses here.
8728 2004-07-20 Martin Baulig <martin@ximian.com>
8730 * iterator.cs: This is the first of a set of changes in the
8731 iterator code. Match the spec more closely: if we're an
8732 IEnumerable, then GetEnumerator() must be called. The first time
8733 GetEnumerator() is called, it returns the current instance; all
8734 subsequent invocations (if any) must create a copy.
8736 2004-07-19 Miguel de Icaza <miguel@ximian.com>
8738 * expression.cs: Resolve the constant expression before returning
8741 2004-07-19 Martin Baulig <martin@ximian.com>
8743 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
8744 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
8745 the return type of the new EmitContext.
8747 2004-07-18 Martin Baulig <martin@ximian.com>
8749 * class.cs (Property.Define): Fix iterators.
8751 * iterators.cs (Iterator.Define): Moved the
8752 `container.AddInterator (this)' call here from the .ctor; only do
8753 it if we resolved successfully.
8755 2004-07-17 Miguel de Icaza <miguel@ximian.com>
8757 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
8758 `true' for preprocessing directives that we parse. The return
8759 value indicates whether we should return to regular tokenizing or
8760 not, not whether it was parsed successfully.
8762 In the past if we were in: #if false ... #line #endif, we would
8763 resume parsing after `#line'. See bug 61604.
8765 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
8766 building: IsEnumType should return true only for enums, not for
8767 enums or System.Enum itself. This fixes #61593.
8769 Likely what happened is that corlib was wrong: mcs depended on
8770 this bug in some places. The bug got fixed, we had to add the
8771 hack, which caused bug 61593.
8773 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
8774 that was a workaround for the older conditions.
8776 2004-07-16 Ben Maurer <bmaurer@ximian.com>
8778 * assign.cs: IAssignMethod has a new interface, as documented
8779 inline. All assignment code now uses this new api.
8781 * ecore.cs, expression.cs: All classes which implement
8782 IAssignMethod now use the new interface.
8784 * expression.cs (Invocation): add a hack to EmitCall so that
8785 IndexerAccess can be the target of a compound assignment without
8786 evaluating its arguments twice.
8788 * statement.cs: Handle changes in Invocation api.
8790 2004-07-16 Martin Baulig <martin@ximian.com>
8792 * iterators.cs: Rewrote this. We're now using one single Proxy
8793 class for both the IEnumerable and the IEnumerator interface and
8794 `Iterator' derives from Class so we can use the high-level API.
8796 * class.cs (TypeContainer.AddIterator): New method.
8797 (TypeContainer.DoDefineType): New protected virtual method, which
8798 is called from DefineType().
8799 (TypeContainer.DoDefineMembers): Call DefineType() and
8800 DefineMembers() on all our iterators.
8801 (TypeContainer.Emit): Call Emit() on all our iterators.
8802 (TypeContainer.CloseType): Call CloseType() on all our iterators.
8804 * codegen.cs (EmitContext.CurrentIterator): New public field.
8806 2004-07-15 Martin Baulig <martin@ximian.com>
8809 (TypeManager.not_supported_exception_type): New type.
8811 2004-07-14 Martin Baulig <martin@ximian.com>
8813 * iterators.cs: Use real error numbers.
8815 2004-07-14 Martin Baulig <martin@ximian.com>
8817 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8818 requires this to be a System.Collection.IEnumerable and not a
8819 class implementing that interface.
8820 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
8822 2004-07-13 Marek Safar <marek.safar@seznam.cz>
8824 * class.cs: Fixed previous fix, it broke some error tests.
8826 2004-07-12 Martin Baulig <martin@ximian.com>
8828 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8831 2004-07-09 Miguel de Icaza <miguel@ximian.com>
8833 * assign.cs (LocalTemporary): Add new argument: is_address,If
8834 `is_address' is true, then the value that we store is the address
8835 to the real value, and not the value itself.
8837 * ecore.cs (PropertyExpr): use the new local temporary
8838 stuff to allow us to handle X.Y += z (where X is a struct)
8840 2004-07-08 Martin Baulig <martin@ximian.com>
8842 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8843 not always return, just like we're doing in Using.Resolve().
8845 2004-07-07 Miguel de Icaza <miguel@ximian.com>
8847 * cs-parser.jay (fixed_statement): flag this as Pinned.
8849 2004-07-06 Miguel de Icaza <miguel@ximian.com>
8851 * typemanager.cs (TypeManager): Removed MakePinned method, this
8852 mechanism is replaced with the .NET 2.x compatible mechanism of
8853 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8855 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
8856 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8857 `IsFixed' property which has a different meaning.
8859 2004-07-02 Raja R Harinath <rharinath@novell.com>
8861 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8862 visible from inside a nested class, not just the names of the
8863 immediately enclosing class.
8866 2004-06-24 Raja R Harinath <rharinath@novell.com>
8868 * expression.cs (BetterConversion): Remove buggy special-case
8869 handling of "implicit constant expression conversions". At this
8870 point, we already know that the conversion is possible -- we're
8871 only checking to see which is better.
8873 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8875 * cs-parser.jay: Added error CS0210 test.
8877 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8879 * cs-parser.jay: Added error CS0134 test.
8881 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8884 * cs-parser.jay: Added error CS0145 test.
8886 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8888 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8890 2004-06-23 Ben Maurer <bmaurer@ximian.com>
8892 * expression.cs (StackAlloc.Resolve): The argument may not
8893 be a constant; deal with this case.
8895 2004-06-23 Marek Safar <marek.safar@seznam.cz>
8897 * attribute.cs (IndexerName_GetIndexerName): Renamed to
8898 GetIndexerAttributeValue.
8899 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8901 * class.cs (Indexer.Define): Added error tests for CS0415,
8904 2004-06-23 Miguel de Icaza <miguel@ximian.com>
8906 * attribute.cs (Attribute.Resolve): Keep field code in sync with
8909 2004-06-23 Martin Baulig <martin@ximian.com>
8911 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8912 neither return nor throw, reset the barrier as well. Fixes #60457.
8914 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
8916 * class.cs : EventAttributes is now set to None by default.
8917 This fixes bug #60459.
8919 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8922 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8923 Don't throw exception but return null (it's sufficient now).
8925 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8927 * typemanager.cs (GetArgumentTypes): Faster implementation.
8929 2004-06-18 Martin Baulig <martin@ximian.com>
8931 * attribute.cs (Attribute.Resolve): Check whether we're an
8932 EmptyCast which a Constant child. Fixes #60333.
8934 2004-06-17 Ben Maurer <bmaurer@ximian.com>
8936 * statement.cs (EmitCollectionForeach): Account for the fact that
8937 not all valuetypes are in areas which we can take the address of.
8938 For these variables, we store to a temporary variable. Also, make
8939 sure that we dont emit a `callvirt' on a valuetype method.
8941 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8943 * expression.cs (StackAlloc.DoReSolve): Added test for
8944 negative parameter (CS0247).
8946 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8949 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8951 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8954 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8957 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8959 Fix bug #58254 & cs1555.cs, cs1556.cs
8960 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8962 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8964 * cs-parser.jay: Added error CS1669 test for indexers.
8966 2004-06-11 Martin Baulig <martin@ximian.com>
8968 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8969 call this twice: for params and varargs methods.
8971 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8974 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8976 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8978 * attribute.cs (Attribute.GetValidTargets): Made public.
8981 (AbstractPropertyEventMethod): New class for better code sharing.
8982 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8984 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8986 2004-06-11 Raja R Harinath <rharinath@novell.com>
8989 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
8990 that the call to Resolve is part of a MemberAccess.
8991 (Expression.Resolve): Use it for SimpleName resolution.
8992 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
8993 Add 'intermediate' boolean argument.
8994 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
8995 error message when the SimpleName can be resolved ambiguously
8996 between an expression and a type.
8997 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
8999 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
9000 call on the left-side.
9002 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9005 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
9007 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9009 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
9011 2004-06-11 Martin Baulig <martin@ximian.com>
9013 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
9014 varargs methods if applicable.
9016 2004-06-11 Martin Baulig <martin@ximian.com>
9018 * expression.cs (Invocation.EmitCall): Don't use
9019 `method.CallingConvention == CallingConventions.VarArgs' since the
9020 method could also have `CallingConventions.HasThis'.
9022 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9024 * class.cs (Event.GetSignatureForError): Implemented.
9025 Fixed crash in error test cs3010.cs
9027 2004-06-10 Miguel de Icaza <miguel@ximian.com>
9029 * cs-tokenizer.cs: Change the way we track __arglist to be
9030 consistent with the other keywords.
9032 2004-06-09 Miguel de Icaza <miguel@ximian.com>
9034 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
9037 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
9039 * codegen.cs: Check that all referenced assemblies have a strongname
9040 before strongnaming the compiled assembly. If not report error CS1577.
9041 Fix bug #56563. Patch by Jackson Harper.
9042 * typemanager.cs: Added a method to return all referenced assemblies.
9043 Fix bug #56563. Patch by Jackson Harper.
9045 2004-06-08 Marek Safar <marek.safar@seznam.cz>
9048 (Method.ApplyAttributeBuilder): Moved and added conditional
9049 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
9052 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
9054 2004-06-08 Marek Safar <marek.safar@seznam.cz>
9057 * class.cs: (EventField.attribute_targets): Changed default target.
9059 2004-06-08 Martin Baulig <martin@ximian.com>
9061 * expression.cs (Invocation.EmitCall): Enable varargs methods.
9063 2004-06-08 Martin Baulig <martin@ximian.com>
9065 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
9067 2004-06-07 Martin Baulig <martin@ximian.com>
9069 Added support for varargs methods.
9071 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
9074 * cs-parser.jay: Added support for `__arglist'.
9076 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
9078 * expression.cs (Argument.AType): Added `ArgList'.
9079 (Invocation): Added support for varargs methods.
9080 (ArglistAccess): New public class.
9081 (Arglist): New public class.
9083 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
9085 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
9086 a method's top-level block if the method has varargs.
9088 * support.cs (ReflectionParameters, InternalParameters): Added
9089 support for varargs methods.
9091 2004-06-07 Miguel de Icaza <miguel@ximian.com>
9093 * class.cs: Provide location in indexer error report.
9095 * driver.cs: Use standard names.
9097 * namespace.cs: Catch the use of using after a namespace has been
9098 declared also on using aliases.
9100 2004-06-03 Raja R Harinath <rharinath@novell.com>
9103 * typemanager.cs (closure_private_ok, closure_invocation_type)
9104 (closure_qualifier_type, closure_invocation_assembly)
9105 (FilterWithClosure): Move to ...
9106 (Closure): New internal nested class.
9107 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
9108 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
9109 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
9110 (MemberLookup, MemberLookupFailed): Use it.
9111 * expression.cs (New.DoResolve): Treat the lookup for the
9112 constructor as being qualified by the 'new'ed type.
9113 (Indexers.GetIndexersForTypeOrInterface): Update.
9115 2004-06-03 Marek Safar <marek.safar@seznam.cz>
9118 (GetConditionalAttributeValue): New method. Returns
9119 condition of ConditionalAttribute.
9120 (SearchMulti): New method. Returns all attributes of type 't'.
9121 Use it when attribute is AllowMultiple = true.
9122 (IsConditionalMethodExcluded): New method.
9125 (Method.IsExcluded): Implemented. Returns true if method has conditional
9126 attribute and the conditions is not defined (method is excluded).
9127 (IMethodData): Extended interface for ConditionalAttribute support.
9128 (PropertyMethod.IsExcluded): Implemented.
9131 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
9134 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
9137 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
9139 * expression.cs (ArrayCreationExpression): Make this just an
9140 `expression'. It can't be a statement, so the code here was
9143 2004-06-02 Marek Safar <marek.safar@seznam.cz>
9146 * typemanager.cs (GetFullNameSignature): New method for
9149 2004-06-02 Marek Safar <marek.safar@seznam.cz>
9152 * class.cs (MemberBase.GetSignatureForError): New virtual method.
9153 Use this method when MethodBuilder is null.
9154 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
9155 Added test for error CS0626 (MONO reports error for this situation).
9156 (IMethodData.GetSignatureForError): Extended interface.
9158 2004-06-01 Marek Safar <marek.safar@seznam.cz>
9161 (AttributeTester.GetObsoleteAttribute): Returns instance of
9162 ObsoleteAttribute when type is obsolete.
9165 (TypeContainer.VerifyObsoleteAttribute): Override.
9166 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9167 (MethodCode.VerifyObsoleteAttribute): Override.
9168 (MemberBase.VerifyObsoleteAttribute): Override.
9171 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9172 and report proper error.
9175 Delegate.VerifyObsoleteAttribute): Override.
9178 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9179 and report proper error.
9180 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9183 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9187 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9188 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9189 Added test for ObsoleteAttribute.
9192 (Catch): Derived from Statement.
9194 2004-06-01 Marek Safar <marek.safar@seznam.cz>
9196 Fixed bug #59071 & cs0160.cs
9198 * statement.cs (Try.Resolve): Check here whether order of catch
9199 clauses matches their dependencies.
9201 2004-05-31 Miguel de Icaza <miguel@ximian.com>
9203 * Reverted patch to namespace.cs (Use lookuptypedirect). This
9204 caused a regression: #59343. Referencing nested classes from an
9205 assembly stopped working.
9207 2004-05-31 Martin Baulig <martin@ximian.com>
9209 MCS is now frozen for beta 2.
9211 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9213 * convert.cs: add a trivial cache for overload operator resolution.
9215 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9217 * decl.cs: If possible, use lookuptypedirect here. We can only do
9218 this if there is no `.' after the namespace. Avoids using
9219 LookupType, which does lots of slow processing.
9220 (FindNestedType) New method, does what it says :-).
9221 * namespace.cs: use LookupTypeDirect.
9222 * rootcontext.cs: use membercache, if possible.
9223 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9225 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9228 According to the spec,
9230 In a member access of the form E.I, if E is a single identifier,
9231 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9232 field, property, localvariable, or parameter with the same type as
9233 the meaning of E as a type-name (§3.8), then both possible
9234 meanings of E are permitted.
9236 We did not check that E as a simple-name had the same type as E as
9239 This trivial check gives us 5-7% on bootstrap time.
9241 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9243 * expression.cs (Invocation.OverloadResolve): Avoid the
9244 use of hashtables and boxing here by allocating on demand.
9246 2004-05-30 Martin Baulig <martin@ximian.com>
9248 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9249 we're doing a silent lookup. Don't try to lookup nested types in
9250 TypeManager.object_type (thanks to Ben Maurer).
9252 2004-05-30 Martin Baulig <martin@ximian.com>
9254 Committing a patch from Ben Maurer.
9256 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9258 2004-05-29 Martin Baulig <martin@ximian.com>
9260 * class.cs (IMethodData.ShouldIgnore): New method.
9262 * typemanager.cs (TypeManager.MethodFlags): Don't take a
9263 `Location' argument, we don't need it anywhere. Use
9264 `IMethodData.ShouldIgnore ()' instead of
9265 `MethodData.GetMethodFlags ()'.
9266 (TypeManager.AddMethod): Removed.
9267 (TypeManager.AddMethod2): Renamed to AddMethod.
9269 2004-05-29 Martin Baulig <martin@ximian.com>
9271 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9273 * convert.cs (Convert.ImplicitReferenceConversion): If we're
9274 converting from a class type S to an interface type and we already
9275 have an object on the stack, don't box it again. Fixes #52578.
9277 2004-05-29 Martin Baulig <martin@ximian.com>
9279 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9280 Added support for `params' parameters. Fixes #59267.
9282 2004-05-29 Martin Baulig <martin@ximian.com>
9284 * literal.cs (NullPointer): Provide a private .ctor which sets
9285 `type' to TypeManager.object_type. Fixes #59048.
9287 2004-05-29 Martin Baulig <martin@ximian.com>
9289 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9290 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
9292 * ecore.cs (EventExpr.instance_expr): Make the field private.
9294 2004-05-26 Marek Safar <marek.safar@seznam.cz>
9296 Fixed bug #50080 & cs0214-2.cs
9297 * expression.cs (Cast.DoResolve): Check unsafe context here.
9299 * statement.cs (Resolve.DoResolve): Likewise.
9301 2004-05-26 Martin Baulig <martin@ximian.com>
9303 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9305 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9306 (RootContext.LookupType): Pass down the `silent' flag.
9308 2004-05-25 Martin Baulig <martin@ximian.com>
9311 (MethodGroupExpr.IdenticalTypeName): New public property.
9312 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9313 expression actually refers to a type.
9315 2004-05-25 Martin Baulig <martin@ximian.com>
9317 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9318 for #56176 and made it actually work.
9320 2004-05-25 Martin Baulig <martin@ximian.com>
9322 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9323 (FieldExpr, PropertyExpr): Override and implement
9324 CacheTemporaries. Fixes #52279.
9326 2004-05-25 Miguel de Icaza <miguel@ximian.com>
9328 * location.cs: In the new compiler listing a file twice is a
9329 warning, not an error.
9331 2004-05-24 Martin Baulig <martin@ximian.com>
9333 * enum.cs (Enum.DefineType): For the `BaseType' to be a
9334 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
9336 2004-05-24 Martin Baulig <martin@ximian.com>
9338 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9339 walking the `using' list. Fixes #53921.
9341 2004-05-24 Martin Baulig <martin@ximian.com>
9343 * const.cs (Const.LookupConstantValue): Added support for
9344 EmptyCast's; fixes #55251.
9346 2004-05-24 Martin Baulig <martin@ximian.com>
9348 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9349 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9350 which does the CS0135 check. The reason is that we first need to
9351 check whether the variable actually exists.
9353 2004-05-24 Martin Baulig <martin@ximian.com>
9355 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9356 than RootContext.LookupType() to find the explicit interface
9359 2004-05-24 Raja R Harinath <rharinath@novell.com>
9361 * Makefile: Simplify. Use executable.make.
9362 * mcs.exe.sources: New file. List of sources of mcs.exe.
9364 2004-05-24 Anders Carlsson <andersca@gnome.org>
9368 Use the invariant culture when doing String.Compare for CLS case
9371 2004-05-23 Martin Baulig <martin@ximian.com>
9373 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9374 don't have any dots. Fixes #52622, added cs0246-8.cs.
9376 * namespace.cs (NamespaceEntry.Lookup): Likewise.
9378 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9380 * class.cs (MemberBase.Define): Reuse MemberType member for
9381 resolved type. Other methods can use it too.
9383 2004-05-23 Martin Baulig <martin@ximian.com>
9385 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9386 the variable also exists in the current block (otherwise, we need
9387 to report a CS0103). Fixes #58670.
9389 2004-05-23 Martin Baulig <martin@ximian.com>
9391 * flowanalysis.cs (Reachability.Reachable): Compute this
9392 on-the-fly rather than storing it as a field.
9394 2004-05-23 Martin Baulig <martin@ximian.com>
9396 * flowanalysis.cs (Reachability.And): Manually compute the
9397 resulting `barrier' from the reachability.
9399 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9402 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9403 instance of ObsoleteAttribute when symbol is obsolete.
9406 (IMethodData): Extended interface for ObsoleteAttribute support.
9408 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9410 * attribute.cs: Fix bug #55970
9412 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9416 (GetObsoleteAttribute): New method. Creates the instance of
9418 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9419 ObsoleteAttribute when member is obsolete.
9420 (AttributeTester.Report_ObsoleteMessage): Common method for
9421 Obsolete error/warning reporting.
9424 (TypeContainer.base_classs_type): New member for storing parent type.
9427 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9428 for this MemberCore.
9430 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9432 * attribute.cs, const.cs: Fix bug #58590
9434 2004-05-21 Martin Baulig <martin@ximian.com>
9436 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9437 out parameters if the end of the method is unreachable. Fixes
9440 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9442 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9443 Hari was right, why extra method.
9445 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9447 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9449 2004-05-20 Martin Baulig <martin@ximian.com>
9451 Merged this back from gmcs to keep the differences to a minumum.
9453 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
9454 instead of a Declspace.
9455 (Attribute.ResolveType): Likewise.
9456 (Attributes.Search): Likewise.
9457 (Attributes.Contains): Likewise.
9458 (Attributes.GetClsCompliantAttribute): Likewise.
9460 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
9462 (MethodData.ApplyAttributes): Take an EmitContext instead of a
9465 2004-05-19 Marek Safar <marek.safar@seznam.cz>
9467 Fix bug #58688 (MCS does not report error when the same attribute
9470 * attribute.cs (Attribute.Emit): Distinction between null and default.
9472 2004-05-19 Raja R Harinath <rharinath@novell.com>
9474 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9475 of a top-level attribute without an attribute target.
9476 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
9478 (Attribute.Conditional_GetConditionName),
9479 (Attribute.Obsolete_GetObsoleteMessage): Update.
9480 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
9481 part of ScanForIndexerName.
9482 (Attribute.CanIgnoreInvalidAttribute): New function.
9483 (Attribute.ScanForIndexerName): Move to ...
9484 (Attributes.ScanForIndexerName): ... here.
9485 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9486 (Attributes.Search): New internal variant that can choose not to
9487 complain if types aren't resolved. The original signature now
9489 (Attributes.GetClsCompliantAttribute): Use internal variant, with
9490 complaints suppressed.
9491 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9492 only if it not useful.
9493 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9494 top-level for attributes that are shared between the assembly
9495 and a top-level class.
9496 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9497 * class.cs: Update to reflect changes.
9498 (DefineIndexers): Fuse loops.
9499 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
9500 a couple more variants of attribute names.
9502 2004-05-18 Marek Safar <marek.safar@seznam.cz>
9504 Fix bug #52585 (Implemented explicit attribute declaration)
9507 (Attributable.ValidAttributeTargets): New abstract method. It gets
9508 list of valid attribute targets for explicit target declaration.
9509 (Attribute.Target): It holds target itself.
9510 (AttributeSection): Removed.
9511 (Attribute.CheckTargets): New method. It checks whether attribute
9512 target is valid for the current element.
9515 (EventProperty): New class. For events that are declared like
9516 property (with add and remove accessors).
9517 (EventField): New class. For events that are declared like field.
9520 * cs-parser.jay: Implemented explicit attribute target declaration.
9522 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
9523 Override ValidAttributeTargets.
9526 (ReturnParameter): Class for applying custom attributes on
9528 (ParameterAtribute): New class. Class for applying custom
9529 attributes on the parameter type.
9531 2004-05-17 Miguel de Icaza <miguel@ximian.com>
9533 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9536 (Method): Allow UNSAFE here.
9538 * modifiers.cs: Support unsafe reporting.
9540 2004-05-17 Marek Safar <marek.safar@seznam.cz>
9542 * decl.cs: Fix bug #58478.
9544 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9546 * statement.cs: When checking for unreachable code on an EmptyStatement,
9547 set the location. Fixes bug #58488.
9549 2004-05-13 Miguel de Icaza <miguel@ximian.com>
9551 * driver.cs: Add -pkg handling.
9553 From Gonzalo: UseShelLExecute=false
9555 2004-05-12 Marek Safar <marek.safar@seznam.cz>
9558 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9560 (Attribute.IsClsCompliaceRequired): Moved to base for better
9562 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9563 when attribute is AttributeUsageAttribute.
9564 (Attribute.GetValidTargets): Simplified.
9565 (Attribute.GetAttributeUsage): New method returns AttributeUsage
9566 attribute for this type.
9567 (Attribute.ApplyAttributes): Method renamed to Emit and make
9569 (GlobalAttributeSection): New class for special handling of global
9570 attributes (assembly, module).
9571 (AttributeSection.Emit): New method.
9573 * class.cs: Implemented Attributable abstract methods.
9574 (MethodCore.LabelParameters): Moved to Parameter class.
9575 (Accessor): Is back simple class.
9576 (PropertyMethod): Implemented Attributable abstract class.
9577 (DelegateMethod): Implemented Attributable abstract class.
9578 (Event): New constructor for disctintion between normal Event
9579 and Event with accessors.
9581 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9583 * codegen.cs, const.cs, decl.cs, delegate.cs:
9584 (CommonAssemblyModulClass): Implemented Attributable abstract class
9587 * enum.cs: Implement IAttributeSupport interface.
9588 (EnumMember): New class for emum members. Implemented Attributable
9592 (ParameterBase): Is abstract.
9593 (ReturnParameter): New class for easier [return:] attribute handling.
9595 * typemanager.cs: Removed builder_to_attr.
9597 2004-05-11 Raja R Harinath <rharinath@novell.com>
9600 * attribute.cs (Attribute.GetPositionalValue): New function.
9601 * class.cs (TypeContainer.VerifyMembers): New function.
9602 (TypeContainer.Emit): Use it.
9603 (ClassOrStruct): New base class for Class and Struct.
9604 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
9605 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9607 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9608 then each non-static field should have a FieldOffset attribute.
9609 Otherwise, none of the fields should have a FieldOffset attribute.
9610 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
9611 and FieldOffset attributes.
9612 * typemanager.cs (TypeManager.struct_layout_attribute_type)
9613 (TypeManager.field_offset_attribute_type): New core types.
9614 (TypeManager.InitCoreTypes): Initialize them.
9616 2004-05-11 Michal Moskal <malekith@pld-linux.org>
9618 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9619 Return correct type.
9622 2004-05-09 Miguel de Icaza <miguel@ximian.com>
9624 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9625 be implicitly converted to ulong.
9627 * expression.cs: The logic for allowing operator &, | and ^ worked
9628 was wrong, it worked before because we did not report an error in
9629 an else branch. Fixes 57895.
9631 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9632 allow volatile fields to be reference types.
9634 2004-05-07 Miguel de Icaza <miguel@ximian.com>
9636 * driver.cs: Add support for /debug-
9638 2004-05-07 Raja R Harinath <rharinath@novell.com>
9640 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
9641 Add a 'complain' parameter to silence errors.
9642 (Attribute.Resolve): Update to changes. Put in sanity check to catch
9643 silently overlooked type-resolutions.
9644 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9646 (Attributes.Search): New function.
9647 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9648 (Attributes.GetAttributeFullName): Remove hack.
9649 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
9650 Update to reflect changes.
9651 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9652 Use Attributes.Search instead of nested loops.
9654 2004-05-07 Marek Safar <marek.safar@seznam.cz>
9657 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9658 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9659 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9661 * report.cs: (Report.Warning): Renamed to Warning_T because of
9662 parameter collision.
9664 2004-05-05 Raja R Harinath <rharinath@novell.com>
9666 * expression.cs (MemberAccess.ResolveMemberAccess):
9667 Exit with non-zero status after Report.Error.
9668 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9670 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9672 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9674 * support.cs: Don't hang when the file is empty.
9676 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9678 * support.cs: In SeekableStreamReader, compute the preamble size of the
9679 underlying stream. Position changes should take into account that initial
9682 2004-05-03 Todd Berman <tberman@sevenl.net>
9684 * driver.cs: remove unused GetSysVersion function.
9686 2004-05-03 Todd Berman <tberman@sevenl.net>
9688 * driver.cs: Remove the hack from saturday, as well as the hack
9689 from jackson (LoadAssemblyFromGac), also adds the CWD to the
9690 link_paths to get that bit proper.
9692 2004-05-01 Todd Berman <tberman@sevenl.net>
9694 * driver.cs: Try a LoadFrom before a Load, this checks the current
9695 path. This is currently a bug in mono that is be fixed, however, this
9696 provides a workaround for now. This will be removed when the bug
9699 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
9701 * CryptoConvert.cs: Updated to latest version. Fix issue with
9702 incomplete key pairs (#57941).
9704 2004-05-01 Todd Berman <tberman@sevenl.net>
9706 * driver.cs: Remove '.' from path_chars, now System.* loads properly
9709 2004-04-30 Jackson Harper <jackson@ximian.com>
9711 * codegen.cs: Open keys readonly.
9713 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9715 * typemanager.cs: don't report cyclic struct layout when a struct
9716 contains 2 or more fields of the same type. Failed for Pango.AttrShape
9717 which has 2 Pango.Rectangle fields.
9719 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
9721 * expression.cs: Handle IntPtr comparisons with IL code
9722 rather than a method call.
9724 2004-04-29 Martin Baulig <martin@ximian.com>
9726 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
9727 the list of PropertyInfo's in class hierarchy and find the
9728 accessor. Fixes #56013.
9730 2004-04-29 Martin Baulig <martin@ximian.com>
9732 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9734 2004-04-29 Martin Baulig <martin@ximian.com>
9736 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9738 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9740 2004-04-29 Martin Baulig <martin@ximian.com>
9742 * class.cs (ConstructorInitializer.Resolve): Check whether the
9743 parent .ctor is accessible. Fixes #52146.
9745 2004-04-29 Martin Baulig <martin@ximian.com>
9747 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9749 * statement.cs (Using.EmitLocalVariableDecls): Use
9750 TypeManager.idisposable_type, not typeof (IDisposable).
9751 (Foreach.EmitCollectionForeach): Added support for valuetypes.
9753 2004-04-29 Martin Baulig <martin@ximian.com>
9755 * class.cs (Event.Define): Don't emit the field and don't set
9756 RTSpecialName and SpecialName for events on interfaces. Fixes
9759 2004-04-29 Raja R Harinath <rharinath@novell.com>
9761 Refactor Attribute.ApplyAttributes.
9762 * attribute.cs (Attributable): New base class for objects that can
9763 have Attributes applied on them.
9764 (Attribute): Make AttributeUsage fields public.
9765 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9766 (Attribute.IsInternalCall): New property.
9767 (Attribute.UsageAttr): Convert to a public read-only property.
9768 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9769 (Attribute.ResolveType, Attribute.Resolve)
9770 (Attribute.ScanForIndexerName): Update to reflect changes.
9771 (Attribute.CheckAttributeTarget): Re-format.
9772 (Attribute.ApplyAttributes): Refactor, to various
9773 Attributable.ApplyAttributeBuilder methods.
9774 * decl.cs (MemberCore): Make Attributable.
9775 * class.cs (Accessor): Make Attributable.
9776 (MethodData.ApplyAttributes): Use proper attribute types, not
9778 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9779 (TypeContainer.ApplyAttributeBuilder)
9780 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9781 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
9782 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9783 (Operator.ApplyAttributeBuilder): New factored-out methods.
9784 * const.cs (Const.ApplyAttributeBuilder): Likewise.
9785 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9786 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9787 * parameter.cs (ParameterBase): New Attributable base class
9788 that can also represent Return types.
9789 (Parameter): Update to the changes.
9791 2004-04-29 Jackson Harper <jackson@ximian.com>
9793 * driver.cs: Prefer the corlib system version when looking for
9794 assemblies in the GAC. This is still a hack, but its a better hack
9797 2004-04-29 Marek Safar <marek.safar@seznam.cz>
9799 * decl.cs, enum.cs: Improved error 3005 reporting.
9801 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9802 (related_symbols): New private member for list of symbols
9803 related to reported error/warning.
9805 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9807 2004-04-29 Martin Baulig <martin@ximian.com>
9809 * ecore.cs (Expression.Constantify): If we're an enum and
9810 TypeManager.TypeToCoreType() doesn't give us another type, use
9811 t.UnderlyingSystemType. Fixes #56178.
9813 2004-04-29 Martin Baulig <martin@ximian.com>
9815 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9816 interfaces and for each interface, only add members directly
9817 declared in that interface. Fixes #53255.
9819 2004-04-28 Martin Baulig <martin@ximian.com>
9821 * expression.cs (ConditionalLogicalOperator): Use a temporary
9822 variable for `left' to avoid that we evaluate it more than once;
9825 2004-04-28 Martin Baulig <martin@ximian.com>
9827 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9830 2004-04-28 Martin Baulig <martin@ximian.com>
9832 * statement.cs (LocalInfo.Resolve): Check whether the type is not
9835 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9836 whether the type is not void (CS1547).
9838 2004-04-28 Martin Baulig <martin@ximian.com>
9840 * expression.cs (Unary.DoResolveLValue): Override this and report
9841 CS0131 for anything but Operator.Indirection.
9843 2004-04-28 Martin Baulig <martin@ximian.com>
9845 Committing a patch from Ben Maurer; see bug #50820.
9847 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9850 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9853 2004-04-28 Martin Baulig <martin@ximian.com>
9855 Committing a patch from Ben Maurer; see bug #50820.
9857 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9860 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9863 2004-04-28 Martin Baulig <martin@ximian.com>
9865 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9866 (Block.AddLabel): Call DoLookupLabel() to only search in the
9869 2004-04-28 Martin Baulig <martin@ximian.com>
9871 * cfold.cs (ConstantFold.BinaryFold): Added special support for
9872 comparing StringConstants and NullLiterals in Equality and Inequality.
9874 2004-04-28 Jackson Harper <jackson@ximian.com>
9876 * driver.cs: Attempt to load referenced assemblies from the
9877 GAC. This is the quick and dirty version of this method that
9878 doesnt take into account versions and just takes the first
9879 canidate found. Will be good enough for now as we will not have more
9880 then one version installed into the GAC until I update this method.
9882 2004-04-28 Martin Baulig <martin@ximian.com>
9884 * typemanager.cs (TypeManager.CheckStructCycles): New public
9885 static method to check for cycles in the struct layout.
9887 * rootcontext.cs (RootContext.PopulateTypes): Call
9888 TypeManager.CheckStructCycles() for each TypeContainer.
9889 [Note: We only need to visit each type once.]
9891 2004-04-28 Martin Baulig <martin@ximian.com>
9893 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9895 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9896 success and added `out object value'. Use a `bool resolved' field
9897 to check whether we've already been called rather than
9898 `ConstantValue != null' since this breaks for NullLiterals.
9900 2004-04-28 Raja R Harinath <rharinath@novell.com>
9902 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9903 setting of this flag, since the 'set' method may be non-public.
9905 2004-04-28 Raja R Harinath <rharinath@novell.com>
9907 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9908 check on current_vector.Block.
9910 2004-04-27 Martin Baulig <martin@ximian.com>
9912 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9913 a field initializer. Fixes #56459.
9915 2004-04-27 Martin Baulig <martin@ximian.com>
9917 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9918 we're not attempting to use an indexer. Fixes #52154.
9920 2004-04-27 Martin Baulig <martin@ximian.com>
9922 * statement.cs (Return): Don't create a return label if we don't
9923 need it; reverts my change from January 20th. Thanks to Ben
9926 2004-04-27 Martin Baulig <martin@ximian.com>
9928 According to the spec, `goto' can only leave a nested scope, but
9931 * statement.cs (Block.LookupLabel): Only lookup in the current
9932 block, don't recurse into parent or child blocks.
9933 (Block.AddLabel): Check in parent and child blocks, report
9934 CS0140/CS0158 if we find a duplicate.
9935 (Block): Removed this indexer for label lookups.
9936 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9937 this already does the error reporting for us.
9940 (FlowBranching.UsageVector.Block): New public variable; may be null.
9941 (FlowBranching.CreateSibling): Added `Block' argument.
9942 (FlowBranching.LookupLabel): New public virtual method. Lookup a
9943 label for the target of a `goto' and check whether we're not
9944 leaving a `finally'.
9946 2004-04-27 Martin Baulig <martin@ximian.com>
9948 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9949 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9952 2004-04-27 Martin Baulig <martin@ximian.com>
9954 * statement.cs (Block.AddLabel): Also check for implicit blocks
9955 and added a CS0158 check.
9957 2004-04-27 Martin Baulig <martin@ximian.com>
9959 * flowanalysis.cs (FlowBranchingLoop): New class.
9960 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9961 UsageVector's instead of an ArrayList.
9962 (FlowBranching.Label): Likewise.
9963 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9964 (FlowBranching.AddBreakVector): New method.
9966 2004-04-27 Miguel de Icaza <miguel@ximian.com>
9968 * attribute.cs: Small regression fix: only convert the type if we
9969 the type is different, fixes System.Drawing build.
9971 2004-04-27 Martin Baulig <martin@ximian.com>
9973 * attribute.cs (Attribute.Resolve): If we have a constant value
9974 for a named field or property, implicity convert it to the correct
9977 2004-04-27 Raja R Harinath <rharinath@novell.com>
9979 * statement.cs (Block.Block): Implicit blocks share
9980 'child_variable_names' fields with parent blocks.
9981 (Block.AddChildVariableNames): Remove.
9982 (Block.AddVariable): Mark variable as "used by a child block" in
9983 every surrounding block.
9984 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9985 been used in a child block, complain about violation of "Invariant
9986 meaning in blocks" rule.
9987 * cs-parser.jay (declare_local_variables): Don't use
9988 AddChildVariableNames.
9989 (foreach_statement): Don't create an implicit block: 'foreach'
9992 2004-04-23 Miguel de Icaza <miguel@ximian.com>
9994 * convert.cs (ImplicitNumericConversion): 0 is also positive when
9995 converting from 0L to ulong. Fixes 57522.
9997 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9999 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10000 derived class hides via 'new' keyword field from base class (test-242.cs).
10001 TODO: Handle this in the more general way.
10003 * class.cs (CheckBase): Ditto.
10005 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10007 * decl.cs (caching_flags): New member for storing cached values
10009 (MemberCore.Flags): New enum where bit flags for caching_flags
10011 (MemberCore.cls_compliance): Moved to caching_flags.
10012 (DeclSpace.Created): Moved to caching_flags.
10014 * class.cs: Use caching_flags instead of DeclSpace.Created
10016 2004-04-21 Miguel de Icaza <miguel@ximian.com>
10018 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10019 if we are only a derived class, not a nested class.
10021 * typemanager.cs: Same as above, but do this at the MemberLookup
10022 level (used by field and methods, properties are handled in
10023 PropertyExpr). Allow for the qualified access if we are a nested
10026 2004-04-21 Marek Safar <marek.safar@seznam.cz>
10028 * class.cs: Refactoring.
10029 (IMethodData): New inteface; Holds links to parent members
10030 to avoid member duplication (reduced memory allocation).
10031 (Method): Implemented IMethodData interface.
10032 (PropertyBase): New inner classes for get/set methods.
10033 (PropertyBase.PropertyMethod): Implemented IMethodData interface
10034 (Event): New inner classes for add/remove methods.
10035 (Event.DelegateMethod): Implemented IMethodData interface.
10037 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10038 EmitContext (related to class.cs refactoring).
10040 2004-04-21 Raja R Harinath <rharinath@novell.com>
10042 * delegate.cs (Delegate.VerifyApplicability): If the number of
10043 arguments are the same as the number of parameters, first try to
10044 verify applicability ignoring any 'params' modifier on the last
10048 2004-04-16 Raja R Harinath <rharinath@novell.com>
10050 * class.cs (TypeContainer.AddIndexer): Use
10051 'ExplicitInterfaceName' to determine if interface name was
10052 explicitly specified. 'InterfaceType' is not initialized at this time.
10053 (TypeContainer.DefineIndexers): Remove use of temporary list. The
10054 Indexers array is already in the required order. Initialize
10055 'IndexerName' only if there are normal indexers.
10056 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10057 (TypeContainer.Emit): Emit DefaultMember attribute only if
10058 IndexerName is initialized.
10061 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
10063 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10066 2004-04-15 Raja R Harinath <rharinath@novell.com>
10068 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10072 * attribute.cs (Attribute.Resolve): Check for duplicate named
10076 2004-04-15 Miguel de Icaza <miguel@ximian.com>
10078 * iterators.cs (MarkYield): track whether we are in an exception,
10079 and generate code accordingly. Use a temporary value to store the
10080 result for our state.
10082 I had ignored a bit the interaction of try/catch with iterators
10083 since their behavior was not entirely obvious, but now it is
10084 possible to verify that our behavior is the same as MS .NET 2.0
10088 2004-04-14 Miguel de Icaza <miguel@ximian.com>
10090 * iterators.cs: Avoid creating temporaries if there is no work to
10093 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10094 Enumerations, use TypeManager.EnumToUnderlying and call
10097 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10100 (This.Emit): Use EmitContext.EmitThis to emit our
10103 (This.EmitAssign): Ditto.
10105 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10106 codepaths, we will move all the functionality into
10109 (FieldExpr.EmitAssign): Ditto.
10111 This fixes several hidden bugs that I uncovered while doing a code
10112 review of this today.
10114 * codegen.cs (EmitThis): reworked so the semantics are more clear
10115 and also support value types "this" instances.
10117 * iterators.cs: Changed so that for iterators in value types, we
10118 do not pass the value type as a parameter.
10120 Initialization of the enumerator helpers is now done in the caller
10121 instead of passing the parameters to the constructors and having
10122 the constructor set the fields.
10124 The fields have now `assembly' visibility instead of private.
10126 2004-04-11 Miguel de Icaza <miguel@ximian.com>
10128 * expression.cs (Argument.Resolve): Check if fields passed as ref
10129 or out are contained in a MarshalByRefObject.
10131 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10132 another compiler type.
10134 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
10136 * class.cs (Indexer.Define): use the new name checking method.
10137 Also, return false on an error.
10138 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10139 (is_identifier_[start/part]_character): make static.
10141 2004-04-10 Miguel de Icaza <miguel@ximian.com>
10143 * expression.cs (Binary.ResolveOperator): Do no append strings
10144 twice: since we can be invoked more than once (array evaluation)
10145 on the same concatenation, take care of this here. Based on a fix
10146 from Ben (bug #56454)
10148 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10150 * codegen.cs: Fix another case where CS1548 must be reported (when
10151 delay-sign isn't specified and no private is available #56564). Fix
10152 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10153 error when MCS is used on the MS runtime and we need to delay-sign
10154 (which seems unsupported by AssemblyBuilder - see #56621).
10156 2004-04-08 Marek Safar <marek.safar@seznam.cz>
10158 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10159 (TypeManager.ComputeNamespaces): Faster implementation for
10162 * compiler.csproj: Updated AssemblyName to mcs.
10164 2004-04-07 Miguel de Icaza <miguel@ximian.com>
10166 * rootcontext.cs: Add new types to the boot resolution.
10168 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10169 MulticastDelegate is not allowed.
10171 * typemanager.cs: Add new types to lookup: System.TypedReference
10174 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10175 check for TypedReference or ArgIterator, they are not allowed.
10177 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10178 makes us properly catch 1510 in some conditions (see bug 56016 for
10181 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
10183 * CryptoConvert.cs: update from corlib version
10186 2004-04-05 Miguel de Icaza <miguel@ximian.com>
10188 * class.cs (Indexer.Define): Check indexername declaration
10190 2004-04-05 Marek Safar <marek.safar@seznam.cz>
10192 * attribute.cs (IsClsCompliant): Fixed problem with handling
10193 all three states (compliant, not-compliant, undetected).
10195 2004-03-30 Marek Safar <marek.safar@seznam.cz>
10197 * attribute.cs (Attribute): Location is now public.
10198 (Resolve): Store resolved arguments (pos_values) in attribute class.
10199 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10200 (GetClsCompliantAttributeValue): New method that gets
10201 CLSCompliantAttribute value.
10202 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10203 if exists else null.
10204 (AttributeTester): New class for CLS-Compliant verification routines.
10206 * class.cs (Emit): Add CLS-Compliant verification.
10207 (Method.GetSignatureForError): Implemented.
10208 (Constructor.GetSignatureForError): Implemented
10209 (Constructor.HasCompliantArgs): Returns if constructor has
10210 CLS-Compliant arguments.
10211 (Constructor.Emit): Override.
10212 (Construcor.IsIdentifierClsCompliant): New method; For constructors
10213 is needed to test only parameters.
10214 (FieldBase.GetSignatureForError): Implemented.
10215 (TypeContainer): New member for storing base interfaces.
10216 (TypeContainer.FindMembers): Search in base interfaces too.
10218 * codegen.cs (GetClsComplianceAttribute): New method that gets
10219 assembly or module CLSCompliantAttribute value.
10220 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10222 (ModuleClass.Emit): Add error 3012 test.
10224 * const.cs (Emit): Override and call base for CLS-Compliant tests.
10226 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10227 state for all decl types.
10228 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10229 if CLS-Compliant tests are required.
10230 (IsClsCompliaceRequired): New method. Analyze whether code
10231 must be CLS-Compliant.
10232 (IsExposedFromAssembly): New method. Returns true when MemberCore
10233 is exposed from assembly.
10234 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10235 value or gets cached value.
10236 (HasClsCompliantAttribute): New method. Returns true if MemberCore
10237 is explicitly marked with CLSCompliantAttribute.
10238 (IsIdentifierClsCompliant): New abstract method. This method is
10239 used to testing error 3005.
10240 (IsIdentifierAndParamClsCompliant): New method. Common helper method
10241 for identifier and parameters CLS-Compliant testing.
10242 (VerifyClsCompliance): New method. The main virtual method for
10243 CLS-Compliant verifications.
10244 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10245 null. I don't know why is null (too many public members !).
10246 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10247 and get value of first CLSCompliantAttribute that found.
10249 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10250 (VerifyClsCompliance): Override and add extra tests.
10252 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10253 clscheck- disable CLS-Compliant verification event if assembly is has
10254 CLSCompliantAttribute(true).
10256 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10257 ApllyAttribute is now called in emit section as in the other cases.
10258 Possible future Emit integration.
10259 (IsIdentifierClsCompliant): New override.
10260 (VerifyClsCompliance): New override.
10261 (GetEnumeratorName): Returns full enum name.
10263 * parameter.cs (GetSignatureForError): Implemented.
10265 * report.cs (WarningData): New struct for Warning message information.
10266 (LocationOfPreviousError): New method.
10267 (Warning): New method. Reports warning based on the warning table.
10268 (Error_T): New method. Reports error based on the error table.
10270 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10271 verifications are done here.
10273 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10275 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10276 CLSCompliantAttribute.
10277 (all_imported_types): New member holds all imported types from other
10279 (LoadAllImportedTypes): New method fills static table with exported types
10280 from all referenced assemblies.
10281 (Modules): New property returns all assembly modules.
10283 2004-03-30 Miguel de Icaza <miguel@ximian.com>
10285 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10286 throwing a parser error.
10288 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10289 which removes the hardcoded get_/set_ prefixes for properties, as
10290 IL allows for the properties to be named something else.
10294 * expression.cs: Do not override operand before we know if it is
10295 non-null. Fix 56207
10297 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10299 * typemanager.cs: support for pinned variables.
10301 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10303 * decl.cs, typemanager.cs: Avoid using an arraylist
10304 as a buffer if there is only one result set.
10306 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10308 * expression.cs: Make sure you cant call a static method
10309 with an instance expression, bug #56174.
10311 2004-03-29 Miguel de Icaza <miguel@ximian.com>
10313 * class.cs (IsDuplicateImplementation): Improve error reporting to
10314 flag 663 (method only differs in parameter modifier).
10316 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10317 in preprocessor directives.
10319 * location.cs (LookupFile): Allow for the empty path.
10321 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
10322 better approach for some of that patch, but its failing with the
10323 CharSet enumeration. For now try/catch will do.
10325 * typemanager.cs: Do not crash if a struct does not have fields.
10328 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10330 * expression.cs: cs0213, cant fix a fixed expression.
10333 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10335 * cs-parser.jay: detect invalid embeded statements gracefully.
10338 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10340 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10343 the invocation type may not be a subclass of the tye of the item/
10344 The type of the item must be a subclass of the invocation item.
10349 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
10351 * attribute.cs: Added methods to get a string and a bool from an
10352 attribute. Required to information from AssemblyKeyFileAttribute,
10353 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10354 * codegen.cs: Modified AssemblyName creation to include support for
10355 strongnames. Catch additional exceptions to report them as CS1548.
10356 * compiler.csproj: Updated include CryptoConvert.cs.
10357 * compiler.csproj.user: Removed file - user specific configuration.
10358 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
10359 Mono.Security assembly. The original class is maintained and tested in
10360 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10361 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10362 like CSC 8.0 (C# v2) supports.
10363 * Makefile: Added CryptoConvert.cs to mcs sources.
10364 * rootcontext.cs: Added new options for strongnames.
10366 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
10368 * driver.cs: For --expect-error, report error code `2'
10369 if the program compiled with no errors, error code `1' if
10370 it compiled with an error other than the one expected.
10372 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
10374 * compiler.csproj: Updated for Visual Studio .NET 2003.
10375 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10376 * compiler.sln: Updated for Visual Studio .NET 2003.
10378 2004-03-24 Ravi Pratap M <ravi@ximian.com>
10380 * expression.cs: Fix bug #47234. We basically need to apply the
10381 rule that we prefer the conversion of null to a reference type
10382 when faced with a conversion to 'object' (csc behaviour).
10384 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10386 * statement.cs: Shorter form for foreach, eliminates
10387 a local variable. r=Martin.
10389 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10391 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10392 checks if we can use brtrue/brfalse to test for 0.
10393 * expression.cs: use the above in the test for using brtrue/brfalse.
10394 cleanup code a bit.
10396 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10398 * expression.cs: Rewrite string concat stuff. Benefits:
10400 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10401 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10402 rather than a concat chain.
10404 * typemanager.cs: Add lookups for more concat overloads.
10406 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10408 * expression.cs: Emit shorter il code for array init.
10425 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
10427 * statement.cs: Before, two switch blocks would be merged if the
10428 total size of the blocks (end_item - begin_item + 1) was less than
10429 two times the combined sizes of the blocks.
10431 Now, it will only merge if after the merge at least half of the
10436 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
10438 * class.cs : csc build fix for GetMethods(). See bug #52503.
10440 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
10442 * expression.cs: Make sure fp comparisons work with NaN.
10443 This fixes bug #54303. Mig approved this patch a long
10444 time ago, but we were not able to test b/c the runtime
10447 2004-03-19 Miguel de Icaza <miguel@ximian.com>
10449 * ecore.cs (TypExpr.GetHashCode): implement this overload.
10451 2004-03-19 Martin Baulig <martin@ximian.com>
10453 * class.cs (MemberCore.IsDuplicateImplementation): Report the
10454 error here and not in our caller.
10456 2004-03-19 Martin Baulig <martin@ximian.com>
10458 * interface.cs: Completely killed this file.
10459 (Interface): We're now a TypeContainer and live in class.cs.
10461 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10462 argument; we're now also called for interfaces.
10463 (TypeContainer.DefineMembers): Allow this method being called
10465 (TypeContainer.GetMethods): New public method; formerly known as
10466 Interface.GetMethod(). This is used by PendingImplementation.
10467 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10468 it's now private and non-static.
10469 (Interface): Moved this here; it's now implemented similar to
10471 (Method, Property, Event, Indexer): Added `bool is_interface'
10472 argument to their .ctor's.
10473 (MemberBase.IsInterface): New public field.
10475 * cs-parser.jay: Create normal Method, Property, Event, Indexer
10476 instances instead of InterfaceMethod, InterfaceProperty, etc.
10477 (opt_interface_base): Removed; we now use `opt_class_base' instead.
10478 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10480 2004-03-19 Martin Baulig <martin@ximian.com>
10482 * class.cs (MethodCore.IsDuplicateImplementation): New private
10483 method which does the CS0111 checking.
10484 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10485 Use IsDuplicateImplementation().
10487 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
10489 * decl.cs (FindMemberToOverride): New method to find the correct
10490 method or property to override in the base class.
10492 - Make Method/Property use the above method to find the
10493 version in the base class.
10494 - Remove the InheritableMemberSignatureCompare as it is now
10497 This patch makes large code bases much faster to compile, as it is
10498 O(n) rather than O(n^2) to do this validation.
10500 Also, it fixes bug 52458 which is that nested classes are not
10501 taken into account when finding the base class member.
10503 Reviewed/Approved by Martin.
10505 2004-03-17 Marek Safar <marek.safar@seznam.cz>
10507 * interface.cs: In all interface classes removed redundant
10508 member initialization.
10510 2004-03-16 Martin Baulig <martin@ximian.com>
10512 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10514 2004-03-15 Miguel de Icaza <miguel@ximian.com>
10516 * decl.cs (DefineTypeAndParents): New helper method to define a
10517 type's containers before the type itself is defined; This is a
10518 bug exposed by the recent changes to Windows.Forms when an
10519 implemented interface was defined inside a class that had not been
10522 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10524 (Check): Loop correctly to report errors modifiers
10525 (UNSAFE was not in the loop, since it was the same as TOP).
10527 * interface.cs: Every interface member now takes a ModFlags,
10528 instead of a "is_new" bool, which we set on the base MemberCore.
10530 Every place where we called "UnsafeOk" in the interface, now we
10531 call the proper member (InterfaceMethod.UnsafeOK) instead to get
10532 the unsafe settings from the member declaration instead of the
10533 container interface.
10535 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
10537 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10538 `set_indexer_name' to the pending bits (one per type).
10540 We fixed a bug today that was picking the wrong method to
10541 override, since for properties the existing InterfaceMethod code
10542 basically ignored the method name. Now we make sure that the
10543 method name is one of the valid indexer names.
10545 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
10547 * support.cs (SeekableStreamReader): Keep track of stream byte
10548 positions and don't mix them with character offsets to the buffer.
10550 Patch from Gustavo Giráldez
10552 2004-03-15 Marek Safar <marek.safar@seznam.cz>
10554 * interface.cs (InterfaceSetGetBase): Removed double member
10555 initialization, base class does it as well.
10557 2004-03-13 Martin Baulig <martin@ximian.com>
10559 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10560 when compiling corlib.
10562 2004-03-13 Miguel de Icaza <miguel@ximian.com>
10564 * convert.cs (ExplicitConversion): We were reporting an error on
10565 certain conversions (object_type source to a value type, when the
10566 expression was `null') before we had a chance to pass it through
10567 the user defined conversions.
10569 * driver.cs: Replace / and \ in resource specifications to dots.
10572 * class.cs: Add check for duplicate operators. Fixes 52477
10574 2004-03-11 Miguel de Icaza <miguel@ximian.com>
10576 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10577 that are in the middle of the statements, not only at the end.
10580 * class.cs (TypeContainer.AddField): No longer set the
10581 `HaveStaticConstructor' flag, now we call it
10582 `UserDefineStaticConstructor' to diferentiate the slightly
10583 semantic difference.
10585 The situation is that we were not adding BeforeFieldInit (from
10586 Modifiers.TypeAttr) to classes that could have it.
10587 BeforeFieldInit should be set to classes that have no static
10592 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10594 And most importantly Zoltan's comment:
10596 http://bugzilla.ximian.com/show_bug.cgi?id=44229
10598 "I think beforefieldinit means 'it's ok to initialize the type sometime
10599 before its static fields are used', i.e. initialization does not need
10600 to be triggered by the first access to the type. Setting this flag
10601 helps the JIT to compile better code, since it can run the static
10602 constructor at JIT time, and does not need to generate code to call it
10603 (possibly lots of times) at runtime. Unfortunately, mcs does not set
10604 this flag for lots of classes like String.
10606 csc sets this flag if the type does not have an explicit static
10607 constructor. The reasoning seems to be that if there are only static
10608 initalizers for a type, and no static constructor, then the programmer
10609 does not care when this initialization happens, so beforefieldinit
10612 This bug prevents the AOT compiler from being usable, since it
10613 generates so many calls to mono_runtime_class_init that the AOT code
10614 is much slower than the JITted code. The JITted code is faster,
10615 because it does not generate these calls if the vtable is type is
10616 already initialized, which is true in the majority of cases. But the
10617 AOT compiler can't do this."
10619 2004-03-10 Miguel de Icaza <miguel@ximian.com>
10621 * class.cs (MethodData.Emit): Refactor the code so symbolic
10622 information is generated for destructors; For some reasons we
10623 were taking a code path that did not generate symbolic information
10626 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
10628 * class.cs: Create a Constructor.CheckBase method that
10629 takes care of all validation type code. The method
10630 contains some code that was moved from Define.
10632 It also includes new code that checks for duplicate ctors.
10633 This fixes bug #55148.
10635 2004-03-09 Joshua Tauberer <tauberer@for.net>
10637 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10638 a { ... }-style array creation invokes EmitStaticInitializers
10639 which is not good for reference-type arrays. String, decimal
10640 and now null constants (NullCast) are not counted toward
10641 static initializers.
10643 2004-03-05 Martin Baulig <martin@ximian.com>
10645 * location.cs (SourceFile.HasLineDirective): New public field;
10646 specifies whether the file contains or is referenced by a "#line"
10648 (Location.DefineSymbolDocuments): Ignore source files which
10649 either contain or are referenced by a "#line" directive.
10651 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
10653 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10654 direct access to our parent, so check the method inline there.
10656 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
10658 * expression.cs (Invocation.EmitCall): Miguel's last commit
10659 caused a regression. If you had:
10664 In Foo the implict this would be null.
10666 2004-02-27 Miguel de Icaza <miguel@ximian.com>
10668 * expression.cs (Invocation.EmitCall): If the method is not
10669 virtual, do not emit a CallVirt to it, use Call.
10671 * typemanager.cs (GetFullNameSignature): Improve the method to
10672 cope with ".ctor" and replace it with the type name.
10674 * class.cs (ConstructorInitializer.Resolve): Now the method takes
10675 as an argument the ConstructorBuilder where it is being defined,
10676 to catch the recursive constructor invocations.
10678 2004-02-26 Miguel de Icaza <miguel@ximian.com>
10680 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10681 routines to check if a type is an enumerable/enumerator allow
10682 classes that implement the IEnumerable or IEnumerator interfaces.
10684 * class.cs (Property, Operator): Implement IIteratorContainer, and
10685 implement SetYields.
10687 (Property.Define): Do the block swapping for get_methods in the
10688 context of iterators. We need to check if Properties also
10689 include indexers or not.
10691 (Operator): Assign the Block before invoking the
10692 OperatorMethod.Define, so we can trigger the Iterator code
10695 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
10696 Property and Operator classes are not created when we parse the
10697 declarator but until we have the block completed, so we use a
10698 singleton SimpleIteratorContainer.Simple to flag whether the
10699 SetYields has been invoked.
10701 We propagate this setting then to the Property or the Operator to
10702 allow the `yield' to function.
10704 2004-02-25 Marek Safar <marek.safar@seznam.cz>
10706 * codegen.cs: Implemented attribute support for modules.
10707 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10708 Assembly/Module functionality.
10710 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10711 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10712 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10714 2004-02-16 Marek Safar <marek.safar@seznam.cz>
10716 * interface.cs (FindMembers): The operation is performed on all base
10717 interfaces and not only on the first. It is required for future CLS Compliance patch.
10719 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
10721 * statement.cs, codegen.cs:
10722 This patch deals with patterns such as:
10724 public class List : IEnumerable {
10726 public MyEnumerator GetEnumerator () {
10727 return new MyEnumerator(this);
10730 IEnumerator IEnumerable.GetEnumerator () {
10734 public struct MyEnumerator : IEnumerator {
10739 Before, there were a few things we did wrong:
10740 1) we would emit callvirt on a struct, which is illegal
10741 2) we emited ldarg when we needed to emit ldarga
10742 3) we would mistakenly call the interface methods on an enumerator
10743 type that derived from IEnumerator and was in another assembly. For example:
10745 public class MyEnumerator : IEnumerator
10747 Would have the interface methods called, even if there were public impls of the
10748 method. In a struct, this lead to invalid IL code.
10750 2004-02-11 Marek Safar <marek.safar@seznam.cz>
10752 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10755 * delegate.cs (Define): Fixed crash when delegate type is undefined.
10757 2004-02-11 Miguel de Icaza <miguel@ximian.com>
10759 * cs-parser.jay: Fix small regression: we were not testing V2
10760 compiler features correctly.
10762 * interface.cs: If the emit context is null, then create one
10764 2004-02-09 Marek Safar <marek.safar@seznam.cz>
10766 * decl.cs (GetSignatureForError): New virtual method to get full name
10767 for error messages.
10769 * attribute.cs (IAttributeSupport): New interface for attribute setting.
10770 Now it is possible to rewrite ApplyAttributes method to be less if/else.
10772 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10773 Duplicated members and code in these classes has been removed.
10774 Better encapsulation in these classes.
10776 2004-02-07 Miguel de Icaza <miguel@ximian.com>
10778 * assign.cs (Assign.DoResolve): When dealing with compound
10779 assignments, there is a new rule in ECMA C# 2.4 (might have been
10780 there before, but it is documented here) that states that in:
10784 If b is of type int, and the `op' is a shift-operator, then the
10785 above is evaluated as:
10789 * expression.cs (Binary.ResolveOperator): Instead of testing for
10790 int/uint/long/ulong, try to implicitly convert to any of those
10791 types and use that in pointer arithmetic.
10793 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10794 method to print information for from the type, not from the
10795 null-method we were given.
10797 2004-02-01 Duncan Mak <duncan@ximian.com>
10799 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10800 parsing for cmd, fixes bug #53694.
10802 2004-02-04 Marek Safar <marek.safar@seznam.cz>
10804 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10805 in the member name duplication tests. Property and operator name duplication
10806 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10808 2004-02-03 Marek Safar <marek.safar@seznam.cz>
10810 * interface.cs (PopulateMethod): Fixed crash when interface method
10811 returns not existing type (error test cs0246-3.cs).
10813 2004-02-02 Ravi Pratap M <ravi@ximian.com>
10815 * cs-parser.jay (interface_accessors): Re-write actions to also
10816 store attributes attached to get and set methods. Fix spelling
10819 (inteface_property_declaration): Modify accordingly.
10821 (InterfaceAccessorInfo): New helper class to store information to pass
10822 around between rules that use interface_accessors.
10824 * interface.cs (Emit): Apply attributes on the get and set
10825 accessors of properties and indexers too.
10827 * attribute.cs (ApplyAttributes): Modify accordingly to use the
10828 right MethodBuilder when applying attributes to the get and set accessors.
10830 2004-01-31 Miguel de Icaza <miguel@ximian.com>
10832 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10834 2004-01-26 Miguel de Icaza <miguel@ximian.com>
10836 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10838 2004-01-25 Miguel de Icaza <miguel@ximian.com>
10840 * cs-parser.jay: Remove YIELD token, instead use the new grammar
10841 changes that treat `yield' specially when present before `break'
10842 or `return' tokens.
10844 * cs-tokenizer.cs: yield is no longer a keyword.
10846 2004-01-23 Marek Safar <marek.safar@seznam.cz>
10848 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10849 setting for default constructors.
10850 For default constructors are almost every time set wrong Modifier. The
10851 generated IL code has been alright. But inside mcs this values was
10852 wrong and this was reason why several of my CLS Compliance tests
10855 2004-01-22 Martin Baulig <martin@ximian.com>
10857 * cs-parser.jay (namespace_or_type_name): Return an Expression,
10858 not a QualifiedIdentifier. This is what `type_name_expression'
10859 was previously doing.
10860 (type_name_expression): Removed; the code is now in
10861 `namespace_or_type_name'.
10862 (qualified_identifier): Removed, use `namespace_or_type_name'
10864 (QualifiedIdentifier): Removed this class.
10866 2004-01-22 Martin Baulig <martin@ximian.com>
10868 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10869 not a string as alias name.
10871 2004-01-21 Miguel de Icaza <miguel@ximian.com>
10873 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10874 #52730 bug, and instead compute correctly the need to use a
10875 temporary variable when requesting an address based on the
10876 static/instace modified of the field and the constructor.
10878 2004-01-21 Martin Baulig <martin@ximian.com>
10880 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10881 class and namespace before looking up aliases. Fixes #52517.
10883 2004-01-21 Martin Baulig <martin@ximian.com>
10885 * flowanalysis.cs (UsageVector.Merge): Allow variables being
10886 assinged in a 'try'; fixes exception4.cs.
10888 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10889 * class.cs : Implemented parameter-less constructor for TypeContainer
10891 * decl.cs: Attributes are now stored here. New property OptAttributes
10893 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10895 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10897 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10899 * typemanager.cs (CSharpSignature): Now reports also inner class name.
10900 (CSharpSignature): New method for indexer and property signature.
10902 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10904 * pending.cs (IsVirtualFilter): Faster implementation.
10906 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10908 * typemanager.cs: Avoid inclusion of same assembly more than once.
10910 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10912 * cs-parser.jay: Fixed problem where the last assembly attribute
10913 has been applied also to following declaration (class, struct, etc.)
10915 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10917 * class.cs: Added error CS0538, CS0539 reporting.
10918 Fixed crash on Microsoft runtime when field type is void.
10920 * cs-parser.jay: Added error CS0537 reporting.
10922 * pending.cs: Added error CS0535 reporting.
10923 Improved error report for errors CS0536, CS0534.
10925 2004-01-20 Miguel de Icaza <miguel@ximian.com>
10927 Merge a few bits from the Anonymous Method MCS tree.
10929 * statement.cs (ToplevelBlock): New class for toplevel methods,
10930 will hold anonymous methods, lifted variables.
10932 * cs-parser.jay: Create toplevel blocks for delegates and for
10933 regular blocks of code.
10935 2004-01-20 Martin Baulig <martin@ximian.com>
10937 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10938 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10939 and `NeedExplicitReturn'; added `IsLastStatement'.
10940 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10941 have a `ReturnLabel' or we're not unreachable.
10943 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10944 child's reachability; don't just override ours with it. Fixes
10945 #58058 (lluis's example).
10946 (FlowBranching): Added public InTryOrCatch(), InCatch(),
10947 InFinally(), InLoop(), InSwitch() and
10948 BreakCrossesTryCatchBoundary() methods.
10950 * statement.cs (Return): Do all error checking in Resolve().
10951 Unless we are the last statement in a top-level block, always
10952 create a return label and jump to it.
10953 (Break, Continue): Do all error checking in Resolve(); also make
10954 sure we aren't leaving a `finally'.
10955 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10956 statement in a top-level block.
10957 (Block.Flags): Added `IsDestructor'.
10958 (Block.IsDestructor): New public property.
10960 2004-01-20 Martin Baulig <martin@ximian.com>
10962 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10964 2004-01-20 Martin Baulig <martin@ximian.com>
10966 * statement.cs (Statement.ResolveUnreachable): New public method.
10967 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10968 (Block.Resolve): Resolve unreachable statements.
10970 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
10972 * expression.cs: We need to fix the case where we do
10973 not have a temp variable here.
10975 * assign.cs: Only expression compound assignments need
10976 temporary variables.
10978 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
10980 * flowanalysis.cs: Reduce memory allocation in a few ways:
10981 - A block with no variables should not allocate a bit
10983 - A method with no out parameters does not need any tracking
10984 for assignment of the parameters, so we need not allocate
10987 public readonly Type[] VariableTypes;
10988 public readonly string[] VariableNames;
10989 Are redundant. The data is already stored in the variable
10990 map, so we need not allocate another array for it.
10991 - We need to add alot of checks for if (params | locals) == null
10992 due to the first two changes.
10994 2004-01-18 Miguel de Icaza <miguel@ximian.com>
10996 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10997 implement IMemoryLocation, we store a copy on a local variable and
10998 take the address of it. Patch from Benjamin Jemlich
11000 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11001 to use a special "type_name_expression" rule which reduces the
11002 number of "QualifiedIdentifier" classes created, and instead
11003 directly creates MemberAccess expressions.
11005 2004-01-17 Miguel de Icaza <miguel@ximian.com>
11007 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11008 that fixes #52853. Null literal assignment to ValueType
11010 * class.cs (MethodData.Emit): Instead of checking the name of the
11011 method to determine if its a destructor, create a new derived
11012 class from Method called Destructor, and test for that.
11014 * cs-parser.jay: Create a Destructor object instead of a Method.
11016 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11020 2004-01-16 Miguel de Icaza <miguel@ximian.com>
11022 * expression.cs (Binary.ResolveOperator): Perform an implicit
11023 conversion from MethodGroups to their delegate types on the
11024 Addition operation.
11026 * delegate.cs: Introduce a new class DelegateCreation that is the
11027 base class for `NewDelegate' and `ImplicitDelegateCreation',
11028 factor some code in here.
11030 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11031 conversion from MethodGroups to compatible delegate types.
11033 * ecore.cs (Expression.Resolve): Do not flag error 654
11034 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11035 we allow conversions from MethodGroups to delegate types now.
11037 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11038 assignments in v2 either.
11040 2004-01-10 Miguel de Icaza <miguel@ximian.com>
11042 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11043 static read-only fields in ctors.
11045 Applied patch from Benjamin Jemlich
11047 * expression.cs (UnaryMutator): Avoid leaking local variables.
11049 2004-01-09 Miguel de Icaza <miguel@ximian.com>
11051 * cs-tokenizer.cs (IsCastToken): Allow the various native types
11052 here to return true, as they can be used like this:
11054 (XXX) int.MEMBER ()
11056 Fixed 49836 and all the other dups
11058 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
11060 * driver.cs: Implement /win32res and /win32icon.
11062 2004-01-08 Miguel de Icaza <miguel@ximian.com>
11064 * cs-parser.jay: Add a rule to improve error handling for the
11065 common mistake of placing modifiers after the type.
11067 2004-01-07 Miguel de Icaza <miguel@ximian.com>
11069 * cs-parser.jay (interface_event_declaration): Catch
11070 initialization of events on interfaces, and report cs0068
11072 * cs-parser.jay (interface_event_declaration): Catch
11073 initialization of events.
11075 * ecore.cs: Better report missing constructors.
11077 * expression.cs (Binary.ResolveOperator): My previous bug fix had
11078 the error reporting done in the wrong place. Fix.
11080 * expression.cs (Binary.ResolveOperator): Catch the
11081 operator + (E x, E y) error earlier, and later allow for implicit
11082 conversions in operator +/- (E e, U x) from U to the underlying
11085 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11086 52596, if the container class is abstract, the default constructor
11087 is protected otherwise its public (before, we were always public).
11089 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11092 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11093 Jemlich that fixes bug #52597, MCS was generating invalid code for
11094 idisposable structs. Thanks to Ben for following up with this
11097 2004-01-06 Miguel de Icaza <miguel@ximian.com>
11099 * driver.cs: Allow assemblies without code to be generated, fixes
11102 2004-01-07 Nick Drochak <ndrochak@gol.com>
11104 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11106 2004-01-05 Miguel de Icaza <miguel@ximian.com>
11108 * cs-parser.jay: Add rules to improve error reporting if fields or
11109 methods are declared at the namespace level (error 116)
11111 * Add rules to catch event add/remove
11113 2004-01-04 David Sheldon <dave-mono@earth.li>
11115 * expression.cs: Added matching ")" to error message for
11118 2004-01-03 Todd Berman <tberman@gentoo.org>
11120 * ecore.cs, attribute.cs:
11121 Applying fix from #52429.
11123 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11125 * ecore.cs, expression.cs, statement.cs:
11126 Total rewrite of how we handle branching. We
11127 now handle complex boolean expressions with fewer
11128 jumps. As well if (x == 0) no longer emits a ceq.
11130 if (x is Foo) is much faster now, because we generate
11133 Overall, we get a pretty big improvement on our benchmark
11134 tests. The code we generate is smaller and more readable.
11136 I did a full two-stage bootstrap. The patch was reviewed
11137 by Martin and Miguel.
11139 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11141 * cs-parser.jay: Make primary_expression not take a QI.
11142 we dont need this because the member_access rule covers
11143 us here. So we replace the rule with just IDENTIFIER.
11145 This has two good effects. First, we remove a s/r conflict.
11146 Second, we allocate many fewer QualifiedIdentifier objects.
11148 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11150 * attribute.cs: Handle MarshalAs attributes as pseudo, and
11151 set the correct information via SRE. This prevents
11152 hanging on the MS runtime. Fixes #29374.
11154 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11156 * convert.cs: correctly handle conversions to value types
11157 from Enum and ValueType as unboxing conversions.
11159 Fixes bug #52569. Patch by Benjamin Jemlich.
11161 2004-01-02 Ravi Pratap <ravi@ximian.com>
11163 * expression.cs (BetterConversion): Prefer int -> uint
11164 over int -> ulong (csc's behaviour). This fixed bug #52046.
11166 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
11168 * decl.cs (MemberCache.FindMembers): now returns a
11171 * typemanager.cs: In general, go with with ^^.
11172 (CopyNewMethods): take an IList.
11173 (RealMemberLookup): Only allocate an arraylist
11174 if we copy from two sets of methods.
11176 This change basically does two things:
11177 1) Fewer array lists allocated due to CopyNewMethods.
11178 2) the explicit cast in MemberList costed ALOT.
11180 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
11182 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11183 a hashtable to avoid needless string allocations when an identifier is
11184 used more than once (the common case).
11186 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11188 * pending.cs: MS's TypeBuilder.GetInterfaces ()
11189 is broken, it will not return anything. So, we
11190 have to use the information we have in mcs to
11193 * typemanager.cs: Add a cache for GetInterfaces,
11194 since this will now be used more often (due to ^^)
11196 (GetExplicitInterfaces) New method that gets the
11197 declared, not effective, interfaces on a type
11198 builder (eg, if you have interface IFoo, interface
11199 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11202 This patch makes MCS able to bootstrap itself on
11205 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11207 * expression.cs: Remove the Nop's that Miguel put
11210 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11212 * report.cs, codegen.cs: Give the real stack trace to
11213 the error when an exception is thrown.
11215 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11217 * decl.cs: only allocate hashtables for ifaces if
11220 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11222 * expression.cs: fix the error from cs0121-2.cs
11223 (a parent interface has two child interfaces that
11224 have a function with the same name and 0 params
11225 and the function is called through the parent).
11227 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
11229 * class.cs, rootcontext.cs, typmanager.cs: do not
11232 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
11234 * codegen.cs: remove stack for the ec flow branching.
11235 It is already a linked list, so no need.
11237 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
11239 * Makefile: Allow custom profiler here.
11241 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11243 * typemanager.cs (LookupType):
11244 - Use a static char [], because split takes
11245 a param array for args, so it was allocating
11247 - Do not store true in a hashtable, it boxes.
11249 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11251 * flowanalysis.cs: bytify common enums.
11253 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11255 * modifiers.cs: Add a new set of flags for the
11256 flags allowed on explicit interface impls.
11257 * cs-parser.jay: catch the use of modifiers in
11258 interfaces correctly.
11259 * class.cs: catch private void IFoo.Blah ().
11261 All related to bug #50572.
11263 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11265 * decl.cs: Rewrite the consistant accessability checking.
11266 Accessability is not linear, it must be implemented in
11267 a tableish way. Fixes #49704.
11269 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11271 * expression.cs: Handle negation in a checked context.
11272 We must use subtraction from zero. Fixes #38674.
11274 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11276 * class.cs: Ignore static void main in DLLs.
11277 * rootcontext.cs: Handle the target type here,
11278 since we are have to access it from class.cs
11279 * driver.cs: account for the above.
11281 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11283 * report.cs: Give line numbers and files if available.
11285 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
11287 * driver.cs: Implement /addmodule.
11289 * typemanager.cs: Change 'modules' field so it now contains Modules not
11292 2003-12-20 Martin Baulig <martin@ximian.com>
11294 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11295 (FieldBase.IsAssigned): Removed this field.
11296 (FieldBase.SetAssigned): New public method.
11297 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11299 2003-12-20 Martin Baulig <martin@ximian.com>
11301 * expression.cs (LocalVariableReference.DoResolve): Don't set
11302 `vi.Used' if we're called from DoResolveLValue().
11304 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11305 returns the usage vector it just merged into the current one -
11306 pass this one to UsageWarning().
11307 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11308 of the `EmitContext', don't call this recursively on our children.
11310 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
11312 * driver.cs: Implement /target:module.
11314 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
11316 * support.cs (CharArrayHashtable): New helper class.
11318 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
11319 char arrays, not strings, so we can avoid creating a string in
11320 consume_identifier if the identifier is a keyword.
11322 2003-12-16 Martin Baulig <martin@ximian.com>
11324 * statement.cs (LocalInfo.Assigned): Removed this property.
11325 (LocalInfo.Flags): Removed `Assigned'.
11326 (LocalInfo.IsAssigned): New public method; takes the EmitContext
11327 and uses flow analysis.
11328 (Block.UsageWarning): Made this method private.
11329 (Block.Resolve): Call UsageWarning() if appropriate.
11331 * expression.cs (LocalVariableReference.DoResolve): Always set
11332 LocalInfo.Used here.
11334 2003-12-13 Martin Baulig <martin@ximian.com>
11336 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11337 any value here; we're now using flow analysis to figure out
11338 whether a statement/block returns a value.
11340 2003-12-13 Martin Baulig <martin@ximian.com>
11342 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11344 (FlowBranching.MergeFinally): Don't call
11345 `branching.CheckOutParameters()' here, this is called in
11347 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11348 when adding the `finally' vector.
11350 2003-12-13 Martin Baulig <martin@ximian.com>
11353 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11354 actually work and also fix #48962.
11356 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
11358 * decl.cs: Do not check System.Object for nested types,
11359 since we know it does not have any. Big bang for buck:
11362 Run 1: 8.35 seconds
11363 Run 2: 8.32 seconds
11364 corlib: 17.99 seconds
11366 Run 1: 8.17 seconds
11367 Run 2: 8.17 seconds
11368 corlib: 17.39 seconds
11370 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
11372 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11373 time we are returning 0 members, so we save alot here.
11375 2003-12-11 Martin Baulig <martin@ximian.com>
11377 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11378 `MergeChild()', also just take the `FlowBranching' as argument;
11379 call Merge() on it and return the result.
11380 (FlowBranching.Merge): We don't need to do anything if we just
11383 2003-12-11 Martin Baulig <martin@ximian.com>
11385 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11386 them in an `ArrayList' to reduce memory usage. Thanks to Ben
11387 Maurer for this idea.
11389 2003-12-11 Martin Baulig <martin@ximian.com>
11391 * flowanalysis.cs (MergeResult): This class is now gone; we now
11392 use the `UsageVector' for this. The reason for this is that if a
11393 branching just has one sibling, we don't need to "merge" them at
11394 all - that's the next step to do.
11395 (FlowBranching.Merge): We now return a `UsageVector' instead of a
11398 2003-12-11 Martin Baulig <martin@ximian.com>
11400 Reworked flow analyis and made it more precise and bug-free. The
11401 most important change is that we're now using a special `Reachability'
11402 class instead of having "magic" meanings of `FlowReturns'. I'll
11403 do some more cleanups and optimizations and also add some more
11404 documentation this week.
11406 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11407 largely reworked this class.
11408 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11409 the new `Reachability' class instead of having "magic" values here.
11410 (FlowBranching): We're now using an instance of `Reachability'
11411 instead of having separate `Returns', `Breaks' etc. fields.
11413 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11414 based on flow analysis; ignore the return value of block.Emit ().
11416 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
11418 * driver.cs typemanager.cs: Find the mono extensions to corlib even
11419 if they are private.
11421 2003-12-09 Martin Baulig <martin@ximian.com>
11423 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11424 call them directly on the UsageVector.
11426 2003-12-09 Martin Baulig <martin@ximian.com>
11428 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11429 Changed return type from `FlowReturns' to `Reachability'.
11431 2003-12-09 Martin Baulig <martin@ximian.com>
11433 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11434 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11435 `Reachable' fields with a single `Reachability' one.
11437 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11439 * class.cs (FindMembers): Remove foreach's.
11444 Run 1: 8.74 seconds
11445 Run 2: 8.71 seconds
11448 Run 1: 8.64 seconds
11449 Run 2: 8.58 seconds
11452 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11457 This patch does a few things:
11458 1. EmptyStatement is now a singleton, so it is never reallocated.
11459 2. All blah is EmptyStatement constructs have been changed to
11460 blah == EmptyStatement.Value, which is much faster and valid
11461 now that EmptyStatement is a singleton.
11462 3. When resolving a block, rather than allocating a new array for
11463 the non-empty statements, empty statements are replaced with
11464 EmptyStatement.Value
11465 4. Some recursive functions have been made non-recursive.
11466 Mainly the performance impact is from (3), however (1) and (2) are needed for
11467 this to work. (4) does not make a big difference in normal situations, however
11468 it makes the profile look saner.
11473 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11474 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11475 Total memory allocated: 56397 KB
11478 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11479 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11480 Total memory allocated: 55666 KB
11482 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11484 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11485 than the hashtable in a hashtable version
11487 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11488 we always end up concating a string. This results in a huge perf
11489 loss, because many strings have to be tracked by the GC. In this
11490 patch, we first use a hashtable that works with two keys, so that
11491 the strings do not need to be concat'ed.
11495 Run 1: 8.74 seconds
11496 Run 2: 8.71 seconds
11499 Run 1: 8.65 seconds
11500 Run 2: 8.56 seconds
11502 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11504 * Makefile: Add a new target `do-time' that does a quick and simple
11505 profile, leaving easy to parse output.
11507 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
11509 * codegen.cs (Init): Create the dynamic assembly with
11510 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11512 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
11514 * support.cs: Make the PtrHashtable use only one
11515 instance of its comparer.
11517 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
11519 * typemanager.cs: Fix lookup of GetNamespaces.
11521 2003-11-29 Miguel de Icaza <miguel@ximian.com>
11523 * expression.cs: Removed redundant line.
11525 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11526 ArrayLists, use for loops with bounds.
11528 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11531 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11532 arraylists, use for loop with bounds.
11534 The above three changes give us a 0.071 second performance
11535 improvement out of 3.294 seconds down to 3.223. On my machine
11536 the above changes reduced the memory usage by 1,387 KB during
11537 compiler bootstrap.
11539 * cs-parser.jay (QualifiedIdentifier): New class used to represent
11540 QualifiedIdentifiers. Before we created a new string through
11541 concatenation, and mostly later on, the result would be
11542 manipulated by DecomposeQI through string manipulation.
11544 This reduced the compiler memory usage for bootstrapping from
11545 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11546 compile times in 0.05 seconds.
11548 2003-11-28 Dick Porter <dick@ximian.com>
11550 * support.cs: Do string compares with the Invariant culture.
11558 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11559 the comparison is done with the Invariant culture.
11561 2003-11-27 Miguel de Icaza <miguel@ximian.com>
11563 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11564 GetEnumerator method.
11566 (ProbeCollectionType): Iterate starting at the most specific type
11567 upwards looking for a GetEnumerator
11569 * expression.cs: Shift count can be up to 31 for int/uint and 63
11572 2003-11-26 Miguel de Icaza <miguel@ximian.com>
11574 * statement.cs (Block.LookupLabel): Also look for the label on the
11575 children blocks. Use a hash table to keep track of visited
11578 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11579 we actually did transform the other operand, otherwise fall back
11580 to the common codepath that casts to long.
11582 * cs-tokenizer.cs: Use the same code pattern as the int case.
11583 Maybe I should do the parsing myself, and avoid depending on the
11584 Parse routines to get this done.
11586 2003-11-25 Miguel de Icaza <miguel@ximian.com>
11588 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11589 which fixes bug 51347. This time test it.
11591 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11592 attributes for example can not tell the difference between these.
11593 The difference was only a syntax feature of the language.
11595 * attribute.cs: Apply attributes to delegates.
11597 * delegate.cs: Call the apply attributes method.
11599 2003-11-24 Miguel de Icaza <miguel@ximian.com>
11601 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11602 comparing 0 vs Byte.MinValue, not the value
11604 (ImplicitConversionRequired): When reporting a conversion error,
11605 use error 31 to print out the constant error instead of the
11608 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11609 which fixes bug 51347.
11611 2003-11-22 Miguel de Icaza <miguel@ximian.com>
11613 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
11614 which fixes the -warnaserror command line option.
11616 2003-11-21 Miguel de Icaza <miguel@ximian.com>
11618 * cfold.cs (DoNumericPromotions): During constant folding of
11619 additions on UIntConstant, special case intconstants with
11620 IntConstants like we do on the expression binary operator.
11622 2003-11-12 Miguel de Icaza <miguel@ximian.com>
11624 * convert.cs (ImplicitReferenceConversion): We were missing a case
11625 (System.Enum are not value types or class types, so we need to
11626 classify them separatedly).
11628 * driver.cs: We do not support error 2007.
11630 2003-11-12 Jackson Harper <jackson@ximian.com>
11632 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11633 system directory. Also use the full file name so users can
11634 libraries names mscorlib-o-tron.dll in a non system dir.
11636 2003-11-10 Martin Baulig <martin@ximian.com>
11638 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11639 (TypeManager.InitCoreTypes): Initialize them here, but instead of
11640 calling `ResolveType()' on them, directly assign their `Type'.
11642 2003-11-08 Martin Baulig <martin@ximian.com>
11644 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11645 return value and the `out parent' parameter.
11646 (TypeContainer.DefineType): Moved the CS0644 check into
11647 GetClassBases(). Don't pass the interface types to the
11648 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11649 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11651 * ecore.cs (TypeExpr.IsAttribute): New property.
11652 (TypeExpr.GetInterfaces): New method.
11654 * interface.cs (Interface.GetInterfaceTypeByName): Return a
11655 TypeExpr instead of a Type.
11656 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11657 (Interface.DefineType): Don't pass the interface types to the
11658 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11659 them later and then call `TypeBulider.AddInterfaceImplementation()'.
11661 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11662 instead of a `Type[]'.
11663 (TypeManager.RegisterBuilder): Likewise.
11664 (TypeManager.AddUserInterface): Likewise.
11665 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11666 `Type[]' and also return a `TypeExpr[]'.
11667 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11669 2003-11-08 Martin Baulig <martin@ximian.com>
11671 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11674 2003-11-08 Martin Baulig <martin@ximian.com>
11676 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11677 TypeManager.ResolveExpressionTypes().
11679 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11680 instead of an Expression.
11681 (TypeExpr): This is now an abstract base class for `TypeExpression'.
11682 (TypeExpression): New public class; formerly known as `TypeExpr'.
11684 * expression.cs (ComposedCast): Derive from TypeExpr.
11686 * typemanager.cs (TypeManager.system_*_expr): These are now
11687 TypExpr's instead of Expression's.
11688 (TypeManager.ResolveExpressionTypes): New public static function;
11689 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11692 2003-11-06 Miguel de Icaza <miguel@ximian.com>
11694 * expression.cs (New.DoResolve): Do not dereference value that
11695 might be a null return.
11697 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11698 sure that the constant value has the right type. Fixes an
11699 unreported bug, similar to 50425.
11701 * const.cs (Const.LookupConstantValue): Call
11702 ImplicitStandardConversionExists before doing a conversion to
11703 avoid havng the TypeManager.ChangeType do conversions.
11705 Reduced the number of casts used
11707 (Const.ChangeType): New routine to enable reuse of the constant
11708 type changing code from statement.
11710 * typemanager.cs (ChangeType): Move common initialization to
11711 static global variables.
11715 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11716 every value type to go through, even if it was void. Fix that.
11718 * cs-tokenizer.cs: Use is_identifier_start_character on the start
11719 character of the define, and the is_identifier_part_character for
11720 the rest of the string.
11722 2003-11-05 Miguel de Icaza <miguel@ximian.com>
11724 * expression.cs (UnaryMutator.EmitCode): When I updated
11725 LocalVariableReference.DoResolve, I overdid it, and dropped an
11726 optimization done on local variable references.
11728 2003-11-04 Miguel de Icaza <miguel@ximian.com>
11730 * ecore.cs: Convert the return from Ldlen into an int.
11732 2003-10-20 Miguel de Icaza <miguel@ximian.com>
11734 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11735 the accessibility, this is a special case for toplevel non-public
11736 classes (internal for instance).
11738 2003-10-20 Nick Drochak <ndrochak@gol.com>
11740 * ecore.cs: Fix typo and build. Needed another right paren.
11742 2003-10-19 Miguel de Icaza <miguel@ximian.com>
11744 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
11745 `internal' case regular and protected, but not allowing protected
11746 to be evaluated later. Bug 49840
11748 2003-10-15 Miguel de Icaza <miguel@ximian.com>
11750 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11751 to kb.Nlast, and not the kb.nFirst to isolate the switch
11754 Extract the underlying type, so enumerations of long/ulong are
11755 treated like long/ulong.
11757 2003-10-14 Miguel de Icaza <miguel@ximian.com>
11759 * expression.cs (New): Overload the meaning of RequestedType to
11760 track the possible creation of the NewDelegate type, since
11761 DoResolve is invoked more than once for new constructors on field
11764 See bugs: #48800 and #37014
11766 * cs-parser.jay (declare_local_constants): Take an arraylist
11767 instead of a single constant.
11769 (local_constant_declaration): It should take a
11770 constant_declarators, not a constant_declarator. Fixes 49487
11772 * convert.cs: Fix error report.
11774 2003-10-13 Jackson Harper <jackson@ximian.com>
11776 * typemanager.cs (TypeToCoreType): Add float and double this fixes
11779 2003-10-09 Martin Baulig <martin@ximian.com>
11781 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11783 (MethodCore.DoDefineParameters): Removed the TypeContainer
11784 argument; use the DeclSpace which was passed to the .ctor instead.
11785 (MethodCore.CheckParameter): Take a DeclSpace instead of a
11786 TypeContainer; we only need a DeclSpace here.
11788 2003-10-09 Martin Baulig <martin@ximian.com>
11790 * class.cs (MethodData): Added additional `DeclSpace ds' argument
11792 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11793 EmitContext's .ctor.
11795 2003-10-09 Martin Baulig <martin@ximian.com>
11797 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11798 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11799 AsAccessible(), moved them as well.
11801 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11803 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11805 * cs-parser.jay : Renamed yyName to yyNames related to jay.
11807 2003-10-07 Miguel de Icaza <miguel@ximian.com>
11809 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11810 generation for >=, as spotted by Paolo, bug 48679.
11811 Patch from David Waite.
11813 * cs-tokenizer.cs: Add handling for #pragma.
11815 * cs-parser.jay: Allow for both yield and yield return in the
11816 syntax. The anti-cobolization of C# fight will go on!
11818 * class.cs (TypeBuilder.DefineType): Catch error condition here
11819 (Parent.DefineType erroring out and returning null).
11821 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11822 coping with enumerations variables, we were mistakenly processing
11823 them as a regular value type instead of built-in types. Fixes the
11826 * typemanager.cs (IsBuiltinOrEnum): New method.
11828 2003-09-30 Miguel de Icaza <miguel@ximian.com>
11830 * cs-parser.jay: Upgrade: yield now needs the return clause.
11832 2003-09-19 Martin Baulig <martin@ximian.com>
11834 * decl.cs (MemberCache.SetupCacheForInterface): Take a
11835 `MemberCache parent' argument. Normally, an interface doesn't
11836 have a parent type except System.Object, but we use this in gmcs
11837 for generic type parameters.
11839 2003-09-18 Martin Baulig <martin@ximian.com>
11841 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11842 on `type.IsInterface'; don't check whether the type has a parent
11843 to determine whether it's an interface.
11845 2003-09-15 Martin Baulig <martin@ximian.com>
11847 * class.cs (TypeContainer.DefineType): Added an error flag to
11848 avoid reporting duplicate CS0146's ("class definition is
11851 * driver.cs (Driver.MainDriver): Abort if
11852 RootContext.ResolveTree() reported any errors.
11854 2003-09-07 Martin Baulig <martin@ximian.com>
11856 * report.cs (Error, Warning): Added overloaded versions which take
11857 a `params object[] args' and call String.Format().
11859 2003-09-07 Martin Baulig <martin@ximian.com>
11861 * decl.cs (DeclSpace..ctor): Don't call
11862 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11863 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
11864 (DeclSpace.RecordDecl): New method.
11866 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11868 2003-09-02 Ravi Pratap <ravi@ximian.com>
11870 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11871 value attributes to be applied to ParameterBuilders.
11873 * class.cs (MethodCore.LabelParameters): Make static and more
11874 generic so that it can be used from other places - like interface
11875 methods, for instance.
11877 * interface.cs (Interface.Emit): Call LabelParameters before
11878 emitting attributes on the InterfaceMethod.
11880 2003-08-26 Martin Baulig <martin@ximian.com>
11882 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11883 resolving aliases; fixes #47927.
11885 2003-08-26 Martin Baulig <martin@ximian.com>
11887 * statement.cs (Using.DoResolve): This is internally emitting a
11888 try/finally clause, so we need to set ec.NeedExplicitReturn if we
11889 do not always return. Fixes #47681.
11891 2003-08-26 Martin Baulig <martin@ximian.com>
11893 * decl.cs (MemberCore): Moved WarningNotHiding(),
11894 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11896 (AdditionResult): Make this nested in DeclSpace.
11897 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11898 argument; call NamespaceEntry.Define() unless we're nested in a
11901 * namespace.cs (Namespace.DefineName): New public function. This
11902 is called from DeclSpace's .ctor to add
11903 (Namespace.Lookup): Include DeclSpaces in the lookup.
11905 * class.cs (Operator): Derive from MemberBase, not MemberCore.
11907 * const.cs (Const): Derive from MemberBase, not MemberCore.
11909 2003-08-25 Martin Baulig <martin@ximian.com>
11911 * convert.cs (Convert.ExplicitReferenceConversion): When
11912 converting from an interface type to a class, unbox if the target
11913 type is a struct type. Fixes #47822.
11915 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11917 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11920 2003-08-22 Martin Baulig <martin@ximian.com>
11922 * class.cs (TypeManager.DefineType): When defining a nested type,
11923 call DefineType() on our parent; fixes #47801.
11925 2003-08-22 Martin Baulig <martin@ximian.com>
11927 * class.cs (MethodData.Define): While checking if a method is an
11928 interface implementation, improve the test a bit more to fix #47654.
11930 2003-08-22 Martin Baulig <martin@ximian.com>
11932 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11933 correctly; fixes #47722.
11935 2003-08-22 Martin Baulig <martin@ximian.com>
11937 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11938 LocalVariableReference, ensure it's not read-only. Fixes #47536.
11940 * statement.cs (Fixed.DoResolve): Make all variables read-only.
11942 2003-08-22 Martin Baulig <martin@ximian.com>
11944 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11945 can only be assigned in static constructors. Fixes #47161.
11947 2003-08-22 Martin Baulig <martin@ximian.com>
11949 Rewrote and improved the flow analysis code.
11951 * flowbranching.cs (FlowBranching): Make this class abstract.
11952 (FlowBranching.CreateBranching): New static function to create a
11953 new flow branching.
11954 (FlowBranchingBlock, FlowBranchingException): New classes.
11955 (FlowBranching.UsageVector.Type): New public readonly field.
11956 (FlowBranching.UsageVector.Breaks): Removed the setter.
11957 (FlowBranching.UsageVector.Returns): Removed the setter.
11958 (FlowBranching.UsageVector): Added Break(), Return(),
11959 NeverReachable() and Throw() methods to modify the reachability.
11960 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11961 done by FlowBranching.Merge().
11962 (FlowBranching.UsageVector.MergeChild): New method; merges the
11963 merge result into the current vector.
11964 (FlowBranching.Merge): New abstract method to merge a branching.
11966 2003-08-12 Martin Baulig <martin@ximian.com>
11968 * expression.cs (Indirection.CacheTemporaries): Create the
11969 LocalTemporary with the pointer type, not its element type.
11971 2003-08-10 Miguel de Icaza <miguel@ximian.com>
11973 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11974 token was a keyword or not.
11976 Add `error' options where an IDENTIFIER was expected; Provide
11977 CheckToken and CheckIdentifierToken convenience error reporting
11980 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11982 * decl.cs: Rename `NamespaceEntry Namespace' public field into
11983 NameSpaceEntry NameSpaceEntry.
11985 (LookupInterfaceOrClass): Avoid creating a full qualified name
11986 from namespace and name: avoid doing lookups when we know the
11987 namespace is non-existant. Use new Tree.LookupByNamespace which
11988 looks up DeclSpaces based on their namespace, name pair.
11990 * driver.cs: Provide a new `parser verbose' to display the
11991 exception thrown during parsing. This is turned off by default
11992 now, so the output of a failure from mcs is more graceful.
11994 * namespace.cs: Track all the namespaces defined in a hashtable
11997 (IsNamespace): New method
11999 2003-08-09 Miguel de Icaza <miguel@ximian.com>
12001 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
12002 we know that we need to concatenate (full typename can never be
12007 * statement.cs: Use a bitfield; Do not initialize to null things
12008 which are done by the constructor by default.
12010 * cs-parser.jay: bug fix, parameter was 4, not 3.
12012 * expression.cs: Just use the property;
12014 * statement.cs: No need for GetVariableInfo method.
12016 2003-08-08 Martin Baulig <martin@ximian.com>
12018 * flowanalysis.cs (FlowReturns): This is now nested in the
12019 `FlowBranching' class.
12020 (MyBitVector): Moved this here from statement.cs.
12021 (FlowBranching.SiblingType): New enum type.
12022 (FlowBranching.CreateSibling): Added `SiblingType' argument.
12024 2003-08-07 Martin Baulig <martin@ximian.com>
12026 * flowanalysis.cs (FlowBranchingType): This is now nested in the
12027 `FlowBranching' class and called `BranchingType'.
12029 2003-08-07 Martin Baulig <martin@ximian.com>
12031 * flowanalysis.cs: Moved all the control flow analysis code into
12034 2003-08-07 Martin Baulig <martin@ximian.com>
12036 * assign.cs (Assign.DoResolve): `target' must either be an
12037 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
12040 2003-08-07 Miguel de Icaza <miguel@ximian.com>
12042 * expression.cs (BinaryMethod): This kind of expression is created by the
12043 Binary class if it determines that the operator has to be handled
12046 (BinaryDelegate): This kind of expression is created if we are
12047 dealing with a + or - operator on delegates.
12049 (Binary): remove method, argumetns, and DelegateOperator: when
12050 dealing with methods,
12052 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
12054 * statement.cs (Block): use bitfields for the three extra booleans
12055 we had in use. Remove unused topblock parameter.
12057 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
12059 * assign.cs: Drop extra unneeded tests.
12061 2003-08-06 Miguel de Icaza <miguel@ximian.com>
12063 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
12065 * statement.cs (Foreach): Use VariableStorage instead of
12068 * codegen.cs (VariableStorage): New class used by clients that
12069 require a variable stored: locals or fields for variables that
12070 need to live across yield.
12072 Maybe provide a convenience api for EmitThis+EmitLoad?
12074 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
12077 2003-08-05 Miguel de Icaza <miguel@ximian.com>
12079 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
12080 RemapParameterLValue): New methods that are used to turn a
12081 precomputed FieldInfo into an expression like this:
12085 The idea is to use this instead of making LocalVariableReference
12086 have more than one meaning.
12088 * cs-parser.jay: Add error production to BASE.
12090 * ecore.cs: Deal with TypeManager.GetField returning null, which
12091 is now a valid return value.
12093 (FieldExprNoAddress): New expression for Fields whose address can
12096 * expression.cs (LocalVariableReference): During the resolve
12097 phases, create new expressions if we are in a remapping context.
12098 Remove code that dealt with remapping here.
12100 (ParameterReference): same.
12102 (ProxyInstance): New expression, like the `This' expression, but
12103 it is born fully resolved. We know what we are doing, so remove
12104 the errors that are targeted to user-provided uses of `this'.
12106 * statement.cs (Foreach): our variable is now stored as an
12107 Expression; During resolution, follow the protocol, dont just
12108 assume it will return this.
12110 2003-08-06 Martin Baulig <martin@ximian.com>
12112 * support.cs (SeekableStreamReader.cs): New public class.
12114 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
12115 SeekableStreamReader instead of the normal StreamReader.
12117 2003-08-04 Martin Baulig <martin@ximian.com>
12119 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
12120 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
12121 deambiguate casts and delegate invocations.
12122 (parenthesized_expression): Use the new tokens to ensure this is
12123 not a cast of method invocation.
12125 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
12126 when reading a `)' and Deambiguate_CloseParens () was previously
12129 * expression.cs (ParenthesizedExpression): New class. This is
12130 just used for the CS0075 test.
12131 (Binary.DoResolve): Check for CS0075.
12133 2003-07-29 Ravi Pratap <ravi@ximian.com>
12135 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
12136 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
12137 reference comparison.
12139 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
12140 examine the ReturnType for equality - this is necessary in the
12141 cases of implicit and explicit operators whose signature also
12142 includes the return type.
12144 2003-07-26 Miguel de Icaza <miguel@ximian.com>
12146 * namespace.cs: Cache the result of the namespace computation,
12147 instead of computing it every time.
12149 2003-07-24 Miguel de Icaza <miguel@ximian.com>
12151 * decl.cs: Use a global arraylist that we reuse over invocations
12152 to avoid excesive memory consumption. Reduces memory usage on an
12153 mcs compile by one meg (45 average).
12155 * typemanager.cs (LookupTypeReflection): In .NET pointers are
12156 private, work around that.
12158 2003-07-23 Miguel de Icaza <miguel@ximian.com>
12160 * literal.cs (IntLiteral): Define Zero and One static literals.
12162 * cs-parser.jay (integer_literal): use static literals to reduce
12163 memory usage for the most used literals (0, 1 and -1). 211kb
12164 reduced in memory usage.
12166 Replace all calls to `new ArrayList' with `new
12167 ArrayList(4)' which is a good average number for most allocations,
12168 and also requires only 16 bytes of memory for its buffer by
12171 This reduced MCS memory usage in seven megabytes for the RSS after
12174 2003-07-28 Ravi Pratap <ravi@ximian.com>
12176 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
12177 handle params methods the correct way by forming only one
12178 applicable set with params and normal methods in them. Earlier we
12179 were looking at params methods only if we found no normal methods
12180 which was not the correct thing to do.
12182 (Invocation.BetterFunction): Take separate arguments indicating
12183 when candidate and the best method are params methods in their
12186 This fixes bugs #43367 and #46199.
12188 * attribute.cs: Documentation updates.
12190 (CheckAttribute): Rename to CheckAttributeTarget.
12191 (GetValidPlaces): Rename to GetValidTargets.
12193 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
12194 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
12198 2003-07-28 Martin Baulig <martin@ximian.com>
12200 * class.cs (TypeContainer.DefineMembers): Use the base type's full
12201 name when looking up the base class of a nested class. Fixes #46977.
12203 2003-07-26 Martin Baulig <martin@ximian.com>
12205 * expression.cs (Indexers.Indexer): New nested struct; contains
12206 getter, setter and the indexer's type.
12207 (Indexers.Properties): This is now an ArrayList of
12208 Indexers.Indexer's.
12209 (IndexerAccess.DoResolveLValue): Correctly set the type if the
12210 indexer doesn't have any getters.
12212 * assign.cs (Assign.DoResolve): Also do the implicit conversions
12213 for embedded property and indexer assignments.
12215 2003-07-26 Martin Baulig <martin@ximian.com>
12217 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
12218 preprocessor directive is not the first non-whitespace character
12221 2003-07-26 Martin Baulig <martin@ximian.com>
12223 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
12224 namespace parsing, follow the spec more closely.
12226 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
12227 NamespaceEntry.Lookup().
12229 2003-07-25 Martin Baulig <martin@ximian.com>
12231 * MethodCore.cs (OverridesSomething): New public field; it's set
12232 from TypeContainer.DefineMembers if this method overrides
12233 something (which doesn't need to be a method). Fix #39462.
12235 2003-07-25 Ravi Pratap <ravi@ximian.com>
12237 * typemanager.cs (GetMembers): Ensure that the list of members is
12238 reversed. This keeps things in sync.
12240 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
12241 find an AttributeUsage attribute.
12243 * expression.cs (Invocation.OverloadResolve): Perform the check
12244 which disallows Invoke to be directly called on a Delegate.
12246 (Error_InvokeOnDelegate): Report error cs1533.
12248 2003-07-25 Martin Baulig <martin@ximian.com>
12250 * expression.cs (Indexers.GetIndexersForType): Only look in the
12251 interface hierarchy if the requested type is already an
12252 interface. Fixes #46788 while keeping #46502 fixed.
12254 2003-07-25 Martin Baulig <martin@ximian.com>
12256 * class.cs (TypeContainer.DefineMembers): Check whether all
12257 readonly fields have been assigned and report warning CS0649 if
12260 * statement.cs (LocalInfo.IsFixed): Always return true if this is
12263 2003-07-24 Ravi Pratap <ravi@ximian.com>
12265 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
12266 returned from GetMethods to make things consistent with the
12267 assumptions MCS makes about ordering of methods.
12269 This should comprehensively fix bug #45127 and it does :-)
12271 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
12272 ordering is actually reverse.
12274 * Clean up some debug messages I left lying around.
12276 * interface.cs (Populate*): Get rid of code which emits attributes
12277 since the stage in which we emit attributes is the 'Emit' stage,
12278 not the define stage.
12280 (Emit): Move attribute emission for interface members here.
12282 2003-07-22 Ravi Pratap <ravi@ximian.com>
12284 * expression.cs (Invocation.OverloadResolve): Follow the spec more
12285 closely: we eliminate methods in base types when we have an
12286 applicable method in a top-level type.
12288 Please see section 14.5.5.1 for an exact description of what goes
12291 This fixes bug #45127 and a host of other related to corlib compilation.
12293 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12294 array is the method corresponding to the top-level type (this is
12295 because of the changes made to icall.c) so we change this
12298 (MethodGroupExpr.Name): This too.
12300 * typemanager.cs (GetElementType): New method which does the right
12301 thing when compiling corlib.
12303 * everywhere: Make use of the above in the relevant places.
12305 2003-07-22 Martin Baulig <martin@ximian.com>
12307 * cs-parser.jay (invocation_expression): Moved
12308 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12309 `cast_expression', but create a InvocationOrCast which later
12310 resolves to either an Invocation or a Cast.
12312 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12313 method; call this before EmitStatement() to make sure that this
12314 expression can be used as a statement.
12316 * expression.cs (InvocationOrCast): New class; resolves to either
12317 an Invocation or a Cast.
12319 * statement.cs (StatementExpression): Call ResolveStatement() on
12320 the ExpressionStatement before emitting it.
12322 2003-07-21 Martin Baulig <martin@ximian.com>
12324 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12325 `ref' and `out' attributes match; fixes #46220.
12326 (MemberAccess.ResolveMemberAccess): You can't reference a type
12327 through an expression; fixes #33180.
12328 (Indexers.GetIndexersForType): Don't return the indexers from
12329 interfaces the class implements; fixes #46502.
12331 2003-07-21 Martin Baulig <martin@ximian.com>
12333 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12334 CS0661 checks; fixes bug #30442.
12336 2003-07-21 Martin Baulig <martin@ximian.com>
12338 * decl.cs (AdditionResult): Added `Error'.
12340 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12342 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
12343 makes cs0031.cs actually work.
12345 2003-07-20 Martin Baulig <martin@ximian.com>
12347 * namespace.cs: Fixed that bug which caused a crash when compiling
12348 the debugger's GUI.
12350 2003-07-20 Miguel de Icaza <miguel@ximian.com>
12352 * typemanager.cs (LookupTypeReflection): Never expose types which
12353 are NotPublic, NestedPrivate, NestedAssembly, or
12354 NestedFamANDAssem. We used to return these, and later do a check
12355 that would report a meaningful error, but the problem is that we
12356 would not get the real match, if there was a name override.
12358 2003-07-18 Miguel de Icaza <miguel@ximian.com>
12360 * namespace.cs (Namespace, Name): Do not compute the namespace
12361 name dynamically, compute it in the constructor. This reduced
12362 memory usage by 1697 KB.
12364 * driver.cs: Use --pause to pause at the end.
12366 2003-07-17 Peter Williams <peter@newton.cx>
12368 * Makefile: Change the name of the test target so that it doesn't
12369 conflict with the recursive test target.
12371 2003-07-17 Miguel de Icaza <miguel@ximian.com>
12373 * expression.cs (LocalVariableReference.Emit, EmitAssign,
12374 AddressOf): Do not use EmitThis, that was wrong, use the actual
12377 2003-07-15 Miguel de Icaza <miguel@ximian.com>
12379 * class.cs (MethodData.Define): While checking if a method is an
12380 interface implementation, improve the test: If we are not public
12381 (use new test here: use the computed MethodAttributes directly,
12382 instead of the parsed modifier flags) check if the `implementing'
12383 method comes from an interface or not.
12385 * pending.cs (VerifyPendingMethods): Slightly better error
12388 * makefile: add test target that does the mcs bootstrap.
12390 2003-07-16 Ravi Pratap <ravi@ximian.com>
12392 * interface.cs (Define): Do nothing here since there are no
12393 members to populate etc. Move the attribute emission out of here
12394 since this was just totally the wrong place to put it. Attribute
12395 application happens during the 'Emit' phase, not in the 'Define'
12398 (Emit): Add this method and move the attribute emission here
12400 * rootcontext.cs (EmitCode): Call the Emit method on interface
12403 2003-07-14 Ravi Pratap M <ravi@ximian.com>
12405 * expression.cs (OverloadResolve): Report error only if Location
12406 is not 'Null' which means that there was a probe going on.
12408 2003-07-14 Martin Baulig <martin@ximian.com>
12410 * expression.cs (ConditionalLogicalOperator): New public class to
12411 implement user defined conditional logical operators.
12412 This is section 14.11.2 in the spec and bug #40505.
12414 2003-07-14 Martin Baulig <martin@ximian.com>
12416 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12418 2003-07-14 Martin Baulig <martin@ximian.com>
12420 * codegen.cs (EmitContext.InFixedInitializer): New public field.
12422 * ecore.cs (IVariable.VerifyFixed): New interface method.
12424 * expression.cs (Unary.ResolveOperator): When resolving the `&'
12425 operator, check whether the variable is actually fixed. Fixes bug
12426 #36055. Set a variable definitely assigned when taking its
12427 address as required by the spec.
12429 * statement.cs (LocalInfo.IsFixed): New field.
12430 (LocalInfo.MakePinned): Set `IsFixed' to true.
12432 2003-07-14 Ravi Pratap M <ravi@ximian.com>
12434 * attribute.cs (Attribute.Resolve): While doing a Member lookup
12435 for .ctors, ensure that we only ask for members declared in the
12436 attribute type (BindingFlags.DeclaredOnly).
12440 * expression.cs (Error_WrongNumArguments): Report error 1501
12441 correctly the way CSC does.
12443 2003-07-13 Martin Baulig <martin@ximian.com>
12445 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12446 lookup on the fully qualified name, to make things like "X.X" work
12447 where "X.X" is a fully qualified type name, but we also have a
12448 namespace "X" in the using list. Fixes #41975.
12450 2003-07-13 Martin Baulig <martin@ximian.com>
12452 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12453 function. If we're a CompoundAssign, we need to create an embedded
12454 CompoundAssign, not an embedded Assign.
12455 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12458 2003-07-13 Martin Baulig <martin@ximian.com>
12460 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12461 work to fix bug #46088.
12463 2003-07-13 Ravi Pratap <ravi@ximian.com>
12465 * class.cs (Operator.Emit): Do not emit attributes here - it is
12466 taken care of by the Method class that we delegate too. This takes
12467 care of bug #45876.
12469 2003-07-10 Martin Baulig <martin@ximian.com>
12471 * expression.cs (TypeOfVoid): New class.
12472 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
12474 2003-07-10 Martin Baulig <martin@ximian.com>
12476 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12479 2003-07-10 Martin Baulig <martin@ximian.com>
12481 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12482 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12484 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12486 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12488 2003-07-10 Martin Baulig <martin@ximian.com>
12490 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12491 of decimal. Fixes #42850.
12493 NOTE: I also fixed the created byte blob, but this doesn't work on
12494 the MS runtime and csc never produces any byte blobs for decimal
12497 2003-07-10 Martin Baulig <martin@ximian.com>
12499 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12500 structs; fixes #32068.
12501 (Block.AddChildVariableNames): Fixed #44302.
12503 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12505 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12507 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12509 * attribute.cs: And this test is onger needed.
12511 2003-07-08 Martin Baulig <martin@ximian.com>
12513 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12514 inaccessible types. Fixes #36313.
12516 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12518 * namespace.cs (NamespaceEntry): Create implicit entries for all
12519 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12520 implicit entries for N1.N2 and N1.
12522 2003-07-08 Martin Baulig <martin@ximian.com>
12524 Rewrote the handling of namespaces to fix a lot of the issues
12525 wrt. `using' aliases etc.
12527 * namespace.cs (Namespace): Splitted this class into a
12528 per-assembly `Namespace' and a per-file `NamespaceEntry'.
12530 * typemanager.cs (TypeManager.IsNamespace): Removed.
12531 (TypeManager.ComputeNamespaces): Only compute namespaces from
12532 loaded assemblies here, not the namespaces from the assembly we're
12533 currently compiling.
12535 2003-07-08 Martin Baulig <martin@ximian.com>
12537 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12539 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12541 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12544 I thought about the memory savings here, but LookupTypeReflection
12545 is used under already very constrained scenarios. Compiling
12546 corlib or mcs only exposes one hit, so it would not really reduce
12547 any memory consumption.
12549 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12551 * typemanager.cs: fixes bug #45889 by only adding public types from
12552 other assemblies to the list of known types.
12554 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12556 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12557 on the type we resolved.
12559 2003-07-05 Martin Baulig <martin@ximian.com>
12561 * pending.cs (PendingImplementation.ParentImplements): Don't
12562 create the proxy if the parent is abstract.
12564 * class.cs (TypeContainer.DefineIndexers): Process explicit
12565 interface implementations first. Fixes #37714.
12567 2003-07-04 Miguel de Icaza <miguel@ximian.com>
12569 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12570 defined recursively; but since we modify the input parameters
12571 (left is set to `this' temporarily), we reset this value if the
12572 left_is_explicit is false, which gives the original semantics to
12575 * literal.cs (NullPointer): new class used to represent a null
12576 literal in a pointer context.
12578 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12579 type is a pointer, use a NullPointer object instead of a
12580 NullLiteral. Closes 43687
12582 (ExplicitConversion): Convert pointer values using
12583 the conv opcode to the proper type.
12585 * ecore.cs (New): change ValueTypeVariable property into a method,
12586 that returns whether the valuetype is suitable for being used.
12588 * expression.cs (Binary.DoNumericPromotions): Only return if we
12589 the int constant was a valid uint, and we can return both left and
12590 right as uints. If not, we continue processing, to trigger the
12591 type conversion. This fixes 39018.
12593 * statement.cs (Block.EmitMeta): During constant resolution, set
12594 the CurrentBlock property on the emitcontext, so that we resolve
12595 constants propertly.
12597 2003-07-02 Martin Baulig <martin@ximian.com>
12599 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12600 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12602 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12603 than emitting it here.
12605 * statement.cs: Fixed some more flow analysis bugs.
12607 2003-07-02 Martin Baulig <martin@ximian.com>
12609 * class.cs (MethodData.Define): When implementing interface
12610 methods, set Final unless we're Virtual.
12612 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12613 check work for interface methods.
12615 2003-07-01 Martin Baulig <martin@ximian.com>
12617 * ecore.cs (EmitContext.This): Replaced this property with a
12618 GetThis() method which takes a Location argument. This ensures
12619 that we get the correct error location for a CS0188.
12621 2003-07-01 Miguel de Icaza <miguel@ximian.com>
12623 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
12624 ImplicitStandardConversion.
12626 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
12628 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
12630 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
12633 2003-06-30 Miguel de Icaza <miguel@ximian.com>
12635 * class.cs (Constructor.Define): Turn off initlocals for unsafe
12638 (MethodData.Define): Turn off initlocals for unsafe methods.
12640 2003-06-29 Miguel de Icaza <miguel@ximian.com>
12642 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12643 complete; Fixes #37521.
12645 * delegate.cs: Use Modifiers.TypeAttr to compute the
12646 TypeAttributes, instead of rolling our own. This makes the flags
12647 correct for the delegates.
12649 2003-06-28 Miguel de Icaza <miguel@ximian.com>
12651 * class.cs (Constructor.Define): Set the private flag for static
12652 constructors as well.
12654 * cs-parser.jay (statement_expression): Set the return value to
12655 null, to avoid a crash when we catch an error.
12657 2003-06-24 Miguel de Icaza <miguel@ximian.com>
12659 * cs-parser.jay: Applied patch from Jackson that adds support for
12660 extern and unsafe modifiers to destructor declarations.
12662 * expression.cs: Report error 21 if the user is trying to index a
12665 * driver.cs: Add an error message, suggested by the bug report.
12667 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12668 if we do not have a ": this ()" constructor initializer. Fixes 45149
12670 2003-06-14 Miguel de Icaza <miguel@ximian.com>
12672 * namespace.cs: Add some information to reduce FAQs.
12674 2003-06-13 Miguel de Icaza <miguel@ximian.com>
12676 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12677 underlying enumeration types. Fixes #43915.
12679 * expression.cs: Treat ushort/short as legal values to be used in
12680 bitwise operations.
12682 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12684 * delegate.cs: transfer custom attributes for paramenters from
12685 the delegate declaration to Invoke and BeginInvoke.
12687 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12689 * attribute.cs: handle custom marshalers and emit marshal info
12692 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
12694 * makefile.gnu: Added anonymous.cs to the compiler sources.
12696 2003-05-28 Miguel de Icaza <miguel@ximian.com>
12698 * iterators.cs: Change the name of the proxy class to include two
12701 * cs-parser.jay: Update grammar to include anonymous methods.
12703 * anonymous.cs: new file.
12705 2003-05-27 Miguel de Icaza <miguel@ximian.com>
12707 * class.cs (Field.Define): Add missing test for pointers and
12710 2003-05-27 Ravi Pratap <ravi@ximian.com>
12712 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12713 we use the stobj opcode.
12715 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12716 since it wasn't the correct fix.
12718 It still is puzzling that we are required to use stobj for IntPtr
12719 which seems to be a ValueType.
12721 2003-05-26 Miguel de Icaza <miguel@ximian.com>
12723 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12724 during regular simple name resolution. Now, the trick is that
12725 instead of returning for processing the simplename, we do a
12726 TypeManager.LookupType (ie, a rooted lookup as opposed to a
12727 contextual lookup type). If a match is found, return that, if
12728 not, return for further composition.
12730 This fixes long-standing 30485.
12732 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12733 using the address to initialize an object, do an Stobj instead of
12734 using the regular Stelem.
12736 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12737 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12738 Because if we are a BaseIndexerAccess that value will be true.
12741 * statement.cs (GotoCase.Resolve): Return after reporting an
12742 error, do not attempt to continue.
12744 * expression.cs (PointerArithmetic.Emit): If our operand is a
12745 long, convert our constants to match the operand before
12746 multiplying. Convert to I type before adding. Fixes 43670.
12748 2003-05-14 Ravi Pratap <ravi@ximian.com>
12750 * enum.cs (ImplicitConversionExists) : Rename to
12751 ImplicitEnumConversionExists to remove ambiguity.
12753 * ecore.cs (NullCast): New type of cast expression class which
12754 basically is very similar to EmptyCast with the difference being
12755 it still is a constant since it is used only to cast a null to
12757 (eg. (string) null)
12759 * convert.cs (ImplicitReferenceConversion): When casting a null
12760 literal, we return a NullCast.
12762 * literal.cs (NullLiteralTyped): Remove - I don't see why this
12763 should be around anymore.
12765 The renaming (reported was slightly wrong). Corrections:
12767 ConvertImplicitStandard -> ImplicitConversionStandard
12768 ConvertExplicitStandard -> ExplicitConversionStandard
12770 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12771 before passing them in !
12773 * convert.cs (ImplicitConversionStandard): When comparing for
12774 equal expr and target types, ensure that expr is not a
12777 In general, we must not be checking (expr_type ==
12778 target_type) in the top level conversion methods
12779 (ImplicitConversion, ExplicitConversion etc). This checking is
12780 done in the methods that they delegate to.
12782 2003-05-20 Miguel de Icaza <miguel@ximian.com>
12784 * convert.cs: Move Error_CannotConvertType,
12785 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12786 ImplicitNumericConversion, ImplicitConversionExists,
12787 ImplicitUserConversionExists, StandardConversionExists,
12788 FindMostEncompassedType, FindMostSpecificSource,
12789 FindMostSpecificTarget, ImplicitUserConversion,
12790 ExplicitUserConversion, GetConversionOperators,
12791 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12792 TryImplicitIntConversion, Error_CannotConvertImplicit,
12793 ConvertImplicitRequired, ConvertNumericExplicit,
12794 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12795 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12798 Perform the following renames:
12800 StandardConversionExists -> ImplicitStandardConversionExists
12801 ConvertImplicit -> ImplicitConversion
12802 ConvertImplicitStandard -> ImplicitStandardConversion
12803 TryImplicitIntConversion -> ImplicitIntConversion
12804 ConvertImplicitRequired -> ImplicitConversionRequired
12805 ConvertNumericExplicit -> ExplicitNumericConversion
12806 ConvertReferenceExplicit -> ExplicitReferenceConversion
12807 ConvertExplicit -> ExplicitConversion
12808 ConvertExplicitStandard -> ExplicitStandardConversion
12810 2003-05-19 Martin Baulig <martin@ximian.com>
12812 * statement.cs (TypeInfo.StructInfo): Made this type protected.
12813 (TypeInfo): Added support for structs having structs as fields.
12815 * ecore.cs (FieldExpr): Implement IVariable.
12816 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12817 VariableInfo for the field.
12819 2003-05-18 Martin Baulig <martin@ximian.com>
12821 * expression.cs (This.DoResolve): Report a CS0027 if we're
12822 emitting a field initializer.
12824 2003-05-18 Martin Baulig <martin@ximian.com>
12826 * expression.cs (This.ResolveBase): New public function.
12827 (This.DoResolve): Check for CS0188.
12829 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12832 * ecore.cs (MethodGroupExpr.DoResolve): Set the
12833 `instance_expression' to null if we don't have any non-static
12836 2003-05-18 Martin Baulig <martin@ximian.com>
12838 Reworked the way how local variables and parameters are handled by
12839 the flow analysis code.
12841 * statement.cs (TypeInfo, VariableMap): New public classes.
12842 (VariableInfo): New public class. This is now responsible for
12843 checking whether a variable has been assigned. It is used for
12844 parameters and local variables.
12845 (Block.EmitMeta): Take the InternalParameters as argument; compute
12846 the layout of the flow vectors here.
12847 (Block.LocalMap, Block.ParameterMap): New public properties.
12848 (FlowBranching): The .ctor doesn't get the InternalParameters
12849 anymore since Block.EmitMeta() now computes the layout of the flow
12851 (MyStructInfo): This class is now known as `StructInfo' and nested
12852 in `TypeInfo'; we don't access this directly anymore.
12854 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12855 property and removed IsAssigned(), IsFieldAssigned(),
12856 SetAssigned() and SetFieldAssigned(); we now call them on the
12857 VariableInfo so we don't need to duplicate this code everywhere.
12859 * expression.cs (ParameterReference): Added `Block block' argument
12861 (LocalVariableReference, ParameterReference, This): The new
12862 VariableInfo class is now responsible for all the definite
12865 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12866 IsParameterAssigned, SetParameterAssigned): Removed.
12868 2003-05-18 Martin Baulig <martin@ximian.com>
12870 * typemanager.cs (InitCoreTypes): Try calling
12871 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12872 the 3-args-version. Corlib now also needs our `void_type'.
12873 (GetMethod): Added overloaded version which takes an optional
12874 `bool report_errors' to allow lookups of optional methods.
12876 2003-05-12 Martin Baulig <martin@ximian.com>
12878 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12879 only used for locals and not for parameters.
12881 2003-05-12 Miguel de Icaza <miguel@ximian.com>
12883 * support.cs (InternalParameters.ParameterType): Return the
12884 ExternalType of the parameter.
12886 * parameter.cs (Parameter.ExternalType): drop the two arguments,
12889 2003-05-11 Miguel de Icaza <miguel@ximian.com>
12891 * class.cs (MethodData.Define): Do not set the `newslot' on
12892 interface members, if they are also flagged as "override".
12894 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12895 better code for ++i and i++. This only works for static fields
12896 and local variables.
12898 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12899 want to pull the DeclSpace out of the builder_to_declspace instead
12900 of the TypeBuilder (like in TypeContainer.FindMembers).
12902 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12903 instead of LookupTypeContainer. Fixes the crash on .NET for
12904 looking up interface members.
12906 * const.cs: Create our own emit context during the Definition
12907 stage, so that constants are evaluated in the proper context, when
12908 a recursive definition happens.
12910 2003-05-11 Martin Baulig <martin@ximian.com>
12912 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
12913 new block for a switch section.
12914 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12915 the adding/lookup in the switch block. Fixes #39828.
12917 2003-05-09 Miguel de Icaza <miguel@ximian.com>
12919 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12920 functionality: I needed to convert the data after I had performed
12921 the add/sub operation into the operands type size.
12923 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12924 pass the type for the box operation, otherwise the resulting
12925 object would have been of type object.
12927 (BoxedCast): Add constructor to specify the type to box as.
12929 2003-05-07 Miguel de Icaza <miguel@ximian.com>
12931 * iterators.cs: I was reusing the `count' variable inadvertently,
12932 take steps to not allow this to happen.
12934 2003-05-06 Miguel de Icaza <miguel@ximian.com>
12936 * attribute.cs (Attribute.Resolve): Params attributes are encoded
12937 by creating an array at the point where the params starts and
12938 putting all those arguments there, then adjusting the size of the
12941 2003-05-05 Miguel de Icaza <miguel@ximian.com>
12943 * expression.cs (New.AddressOf): Implement interface
12944 IMemoryLocation. This is used when the `new' operator is used in
12945 the context of an invocation to a method on a value type.
12947 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12950 * namespace.cs: Also check the using aliases here.
12952 * driver.cs: Move the test for using validity after the types have
12953 been entered, so we do a single pass that also includes the using
12956 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12957 in the regular case. CreateSiblingForFinally is doing extra
12960 * attribute.cs (GetAttributeArgumentExpression): Store the result
12961 on an out value, and use the return value to indicate failure
12962 instead of using null (which is a valid return for Constant.GetValue).
12964 * statement.cs: Perform the analysis flow for the increment
12965 portion after the statement, because this will be the real flow of
12966 execution. Fixes #42385
12968 * codegen.cs (EmitContext.EmitArgument,
12969 EmitContext.EmitStoreArgument): New helper functions when the
12970 RemapToProxy flag is set.
12972 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12975 Add support for remapping parameters.
12977 * iterators.cs: Propagate parameter values; Store parameter
12978 values in the proxy classes.
12980 2003-05-04 Miguel de Icaza <miguel@ximian.com>
12982 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
12983 need a proxy reference; I do not know what I was thinking
12985 * cs-parser.jay (constructor_initializer): catch another error,
12986 and display nice message.
12988 (field_declaration): catch void field declaration
12989 to flag a better error.
12991 * class.cs (MemberBase.CheckBase): Report an error instead of a
12992 warning if a new protected member is declared in a struct.
12993 (Field.Define): catch the error of readonly/volatile.
12995 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12997 (FieldExpr.AddressOf): ditto. Catch error where the address of a
12998 volatile variable is taken
13000 2003-05-02 Miguel de Icaza <miguel@ximian.com>
13002 * statement.cs (Fixed.Resolve): Report an error if we are not in
13005 2003-05-01 Miguel de Icaza <miguel@ximian.com>
13007 * typemanager.cs: reuse the code that handles type clashes for
13008 delegates and enumerations.
13010 * class.cs (Report28): Always report.
13012 * expression.cs (EncodeAsAttribute): Allow nulls here.
13014 2003-04-28 Miguel de Icaza <miguel@ximian.com>
13016 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13017 the functionality for testing whether an expression is valid for
13018 an attribute here. Also handle the case of arrays of elements
13021 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13022 encoding a linear array into an array of objects that are suitable
13023 to be passed to an CustomAttributeBuilder.
13025 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13027 * ecore.cs: (FieldExpr): Handle field remapping here.
13029 * iteratators.cs: Pass the instance variable (if the method is an
13030 instance method) to the constructors, so we can access the field
13031 variables on the class.
13033 TODO: Test this with structs. I think the THIS variable on
13034 structs might have to be a pointer, and not a refenrece
13036 2003-04-27 Miguel de Icaza <miguel@ximian.com>
13038 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
13039 local variables to fields in a proxy class.
13041 * iterators.cs (PopulateProxy): Rename our internal fields to
13043 Create a <THIS> field if we are an instance method, so we can
13044 reference our parent container variables.
13045 (MapVariable): Called back from the EmitContext code to enter a
13046 new variable to field mapping into the proxy class (we just create
13050 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
13051 for using the remapped locals to fields.
13053 I placed the code here, because that gives the same semantics to
13054 local variables, and only changes the Emit code.
13056 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
13057 statements inside iterators.
13058 (VariableInfo): Add a FieldBuilder for the cases when we are
13059 remapping local variables to fields in a proxy class
13061 * ecore.cs (SimpleNameResolve): Avoid testing two times for
13062 current_block != null.
13064 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
13065 not cope with strings, as it has been moved to the
13066 TableSwitchEmit. Fixed bug in switch generation.
13068 * expression.cs (New.DoResolve): Provide more context for the user
13069 when reporting an error.
13071 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
13074 * expression.cs (MemberAccess.DoResolve): When we get a type back,
13075 check the permissions for it. Note than in a type-resolution
13076 context the check was already present in DeclSpace.ResolveType,
13077 but was missing from the MemberAccess.
13079 (ArrayCreation.CheckIndices): warn if the user has
13080 more nested levels of expressions, but there are no more
13081 dimensions specified. Avoids crash on bug 41906.
13083 2003-04-26 Miguel de Icaza <miguel@ximian.com>
13085 * statement.cs (Block): replace Implicit bool, for a generic
13087 New flag: `Unchecked'. This is used during the EmitMeta phase
13088 (which is out-of-line with the regular Resolve/Emit process for a
13089 statement, as this is done ahead of time, but still gets a chance
13090 to call constant resolve).
13092 (Block.Flags): new enum for adding a new flag.
13094 (Block.EmitMeta): track the state of unchecked.
13096 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
13097 to enable constant resolution to work there as well.
13099 2003-04-22 Miguel de Icaza <miguel@ximian.com>
13101 * typemanager.cs (ienumerable_type): Also look up
13102 System.Collections.IEnumerable.
13104 2003-04-21 Miguel de Icaza <miguel@ximian.com>
13106 TODO: Test more than one conditional per method.
13108 * class.cs (Indexer.Define): Report the location where the user is
13109 referencing the unsupported feature.
13111 (MethodData): Overload the use of `conditionals' to
13112 minimize the creation of needless ArrayLists. This saves roughly
13113 212kb on my machine.
13115 (Method): Implement the new IIteratorContainer interface.
13116 (Method.SetYields): Implement the method by setting the ModFlags
13117 to contain METHOD_YIELDS.
13119 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
13120 which just got set to null.
13122 * iterators.cs: New file.
13124 (Yield, YieldBreak): New statements.
13126 * statement.cs (Return.Resolve): Flag an error if we are used in
13127 an iterator method.
13129 * codegen.cs (InIterator): New flag set if the code is being
13130 compiled in an iterator method.
13132 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
13133 internal modifier, and we just use it to avoid adding extra
13134 fields, as this is seldom used.
13136 * cs-parser.jay: Add yield_statement (yield and yield break).
13138 * driver.cs: New flag -v2 to turn on version 2 features.
13140 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
13141 hashtable when v2 is enabled.
13143 2003-04-20 Miguel de Icaza <miguel@ximian.com>
13145 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
13146 there is already a namespace defined with this name.
13148 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
13149 people upgraded their corlibs.
13151 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
13152 always use fully qualified types, no need to use the compiler
13155 (TypeManager.IsNamespace): Use binarysearch.
13157 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
13158 AddDelegate): I did not quite use the new IsValid API properly: I
13159 have to pass the short-name and the fullname. I was passing only
13160 the basename instead of the fullname sometimes.
13162 (TypeContainer.DefineType): call NamespaceClash.
13164 * interface.cs (Interface.DefineType): use NamespaceClash before
13167 * delegate.cs (Delegate.DefineType): use NamespaceClash before
13170 * enum.cs: (Enum.DefineType): use NamespaceClash before
13173 * typemanager.cs (: 3-line patch that gives us some tasty 11%
13174 speed increase. First, use the negative_hits cache when we get a
13175 negative. Second, add the type with its full original name
13176 instead of the new . and + encoded name (reflection uses + to
13177 separate type from a nested type). Use LookupTypeReflection
13178 directly which bypasses the type->name hashtable (that we already
13179 know does not contain the type.
13181 * decl.cs (DeclSpace.ResolveTypeExpr): track the
13182 location/container type.
13184 * driver.cs: When passing utf8, use directly the UTF8Encoding.
13186 2003-04-19 Miguel de Icaza <miguel@ximian.com>
13188 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
13190 * delegate.cs (NewDelegate.Resolve): Test whether an instance
13191 method is being referenced in the method group from a static
13192 context, and report error 120 if so.
13194 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
13197 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
13198 is created, we create the A namespace).
13200 * cs-parser.jay: A namespace also introduces a DeclarationFound.
13203 2003-04-18 Miguel de Icaza <miguel@ximian.com>
13205 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
13206 invocation to ModuleBuilder.GetType with the same values will
13207 return a new type instance, so we need to cache its return
13210 * expression.cs (Binary.ResolveOperator): Only allow the compare
13211 operators on enums if they are of the same type.
13213 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
13214 types of ValueType on their own case. Before we were giving them
13215 the same treatment as objects.
13217 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
13218 fullname. Short name is used to compare against container name.
13219 Fullname is used to check against defined namespace names.
13221 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
13222 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
13224 (Method.CheckBase): Call parent.
13225 (MemberBase.CheckBase): Check for protected members on sealed
13227 (PropertyBase.CheckBase): Call parent.
13228 (Field.Define): Call parent.
13230 * report.cs: Negative error codes are now mapped to 8000 - code,
13231 so that the display is render more nicely.
13233 * typemanager.cs: Do not use try/catch, instead report a regular
13236 (GetPointerType, GetReferenceType): These methods provide
13237 mechanisms to obtain the T* and T& from a T. We had the code
13238 previously scattered around the code base, and it also used
13239 TypeManager.LookupType that would go through plenty of caches.
13240 This one goes directly to the type source.
13242 In some places we did the Type.GetType followed by
13243 ModuleBuilder.GetType, but not in others, so this unifies the
13244 processing as well.
13246 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13247 statements now that we have namespace information.
13249 * typemanager.cs (IsNamespace): New method, returns whether the
13250 string presented is a namespace or not.
13252 (ComputeNamespaces): New public entry point, computes the list of
13253 available namespaces, using the GetNamespaces API call in Mono, or
13254 the slower version in MS.NET.
13256 Now before we start the semantic analysis phase, we have a
13257 complete list of namespaces including everything that the user has
13260 Deleted old code to cache namespaces in .nsc files.
13262 2003-04-17 Miguel de Icaza <miguel@ximian.com>
13264 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13265 class/struct location definition Location for the implicit
13266 constructor location.
13268 (Operator.Define): Use the location of the operator for the
13269 implicit Method definition.
13271 (Constructor.Emit): use the constructor location for the implicit
13272 base initializer constructor.
13274 * ecore.cs: Remove ITypeExpression. This interface is now gone,
13275 and the Expression class now contains two new methods:
13277 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
13278 isolate type lookup from the rest of the resolution process.
13280 Since we use Expressions to hold type definitions due to the way
13281 we parse the input we have historically overloaded Resolve to
13282 perform the Type lookups if a special flag is passed. Now this is
13283 eliminated and two methods take their place.
13285 The differences in the two methods between xStep and xTerminal is
13286 that xStep is involved in our current lookup system that uses
13287 SimpleNames to compose a name, while xTerminal is used just to
13288 catch the case where the simplename lookup failed.
13290 2003-04-16 Miguel de Icaza <miguel@ximian.com>
13292 * expression.cs (ResolveMemberAccess): Remove redundant code.
13293 TypeExpr expressions are always born fully resolved.
13295 * interface.cs (PopulateMethod): Do not lookup the types twice.
13296 We were doing it once during SemanticAnalysis and once during
13299 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13300 in local variable type definitions, were being returned as a
13301 SimpleName (we decomposed everything into a string), that is
13302 because primary_expression was being used instead of a type in the
13303 grammar (reduce/reduce conflicts).
13305 The part that was wrong is that we converted the expression into a
13306 string (an oversimplification in one hand, compounded with primary
13307 expressions doing string concatenation).
13313 Would return "A.B.C[]" as a SimpleName. This stopped things like
13314 using clauses from working on this particular context. And a type
13315 was being matched directly against "A.B.C[]".
13317 We now use the correct approach, and allow for ComposedCast to be
13318 part of the unary expression. So the "A.B.C []" become a composed
13319 cast of "A.B.C" (as a nested group of MemberAccess with a
13320 SimpleName at the end) plus the rank composition "[]".
13324 2003-04-10 Miguel de Icaza <miguel@ximian.com>
13326 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13327 for the access level checking.
13329 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
13330 `TypeContainer container', because I kept getting confused when I
13331 was debugging this code.
13333 * expression.cs (Indexers): Instead of tracking getters/setters,
13334 we now track them in parallel. We create one arraylist less, but
13335 most importantly it is possible now for the LValue code to find a
13336 matching get for a set.
13338 (IndexerAccess.DoResolveLValue): Update the code.
13339 GetIndexersForType has been modified already to extract all the
13340 indexers from a type. The code assumed it did not.
13342 Also make the code set the correct return type for the indexer.
13343 This was fixed a long time ago for properties, but was missing for
13344 indexers. It used to be void_type.
13346 (Binary.Emit): Test first for doubles instead of
13347 floats, as they are more common.
13349 (Binary.EmitBranchable): Use the .un version of the branch opcodes
13350 when dealing with floats and the <=, >= operators. This fixes bug
13353 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13354 to load the array value by emitting a load on the foreach variable
13355 type. This was incorrect.
13357 We now emit the code to load an element using the the array
13358 variable type, and then we emit the conversion operator.
13362 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
13364 * attribute.cs: Avoid allocation of ArrayLists in the common case.
13366 2003-04-09 Miguel de Icaza <miguel@ximian.com>
13368 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13369 test for protection before we test for signatures.
13371 (MethodSignature.ToString): implement.
13373 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13374 to the case where we reduced into a LongConstant.
13376 * decl.cs (CheckAccessLevel): If the type is an array, we can not
13377 depend on whether the information is acurrate, because the
13378 Microsoft runtime will always claim that the array type is public,
13379 regardless of the real state.
13381 If the type is a pointer, another problem happens: the type is
13382 reported as non-public in Microsoft.
13384 In both cases we have to call CheckAccessLevel recursively with
13385 the underlying type as the argument to be tested.
13387 2003-04-08 Miguel de Icaza <miguel@ximian.com>
13389 * assign.cs (Assign.Emit): If we are dealing with a compound
13390 assignment expression, we should use the code path that stores the
13391 intermediate result in a temporary value. This fixes #40903.
13393 *expression.cs (Indirection.ToString): Provide ToString method for
13396 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
13398 * class.cs: Null out fields holding references to Block objects so
13399 they can be garbage collected.
13401 * expression.cs (OverloadResolve): Remove unused local.
13403 2003-04-07 Martin Baulig <martin@ximian.com>
13405 * codegen.cs (EmitContext.CurrentFile): New public field.
13406 (EmitContext.Mark): Use the CurrentFile to check whether the
13407 location is in the correct file.
13408 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13410 2003-04-07 Martin Baulig <martin@ximian.com>
13412 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13414 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13415 location. [FIXME: The location argument which gets passed to this
13416 method is sometimes wrong!]
13418 2003-04-07 Nick Drochak <ndrochak@gol.com>
13420 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13422 2003-04-07 Miguel de Icaza <miguel@ximian.com>
13424 * expression.cs (Indirection.EmitAssign): We were using the
13425 temporary, but returning immediately instead of continuing the
13428 2003-04-06 Martin Baulig <martin@ximian.com>
13430 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13431 if it's a nested child, but also deriving from the outer class.
13434 * typemanager.cs (IsNestedChildOf): Make this work if it's a
13435 nested child, but also deriving from the outer class. See
13437 (FilterWithClosure): We may access private members of the outer
13438 class if we're a nested child and deriving from the outer class.
13439 (RealMemberLookup): Only set `closure_private_ok' if the
13440 `original_bf' contained BindingFlags.NonPublic.
13442 2003-04-05 Martin Baulig <martin@ximian.com>
13444 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
13446 2003-04-02 Miguel de Icaza <miguel@ximian.com>
13448 * class.cs (Event.Define): Do not allow abstract events to have
13451 2003-04-01 Miguel de Icaza <miguel@ximian.com>
13453 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13454 block in event declarations.
13456 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13457 value type, get its address.
13459 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13460 leaving a class on the stack instead of a boolean value (int
13461 0/1). Change the code so we compare against null, and then the
13462 result against zero.
13464 * class.cs (TypeContainer.GetClassBases): We were checking for the
13465 parent class being sealed too late.
13467 * expression.cs (Binary.Emit): For <= and >= when dealing with
13468 floating point values, use cgt.un and clt.un instead of cgt and
13471 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
13473 * statement.cs: Apply the same optimization as MS: skip the
13474 GetEnumerator returning an IEnumerator, and use the one returning a
13475 CharEnumerator instead. This allows us to avoid the try-finally block
13478 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
13480 * cs-parser.jay: Attributes cannot be applied to
13481 namespaces. Fixes #40473
13483 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13486 (Add*): check if the name is valid using the full name for constants,
13487 fields, properties and events.
13489 2003-03-28 Miguel de Icaza <miguel@ximian.com>
13491 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13492 char constants to be part of the enumeration.
13494 * expression.cs (Conditional.DoResolve): Add support for operator
13495 true. Implements the missing functionality from 14.12
13497 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13498 operator true/false as required by the spec.
13500 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13501 implicit conversion to boolean.
13503 * statement.cs (Statement.ResolveBoolean): A boolean expression is
13504 also one where the type implements `operator true'.
13506 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13507 get an expression that will invoke operator true based on an
13510 (GetConversionOperators): Removed the hack that called op_True
13513 (Expression.ResolveBoolean): Move this from Statement.
13515 2003-03-17 Miguel de Icaza <miguel@ximian.com>
13517 * ecore.cs (FieldExpr): do not allow initialization of initonly
13518 fields on derived classes
13520 2003-03-13 Martin Baulig <martin@ximian.com>
13522 * statement.cs (Block.Emit): Call ig.BeginScope() and
13523 ig.EndScope() when compiling with debugging info; call
13524 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13526 2003-03-08 Miguel de Icaza <miguel@ximian.com>
13528 * expression.cs (Indexers): Do not construct immediately, allow
13529 for new members to be appended as we go. Fixes 38143
13531 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13533 * expression.cs: save/restore context when resolving an unchecked
13536 2003-03-05 Miguel de Icaza <miguel@ximian.com>
13538 * cfold.cs: Catch division by zero in modulus operator during
13541 2003-03-03 Miguel de Icaza <miguel@ximian.com>
13543 * interface.cs (Interface.DefineMembers): Avoid defining members
13546 2003-02-27 Miguel de Icaza <miguel@ximian.com>
13548 * driver.cs: handle the +/- options for -noconfig
13550 * statement.cs (Unckeched.Resolve): Also track the state of
13551 unchecked in the Resolve phase.
13553 2003-02-27 Martin Baulig <martin@ximian.com>
13555 * ecore.cs (Expression.MemberLookup): Don't create a
13556 MethodGroupExpr for something which is not a method. Fixes #38291.
13558 2003-02-25 Miguel de Icaza <miguel@ximian.com>
13560 * class.cs (MemberBase.CheckParameters): Also check that the type
13561 is unmanaged if it is a pointer.
13563 * expression.cs (SizeOf.Resolve): Add location information.
13565 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13566 a managed type is declared.
13568 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13569 parameter modifiers as well. Fixes bug 38606
13571 * class.cs: Very sad. Am backing out the speed up changes
13572 introduced by the ArrayList -> Array in the TypeContainer, as they
13573 were not actually that much faster, and introduced a bug (no error
13574 reports on duplicated methods).
13576 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13577 source first, this will guarantee that we have a valid expression
13578 before calling in lower levels functions that will require a
13579 resolved object. Then use this original_source in the
13580 target.ResolveLValue instead of the original source that was
13583 Another change. Use target.Resolve instead of LValueResolve.
13584 Although we are resolving for LValues, we will let the Assign code
13585 take care of that (it will be called again from Resolve). This
13586 basically allows code like this:
13588 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13589 class Y { void A (X x) { x [0] += o; }
13591 The problem was that the indexer was trying to resolve for
13592 set_Item (idx, object o) and never finding one. The real set_Item
13593 was set_Item (idx, X). By delaying the process we get the right
13598 2003-02-23 Martin Baulig <martin@ximian.com>
13600 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
13601 while calling DoEmit ().
13603 * codegen.cs (EmitContext.Mark): Don't mark locations in other
13604 source files; if you use the #line directive inside a method, the
13605 compiler stops emitting line numbers for the debugger until it
13606 reaches the end of the method or another #line directive which
13607 restores the original file.
13609 2003-02-23 Martin Baulig <martin@ximian.com>
13611 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
13613 2003-02-23 Martin Baulig <martin@ximian.com>
13615 * statement.cs (Block.AddChildVariableNames): We need to call this
13616 recursively, not just for our immediate children.
13618 2003-02-23 Martin Baulig <martin@ximian.com>
13620 * class.cs (Event.Define): Always make the field private, like csc does.
13622 * typemanager.cs (TypeManager.RealMemberLookup): Make events
13623 actually work, fixes bug #37521.
13625 2003-02-23 Miguel de Icaza <miguel@ximian.com>
13627 * delegate.cs: When creating the various temporary "Parameters"
13628 classes, make sure that we call the ComputeAndDefineParameterTypes
13629 on those new parameters (just like we do with the formal ones), to
13630 allow them to be resolved in the context of the DeclSpace.
13632 This fixes the bug that Dick observed in Bugzilla #38530.
13634 2003-02-22 Miguel de Icaza <miguel@ximian.com>
13636 * expression.cs (ResolveMemberAccess): When resolving a constant,
13637 do not attempt to pull a constant if the value was not able to
13638 generate a valid constant.
13640 * const.cs (LookupConstantValue): Do not report more errors than required.
13642 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13644 * expression.cs: fixes bug #38328.
13646 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13648 * class.cs: Changed all the various members that can be part of a
13649 class from being an ArrayList to be an Array of the right type.
13650 During the DefineType type_list, interface_list, delegate_list and
13651 enum_list are turned into types, interfaces, delegates and enums
13654 And during the member population, indexer_list, event_list,
13655 constant_list, field_list, instance_constructor_list, method_list,
13656 operator_list and property_list are turned into their real arrays.
13658 Although we could probably perform this operation earlier, for
13659 good error reporting we need to keep the lists and remove the
13660 lists for longer than required.
13662 This optimization was triggered by Paolo profiling the compiler
13663 speed on the output of `gen-sample-program.pl' perl script.
13665 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13666 not crash in methods like MemberLookupFailed that use this field.
13668 This problem arises when the compiler fails to resolve a type
13669 during interface type definition for example.
13671 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13673 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13674 inherit from System.Object, so we have to stop at null, not only
13675 when reaching System.Object.
13677 2003-02-17 Miguel de Icaza <miguel@ximian.com>
13679 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13680 DeclaredOnly because the parent indexer might have had a different
13681 name, but did not loop until the top of the hierarchy was reached.
13683 The problem this one fixes is 35492: when a class implemented an
13684 indexer from an interface, we were getting the interface method
13685 (which was abstract) and we were flagging an error (can not invoke
13688 This also keeps bug 33089 functioning, and test-148 functioning.
13690 * typemanager.cs (IsSpecialMethod): The correct way of figuring
13691 out if a method is special is to see if it is declared in a
13692 property or event, or whether it is one of the predefined operator
13693 names. This should fix correctly #36804.
13695 2003-02-15 Miguel de Icaza <miguel@ximian.com>
13697 The goal here is to remove the dependency on EmptyCast.Peel ().
13698 Killing it completely.
13700 The problem is that currently in a number of places where
13701 constants are expected, we have to "probe" for an EmptyCast, and
13702 Peel, which is not the correct thing to do, as this will be
13703 repetitive and will likely lead to errors.
13705 The idea is to remove any EmptyCasts that are used in casts that
13706 can be reduced to constants, so we only have to cope with
13709 This bug hunt was triggered by Bug 37363 and the desire to remove
13710 the duplicate pattern where we were "peeling" emptycasts to check
13711 whether they were constants. Now constants will always be
13714 * ecore.cs: Use an enumconstant here instead of wrapping with
13717 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13718 throwing me off. By handling this we can get rid of a few hacks.
13720 * statement.cs (Switch): Removed Peel() code.
13722 2003-02-14 Miguel de Icaza <miguel@ximian.com>
13724 * class.cs: Location information for error 508
13726 * expression.cs (New.DoResolve): Add a guard against double
13727 resolution of an expression.
13729 The New DoResolve might be called twice when initializing field
13730 expressions (see EmitFieldInitializers, the call to
13731 GetInitializerExpression will perform a resolve on the expression,
13732 and later the assign will trigger another resolution
13734 This leads to bugs (#37014)
13736 * delegate.cs: The signature for EndInvoke should contain any ref
13737 or out parameters as well. We were not doing this in the past.
13739 * class.cs (Field.Define): Do not overwrite the type definition
13740 inside the `volatile' group. Turns out that volatile enumerations
13741 were changing the type here to perform a validity test, which
13744 2003-02-12 Miguel de Icaza <miguel@ximian.com>
13746 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13747 and structs, we do not want to load the instance variable
13749 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13750 enum_type has to be handled like an object reference (implicit
13751 conversions exists from this to object), but the regular IsClass
13752 and IsValueType tests will never return true for this one.
13754 Also we use TypeManager.IsValueType instead of type.IsValueType,
13755 just for consistency with the rest of the code (this is only
13756 needed if we ever use the construct exposed by test-180.cs inside
13757 corlib, which we dont today).
13759 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
13761 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13764 2003-02-09 Martin Baulig <martin@ximian.com>
13766 * namespace.cs (Namespace..ctor): Added SourceFile argument.
13767 (Namespace.DefineNamespaces): New static public method; this is
13768 called when we're compiling with debugging to add all namespaces
13769 to the symbol file.
13771 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13772 pass it to the Namespace's .ctor.
13774 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13775 and MethodBase arguments; pass the namespace ID to the symwriter;
13776 pass the MethodBase instead of the token to the symwriter.
13777 (SymbolWriter.DefineNamespace): New method to add a namespace to
13780 2003-02-09 Martin Baulig <martin@ximian.com>
13782 * symbolwriter.cs: New file. This is a wrapper around
13783 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
13784 methods here in near future.
13786 2003-02-09 Martin Baulig <martin@ximian.com>
13788 * codegen.cs (EmitContext.Mark): Just pass the arguments to
13789 ILGenerator.MarkSequencePoint() which are actually used by the
13792 2003-02-09 Martin Baulig <martin@ximian.com>
13794 * location.cs (SourceFile): New public sealed class. This
13795 contains the name and an index which is used in the location's token.
13796 (Location): Reserve an appropriate number of bits in the token for
13797 the source file instead of walking over that list, this gives us a
13798 really huge performance improvement when compiling with debugging.
13800 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13801 `SourceFile' argument instead of a string.
13802 (Driver.ProcessFile): Add all the files via Location.AddFile(),
13803 but don't parse/tokenize here, we need to generate the list of all
13804 source files before we do that.
13805 (Driver.ProcessFiles): New static function. Parses/tokenizes all
13808 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13809 instead of a string.
13811 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13814 2003-02-09 Martin Baulig <martin@ximian.com>
13816 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13817 filename on `#line default'.
13819 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13821 * statement.cs: don't clear the pinned var when the fixed statement
13822 returns from the method (fixes bug#37752).
13824 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13826 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
13829 2003-02-07 Martin Baulig <martin@ximian.com>
13831 * driver.cs: Removed the `--debug-args' command line argument.
13833 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13834 automatically by the AsssemblyBuilder.
13835 (CodeGen.InitializeSymbolWriter): We don't need to call any
13836 initialization function on the symbol writer anymore. This method
13837 doesn't take any arguments.
13839 2003-02-03 Miguel de Icaza <miguel@ximian.com>
13841 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13842 from referenced assemblies as well.
13844 2003-02-02 Martin Baulig <martin@ximian.com>
13846 * class.cs (MethodData.Emit): Generate debugging info for external methods.
13848 2003-02-02 Martin Baulig <martin@ximian.com>
13850 * class.cs (Constructor.Emit): Open the symbol writer before
13851 emitting the constructor initializer.
13852 (ConstructorInitializer.Emit): Call ec.Mark() to allow
13853 single-stepping through constructor initializers.
13855 2003-01-30 Miguel de Icaza <miguel@ximian.com>
13857 * class.cs: Handle error 549: do not allow virtual methods in
13860 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13862 * decl.cs: Check access levels when resolving types
13864 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13866 * statement.cs: Add parameters and locals set in catch blocks that might
13867 return to set vector
13869 2003-01-29 Miguel de Icaza <miguel@ximian.com>
13871 * class.cs (Operator): Set the SpecialName flags for operators.
13873 * expression.cs (Invocation.DoResolve): Only block calls to
13874 accessors and operators on SpecialName methods.
13876 (Cast.TryReduce): Handle conversions from char constants.
13879 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13881 * statement.cs: small memory and time optimization in FlowBranching.
13883 2003-01-28 Pedro Mart <yoros@wanadoo.es>
13885 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13886 problem that the last fix but in the other sid (Set).
13888 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13889 access when there is no indexer in the hierarchy.
13891 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13893 * class.cs: Combine some if statements.
13895 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13897 * driver.cs: fixed bug #37187.
13899 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
13901 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13902 any indexer, it's needed to build a list with all the indexers in the
13903 hierarchy (AllGetters), else we have problems. Fixes #35653.
13905 2003-01-23 Miguel de Icaza <miguel@ximian.com>
13907 * class.cs (MethodData.Define): It is wrong for an interface
13908 implementation to be static in both cases: explicit and implicit.
13909 We were only handling this in one case.
13911 Improve the if situation there to not have negations.
13913 * class.cs (Field.Define): Turns out that we do not need to check
13914 the unsafe bit on field definition, only on usage. Remove the test.
13916 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13918 * driver.cs: use assembly.Location instead of Codebase (the latest
13919 patch made mcs fail when using MS assemblies).
13921 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
13923 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13924 get the path to *corlib.dll.
13926 2003-01-21 Nick Drochak <ndrochak@gol.com>
13930 * typemanager.cs: Remove compiler warnings
13932 2003-01-20 Duncan Mak <duncan@ximian.com>
13934 * AssemblyInfo.cs: Bump the version number to 0.19.
13936 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13938 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13940 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
13942 * class.cs (Constructor::Emit): Emit debugging info for constructors.
13944 2003-01-17 Miguel de Icaza <miguel@ximian.com>
13946 * cs-parser.jay: Small fix: we were not comparing the constructor
13947 name correctly. Thanks to Zoltan for the initial pointer.
13949 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13951 * cs-tokenizer.cs: Set file name when specified with #line
13953 2003-01-15 Miguel de Icaza <miguel@ximian.com>
13955 * cs-parser.jay: Only perform the constructor checks here if we
13956 are named like the class; This will help provider a better
13957 error. The constructor path is taken when a type definition is
13958 not found, but most likely the user forgot to add the type, so
13959 report that rather than the constructor error.
13961 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13963 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13966 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13968 * cs-parser.jay: Add cleanup call.
13970 2003-01-13 Duncan Mak <duncan@ximian.com>
13972 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13973 consistent with other methods.
13975 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13977 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13979 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13981 * attribute.cs: only set GuidAttr to true when we have a
13984 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13988 * typemanager.cs: fixes to allow mcs compile corlib with the new
13989 Type.IsSubclassOf fix.
13991 2003-01-08 Miguel de Icaza <miguel@ximian.com>
13993 * expression.cs (LocalVariableReference.DoResolve): Classify a
13994 constant as a value, not as a variable. Also, set the type for
13997 * cs-parser.jay (fixed_statement): take a type instead of a
13998 pointer_type, so we can produce a better error message later.
14000 * statement.cs (Fixed.Resolve): Flag types that are not pointers
14003 (For.DoEmit): Make inifinite loops have a
14004 non-conditional branch back.
14006 (Fixed.DoEmit): First populate the pinned variables, then emit the
14007 statement, then clear the variables. Before I was emitting the
14008 code once for each fixed piece.
14011 2003-01-08 Martin Baulig <martin@ximian.com>
14013 * statement.cs (FlowBranching.MergeChild): A break in a
14014 SWITCH_SECTION does not leave a loop. Fixes #36155.
14016 2003-01-08 Martin Baulig <martin@ximian.com>
14018 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
14019 lives in the same number space than `param_map'. Fixes #36154.
14021 2003-01-07 Miguel de Icaza <miguel@ximian.com>
14023 * cs-parser.jay (constructor_declaration): Set the
14024 Constructor.ModFlags before probing for it. This makes the
14025 compiler report 514, 515 and 132 (the code was there, but got
14028 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
14029 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
14030 (GotoCase.Resolve): Set `Returns' to ALWAYS.
14032 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
14034 * enum.cs: create the enum static fields using the enum type.
14036 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
14038 * class.cs: don't try to create the ParamBuilder for the return
14039 type if it's not needed (and handle it breaking for the ms runtime
14042 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
14044 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
14046 2002-12-29 Miguel de Icaza <miguel@ximian.com>
14048 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
14049 the command. This showed up while compiling the JANET source
14050 code, which used \r as its only newline separator.
14052 2002-12-28 Miguel de Icaza <miguel@ximian.com>
14054 * class.cs (Method.Define): If we are an operator (because it
14055 reuses our code), then set the SpecialName and HideBySig. #36128
14057 2002-12-22 Miguel de Icaza <miguel@ximian.com>
14059 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
14060 exception, report error 120 `object reference required'.
14062 * driver.cs: Add --pause option, used during to measure the size
14063 of the process as it goes with --timestamp.
14065 * expression.cs (Invocation.DoResolve): Do not allow methods with
14066 SpecialName to be invoked.
14068 2002-12-21 Miguel de Icaza <miguel@ximian.com>
14070 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
14071 number before adding it.
14073 2002-12-21 Ravi Pratap <ravi@ximian.com>
14075 * ecore.cs (StandardImplicitConversion): When in an unsafe
14076 context, we allow conversion between void * to any other pointer
14077 type. This fixes bug #35973.
14079 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
14081 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
14082 is not thrown when extensionless outputs are used
14084 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14086 * rootcontext.cs: fixed compilation of corlib.
14088 2002-12-19 Miguel de Icaza <miguel@ximian.com>
14090 * attribute.cs (Attributes.Contains): Add new method.
14092 * class.cs (MethodCore.LabelParameters): if the parameter is an
14093 `out' parameter, check that no attribute `[In]' has been passed.
14095 * enum.cs: Handle the `value__' name in an enumeration.
14097 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
14099 * decl.cs: Added special case to allow overrides on "protected
14102 2002-12-18 Ravi Pratap <ravi@ximian.com>
14104 * attribute.cs (Attributes.AddAttributeSection): Rename to this
14105 since it makes much more sense.
14107 (Attributes.ctor): Don't require a Location parameter.
14109 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
14111 * attribute.cs (ApplyAttributes): Remove extra Location parameters
14112 since we already have that information per attribute.
14114 * everywhere : make appropriate changes.
14116 * class.cs (LabelParameters): Write the code which actually
14117 applies attributes to the return type. We can't do this on the MS
14118 .NET runtime so we flag a warning in the case an exception is
14121 2002-12-18 Miguel de Icaza <miguel@ximian.com>
14123 * const.cs: Handle implicit null conversions here too.
14125 2002-12-17 Ravi Pratap <ravi@ximian.com>
14127 * class.cs (MethodCore.LabelParameters): Remove the extra
14128 Type [] parameter since it is completely unnecessary. Instead
14129 pass in the method's attributes so that we can extract
14130 the "return" attribute.
14132 2002-12-17 Miguel de Icaza <miguel@ximian.com>
14134 * cs-parser.jay (parse): Use Report.Error to flag errors instead
14135 of ignoring it and letting the compile continue.
14137 * typemanager.cs (ChangeType): use an extra argument to return an
14138 error condition instead of throwing an exception.
14140 2002-12-15 Miguel de Icaza <miguel@ximian.com>
14142 * expression.cs (Unary.TryReduce): mimic the code for the regular
14143 code path. Perform an implicit cast in the cases where we can
14144 implicitly convert to one of the integral types, and then reduce
14145 based on that constant. This fixes bug #35483.
14147 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14149 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
14151 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14153 * namespace.cs: fixed bug #35489.
14155 2002-12-12 Miguel de Icaza <miguel@ximian.com>
14157 * class.cs: Remove some dead code.
14159 * cs-parser.jay: Estimate the number of methods needed
14160 (RootContext.MethodCount);
14162 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
14163 numbers instead of StringBuilders.
14165 * support.cs (PtrHashtable): Add constructor with initial size;
14166 We can now reduce reallocations of the method table.
14168 2002-12-10 Ravi Pratap <ravi@ximian.com>
14170 * attribute.cs (ApplyAttributes): Keep track of the emitted
14171 attributes on a per-target basis. This fixes bug #35413.
14173 2002-12-10 Miguel de Icaza <miguel@ximian.com>
14175 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
14176 default to the Windows 1252 encoding.
14178 (UnixParseOption): Support version, thanks to Alp for the missing
14181 * AssemblyInfo.cs: Add nice assembly information.
14183 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
14186 * cs-parser.jay: Allow a trailing comma before the close bracked
14187 in the attribute_section production.
14189 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
14190 address of the instance was being taken, I will take this out,
14191 because we take the address of the object immediately here.
14193 2002-12-09 Ravi Pratap <ravi@ximian.com>
14195 * typemanager.cs (AreMultipleAllowed): Take care of the most
14196 obvious case where attribute type is not in the current assembly -
14199 2002-12-08 Miguel de Icaza <miguel@ximian.com>
14201 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
14202 definitions, instead of doing that afterwards.
14204 Also we use a nice little hack, depending on the constructor, we
14205 know if we are a "composed" name or a simple name. Hence, we
14206 avoid the IndexOf test, and we avoid
14208 * codegen.cs: Add code to assist in a bug reporter to track down
14209 the source of a compiler crash.
14211 2002-12-07 Ravi Pratap <ravi@ximian.com>
14213 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
14214 types have been emitted for a given element and flag an error
14215 if something which does not have AllowMultiple set is used more
14218 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
14219 attribute types and their corresponding AllowMultiple properties
14221 (AreMultipleAllowed): Check the property for a given type.
14223 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
14224 property in the case we have a TypeContainer.
14226 (Attributes.AddAttribute): Detect duplicates and just skip on
14227 adding them. This trivial fix catches a pretty gross error in our
14228 attribute emission - global attributes were being emitted twice!
14230 Bugzilla bug #33187 is now fixed.
14232 2002-12-06 Miguel de Icaza <miguel@ximian.com>
14234 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
14235 instead of pp_and).
14237 * expression.cs (Binary.ResolveOperator): I can only use the
14238 Concat (string, string, string) and Concat (string, string,
14239 string, string) if the child is actually a concatenation of
14242 2002-12-04 Miguel de Icaza <miguel@ximian.com>
14244 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
14245 context where we need a 2-character lookahead.
14247 * pending.cs (PendingImplementation): Rework so we can keep track
14248 of interface types all the time, and flag those which were
14249 implemented by parents as optional.
14251 2002-12-03 Miguel de Icaza <miguel@ximian.com>
14253 * expression.cs (Binary.ResolveOperator): Use
14254 String.Concat(string,string,string) or
14255 String.Concat(string,string,string,string) when possible.
14257 * typemanager: More helper methods.
14260 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14262 * pending.cs: remove the bogus return from GetMissingInterfaces()
14263 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14265 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14267 * namespace.cs: avoid duplicated 'using xxx' being added to
14268 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14269 when we get more than one 'using' statement for the same namespace.
14270 Report a CS0105 warning for it.
14272 2002-11-30 Miguel de Icaza <miguel@ximian.com>
14274 * cs-tokenizer.cs (consume_identifier): use read directly, instead
14275 of calling getChar/putback, uses internal knowledge of it.
14277 (xtoken): Reorder tokenizer so most common patterns are checked
14278 first. This reduces the compilation time in another 5% (from 8.11s
14279 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14281 The parsing time is 22% of the compilation in mcs, and from that
14282 64% is spent on the tokenization process.
14284 I tried using a binary search for keywords, but this is slower
14285 than the hashtable. Another option would be to do a couple of
14288 * Not use a StringBuilder, instead use an array of chars,
14289 with a set value. Notice that this way we could catch
14290 the 645 error without having to do it *afterwards*.
14292 * We could write a hand-parser to avoid the hashtable
14293 compares altogether.
14295 The identifier consumption process takes 37% of the tokenization
14296 time. Another 15% is spent on is_number. 56% of the time spent
14297 on is_number is spent on Int64.Parse:
14299 * We could probably choose based on the string length to
14300 use Int32.Parse or Int64.Parse and avoid all the 64-bit
14303 Another 3% is spend on wrapping `xtoken' in the `token' function.
14305 Handle 0xa0 as whitespace (#34752)
14307 2002-11-26 Miguel de Icaza <miguel@ximian.com>
14309 * typemanager.cs (IsCLRType): New routine to tell whether a type
14310 is one of the builtin types.
14312 Maybe it needs to use TypeCodes to be faster. Maybe we could use
14313 typecode in more places instead of doing pointer comparissions.
14314 We could leverage some knowledge about the way the typecodes are
14317 New code to cache namespaces in assemblies, it is currently not
14318 invoked, to be used soon.
14320 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14322 * expression.cs (Binary.ResolveOperator): specially handle
14323 strings, and do not perform user-defined operator overloading for
14326 2002-11-24 Miguel de Icaza <miguel@ximian.com>
14328 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14329 internalcall as it is a pretty simple operation; Avoid whenever
14330 possible to call Char.IsLetter.
14332 (consume_identifier): Cut by half the number of
14333 hashtable calls by merging the is_keyword and GetKeyword behavior.
14335 Do not short-circuit, because if we do, we
14336 report errors (ie, #if false && true would produce an invalid
14340 2002-11-24 Martin Baulig <martin@ximian.com>
14342 * expression.cs (Cast.TryReduce): If we're in checked syntax,
14343 check constant ranges and report a CS0221. Fixes #33186.
14345 2002-11-24 Martin Baulig <martin@ximian.com>
14347 * cs-parser.jay: Make this work for uninitialized variable
14348 declarations in the `for' initializer. Fixes #32416.
14350 2002-11-24 Martin Baulig <martin@ximian.com>
14352 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14353 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
14355 2002-11-24 Martin Baulig <martin@ximian.com>
14357 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14358 argument; if true, we also check for user-defined conversions.
14359 This is only needed if both arguments are of a user-defined type.
14360 Fixes #30443, added test-175.cs.
14361 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14363 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14365 2002-11-24 Martin Baulig <martin@ximian.com>
14367 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14368 function to get the store opcode.
14369 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14370 only emit the Ldelema if the store opcode is Stobj. You must run
14371 both test-34 and test-167 to test this. Fixes #34529.
14373 2002-11-23 Martin Baulig <martin@ximian.com>
14375 * ecore.cs (Expression.MemberLookup): Added additional
14376 `qualifier_type' argument which is used when we're being called
14377 from MemberAccess.DoResolve() and null if we're called from a
14379 (Expression.MemberLookupFailed): New method to report errors; this
14380 does the CS1540 check and reports the correct error message.
14382 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14383 argument for the CS1540 check and redone the way how we're dealing
14384 with private members. See the comment in the source code for details.
14385 (FilterWithClosure): Reverted this back to revision 1.197; renamed
14386 `closure_start_type' to `closure_qualifier_type' and check whether
14387 it's not null. It was not this filter being broken, it was just
14388 being called with the wrong arguments.
14390 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14391 and pass it the correct `qualifier_type'; this also does the error
14394 2002-11-22 Miguel de Icaza <miguel@ximian.com>
14396 * expression.cs (Invocation.EmitParams): If the we are dealing
14397 with a non-built-in value type, load its address as well.
14399 (ArrayCreation): Use a a pretty constant instead
14400 of the hardcoded value 2. Use 6 instead of 2 for the number of
14401 static initializers.
14403 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14404 because they are not really value types, just glorified integers.
14406 * driver.cs: Do not append .exe, the CSC compiler does not do it.
14408 * ecore.cs: Remove redundant code for enumerations, make them use
14409 the same code path as everything else, fixes the casting issue
14410 with enumerations in Windows.Forms.
14412 * attribute.cs: Do only cast to string if it is a string, the
14413 validation happens later.
14415 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14416 people upgrade their corlibs.
14418 * ecore.cs: Oops, enumerations were not following the entire code path
14420 2002-11-21 Miguel de Icaza <miguel@ximian.com>
14422 * typemanager.cs (FilterWithClosure): Commented out the test for
14423 1540 in typemanager.cs, as it has problems when accessing
14424 protected methods from a parent class (see test-174.cs).
14426 * attribute.cs (Attribute.ValidateGuid): new method.
14427 (Attribute.Resolve): Use above.
14429 2002-11-19 Miguel de Icaza <miguel@ximian.com>
14431 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14433 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14434 handling for enumerations, as we only needed the TypeContainer
14435 functionality to begin with (this is required for the fix below to
14436 work for enums that reference constants in a container class for
14439 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14441 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14442 a valid TypeBuilder to perform lookups on.o
14444 * class.cs (InheritableMemberSignatureCompare): Use true in the
14445 call to GetGetMethod and GetSetMethod, because we are comparing
14446 the signature, and we need to get the methods *even* if they are
14449 (PropertyBase.CheckBase): ditto.
14451 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14452 GotoCase.Resolve): Use Peel on EmpytCasts.
14454 * ecore.cs (EmptyCast): drop child, add Peel method.
14456 2002-11-17 Martin Baulig <martin@ximian.com>
14458 * ecore.cs (EmptyCast.Child): New public property.
14460 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14461 label resolved to an EmptyCast. Fixes #34162.
14462 (GotoCase.Resolve): Likewise.
14463 (Block.EmitMeta): Likewise.
14465 2002-11-17 Martin Baulig <martin@ximian.com>
14467 * expression.cs (Invocation.BetterConversion): Prefer int over
14468 uint; short over ushort; long over ulong for integer literals.
14469 Use ImplicitConversionExists instead of StandardConversionExists
14470 since we also need to check for user-defined implicit conversions.
14471 Fixes #34165. Added test-173.cs.
14473 2002-11-16 Martin Baulig <martin@ximian.com>
14475 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14476 with the `true' and `false' literals. Fixes #33151.
14478 2002-11-16 Martin Baulig <martin@ximian.com>
14480 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14481 October 22nd; don't do the cs1540 check for static members.
14483 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14484 now using our own filter here and doing the cs1540 check again.
14486 2002-11-16 Martin Baulig <martin@ximian.com>
14488 * support.cs (InternalParameters): Don't crash if we don't have
14489 any fixed parameters. Fixes #33532.
14491 2002-11-16 Martin Baulig <martin@ximian.com>
14493 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14494 when looking up static methods to make this work on Windows.
14497 2002-11-16 Martin Baulig <martin@ximian.com>
14499 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14500 a setter rather than using PropertyInfo.CanWrite.
14502 2002-11-15 Nick Drochak <ndrochak@gol.com>
14504 * class.cs: Allow acces to block member by subclasses. Fixes build
14507 2002-11-14 Martin Baulig <martin@ximian.com>
14509 * class.cs (Constructor.Emit): Added the extern/block check.
14512 2002-11-14 Martin Baulig <martin@ximian.com>
14514 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14515 iteration while looking for indexers, this is needed because the
14516 indexer may have a different name in our base classes. Fixed the
14517 error reporting (no indexers at all, not get accessor, no
14518 overloaded match). Fixes bug #33089.
14519 (IndexerAccess.DoResolveLValue): Likewise.
14521 2002-11-14 Martin Baulig <martin@ximian.com>
14523 * class.cs (PropertyBase.CheckBase): Make this work for multiple
14524 indexers. Fixes the first part of bug #33089.
14525 (MethodSignature.InheritableMemberSignatureCompare): Added support
14528 2002-11-13 Ravi Pratap <ravi@ximian.com>
14530 * attribute.cs (Attribute.Resolve): Catch the
14531 NullReferenceException and report it since it isn't supposed to
14534 2002-11-12 Miguel de Icaza <miguel@ximian.com>
14536 * expression.cs (Binary.EmitBranchable): Also handle the cases for
14537 LogicalOr and LogicalAnd that can benefit from recursively
14538 handling EmitBranchable. The code now should be nice for Paolo.
14540 2002-11-08 Miguel de Icaza <miguel@ximian.com>
14542 * typemanager.cs (LookupType): Added a negative-hit hashtable for
14543 the Type lookups, as we perform quite a number of lookups on
14544 non-Types. This can be removed once we can deterministically tell
14545 whether we have a type or a namespace in advance.
14547 But this might require special hacks from our corlib.
14551 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14552 and double which avoids a conversion from an integer to a double.
14554 * expression.cs: tiny optimization, avoid calling IsConstant,
14555 because it effectively performs the lookup twice.
14557 2002-11-06 Miguel de Icaza <miguel@ximian.com>
14559 But a bogus return here to keep the semantics of the old code
14560 until the Mono runtime is fixed.
14562 * pending.cs (GetMissingInterfaces): New method used to remove all
14563 the interfaces that are already implemented by our parent
14564 classes from the list of pending methods.
14566 * interface.cs: Add checks for calls after ResolveTypeExpr.
14568 2002-11-05 Miguel de Icaza <miguel@ximian.com>
14570 * class.cs (Class.Emit): Report warning 67: event not used if the
14571 warning level is beyond 3.
14573 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14574 being a NullLiteral.
14576 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14579 * class.cs (TypeContainer.GetClassBases): Cover a missing code
14580 path that might fail if a type can not be resolved.
14582 * expression.cs (Binary.Emit): Emit unsigned versions of the
14585 * driver.cs: use error 5.
14587 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14589 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14591 2002-11-01 Miguel de Icaza <miguel@ximian.com>
14593 * cs-parser.jay (switch_section): A beautiful patch from Martin
14594 Baulig that fixed 33094.
14596 2002-10-31 Miguel de Icaza <miguel@ximian.com>
14598 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14599 Check whether the base is abstract and report an error if so.
14601 * expression.cs (IndexerAccess.DoResolveLValue,
14602 IndexerAccess.DoResolve): ditto.
14604 (Invocation.DoResolve): ditto.
14606 (Invocation.FullMethodDesc): Improve the report string.
14608 * statement.cs (Block): Eliminate IsVariableDefined as it is
14609 basically just a wrapper for GetVariableInfo.
14611 * ecore.cs (SimpleName): Use new
14613 * support.cs (ReflectionParamter.ParameterType): We unwrap the
14614 type, as we return the actual parameter ref/unref state on a
14617 2002-10-30 Miguel de Icaza <miguel@ximian.com>
14619 * support.cs: Return proper flags REF/OUT fixing the previous
14622 * expression.cs: Reverted last patch, that was wrong. Is_ref is
14623 not used to mean `ref' but `ref or out' in ParameterReference
14625 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
14626 full type signature instead of calling TypeManger.CSharpName
14629 * support.cs (InternalParameters.ParameterDesc): Do not compare
14630 directly to the modflags, because REF/OUT will actually be bitsets
14633 * delegate.cs (VerifyMethod): Check also the modifiers.
14635 * cs-tokenizer.cs: Fix bug where floating point values with an
14636 exponent where a sign was missing was ignored.
14638 * driver.cs: Allow multiple assemblies to be specified in a single
14641 2002-10-28 Miguel de Icaza <miguel@ximian.com>
14643 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
14644 because identifiers after a parenthesis would end up in this kind
14645 of production, and we needed to desamiguate it for having casts
14648 (UserDefinedType *) xxx
14650 2002-10-24 Miguel de Icaza <miguel@ximian.com>
14652 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14653 we should set on the Bindingflags.NonPublic, but not turn on
14654 private_ok. private_ok controls whether a Private member is
14655 returned (this is chekced on the filter routine), while the
14656 BindingFlags.NonPublic just controls whether private/protected
14657 will be allowed. This fixes the problem part of the problem of
14658 private properties being allowed to be used in derived classes.
14660 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14661 so we can call the children DoResolveLValue method (this will
14662 properly signal errors on lvalue assignments to base properties)
14664 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14665 getter are null, and we have a property info, we know that this
14666 happened because the lookup failed, so we report an error 122 for
14667 protection level violation.
14669 We also silently return if setter and getter are null in the
14670 resolve functions, this condition only happens if we have flagged
14671 the error before. This is the other half of the problem.
14673 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14674 not have accessibility information, that is why we were returning
14675 true in the filter function in typemanager.cs.
14677 To properly report 122 (property is inaccessible because of its
14678 protection level) correctly, we report this error in ResolveAccess
14679 by failing if both the setter and the getter are lacking (ie, the
14682 DoResolve and DoLResolve have been modified to check for both
14683 setter/getter being null and returning silently, the reason being
14684 that I did not want to put the knowledge about this error in upper
14687 int old = Report.Errors;
14688 x = new PropertyExpr (...);
14689 if (old != Report.Errors)
14694 So the property expr is returned, but it is invalid, so the error
14695 will be flagged during the resolve process.
14697 * class.cs: Remove InheritablePropertySignatureCompare from the
14698 class, as we no longer depend on the property signature to compute
14699 whether it is possible to implement a method or not.
14701 The reason is that calling PropertyInfo.GetGetMethod will return
14702 null (in .NET, in Mono it works, and we should change this), in
14703 cases where the Get Method does not exist in that particular
14708 class X { public virtual int A { get { return 1; } } }
14710 class Z : Y { public override int A { get { return 2; } } }
14712 Would fail in Z because the parent (Y) would not have the property
14713 defined. So we avoid this completely now (because the alternative
14714 fix was ugly and slow), and we now depend exclusively on the
14717 (PropertyBase.CheckBase): Use a method-base mechanism to find our
14718 reference method, instead of using the property.
14720 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14721 routines are gone now.
14723 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14724 names, they were incorrectly named.
14726 * cs-tokenizer.cs: Return are more gentle token on failure.
14728 * pending.cs (PendingImplementation.InterfaceMethod): This routine
14729 had an out-of-sync index variable, which caused it to remove from
14730 the list of pending methods the wrong method sometimes.
14732 2002-10-22 Miguel de Icaza <miguel@ximian.com>
14734 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14735 CanWrite, because those refer to this particular instance of the
14736 property, and do not take into account the fact that we can
14737 override single members of a property.
14739 Constructor requires an EmitContext. The resolution process does
14740 not happen here, but we need to compute the accessors before,
14741 because the resolution does not always happen for properties.
14743 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14744 subclass, before we did not update this flag, but we did update
14747 (GetAccessors): Drop this routine, as it did not work in the
14748 presence of partially overwritten set/get methods.
14750 Notice that this broke the cs1540 detection, but that will require
14753 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14757 * driver.cs: issue a warning instead of an error if we don't support
14758 debugging for the platform. Also ignore a couple of errors that may
14759 arise when trying to write the symbols. Undo my previous patch.
14761 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14763 * driver.cs: ignore /debug switch except for Unix platforms.
14765 2002-10-23 Nick Drochak <ndrochak@gol.com>
14767 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14769 2002-10-21 Miguel de Icaza <miguel@ximian.com>
14771 * driver.cs: Do not make mcs-debug conditional, so we do not break
14772 builds that use it.
14774 * statement.cs (UsageVector.MergeChildren): I would like Martin to
14775 review this patch. But basically after all the children variables
14776 have been merged, the value of "Breaks" was not being set to
14777 new_breaks for Switch blocks. I think that it should be set after
14778 it has executed. Currently I set this to the value of new_breaks,
14779 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14780 conservative, but I do not understand this code very well.
14782 I did not break anything in the build, so that is good ;-)
14784 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14786 2002-10-20 Mark Crichton <crichton@gimp.org>
14788 * cfold.cs: Fixed compile blocker. Really fixed it this time.
14790 2002-10-20 Nick Drochak <ndrochak@gol.com>
14792 * cfold.cs: Fixed compile blocker.
14794 2002-10-20 Miguel de Icaza <miguel@ximian.com>
14796 * driver.cs: I was chekcing the key, not the file.
14798 2002-10-19 Ravi Pratap <ravi@ximian.com>
14800 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14801 message that we were generating - we just need to silently return
14804 2002-10-19 Miguel de Icaza <miguel@ximian.com>
14806 * class.cs (Event.Define): Change my previous commit, as this
14807 breaks the debugger. This is a temporary hack, as it seems like
14808 the compiler is generating events incorrectly to begin with.
14810 * expression.cs (Binary.ResolveOperator): Added support for
14811 "U operator - (E x, E y)"
14813 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14816 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14817 init-only variables, but this path did not take into account that
14818 there might be also instance readonly variables. Correct this
14821 This fixes bug 32253
14823 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14826 * driver.cs: Change the extension for modules to `netmodule'
14828 * cs-parser.jay: Improved slightly the location tracking for
14829 the debugger symbols.
14831 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14832 modifiers that were specified instead of the hardcoded value
14833 (FamAndAssem). This was basically ignoring the static modifier,
14834 and others. Fixes 32429.
14836 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14837 fixed a bug in the process (32476)
14839 * expression.cs (ArrayAccess.EmitAssign): Patch from
14840 hwang_rob@yahoo.ca that fixes bug 31834.3
14842 2002-10-18 Miguel de Icaza <miguel@ximian.com>
14844 * driver.cs: Make the module extension .netmodule.
14846 2002-10-16 Miguel de Icaza <miguel@ximian.com>
14848 * driver.cs: Report an error if the resource file is not found
14849 instead of crashing.
14851 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14852 false, like Emit does.
14854 2002-10-16 Nick Drochak <ndrochak@gol.com>
14856 * typemanager.cs: Remove unused private member. Also reported mcs
14857 bug to report this as a warning like csc.
14859 2002-10-15 Martin Baulig <martin@gnome.org>
14861 * statement.cs (Statement.Emit): Made this a virtual method; emits
14862 the line number info and calls DoEmit().
14863 (Statement.DoEmit): New protected abstract method, formerly knows
14864 as Statement.Emit().
14866 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14868 2002-10-11 Miguel de Icaza <miguel@ximian.com>
14870 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14871 have fixed a remaining problem: not every AddXXXX was adding a
14872 fully qualified name.
14874 Now everyone registers a fully qualified name in the DeclSpace as
14875 being defined instead of the partial name.
14877 Downsides: we are slower than we need to be due to the excess
14878 copies and the names being registered this way.
14880 The reason for this is that we currently depend (on the corlib
14881 bootstrap for instance) that types are fully qualified, because
14882 we dump all the types in the namespace, and we should really have
14883 types inserted into the proper namespace, so we can only store the
14884 basenames in the defined_names array.
14886 2002-10-10 Martin Baulig <martin@gnome.org>
14888 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14889 from bug #31834, see the bug report for a testcase which is
14892 2002-10-10 Martin Baulig <martin@gnome.org>
14894 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14895 flow analysis code for this.
14897 * statement.cs (Do, While, For): Tell the flow analysis code about
14899 (FlowBranching.UsageVector): Added support for infinite loops.
14900 (Block.Resolve): Moved the dead code elimination here and use flow
14903 2002-10-09 Miguel de Icaza <miguel@ximian.com>
14905 * class.cs (Field.Define): Catch cycles on struct type
14908 * typemanager.cs (IsUnmanagedtype): Do not recursively check
14909 fields if the fields are static. We only need to check instance
14912 * expression.cs (As.DoResolve): Test for reference type.
14914 * statement.cs (Using.ResolveExpression): Use
14915 ConvertImplicitRequired, not ConvertImplicit which reports an
14917 (Using.ResolveLocalVariableDecls): ditto.
14919 * expression.cs (Binary.ResolveOperator): Report errors in a few
14920 places where we had to.
14922 * typemanager.cs (IsUnmanagedtype): Finish implementation.
14924 2002-10-08 Miguel de Icaza <miguel@ximian.com>
14926 * expression.cs: Use StoreFromPtr instead of extracting the type
14927 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
14929 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14930 an enumeration value to a System.Enum, but System.Enum is not a
14931 value type, but an class type, so we need to box.
14933 (Expression.ConvertExplicit): One codepath could return
14934 errors but not flag them. Fix this. Fixes #31853
14936 * parameter.cs (Resolve): Do not allow void as a parameter type.
14938 2002-10-06 Martin Baulig <martin@gnome.org>
14940 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14941 if it's a class type and not a struct. Fixes #31815.
14943 2002-10-06 Martin Baulig <martin@gnome.org>
14945 * statement.cs: Reworked the flow analysis code a bit to make it
14946 usable for dead code elimination.
14948 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14950 * cs-parser.jay: allow empty source files. Fixes bug #31781.
14952 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14954 * expression.cs (ComposedCast.DoResolveType): A quick workaround
14955 to fix the test 165, will investigate deeper.
14957 2002-10-04 Martin Baulig <martin@gnome.org>
14959 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14960 finally blocks actually work.
14961 (Try.Resolve): We don't need to create a sibling for `finally' if
14962 there is no finally block.
14964 2002-10-04 Martin Baulig <martin@gnome.org>
14966 * class.cs (Constructor.Define): The default accessibility for a
14967 non-default constructor is private, not public.
14969 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14971 * class.cs (Constructor): Make AllowedModifiers public, add
14974 * cs-parser.jay: Perform the modifiers test here, as the
14975 constructor for the Constructor class usually receives a zero
14976 because of the way we create it (first we create, later we
14977 customize, and we were never checking the modifiers).
14979 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14980 is a version of LookupTypeReflection that includes the type-name
14981 cache. This can be used as a fast path for functions that know
14982 the fully qualified name and are only calling into *.GetType() to
14983 obtain a composed type.
14985 This is also used by TypeManager.LookupType during its type
14988 (LookupType): We now also track the real type name, as sometimes
14989 we can get a quey for the real type name from things like
14990 ComposedCast. This fixes bug 31422.
14992 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14993 complete type fullname, it does not have to go through the type
14994 resolution system to obtain the composed version of the type (for
14995 obtaining arrays or pointers).
14997 (Conditional.Emit): Use the EmitBoolExpression to
14998 generate nicer code, as requested by Paolo.
15000 (ArrayCreation.CheckIndices): Use the patch from
15001 hwang_rob@yahoo.ca to validate the array initializers.
15003 2002-10-03 Miguel de Icaza <miguel@ximian.com>
15005 * class.cs (ConstructorInitializer.Emit): simplify code by using
15006 Invocation.EmitCall, and at the same time, fix the bugs in calling
15007 parent constructors that took variable arguments.
15009 * ecore.cs (Expression.ConvertNumericExplicit,
15010 Expression.ImplicitNumericConversion): Remove the code that
15011 manually wrapped decimal (InternalTypeConstructor call is now gone
15014 * expression.cs (Cast.TryReduce): Also handle decimal types when
15015 trying to perform a constant fold on the type.
15017 * typemanager.cs (IsUnmanagedtype): Partially implemented.
15019 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
15020 that only turned off an error report, and did nothing else.
15022 2002-10-02 Miguel de Icaza <miguel@ximian.com>
15024 * driver.cs: Handle and ignore /fullpaths
15026 2002-10-01 Miguel de Icaza <miguel@ximian.com>
15028 * expression.cs (Binary.ResolveOperator): Catch the case where
15029 DoNumericPromotions returns true,
15031 (Binary.DoNumericPromotions): Simplify the code, and the tests.
15033 2002-09-27 Miguel de Icaza <miguel@ximian.com>
15035 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
15038 2002-09-26 Miguel de Icaza <miguel@ximian.com>
15040 * ecore.cs (ConvertNumericExplicit): It is not enough that the
15041 conversion exists, but it is also required that the conversion be
15042 performed. This manifested in "(Type64Enum) 2".
15044 * class.cs (TypeManager.AddMethod): The fix is not to change
15045 AddEnum, because that one was using a fully qualified name (every
15046 DeclSpace derivative does), but to change the AddMethod routine
15047 that was using an un-namespaced name. This now correctly reports
15048 the duplicated name.
15050 Revert patch until I can properly fix it. The issue
15051 is that we have a shared Type space across all namespaces
15052 currently, which is wrong.
15054 Options include making the Namespace a DeclSpace, and merge
15055 current_namespace/current_container in the parser.
15057 2002-09-25 Miguel de Icaza <miguel@ximian.com>
15059 * cs-parser.jay: Improve error reporting when we get a different
15060 kind of expression in local_variable_type and
15061 local_variable_pointer_type.
15063 Propagate this to avoid missleading errors being reported.
15065 * ecore.cs (ImplicitReferenceConversion): treat
15066 TypeManager.value_type as a target just like object_type. As
15071 Is valid, and needs to result in the int 1 being boxed before it
15072 is assigned to the value type v.
15074 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
15075 to validate the enumeration name.
15077 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
15078 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
15079 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
15081 * ecore.cs (TryImplicitIntConversion): When doing an
15082 implicit-enumeration-conversion, check if the type is 64-bits and
15083 perform a conversion before passing to EnumConstant.
15085 2002-09-23 Miguel de Icaza <miguel@ximian.com>
15087 * decl.cs (Error_AmbiguousTypeReference); New routine used to
15088 report ambiguous type references. Unlike the MS version, we
15089 report what the ambiguity is. Innovation at work ;-)
15091 (DeclSpace.FindType): Require a location argument to
15092 display when we display an ambiguous error.
15094 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
15096 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
15098 * expression.cs (EmitDynamicInitializers): Apply patch from
15099 hwang_rob@yahoo.ca that fixes the order in which we emit our
15102 2002-09-21 Martin Baulig <martin@gnome.org>
15104 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
15105 delegate takes no arguments.
15107 2002-09-20 Miguel de Icaza <miguel@ximian.com>
15109 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
15112 * expression.cs: Extract the underlying type.
15114 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
15116 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
15118 2002-09-19 Miguel de Icaza <miguel@ximian.com>
15120 * class.cs (TypeContainer.DefineType): We can not use the nice
15121 PackingSize with the size set to 1 DefineType method, because it
15122 will not allow us to define the interfaces that the struct
15125 This completes the fixing of bug 27287
15127 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
15128 means also structs. This fixes part of the problem.
15129 (Expresion.ImplicitReferenceConversionExists): ditto.
15131 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
15132 error if there were no errors reported during the type lookup
15133 process, to avoid duplicates or redundant errors. Without this
15134 you would get an ambiguous errors plus a type not found. We have
15135 beaten the user enough with the first error.
15137 (DeclSparce.FindType): Emit a warning if we have an ambiguous
15140 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
15141 during the resolution process, stop the lookup, this avoids
15142 repeated error reports (same error twice).
15144 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
15146 * typemanager.cs (LookupType): Redo the type lookup code to match
15147 the needs of System.Reflection.
15149 The issue is that System.Reflection requires references to nested
15150 types to begin with a "+" sign instead of a dot. So toplevel
15151 types look like: "NameSpace.TopLevelClass", and nested ones look
15152 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
15155 2002-09-19 Martin Baulig <martin@gnome.org>
15157 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
15158 says that a method always returns or always throws an exception,
15159 don't report the CS0161.
15161 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
15162 set `Returns = new_returns'.
15164 2002-09-19 Martin Baulig <martin@gnome.org>
15166 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
15167 to an enum constant, check for a CS0176.
15169 2002-09-18 Miguel de Icaza <miguel@ximian.com>
15171 * class.cs (TypeContainer.CheckPairedOperators): Now we check
15172 for operators that must be in pairs and report errors.
15174 * ecore.cs (SimpleName.DoResolveType): During the initial type
15175 resolution process, when we define types recursively, we must
15176 check first for types in our current scope before we perform
15177 lookups in the enclosing scopes.
15179 * expression.cs (MakeByteBlob): Handle Decimal blobs.
15181 (Invocation.VerifyArgumentsCompat): Call
15182 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
15183 I thought we were supposed to always call this, but there are a
15184 few places in the code where we dont do it.
15186 2002-09-17 Miguel de Icaza <miguel@ximian.com>
15188 * driver.cs: Add support in -linkres and -resource to specify the
15189 name of the identifier.
15191 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15193 * ecore.cs (StandardConversionExists): Sync with the conversion
15194 code: allow anything-* to void* conversions.
15196 (FindMostSpecificSource): Use an Expression argument
15197 instead of a Type, because we might be handed over a Literal which
15198 gets a few more implicit conversions that plain types do not. So
15199 this information was being lost.
15201 Also, we drop the temporary type-holder expression when not
15204 2002-09-17 Martin Baulig <martin@gnome.org>
15206 * class.cs (PropertyBase.CheckBase): Don't check the base class if
15207 this is an explicit interface implementation.
15209 2002-09-17 Martin Baulig <martin@gnome.org>
15211 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
15212 different `IndexerName' attributes.
15214 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
15215 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
15216 virtual CommonResolve().
15218 2002-09-16 Miguel de Icaza <miguel@ximian.com>
15220 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
15221 and convert that to the UnderlyingType.
15223 * statement.cs (Foreach.Resolve): Indexers are just like variables
15224 or PropertyAccesses.
15226 * cs-tokenizer.cs (consume_string): Track line numbers and columns
15227 inside quoted strings, we were not doing this before.
15229 2002-09-16 Martin Baulig <martin@gnome.org>
15231 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
15232 resolve it. This is needed for the definite assignment check of the
15233 instance expression, fixes bug #29846.
15234 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
15236 2002-09-16 Nick Drochak <ndrochak@gol.com>
15238 * parameter.cs: Fix compile error. Cannot reference static member
15239 from an instance object. Is this an mcs bug?
15241 2002-09-14 Martin Baulig <martin@gnome.org>
15243 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
15244 multiple times. Fixes bug #30295, added test-166.cs.
15246 2002-09-14 Martin Baulig <martin@gnome.org>
15248 * statement.cs (Block.Emit): Don't emit unreachable code.
15249 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15250 `break' statements.
15251 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15253 2002-09-14 Martin Baulig <martin@gnome.org>
15255 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15258 2002-09-14 Martin Baulig <martin@gnome.org>
15260 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15261 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15262 be false on the ms runtime.
15264 2002-09-13 Martin Baulig <martin@gnome.org>
15266 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15267 the CS0038 error message.
15269 2002-09-12 Miguel de Icaza <miguel@ximian.com>
15271 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15272 constant inside, return it.
15274 2002-09-12 Martin Baulig <martin@gnome.org>
15276 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15277 implicit conversion can be done between enum types.
15279 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15280 check whether an implicit conversion to the current enum's UnderlyingType
15281 exists and report an error if not.
15283 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15284 without debugging support.
15286 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15287 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
15289 2002-09-12 Martin Baulig <martin@gnome.org>
15291 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15293 * ecore.cs (IMemberExpr.DeclaringType): New property.
15294 (SimpleName.SimpleNameResolve): Check whether we're accessing a
15295 nonstatic member of an outer type (CS0038).
15297 2002-09-11 Miguel de Icaza <miguel@ximian.com>
15299 * driver.cs: Activate the using-error detector at warning level
15300 4 (at least for MS-compatible APIs).
15302 * namespace.cs (VerifyUsing): Small buglett fix.
15304 * pending.cs (PendingImplementation): pass the container pointer.
15306 * interface.cs (GetMethods): Allow for recursive definition. Long
15307 term, I would like to move every type to support recursive
15308 definitions, not the current ordering mechanism that we have right
15311 The situation is this: Attributes are handled before interfaces,
15312 so we can apply attributes to interfaces. But some attributes
15313 implement interfaces, we will now handle the simple cases
15314 (recursive definitions will just get an error).
15316 * parameter.cs: Only invalidate types at the end if we fail to
15319 2002-09-09 Martin Baulig <martin@gnome.org>
15321 * ecore.cs (PropertyExpr.Emit): Also check for
15322 TypeManager.system_int_array_get_length so this'll also work when
15323 compiling corlib. Fixes #30003.
15325 2002-09-09 Martin Baulig <martin@gnome.org>
15327 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15328 and throw an exception if we can't get the type's size. Fixed #30040,
15331 2002-09-09 Martin Baulig <martin@gnome.org>
15333 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15335 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15336 context. Fixes bug #30027.
15338 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15339 virtual functions. Fixes bug #30043, added test-164.cs.
15341 2002-09-08 Ravi Pratap <ravi@ximian.com>
15343 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15345 2002-09-08 Nick Drochak <ndrochak@gol.com>
15347 * driver.cs: Use an object to get the windows codepage since it's not a
15350 2002-09-08 Miguel de Icaza <miguel@ximian.com>
15352 * statement.cs (For.Emit): for infinite loops (test == null)
15353 return whether there is a break inside, not always "true".
15355 * namespace.cs (UsingEntry): New struct to hold the name of the
15356 using definition, the location where it is defined, and whether it
15357 has been used in a successful type lookup.
15359 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15364 2002-09-06 Ravi Pratap <ravi@ximian.com>
15366 * attribute.cs : Fix incorrect code which relied on catching
15367 a NullReferenceException to detect a null being passed in
15368 where an object was expected.
15370 2002-09-06 Miguel de Icaza <miguel@ximian.com>
15372 * statement.cs (Try): flag the catch variable as assigned
15374 * expression.cs (Cast): Simplified by using ResolveType instead of
15375 manually resolving.
15377 * statement.cs (Catch): Fix bug by using ResolveType.
15379 2002-09-06 Ravi Pratap <ravi@ximian.com>
15381 * expression.cs (BetterConversion): Special case for when we have
15382 a NullLiteral as the argument and we have to choose between string
15383 and object types - we choose string the way csc does.
15385 * attribute.cs (Attribute.Resolve): Catch the
15386 NullReferenceException and report error #182 since the Mono
15387 runtime no more has the bug and having this exception raised means
15388 we tried to select a constructor which takes an object and is
15391 2002-09-05 Ravi Pratap <ravi@ximian.com>
15393 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15394 message (1502, 1503) when we can't locate a method after overload
15395 resolution. This is much more informative and closes the bug
15398 * interface.cs (PopulateMethod): Return if there are no argument
15399 types. Fixes a NullReferenceException bug.
15401 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15402 expressions too. Previously we were checking only in one place for
15403 positional arguments leaving out named arguments.
15405 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15406 type to the enum type is not allowed. Remove code corresponding to
15409 (ConvertNumericExplicit): Allow explicit conversions from
15410 the underlying type to enum type. This precisely follows the spec
15411 and closes a bug filed by Gonzalo.
15413 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15416 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15418 2002-09-03 Miguel de Icaza <miguel@ximian.com>
15420 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15421 it was important that we stored the right value after the
15422 reduction in `converted'.
15424 2002-09-04 Martin Baulig <martin@gnome.org>
15426 * location.cs (Location.SymbolDocument): Use full pathnames for the
15429 2002-08-30 Miguel de Icaza <miguel@ximian.com>
15431 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15432 of the expression resolve mechanism, because that will catch the
15433 SimpleName error failures.
15435 (Conditional): If we can not resolve the
15436 expression, return, do not crash.
15438 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15441 (location): display token name instead of its number.
15443 2002-08-28 Martin Baulig <martin@gnome.org>
15445 * expression.cs (Binary.ResolveOperator): Don't silently return
15446 but return an error if an operator cannot be applied between two
15449 2002-08-28 Martin Baulig <martin@gnome.org>
15451 * class.cs (Constructor.Define): Set the permission attributes
15452 correctly instead of making all constructors public.
15454 2002-08-28 Martin Baulig <martin@gnome.org>
15456 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15457 for private members before reporting a CS0103; if we find anything,
15460 2002-08-28 Martin Baulig <martin@gnome.org>
15462 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15463 to check whether `closure_start_type == closure_invocation_type',
15464 we also need to check whether `m.DeclaringType == closure_invocation_type'
15465 before bypassing the permission checks. We might be accessing
15466 protected/private members from the base class.
15467 (TypeManager.RealMemberLookup): Only set private_ok if private
15468 members were requested via BindingFlags.NonPublic.
15470 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15472 * expression.cs (MemberAccess.ResolveMemberAccess): Set
15473 MethodGroupExpr.IsExplicitImpl if appropriate.
15474 (Invocation.DoResolve): Don't report the CS0120 for explicit
15475 interface implementations.
15477 2002-08-27 Martin Baulig <martin@gnome.org>
15479 * expression.cs (Invocation.DoResolve): If this is a static
15480 method and we don't have an InstanceExpression, we must report
15483 2002-08-25 Martin Baulig <martin@gnome.org>
15485 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15486 `==' between a valuetype and an object.
15488 2002-08-25 Miguel de Icaza <miguel@ximian.com>
15490 * ecore.cs (TypeExpr): Provide a ToString method.
15492 2002-08-24 Martin Baulig <martin@gnome.org>
15494 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15495 now called proggie.dbg and it's a binary file.
15497 2002-08-23 Martin Baulig <martin@gnome.org>
15499 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15501 2002-08-23 Martin Baulig <martin@gnome.org>
15503 * struct.cs (MyStructInfo.ctor): Make this work with empty
15504 structs; it's not allowed to use foreach() on null.
15506 2002-08-23 Martin Baulig <martin@gnome.org>
15508 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15509 writer the full pathname of the generated assembly.
15511 2002-08-23 Martin Baulig <martin@gnome.org>
15513 * statements.cs (FlowBranching.UsageVector.MergeChildren):
15514 A `finally' block never returns or breaks; improved handling of
15517 2002-08-23 Martin Baulig <martin@gnome.org>
15519 * statement.cs (Throw.Resolve): Allow `throw null'.
15521 2002-08-23 Martin Baulig <martin@gnome.org>
15523 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15524 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15525 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
15526 MemberLookup would return a wrong event if this is an explicit
15527 interface implementation and the class has an event with the same
15530 2002-08-23 Martin Baulig <martin@gnome.org>
15532 * statement.cs (Block.AddChildVariableNames): New public method.
15533 (Block.AddChildVariableName): Likewise.
15534 (Block.IsVariableNameUsedInChildBlock): Likewise.
15535 (Block.AddVariable): Check whether a variable name has already
15536 been used in a child block.
15538 * cs-parser.jay (declare_local_variables): Mark all variable names
15539 from the current block as being used in a child block in the
15542 2002-08-23 Martin Baulig <martin@gnome.org>
15544 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15545 find the symbol writer.
15547 * driver.cs: csc also allows the arguments to /define being
15548 separated by commas, not only by semicolons.
15550 2002-08-23 Martin Baulig <martin@gnome.org>
15552 * interface.cs (Interface.GetMembers): Added static check for events.
15554 2002-08-15 Martin Baulig <martin@gnome.org>
15556 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15557 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15559 * ecore.cs (Expression.MemberLookup): Added documentation and explained
15560 why the MethodData.EmitDestructor() change was necessary.
15562 2002-08-20 Martin Baulig <martin@gnome.org>
15564 * class.cs (TypeContainer.FindMembers): Added static check for events.
15566 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15568 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15569 use Type.GetEvents(), not Type.FindMembers().
15571 2002-08-20 Martin Baulig <martin@gnome.org>
15573 * decl.cs (MemberCache): Added a special method cache which will
15574 be used for method-only searched. This ensures that a method
15575 search will return a MethodInfo with the correct ReflectedType for
15578 2002-08-20 Martin Baulig <martin@gnome.org>
15580 * decl.cs (DeclSpace.FindMembers): Made this public.
15582 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15584 * delegate.cs: fixed build on windows.
15585 [FIXME: Filed as bug #29150: MCS must report these errors.]
15587 2002-08-19 Ravi Pratap <ravi@ximian.com>
15589 * ecore.cs (StandardConversionExists): Return a false
15590 if we are trying to convert the void type to anything else
15591 since that is not allowed.
15593 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15594 we flag error 70 in the event an event is trying to be accessed
15595 directly from outside the declaring type.
15597 2002-08-20 Martin Baulig <martin@gnome.org>
15599 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
15600 MemberCache from typemanager.cs to decl.cs.
15602 2002-08-19 Martin Baulig <martin@gnome.org>
15604 * class.cs (TypeContainer): Implement IMemberContainer.
15605 (TypeContainer.DefineMembers): Create the MemberCache.
15606 (TypeContainer.FindMembers): Do better BindingFlags checking; only
15607 return public members if BindingFlags.Public was given, check
15608 whether members are static.
15610 2002-08-16 Martin Baulig <martin@gnome.org>
15612 * decl.cs (DeclSpace.Define): Splitted this in Define and
15613 DefineMembers. DefineMembers is called first and initializes the
15616 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
15617 DefineMembers() on all our DeclSpaces.
15619 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
15620 but call DefineMembers() on all nested interfaces. We call their
15621 Define() in our new Define() function.
15623 * interface.cs (Interface): Implement IMemberContainer.
15624 (Interface.Define): Moved all code except the attribute stuf to
15626 (Interface.DefineMembers): Initialize the member cache.
15628 * typemanager.cs (IMemberFinder): Removed this interface, we don't
15629 need this anymore since we can use MemberCache.FindMembers directly.
15631 2002-08-19 Martin Baulig <martin@gnome.org>
15633 * typemanager.cs (MemberCache): When creating the cache for an
15634 interface type, add all inherited members.
15635 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
15636 to `out bool used_cache' and documented it.
15637 (TypeManager.MemberLookup): If we already used the cache in the first
15638 iteration, we don't need to do the interfaces check.
15640 2002-08-19 Martin Baulig <martin@gnome.org>
15642 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
15643 here from IMemberFinder and don't implement this interface anymore.
15644 (DeclSpace.MemberCache): Moved here from IMemberFinder.
15646 * typemanager.cs (IMemberFinder): This interface is now only used by
15647 classes which actually support the member cache.
15648 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15649 since we only put DeclSpaces into this Hashtable.
15650 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15651 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15653 2002-08-16 Martin Baulig <martin@gnome.org>
15655 * typemanager.cs (ICachingMemberFinder): Removed.
15656 (IMemberFinder.MemberCache): New property.
15657 (TypeManager.FindMembers): Merged this with RealFindMembers().
15658 This function will never be called from TypeManager.MemberLookup()
15659 so we can't use the cache here, just the IMemberFinder.
15660 (TypeManager.MemberLookup_FindMembers): Check whether the
15661 IMemberFinder has a MemberCache and call the cache's FindMembers
15663 (MemberCache): Rewrote larger parts of this yet another time and
15664 cleaned it up a bit.
15666 2002-08-15 Miguel de Icaza <miguel@ximian.com>
15668 * driver.cs (LoadArgs): Support quoting.
15670 (Usage): Show the CSC-like command line arguments.
15672 Improved a few error messages.
15674 2002-08-15 Martin Baulig <martin@gnome.org>
15676 * typemanager.cs (IMemberContainer.Type): New property.
15677 (IMemberContainer.IsInterface): New property.
15679 The following changes are conditional to BROKEN_RUNTIME, which is
15680 defined at the top of the file.
15682 * typemanager.cs (MemberCache.MemberCache): Don't add the base
15683 class'es members, but add all members from TypeHandle.ObjectType
15684 if we're an interface.
15685 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15686 is the current type.
15687 (MemberCache.CacheEntry.Container): Removed this field.
15688 (TypeHandle.GetMembers): Include inherited members.
15690 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15692 * typemanager.cs: fixed compilation and added a comment on a field that
15695 2002-08-15 Martin Baulig <martin@gnome.org>
15697 * class.cs (ConstructorInitializer.Resolve): In the
15698 Expression.MemberLookup call, use the queried_type as
15701 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15702 declared' attribute, it's always true.
15703 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15704 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15705 temporary wrapper for FindMembers which tells MemberLookup whether
15706 members from the base classes are included in the return value.
15707 This will go away soon.
15708 (TypeManager.MemberLookup): Use this temporary hack here; once the
15709 new MemberCache is completed, we don't need to do the DeclaredOnly
15710 looping here anymore since the MemberCache will take care of this.
15711 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15712 (MemberCache): When creating the MemberCache for a class, get
15713 members from the current class and all its base classes.
15714 (MemberCache.CacheEntry.Container): New field. This is a
15715 temporary hack until the Mono runtime is fixed to distinguish
15716 between ReflectedType and DeclaringType. It allows us to use MCS
15717 with both the MS runtime and the unfixed Mono runtime without
15718 problems and without accecting performance.
15719 (MemberCache.SearchMembers): The DeclaredOnly looping from
15720 TypeManager.MemberLookup is now done here.
15722 2002-08-14 Martin Baulig <martin@gnome.org>
15724 * statement.cs (MyStructInfo.MyStructInfo): Don't call
15725 Type.GetFields on dynamic types but get the fields from the
15726 corresponding TypeContainer.
15727 (MyStructInfo.GetStructInfo): Added check for enum types.
15729 * typemanager.cs (MemberList.IsSynchronized): Implemented.
15730 (MemberList.SyncRoot): Implemented.
15731 (TypeManager.FilterWithClosure): No need to check permissions if
15732 closure_start_type == closure_invocation_type, don't crash if
15733 closure_invocation_type is null.
15735 2002-08-13 Martin Baulig <martin@gnome.org>
15737 Rewrote TypeContainer.FindMembers to use a member cache. This
15738 gives us a speed increase of about 35% for the self-hosting MCS
15739 build and of about 15-20% for the class libs (both on GNU/Linux).
15741 * report.cs (Timer): New class to get enhanced profiling. This
15742 whole class is "TIMER" conditional since it remarkably slows down
15745 * class.cs (MemberList): New class. This is an IList wrapper
15746 which we're now using instead of passing MemberInfo[]'s around to
15747 avoid copying this array unnecessarily.
15748 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15749 (ICachingMemberFinder, IMemberContainer): New interface.
15750 (TypeManager.FilterWithClosure): If `criteria' is null, the name
15751 has already been checked, otherwise use it for the name comparision.
15752 (TypeManager.FindMembers): Renamed to RealMemberFinder and
15753 provided wrapper which tries to use ICachingMemberFinder.FindMembers
15754 if possible. Returns a MemberList, not a MemberInfo [].
15755 (TypeHandle): New class, implements IMemberContainer. We create
15756 one instance of this class per type, it contains a MemberCache
15757 which is used to do the member lookups.
15758 (MemberCache): New class. Each instance of this class contains
15759 all members of a type and a name-based hash table.
15760 (MemberCache.FindMembers): This is our new member lookup
15761 function. First, it looks up all members of the requested name in
15762 the hash table. Then, it walks this list and sorts out all
15763 applicable members and returns them.
15765 2002-08-13 Martin Baulig <martin@gnome.org>
15767 In addition to a nice code cleanup, this gives us a performance
15768 increase of about 1.4% on GNU/Linux - not much, but it's already
15769 half a second for the self-hosting MCS compilation.
15771 * typemanager.cs (IMemberFinder): New interface. It is used by
15772 TypeManager.FindMembers to call FindMembers on a TypeContainer,
15773 Enum, Delegate or Interface.
15774 (TypeManager.finder_to_member_finder): New PtrHashtable.
15775 (TypeManager.finder_to_container): Removed.
15776 (TypeManager.finder_to_delegate): Removed.
15777 (TypeManager.finder_to_interface): Removed.
15778 (TypeManager.finder_to_enum): Removed.
15780 * interface.cs (Interface): Implement IMemberFinder.
15782 * delegate.cs (Delegate): Implement IMemberFinder.
15784 * enum.cs (Enum): Implement IMemberFinder.
15786 * class.cs (TypeContainer): Implement IMemberFinder.
15788 2002-08-12 Martin Baulig <martin@gnome.org>
15790 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15792 2002-08-12 Martin Baulig <martin@gnome.org>
15794 * ecore.cs (ITypeExpression): New interface for expressions which
15796 (TypeExpression): Renamed to TypeLookupExpression.
15797 (Expression.DoResolve): If we're doing a types-only lookup, the
15798 expression must implement the ITypeExpression interface and we
15799 call DoResolveType() on it.
15800 (SimpleName): Implement the new ITypeExpression interface.
15801 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15802 hack, the situation that we're only looking up types can't happen
15803 anymore when this method is called. Moved the type lookup code to
15804 DoResolveType() and call it.
15805 (SimpleName.DoResolveType): This ITypeExpression interface method
15806 is now doing the types-only lookup.
15807 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15808 (ResolveFlags): Added MaskExprClass.
15810 * expression.cs (MemberAccess): Implement the ITypeExpression
15812 (MemberAccess.DoResolve): Added support for a types-only lookup
15813 when we're called via ITypeExpression.DoResolveType().
15814 (ComposedCast): Implement the ITypeExpression interface.
15816 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
15817 Expression.Resolve() with ResolveFlags.Type instead.
15819 2002-08-12 Martin Baulig <martin@gnome.org>
15821 * interface.cs (Interface.Define): Apply attributes.
15823 * attribute.cs (Attribute.ApplyAttributes): Added support for
15824 interface attributes.
15826 2002-08-11 Martin Baulig <martin@gnome.org>
15828 * statement.cs (Block.Emit): Only check the "this" variable if we
15829 do not always throw an exception.
15831 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15832 whether the property has a set accessor.
15834 2002-08-11 Martin Baulig <martin@gnome.org>
15836 Added control flow analysis support for structs.
15838 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15839 with control flow analysis turned off.
15840 (IVariable): New interface.
15841 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15842 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15843 (FieldExpr.DoResolve): Resolve the instance expression with flow
15844 analysis turned off and do the definite assignment check after the
15845 resolving when we know what the expression will resolve to.
15847 * expression.cs (LocalVariableReference, ParameterReference):
15848 Implement the new IVariable interface, only call the flow analysis
15849 code if ec.DoFlowAnalysis is true.
15850 (This): Added constructor which takes a Block argument. Implement
15851 the new IVariable interface.
15852 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15853 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15854 This does the definite assignment checks for struct members.
15856 * class.cs (Constructor.Emit): If this is a non-static `struct'
15857 constructor which doesn't have any initializer, call
15858 Block.AddThisVariable() to tell the flow analysis code that all
15859 struct elements must be initialized before control returns from
15862 * statement.cs (MyStructInfo): New public class.
15863 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15864 argument to this indexer. If non-zero, check an individual struct
15865 member, not the whole struct.
15866 (FlowBranching.CheckOutParameters): Check struct members.
15867 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15868 overloaded versions of these methods which take an additional
15869 `int field_idx' argument to check struct members.
15870 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15871 overloaded versions of these methods which take an additional
15872 `string field_name' argument to check struct member.s
15873 (VariableInfo): Implement the IVariable interface.
15874 (VariableInfo.StructInfo): New public property. Returns the
15875 MyStructInfo instance of the variable if it's a struct or null.
15876 (Block.AddThisVariable): New public method. This is called from
15877 Constructor.Emit() for non-static `struct' constructor which do
15878 not have any initializer. It creates a special variable for the
15879 "this" instance variable which will be checked by the flow
15880 analysis code to ensure that all of the struct's fields are
15881 initialized before control returns from the constructor.
15882 (UsageVector): Added support for struct members. If a
15883 variable/parameter is a struct with N members, we reserve a slot
15884 in the usage vector for each member. A struct is considered fully
15885 initialized if either the struct itself (slot 0) or all its
15886 members are initialized.
15888 2002-08-08 Martin Baulig <martin@gnome.org>
15890 * driver.cs (Driver.MainDriver): Only report an error CS5001
15891 if there were no compilation errors.
15893 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15894 `UnsafeContext' property to determine whether the parent is in
15895 unsafe context rather than checking the parent's ModFlags:
15896 classes nested in an unsafe class are unsafe as well.
15898 2002-08-08 Martin Baulig <martin@gnome.org>
15900 * statement.cs (UsageVector.MergeChildren): Distinguish between
15901 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15902 we return. Added test17() and test18() to test-154.cs.
15904 2002-08-08 Martin Baulig <martin@gnome.org>
15906 * typemanager.cs (TypeManager.FilterWithClosure): If we have
15907 Family access, make sure the invoking type isn't a subclass of the
15908 queried type (that'd be a CS1540).
15910 * ecore.cs (Expression.MemberLookup): Added overloaded version of
15911 this method which takes an additional `Type invocation_type'.
15913 * expression.cs (BaseAccess.DoResolve): Use the base type as
15914 invocation and query type.
15915 (MemberAccess.DoResolve): If the lookup failed and we're about to
15916 report a CS0122, try a lookup with the ec.ContainerType - if this
15917 succeeds, we must report a CS1540.
15919 2002-08-08 Martin Baulig <martin@gnome.org>
15921 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15922 (MethodGroupExpr): Implement the IMemberExpr interface.
15924 * expression (MemberAccess.ResolveMemberAccess): No need to have
15925 any special code for MethodGroupExprs anymore, they're now
15928 2002-08-08 Martin Baulig <martin@gnome.org>
15930 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15931 Family, FamANDAssem and FamORAssem permissions.
15932 (TypeManager.IsSubclassOrNestedChildOf): New public method.
15934 2002-08-08 Martin Baulig <martin@gnome.org>
15936 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15937 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15940 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15942 * driver.cs: implemented /resource option to embed managed resources.
15944 2002-08-07 Martin Baulig <martin@gnome.org>
15946 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15947 (FieldBase.HasFieldInitializer): New public property.
15948 (FieldBase.GetInitializerExpression): New public method. Resolves and
15949 returns the field initializer and makes sure it is only resolved once.
15950 (TypeContainer.EmitFieldInitializers): Call
15951 FieldBase.GetInitializerExpression to get the initializer, this ensures
15952 that it isn't resolved multiple times.
15954 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
15955 the resolving process (SimpleName/MemberLookup) that we're currently
15956 emitting a field initializer (which must not access any instance members,
15957 this is an error CS0236).
15959 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15960 argument, if the `IsFieldInitializer' flag is set, we must report and
15961 error CS0236 and not an error CS0120.
15963 2002-08-07 Martin Baulig <martin@gnome.org>
15965 * ecore.cs (IMemberExpr): New public interface.
15966 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15967 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15968 if the expression is an IMemberExpr.
15970 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15971 to be null, implicitly default to `this' if we're non-static in
15972 this case. Simplified the code a lot by using the new IMemberExpr
15973 interface. Also fixed bug #28176 here.
15975 2002-08-06 Martin Baulig <martin@gnome.org>
15977 * cs-parser.jay (SimpleLookup): Removed. We need to create
15978 ParameterReferences during semantic analysis so that we can do a
15979 type-only search when resolving Cast, TypeOf and SizeOf.
15980 (block): Pass the `current_local_parameters' to the Block's
15983 * class.cs (ConstructorInitializer): Added `Parameters parameters'
15984 argument to the constructor.
15985 (ConstructorInitializer.Resolve): Create a temporary implicit
15986 block with the parameters.
15988 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15989 references here if we aren't doing a type-only search.
15991 * statement.cs (Block): Added constructor which takes a
15992 `Parameters parameters' argument.
15993 (Block.Parameters): New public property.
15995 * support.cs (InternalParameters.Parameters): Renamed `parameters'
15996 to `Parameters' and made it public readonly.
15998 2002-08-06 Martin Baulig <martin@gnome.org>
16000 * ecore.cs (Expression.Warning): Made this public as well.
16002 * report.cs (Report.Debug): Print the contents of collections.
16004 2002-08-06 Martin Baulig <martin@gnome.org>
16006 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
16007 used to tell Resolve() which kinds of expressions it may return.
16008 (Expression.Resolve): Added overloaded version of this method which
16009 takes a `ResolveFlags flags' argument. This can be used to tell
16010 Resolve() which kinds of expressions it may return. Reports a
16012 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
16013 ResolveFlags.SimpleName.
16014 (Expression.Error118): Added overloaded version of this method which
16015 takes a `ResolveFlags flags' argument. It uses the flags to determine
16016 which kinds of expressions are allowed.
16018 * expression.cs (Argument.ResolveMethodGroup): New public method.
16019 Resolves an argument, but allows a MethodGroup to be returned.
16020 This is used when invoking a delegate.
16022 * TODO: Updated a bit.
16024 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16026 Fixed compilation with csc.
16028 * ecore.cs: Expression.Error made public. Is this correct? Should
16029 Warning be made public too?
16031 * expression.cs: use ea.Location instead of ea.loc.
16032 [FIXME: Filed as bug #28607: MCS must report these errors.]
16034 2002-08-06 Martin Baulig <martin@gnome.org>
16036 * ecore.cs (Expression.loc): Moved the location here instead of
16037 duplicating it in all derived classes.
16038 (Expression.Location): New public property.
16039 (Expression.Error, Expression.Warning): Made them non-static and
16040 removed the location argument.
16041 (Expression.Warning): Added overloaded version which takes an
16042 `int level' argument.
16043 (Expression.Error118): Make this non-static and removed the
16044 expression and location arguments.
16045 (TypeExpr): Added location argument to the constructor.
16047 * expression.cs (StaticCallExpr): Added location argument to
16049 (Indirection, PointerArithmetic): Likewise.
16050 (CheckedExpr, UnCheckedExpr): Likewise.
16051 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
16052 (StringPtr): Likewise.
16055 2002-08-05 Martin Baulig <martin@gnome.org>
16057 * expression.cs (BaseAccess.DoResolve): Actually report errors.
16059 * assign.cs (Assign.DoResolve): Check whether the source
16060 expression is a value or variable.
16062 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
16063 while resolving the corresponding blocks.
16065 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
16066 an error, don't silently return null.
16068 * statement.cs (Block.AddVariable): Do the error reporting here
16069 and distinguish between CS0128 and CS0136.
16070 (Block.DoResolve): Report all unused labels (warning CS0164).
16071 (LabeledStatement): Pass the location to the constructor.
16072 (LabeledStatement.HasBeenReferenced): New property.
16073 (LabeledStatement.Resolve): Set it to true here.
16075 * statement.cs (Return.Emit): Return success even after reporting
16076 a type mismatch error (CS0126 or CS0127), this is what csc does and
16077 it avoids confusing the users with any consecutive errors.
16079 2002-08-05 Martin Baulig <martin@gnome.org>
16081 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
16083 * const.cs (Const.LookupConstantValue): Catch circular definitions.
16085 * expression.cs (MemberAccess.DoResolve): Silently return if an
16086 error has already been reported.
16088 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
16089 error has already been reported.
16091 2002-08-05 Martin Baulig <martin@gnome.org>
16093 * statement.cs (UsageVector): Only initialize the `parameters'
16094 vector if we actually have any "out" parameters.
16096 2002-08-05 Martin Baulig <martin@gnome.org>
16098 * expression.cs (Binary.ResolveOperator): When combining delegates,
16099 they must have the same type.
16101 2002-08-05 Martin Baulig <martin@gnome.org>
16103 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
16104 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
16105 work with the ms runtime and we also don't need it: if we're a
16106 PropertyBuilder and not in the `indexer_arguments' hash, then we
16107 are a property and not an indexer.
16109 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
16110 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
16111 since the latter one doesn't work with the ms runtime.
16113 2002-08-03 Martin Baulig <martin@gnome.org>
16115 Fixed bugs #27998 and #22735.
16117 * class.cs (Method.IsOperator): New public field.
16118 (Method.CheckBase): Report CS0111 if there's already a method
16119 with the same parameters in the current class. Report CS0508 when
16120 attempting to change the return type of an inherited method.
16121 (MethodData.Emit): Report CS0179 if a method doesn't have a body
16122 and it's not marked abstract or extern.
16123 (PropertyBase): New abstract base class for Property and Indexer.
16124 (PropertyBase.CheckBase): Moved here from Property and made it work
16126 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
16127 the same so we can reuse it there.
16128 (Property, Indexer): Derive from PropertyBase.
16129 (MethodSignature.inheritable_property_signature_filter): New delegate
16130 to find properties and indexers.
16132 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
16133 argument and improved error reporting.
16135 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
16136 EmptyReadOnlyParameters and made it a property.
16138 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
16139 version of this method which takes a `PropertyInfo indexer'.
16140 (TypeManager.RegisterIndexer): New method.
16142 * class.cs: Added myself as author of this file :-)
16144 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16146 * class.cs: fixed compilation on windoze.
16148 2002-08-03 Martin Baulig <martin@gnome.org>
16150 * interface.cs (Interface.GetInterfaceBases): Check whether all
16151 base interfaces are at least as accessible than the current one.
16153 * class.cs (TypeContainer.GetClassBases): Check whether base types
16154 are at least as accessible than the current type.
16155 (TypeContainer.AsAccessible): Implemented and made non-static.
16156 (MemberBase.CheckParameters): Report errors if the accessibility
16159 * delegate.cs (Delegate.Delegate): The default visibility is
16160 internal for top-level types and private for nested types.
16161 (Delegate.Define): Report errors if the accessibility checks fail.
16163 * enum.cs (Enum.Enum): The default visibility is internal for
16164 top-level types and private for nested types.
16165 (Enum.DefineType): Compute the correct visibility.
16167 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
16168 function which takes a `bool is_toplevel' instead of a TypeContainer.
16170 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
16173 2002-08-02 Martin Baulig <martin@gnome.org>
16175 * expression.cs (LocalVariableReferenc): Added constructor which
16176 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
16177 (LocalVariableReference.IsReadOnly): New property.
16178 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
16179 variable is readonly, use our own readonly flag to do this; you can
16180 use the new constructor to get a writable reference to a read-only
16183 * cs-parser.jay (foreach_statement, using_statement): Get a writable
16184 reference to the local variable.
16186 2002-08-01 Miguel de Icaza <miguel@ximian.com>
16188 * rootcontext.cs (ResolveCore): Also include System.Exception
16190 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
16191 we reach an EmptyStatement.
16193 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
16196 * expression.cs (Binary.ResolveOperator): Check error result in
16199 use brtrue/brfalse directly and avoid compares to null.
16201 2002-08-02 Martin Baulig <martin@gnome.org>
16203 * class.cs (TypeContainer.Define): Define all nested interfaces here.
16204 Fixes bug #28407, added test-155.cs.
16206 2002-08-01 Martin Baulig <martin@gnome.org>
16208 * class.cs (Event.EmitDefaultMethod): Make this work with static
16209 events. Fixes #28311, added verify-3.cs.
16211 2002-08-01 Martin Baulig <martin@gnome.org>
16213 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
16214 `is_disposable' fields.
16215 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
16216 `hm.is_disposable' if we're using the collection pattern.
16217 (Foreach.EmitCollectionForeach): Use the correct type for the
16218 enumerator's local variable, only emit the try/finally block if
16219 necessary (fixes #27713).
16221 2002-08-01 Martin Baulig <martin@gnome.org>
16223 * ecore.cs (Expression.report118): Renamed to Error118 and made
16226 * statement.cs (Throw.Resolve): Check whether the expression is of
16227 the correct type (CS0118) and whether the type derives from
16228 System.Exception (CS0155).
16229 (Catch.Resolve): New method. Do the type lookup here and check
16230 whether it derives from System.Exception (CS0155).
16231 (Catch.CatchType, Catch.IsGeneral): New public properties.
16233 * typemanager.cs (TypeManager.exception_type): Added.
16235 2002-07-31 Miguel de Icaza <miguel@ximian.com>
16237 * driver.cs: Updated About function.
16239 2002-07-31 Martin Baulig <martin@gnome.org>
16241 Implemented Control Flow Analysis.
16243 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
16244 (EmitContext.CurrentBranching): Added.
16245 (EmitContext.StartFlowBranching): Added.
16246 (EmitContext.EndFlowBranching): Added.
16247 (EmitContext.KillFlowBranching): Added.
16248 (EmitContext.IsVariableAssigned): Added.
16249 (EmitContext.SetVariableAssigned): Added.
16250 (EmitContext.IsParameterAssigned): Added.
16251 (EmitContext.SetParameterAssigned): Added.
16252 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16253 Added control flow analysis stuff here.
16255 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16256 resolve the expression as lvalue.
16257 (LocalVariableReference.DoResolve): Check whether the variable has
16258 already been assigned.
16259 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16260 the parameter as assigned here.
16261 (ParameterReference.DoResolve): Check whether the parameter has already
16263 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16264 expression as lvalue.
16266 * statement.cs (FlowBranching): New class for the flow analysis code.
16267 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16268 (LabeledStatement.IsDefined): New public property.
16269 (LabeledStatement.AddUsageVector): New public method to tell flow
16270 analyis that the label may be reached via a forward jump.
16271 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16273 (VariableInfo.Number): New public field. This is used by flow analysis
16274 to number all locals of a block.
16275 (Block.CountVariables): New public property. This is the number of
16276 local variables in this block (including the locals from all parent
16278 (Block.EmitMeta): Number all the variables.
16280 * statement.cs: Added flow analysis support to all classes.
16282 2002-07-31 Martin Baulig <martin@gnome.org>
16284 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16285 To get debugging messages, compile mcs with /define:MCS_DEBUG and
16286 then use this argument.
16288 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16290 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16291 use this to specify /define options.
16293 2002-07-29 Martin Baulig <martin@gnome.org>
16295 * statement.cs (Fixed): Moved all code that does variable lookups
16296 and resolvings from Emit to Resolve.
16298 * statement.cs (For): Moved all code that does variable lookups
16299 and resolvings from Emit to Resolve.
16301 * statement.cs (Using): Moved all code that does variable lookups
16302 and resolvings from Emit to Resolve.
16304 2002-07-29 Martin Baulig <martin@gnome.org>
16306 * attribute.cs (Attribute.Resolve): Explicitly catch a
16307 System.NullReferenceException when creating the
16308 CustromAttributeBuilder and report a different warning message.
16310 2002-07-29 Martin Baulig <martin@gnome.org>
16312 * support.cs (ParameterData.ParameterName): Added method to
16313 get the name of a parameter.
16315 * typemanager.cs (TypeManager.IsValueType): New public method.
16317 2002-07-29 Martin Baulig <martin@gnome.org>
16319 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
16320 is a flag which specifies that it's either ref or out.
16321 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16322 the out parameter to `out Parameter.Modifier mod', also set the
16323 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16325 * support.cs (InternalParameters.ParameterModifier): Distinguish
16326 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16327 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16329 * expression.cs (Argument.GetParameterModifier): Distinguish
16330 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16331 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16333 2002-07-29 Martin Baulig <martin@gnome.org>
16335 * expression.cs (ParameterReference.ParameterReference): Added
16336 `Location loc' argument to the constructor.
16338 * cs-parser.jay: Pass location to ParameterReference.
16340 2002-07-28 Miguel de Icaza <miguel@ximian.com>
16342 * statement.cs (Try): Initialize the location.
16344 * cs-parser.jay: pass location to Try.
16346 * expression.cs (Unary.Reduce): Change the prototype to return
16347 whether a constant fold could be performed or not. The result is
16348 returned in an out parameters. In the case of Indirection and
16349 AddressOf, we want to perform the full tests.
16351 2002-07-26 Miguel de Icaza <miguel@ximian.com>
16353 * statement.cs (Statement.Emit): Flag dead code.
16355 2002-07-27 Andrew Birkett <andy@nobugs.org>
16357 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16359 2002-07-27 Martin Baulig <martin@gnome.org>
16361 * class.cs (MethodData.Define): Put back call to
16362 TypeManager.AddMethod(), accidentally commented this out.
16364 * report.cs (Debug): New public method to print debugging information,
16365 this is `[Conditional ("DEBUG")]'.
16367 2002-07-26 Martin Baulig <martin@gnome.org>
16369 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16370 (switch_statement): Push the current_block to the switch_stack and
16371 pop it again when we're done with the switch.
16372 (switch_section): The new block is a child of the current_block.
16373 Fixes bug #24007, added test-152.cs.
16375 2002-07-27 Martin Baulig <martin@gnome.org>
16377 * expression.cs (Invocation.EmitArguments): When calling a varargs
16378 function with only its fixed arguments, we need to pass an empty
16381 2002-07-27 Martin Baulig <martin@gnome.org>
16383 Mono 0.13 has been released.
16385 2002-07-25 Miguel de Icaza <miguel@ximian.com>
16387 * driver.cs: Rename --resource to --linkres, because that is what
16388 we do currently, we dont support --resource yet.
16390 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16392 2002-07-25 Martin Baulig <martin@gnome.org>
16394 * class.cs (MethodData): New public class. This is a `method builder'
16395 class for a method or one accessor of a Property/Indexer/Event.
16396 (MethodData.GetMethodFlags): Moved here from MemberBase.
16397 (MethodData.ApplyAttributes): Likewise.
16398 (MethodData.ApplyObsoleteAttribute): Likewise.
16399 (MethodData.ApplyConditionalAttribute): Likewise.
16400 (MethodData.ApplyDllImportAttribute): Likewise.
16401 (MethodData.CheckAbstractAndExternal): Likewise.
16402 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16403 (MethodData.Emit): Formerly known as Method.Emit().
16404 (MemberBase): Moved everything which was specific to a single
16405 accessor/method to MethodData.
16406 (Method): Create a new MethodData and call Define() and Emit() on it.
16407 (Property, Indexer, Event): Create a new MethodData objects for each
16408 accessor and call Define() and Emit() on them.
16410 2002-07-25 Martin Baulig <martin@gnome.org>
16412 Made MethodCore derive from MemberBase to reuse the code from there.
16413 MemberBase now also checks for attributes.
16415 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16416 (MemberBase.GetMethodFlags): Moved here from class Method and marked
16418 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16419 `CallingConventions cc' and `Attributes opt_attrs' arguments.
16420 (MemberBase.ApplyAttributes): New virtual method; applies the
16421 attributes to a method or accessor.
16422 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16423 (MemberBase.ApplyConditionalAttribute): Likewise.
16424 (MemberBase.ApplyDllImportAttribute): Likewise.
16425 (MemberBase.CheckAbstractAndExternal): Likewise.
16426 (MethodCore.ParameterTypes): This is now a property instead of a
16427 method, it's initialized from DoDefineParameters().
16428 (MethodCore.ParameterInfo): Removed the set accessor.
16429 (MethodCore.DoDefineParameters): New protected virtual method to
16430 initialize ParameterTypes and ParameterInfo.
16431 (Method.GetReturnType): We can now simply return the MemberType.
16432 (Method.GetMethodFlags): Override the MemberBase version and add
16433 the conditional flags.
16434 (Method.CheckBase): Moved some code from Define() here, call
16435 DoDefineParameters() here.
16436 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16437 here to avoid some larger code duplication.
16438 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16439 ensure that abstract and external accessors don't declare a body.
16441 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16442 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16443 lookup in the attribute's parent classes, so we need to abort as soon
16444 as we found the first match.
16445 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16446 the attribute has no arguments.
16448 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16451 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16453 * cs-parser.jay: reverted previous patch.
16455 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16457 * cs-parser.jay: fixed bug #22119.
16459 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16461 * attribute.cs: fixed compilation. The error was:
16462 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
16463 be assigned to before control leaves the current method."
16464 [FIXME: Filed as bug #28186: MCS must report this error.]
16466 2002-07-25 Martin Baulig <martin@gnome.org>
16468 * attribute.cs (Attribute.Conditional_GetConditionName): New static
16469 method to pull the condition name ouf of a Conditional attribute.
16470 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16471 the obsolete message and error flag out of an Obsolete attribute.
16473 * class.cs (Method.GetMethodFlags): New public method to get the
16474 TypeManager.MethodFlags for this method.
16475 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16477 (Method.Define): Get and apply the Obsolete and Conditional attributes;
16478 if we're overriding a virtual function, set the new private variable
16479 `parent_method'; call the new TypeManager.AddMethod().
16481 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
16482 the MethodBuilder and the Method in a PtrHashtable.
16483 (TypeManager.builder_to_method): Added for this purpose.
16484 (TypeManager.MethodFlags): Added IsObsoleteError.
16485 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
16486 Obsolete and Conditional arguments in MethodBuilders. If we discover
16487 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16488 the message from the attribute.
16490 2002-07-24 Martin Baulig <martin@gnome.org>
16492 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16493 preprocessor directives, ensure that the argument to #define/#undef is
16494 exactly one identifier and that it's actually an identifier.
16496 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16499 2002-07-24 Martin Baulig <martin@gnome.org>
16501 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16502 initialize it to TypeManager.object_type in the constructor.
16503 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16504 of the `hm.get_current' method if we're using the collection pattern.
16505 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16506 for the explicit conversion to make it work when we're using the collection
16507 pattern and the `Current' property has a different return type than `object'.
16510 2002-07-24 Martin Baulig <martin@gnome.org>
16512 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16513 does not match, but don't report any errors. This method is called in
16514 order for all methods in a MethodGroupExpr until a matching method is
16515 found, so we don't want to bail out if the first method doesn't match.
16516 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16517 matches, report the 123. Fixes #28070.
16519 2002-07-24 Martin Baulig <martin@gnome.org>
16521 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16522 TypeManager.TypeToCoreType() to the top of the method so the
16523 following equality checks will work. Fixes #28107.
16525 2002-07-24 Martin Baulig <martin@gnome.org>
16527 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16528 operand is of type uint, and the other operand is of type sbyte,
16529 short or int, the operands are converted to type long." -
16530 Actually do what this comment already told us. Fixes bug #28106,
16533 2002-07-24 Martin Baulig <martin@gnome.org>
16535 * class.cs (MethodBase): New abstract class. This is now a base
16536 class for Property, Indexer and Event to avoid some code duplication
16537 in their Define() and DefineMethods() methods.
16538 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16539 generic methods for Define() and DefineMethods().
16540 (FieldBase): Derive from MemberBase, not MemberCore.
16541 (Property): Derive from MemberBase, not MemberCore.
16542 (Property.DefineMethod): Moved all the code from this method to the
16543 new MethodBase.DefineAccessor(), just call it with appropriate
16545 (Property.Define): Call the new Property.DoDefine(), this does some
16546 sanity checks and we don't need to duplicate the code everywhere.
16547 (Event): Derive from MemberBase, not MemberCore.
16548 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16549 accessors, this will also make them work with interface events.
16550 (Indexer): Derive from MemberBase, not MemberCore.
16551 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16552 (Indexer.Define): Use the new MethodBase functions.
16554 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16555 argument to the constructor.
16556 (Interface.FindMembers): Added support for interface events.
16557 (Interface.PopluateEvent): Implemented.
16559 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
16561 2002-07-22 Miguel de Icaza <miguel@ximian.com>
16563 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16564 but this is required to check for a method name being the same as
16565 the containing class.
16569 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16571 * interface.cs: initialize variable.
16573 2002-07-23 Martin Baulig <martin@gnome.org>
16575 Implemented the IndexerName attribute in interfaces.
16577 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16578 name if this is an explicit interface implementation.
16579 (Indexer.InterfaceIndexerName): New public variable. If we're
16580 implementing an interface indexer, this is the IndexerName in that
16581 interface. Otherwise, it's the IndexerName.
16582 (Indexer.DefineMethod): If we're implementing interface indexer,
16583 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
16584 and Pending.ImplementIndexer methods.
16585 (Indexer.Define): Also define the PropertyBuilder if we're
16586 implementing an interface indexer and this is neither an explicit
16587 interface implementation nor do the IndexerName match the one in
16590 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16591 If a method is defined here, then we always need to create a proxy
16592 for it. This is used when implementing interface indexers.
16593 (Pending.IsInterfaceIndexer): New public method.
16594 (Pending.ImplementIndexer): New public method.
16595 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16596 This is used when implementing interface indexers to define a proxy
16598 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16599 define a proxy if necessary.
16601 * interface.cs (Interface.IndexerName): New public variable.
16602 (Interface.PopulateIndexer): Set the IndexerName.
16603 (Interface.DefineIndexers): New private method. Populate all the
16604 indexers and make sure their IndexerNames match.
16606 * typemanager.cs (IndexerPropertyName): Added support for interface
16609 2002-07-22 Martin Baulig <martin@gnome.org>
16611 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
16612 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
16613 ret if HasReturnLabel.
16614 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
16617 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
16618 and set the ec.LoopBeginTryCatchLevel.
16619 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
16620 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
16621 the current ec.TryCatchLevel, the branch goes out of an exception
16622 block. In this case, we need to use Leave and not Br.
16624 2002-07-22 Martin Baulig <martin@gnome.org>
16626 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
16627 block unless the block does not always return or it is contained in
16628 another try { ... } catch { ... } block. Fixes bug #26506.
16629 Added verify-1.cs to the test suite.
16631 2002-07-22 Martin Baulig <martin@gnome.org>
16633 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
16634 then we do not always return. Fixes bug #24985.
16636 2002-07-22 Martin Baulig <martin@gnome.org>
16638 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
16639 lookup on a per-class level; ie. walk up the class hierarchy until we
16640 found at least one applicable method, then choose the best among them.
16641 Fixes bug #24463 and test-29.cs.
16643 2002-07-22 Martin Baulig <martin@gnome.org>
16645 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16646 return types of the methods. The return type is not part of the
16647 signature and we must not check it to make the `new' modifier work.
16648 Fixes bug #27999, also added test-147.cs.
16649 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16651 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16652 on the method's return type.
16654 2002-07-21 Martin Baulig <martin@gnome.org>
16656 * assign.cs: Make this work if the rightmost source is a constant and
16657 we need to do an implicit type conversion. Also adding a few more tests
16658 to test-38.cs which should have caught this.
16660 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16661 target in the makefile for this. The makefile.gnu is primarily intended
16662 for end-users who don't want to debug the compiler.
16664 2002-07-21 Martin Baulig <martin@gnome.org>
16666 * assign.cs: Improved the Assign class so it can now handle embedded
16667 assignments (X = Y = Z = something). As a side-effect this'll now also
16668 consume less local variables. test-38.cs now passes with MCS, added
16669 a few new test cases to that test.
16671 2002-07-20 Martin Baulig <martin@gnome.org>
16673 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16674 instructions. Fixes bug #27977, also added test-146.cs.
16676 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16678 * cs-tokenizer.cs: fixed getHex ().
16680 2002-07-19 Martin Baulig <martin@gnome.org>
16682 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16683 not Type.GetType() to lookup the array type. This is needed when
16684 we're constructing an array of a user-defined type.
16685 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16686 single-dimensional arrays, but also for single-dimensial arrays of
16689 2002-07-19 Martin Baulig <martin@gnome.org>
16691 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16692 this function is called, it's not allowed to share LocalBuilders
16693 among ILGenerators.
16695 2002-07-19 Martin Baulig <martin@gnome.org>
16697 * expression.cs (Argument.Resolve): Report an error 118 when trying
16698 to pass a type as argument.
16700 2002-07-18 Martin Baulig <martin@gnome.org>
16702 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16703 Conv_R_Un for the signed `long' type.
16705 2002-07-15 Miguel de Icaza <miguel@ximian.com>
16707 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16708 `expr' for the temporary result, as that will fail if we do
16709 multiple resolves on the same expression.
16711 2002-07-05 Miguel de Icaza <miguel@ximian.com>
16713 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16714 ec.TypeContainer for looking up aliases.
16716 * class.cs (TypeContainer): Remove LookupAlias from here.
16718 * decl.cs (DeclSpace); Move here.
16720 2002-07-01 Miguel de Icaza <miguel@ximian.com>
16722 * class.cs (FindMembers): Only call filter if the constructor
16723 bulider is not null.
16725 Also handle delegates in `NestedTypes' now. Now we will perform
16726 type lookups using the standard resolution process. This also
16729 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16730 This uses Expressions (the limited kind that can be parsed by the
16731 tree) instead of strings.
16733 * expression.cs (ComposedCast.ToString): Implement, used to flag
16734 errors since now we have to render expressions.
16736 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
16739 * ecore.cs (SimpleName.ToString): ditto.
16741 * cs-parser.jay: Instead of using strings to assemble types, use
16742 Expressions to assemble the type (using SimpleName, ComposedCast,
16743 MemberAccess). This should fix the type lookups in declarations,
16744 because we were using a different code path for this.
16746 * statement.cs (Block.Resolve): Continue processing statements
16747 even when there is an error.
16749 2002-07-17 Miguel de Icaza <miguel@ximian.com>
16751 * class.cs (Event.Define): Also remove the `remove' method from
16752 the list of pending items.
16754 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16755 generate more compact code.
16757 2002-07-17 Martin Baulig <martin@gnome.org>
16759 * const.cs (Const.LookupConstantValue): Add support for constant
16760 `unchecked' and `checked' expressions.
16761 Also adding test case test-140.cs for this.
16763 2002-07-17 Martin Baulig <martin@gnome.org>
16765 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16766 check whether mi.ReturnType implements the IEnumerator interface; the
16767 `==' and the IsAssignableFrom() will fail in this situation.
16769 2002-07-16 Ravi Pratap <ravi@ximian.com>
16771 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
16774 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16776 * expression.cs: fixed bug #27811.
16778 2002-07-14 Miguel de Icaza <miguel@ximian.com>
16780 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16781 Molaro: when we are a ref, the value already contains a pointer
16782 value, do not take the address of it.
16784 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16785 * removed mb-parser.jay and mb-tokenizer.cs
16787 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16789 * expression.cs: check against the building corlib void type.
16791 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16793 * ecore.cs: fix for valuetype static readonly fields: when
16794 initializing them, we need their address, not the address of a copy.
16796 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16798 * typemanager.cs: register also enum_type in corlib.
16800 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16802 * class.cs: allow calling this (but not base) initializers in structs.
16804 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16806 * ecore.cs: make sure we compare against the building base types
16809 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16811 * typemanager.cs: fix TypeToCoreType() to handle void and object
16812 (corlib gets no more typerefs after this change).
16814 2002-07-12 Miguel de Icaza <miguel@ximian.com>
16816 * expression.cs (ArrayCreation.EmitArrayArguments): use
16817 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16819 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16820 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
16821 array indexes, the runtime actually forbids them.
16823 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16824 for array arguments here.
16826 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16827 instead of the default for ValueTypes.
16829 (New.DoEmit): Use IsValueType instead of
16830 IsSubclassOf (value_type)
16831 (New.DoResolve): ditto.
16832 (Invocation.EmitCall): ditto.
16834 * assign.cs (Assign): ditto.
16836 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16837 Statements *are* currently doing part of their resolution during
16840 Expressions do always resolve during resolve, but statements are
16841 only required to propagate resolution to their children.
16843 2002-07-11 Miguel de Icaza <miguel@ximian.com>
16845 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16847 (LoadAssembly): Do not add the dll if it is already specified
16849 (MainDriver): Add the System directory to the link path at the end,
16850 after all the other -L arguments.
16852 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16853 wrong opcode for loading bytes and bools (ldelem.i1 instead of
16854 ldelem.u1) and using the opposite for sbytes.
16856 This fixes Digger, and we can finally run it.
16858 * driver.cs (UnixParseOption): Move the option parsing here.
16859 (CSCParseOption): Implement CSC-like parsing of options.
16861 We now support both modes of operation, the old Unix way, and the
16862 new CSC-like way. This should help those who wanted to make cross
16863 platform makefiles.
16865 The only thing broken is that /r:, /reference: and /lib: are not
16866 implemented, because I want to make those have the same semantics
16867 as the CSC compiler has, and kill once and for all the confussion
16868 around this. Will be doing this tomorrow.
16870 * statement.cs (Unsafe.Resolve): The state is checked during
16871 resolve, not emit, so we have to set the flags for IsUnsfe here.
16873 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16875 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16876 not catch the Error_ObjectRefRequired in SimpleName (as it is
16877 possible to have a class/instance variable name that later gets
16878 deambiguated), we have to check this here.
16880 2002-07-10 Ravi Pratap <ravi@ximian.com>
16882 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16883 make static and put into Expression.
16885 (Event.Define): Register the private field of the event with the
16886 TypeManager so that GetFieldFromEvent can get at it.
16888 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16889 keep track of the private field associated with an event which
16892 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16895 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16897 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16899 * expression.cs (Binary.EmitBranchable): this routine emits the
16900 Binary expression in a branchable context. This basically means:
16901 we need to branch somewhere, not just get the value on the stack.
16903 This works together with Statement.EmitBoolExpression.
16905 * statement.cs (Statement.EmitBoolExpression): Use
16908 2002-07-09 Miguel de Icaza <miguel@ximian.com>
16910 * statement.cs (For): Reduce the number of jumps in loops.
16912 (For): Implement loop inversion for the For statement.
16914 (Break): We can be breaking out of a Try/Catch controlled section
16915 (foreach might have an implicit try/catch clause), so we need to
16916 use Leave instead of Br.
16918 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16919 now). If the instace expression supports IMemoryLocation, we use
16920 the AddressOf method from the IMemoryLocation to extract the
16921 address instead of emitting the instance.
16923 This showed up with `This', as we were emitting the instance
16924 always (Emit) instead of the Address of This. Particularly
16925 interesting when This is a value type, as we dont want the Emit
16926 effect (which was to load the object).
16928 2002-07-08 Miguel de Icaza <miguel@ximian.com>
16930 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16932 * statement.cs (Checked): Set the CheckedState during the resolve
16933 process too, as the ConvCast operations track the checked state on
16934 the resolve process, and not emit.
16936 * cs-parser.jay (namespace_member_declaration): Flag that we have
16937 found a declaration when we do. This is used to flag error 1529
16939 * driver.cs: Report ok when we display the help only.
16941 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
16943 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16945 2002-07-04 Miguel de Icaza <miguel@ximian.com>
16947 * cs-tokenizer.cs (define): We also have to track locally the
16948 defines. AllDefines is just used for the Conditional Attribute,
16949 but we also need the local defines for the current source code.
16951 2002-07-03 Miguel de Icaza <miguel@ximian.com>
16953 * statement.cs (While, For, Do): These loops can exit through a
16954 Break statement, use this information to tell whether the
16955 statement is the last piece of code.
16957 (Break): Flag that we break.
16959 * codegen.cs (EmitContexts): New `Breaks' state variable.
16961 2002-07-03 Martin Baulig <martin@gnome.org>
16963 * class.cs (TypeContainer.MethodModifiersValid): Allow override
16964 modifiers in method declarations in structs. Otherwise, you won't
16965 be able to override things like Object.Equals().
16967 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16969 * class.cs (Method, Property, Indexer): Do not allow the public
16970 modifier to be used in explicit interface implementations.
16972 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16973 override modifiers in method declarations in structs
16975 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
16977 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16978 integer or real overflow, report an error
16980 2002-07-02 Martin Baulig <martin@gnome.org>
16982 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16983 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16984 to tell the runtime about our newly created System.Object and
16985 System.ValueType types.
16987 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16989 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16990 struct instead of Ldarg/Starg.
16992 2002-07-02 Martin Baulig <martin@gnome.org>
16994 * expression.cs (Indirection.Indirection): Call
16995 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16997 2002-07-02 Martin Baulig <martin@gnome.org>
16999 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17000 ValueType, call TypeManager.TypeToCoreType() on it.
17001 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17002 the OpCodes.Newarr argument.
17004 2002-07-02 Martin Baulig <martin@gnome.org>
17006 * expression.cs (Invocation.EmitCall): When compiling corlib,
17007 replace all calls to the system's System.Array type to calls to
17008 the newly created one.
17010 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
17011 System.Array methods.
17012 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
17013 from the system's System.Array type which must be replaced.
17015 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
17017 * typemanager.cs: load unverifiable_code_ctor so we can build
17018 corlib using the correct type. Avoid using GetTypeCode() with
17020 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
17021 TypeManager.object_type to allow building corlib.
17023 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
17025 * ecore.cs: handle System.Enum separately in LoadFromPtr().
17027 2002-07-01 Martin Baulig <martin@gnome.org>
17029 * class.cs: Make the last change actually work, we need to check
17030 whether `ifaces != null' to avoid a crash.
17032 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17034 * class.cs: when we build structs without fields that implement
17035 interfaces, we need to add the interfaces separately, since there is
17036 no API to both set the size and add the interfaces at type creation
17039 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17041 * expression.cs: the dimension arguments to the array constructors
17042 need to be converted if they are a long.
17044 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
17046 * class.cs: don't emit ldarg.0 if there is no parent constructor
17047 (fixes showstopper for corlib).
17049 2002-06-29 Martin Baulig <martin@gnome.org>
17051 MCS now compiles corlib on GNU/Linux :-)
17053 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
17054 ie. check for MethodImplOptions.InternalCall.
17056 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
17057 and TypeManager.attribute_type are null, so we must explicitly check
17058 whether parent is not null to find out whether it's an attribute type.
17059 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
17060 and SetBuilder, not only if the property is neither abstract nor external.
17061 This is necessary to set the MethodImplOptions on the accessor methods.
17062 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
17063 SetBuilder, see Property.Emit().
17065 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
17066 populate "System.Object", "System.ValueType" and "System.Attribute" since
17067 they've already been populated from BootCorlib_PopulateCoreTypes().
17069 2002-06-29 Martin Baulig <martin@gnome.org>
17071 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
17072 is the NullLiteral, we also need to make sure that target_type is not
17075 2002-06-29 Martin Baulig <martin@gnome.org>
17077 * rootcontext.cs (RootContext.ResolveCore): We must initialize
17078 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
17079 before calling BootstrapCorlib_ResolveDelegate ().
17081 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17083 * statement.cs: fixed build-breaker. All tests passed ok.
17085 2002-06-27 Martin Baulig <martin@gnome.org>
17087 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
17088 for System.Decimal when compiling corlib.
17090 2002-06-27 Martin Baulig <martin@gnome.org>
17092 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
17093 switch blocks which contain nothing but a default clause.
17095 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
17097 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
17099 2002-06-27 Martin Baulig <martin@gnome.org>
17101 * ecore.cs (PropertyExpr.PropertyExpr): Call
17102 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
17104 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
17105 is already a TypeBuilder.
17107 2002-06-27 Martin Baulig <martin@gnome.org>
17109 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
17110 `target_type == TypeManager.array_type', not IsAssignableFrom() in
17111 the "from an array-type to System.Array" case. This makes it work
17112 when compiling corlib.
17114 2002-06-27 Martin Baulig <martin@gnome.org>
17116 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
17117 non-static PropertyExpr, set its InstanceExpression. This makes
17118 the `ICollection.Count' property work in System/Array.cs.
17120 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
17122 * driver.cs: Made error handling more consistent. Errors now
17123 tracked by Report class, so many methods which used to return int
17124 now return void. Main() now prints success/failure and
17125 errors/warnings message.
17127 Renamed '--probe' compiler argument to '--expect-error'. Removed
17128 the magic number return values (123 and 124). Now, if the
17129 expected error occurs, the compiler exits with success (exit value
17130 0). If the compilation completes without seeing that particular
17131 error, the compiler exits with failure (exit value 1). The
17132 makefile in mcs/errors has been changed to handle the new behaviour.
17134 * report.cs: Made 'expected error' number a property and renamed
17135 it from 'Probe' to 'ExpectedError'.
17137 * genericparser.cs: Removed error handling support, since it is
17138 now all done by Report class.
17140 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
17141 class, so parse() no longer returns an int.
17143 * namespace.cs: Use Report.Error instead of GenericParser.error
17145 2002-06-22 Miguel de Icaza <miguel@ximian.com>
17147 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
17148 TypeContainer.AddOperator): At the front of the list put the
17149 explicit implementations, so they get resolved/defined first.
17151 2002-06-21 Miguel de Icaza <miguel@ximian.com>
17153 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
17154 interface type is implemented by this TypeContainer. Used during
17155 explicit interface implementation.
17157 (Property.Define, Indexer.Define, Method.Define): Validate that
17158 the given interface in the explicit implementation is one of the
17159 base classes for the containing type.
17161 Also if we are explicitly implementing an interface, but there is
17162 no match in the pending implementation table, report an error.
17164 (Property.Define): Only define the property if we are
17165 not explicitly implementing a property from an interface. Use the
17166 correct name also for those properties (the same CSC uses,
17167 although that is really not needed).
17169 (Property.Emit): Do not emit attributes for explicitly implemented
17170 properties, as there is no TypeBuilder.
17172 (Indexer.Emit): ditto.
17174 Hiding then means that we do not really *implement* a pending
17175 implementation, which makes code fail.
17177 2002-06-22 Martin Baulig <martin@gnome.org>
17179 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
17180 the return value of Object.GetType(). [FIXME: we need to do this whenever
17181 we get a type back from the reflection library].
17183 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
17185 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
17187 2002-06-20 Miguel de Icaza <miguel@ximian.com>
17189 * attribute.cs: Return null if we can not look up the type.
17191 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
17192 the interface types found.
17194 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
17195 interface types found.
17197 * typemanager.cs (GetInterfaces): Make this routine returns alll
17198 the interfaces and work around the lame differences between
17199 System.Type and System.Reflection.Emit.TypeBuilder in the results
17200 result for GetInterfaces.
17202 (ExpandInterfaces): Given an array of interface types, expand and
17203 eliminate repeated ocurrences of an interface. This expands in
17204 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
17207 2002-06-21 Martin Baulig <martin@gnome.org>
17209 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
17212 2002-06-21 Martin Baulig <martin@gnome.org>
17214 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
17215 and called with one of the core types, return the corresponding typebuilder for
17218 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
17221 2002-06-21 Martin Baulig <martin@gnome.org>
17223 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
17224 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
17225 (Expression.ConvertReferenceExplicit): Likewise.
17227 * expression.cs (ElementAccess.DoResolve): Likewise.
17228 (ElementAccess.DoResolveLValue): Likewise.
17230 2002-06-10 Martin Baulig <martin@gnome.org>
17232 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
17233 add the "value" parameter to the parameter list.
17235 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
17238 2002-06-19 Miguel de Icaza <miguel@ximian.com>
17240 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
17241 the argument to an int, uint, long or ulong, per the spec. Also
17242 catch negative constants in array creation.
17244 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17246 * class.cs: do not allow the same interface to appear twice in
17247 the definition list.
17249 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17251 * ecore.cs: don't use ldlen with System.Array.
17253 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17255 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17257 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17259 * modifiers.cs: produce correct field attributes for protected
17260 internal. Easy fix so miguel can work on ther harder stuff:-)
17262 2002-06-18 Miguel de Icaza <miguel@ximian.com>
17264 * pending.cs: New file. Move the code from class.cs here.
17265 Support clearning the pending flag for all methods (when not doing
17266 explicit interface implementation).
17268 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17270 * rootcontext.cs: added a couple more types needed to bootstrap.
17272 2002-06-17 Miguel de Icaza <miguel@ximian.com>
17274 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17275 constructor in the type, instead of any constructor in the type
17276 hierarchy. Thanks to Paolo for finding this bug (it showed up as
17277 a bug in the Mono runtime when applying the params attribute).
17279 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17280 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17282 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
17284 * expression.cs (Unary.ResolveOperator): Use TypeManager
17285 to resolve the type.
17287 2002-06-13 Ravi Pratap <ravi@ximian.com>
17289 * cs-parser.jay (enum_member_declaration): Pass in the attributes
17292 * enum.cs (AddEnumMember): Add support to store the attributes associated
17293 with each member too.
17295 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17296 field builders too - this takes care of the enum member case.
17298 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
17300 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17301 address-of operator on both value types and pointers.
17303 2002-06-10 Martin Baulig <martin@gnome.org>
17305 * interface.cs (Interface.PopulateIndexer): Add the indexer's
17306 PropertyBuilder to the `property_builders' list.
17308 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17309 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17310 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
17311 find any indexers which are inherited from an interface.
17313 2002-06-09 Martin Baulig <martin@gnome.org>
17315 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17316 the same type as the constant if necessary. There's also a test-130.cs
17319 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17321 * typemanager.cs (TypeManager.ChangeType): Previously known as
17322 Enum.ChangeEnumType().
17324 2002-06-09 Martin Baulig <martin@gnome.org>
17326 * expression.cs (Cast.TryReduce): Added support for consts.
17328 2002-06-08 Ravi Pratap <ravi@ximian.com>
17330 * class.cs (Accessor): Hold attributes information so we can pass
17333 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17334 Modify to pass in attributes attached to the methods.
17336 (add_accessor_declaration, remove_accessor_declaration): Ditto.
17338 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17339 to handle the Accessor kind :-)
17341 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17343 2002-06-08 Martin Baulig <martin@gnome.org>
17345 * expression.cs (Unary.TryReduceNegative): Added support for
17348 2002-06-08 Martin Baulig <martin@gnome.org>
17350 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17351 name can't be found in the `defined_names' - the caller will do a
17352 MemberLookup in this case and thus find methods in System.Enum
17353 such as Enum.IsDefined().
17355 2002-06-08 Martin Baulig <martin@gnome.org>
17357 * enum.cs (Enum.ChangeEnumType): This is a custom version of
17358 Convert.ChangeType() which works with TypeBuilder created types.
17359 (Enum.LookupEnumValue, Enum.Define): Use it here.
17361 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17362 `TypeBuilder.BaseType != null' check.
17363 (TypeContainer.FindMembers): Only lookup parent members if we
17364 actually have a parent.
17365 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17366 (ConstructorInitializer.Resolve): Likewise.
17368 * interface.cs (Interface.FindMembers): Added
17369 `TypeBuilder.BaseType != null' check.
17371 * rootcontext.cs (RootContext.ResolveCore): Added
17372 "System.Runtime.CompilerServices.IndexerNameAttribute" to
17373 classes_second_stage.
17375 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17376 debug_type and trace_type when compiling with --nostdlib.
17378 2002-06-07 Martin Baulig <martin@gnome.org>
17380 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17381 (AddField): Set it to true when adding a non-static field.
17382 (DefineType): Use `have_nonstatic_fields' to find out whether we
17383 have non-static fields, not `Fields != null'.
17385 2002-06-02 Miguel de Icaza <miguel@ximian.com>
17387 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17388 dereferencing a null on the static-field code path)
17390 2002-05-30 Martin Baulig <martin@gnome.org>
17392 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17393 to take command line arguments. Use reflection to call the new
17394 custom `Initialize' function on the symbol writer and pass it the
17395 command line arguments.
17397 * driver.cs (--debug-args): New command line argument to pass command
17398 line arguments to the symbol writer.
17400 2002-05-28 Miguel de Icaza <miguel@ximian.com>
17402 * assign.cs (DoResolve): Forgot to do the implicit conversion to
17403 the target type for indexers and properties. Thanks to Joe for
17406 2002-05-27 Miguel de Icaza <miguel@ximian.com>
17408 * typemanager.cs (MethodFlags): returns the method flags
17409 (Obsolete/ShouldIgnore) that control warning emission and whether
17410 the invocation should be made, or ignored.
17412 * expression.cs (Invocation.Emit): Remove previous hack, we should
17413 not do this on matching a base type, we should do this based on an attribute
17415 Only emit calls to System.Diagnostics.Debug and
17416 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17417 on the command line.
17419 * rootcontext.cs: Global settings for tracing and debugging.
17421 * cs-tokenizer.cs (define): New utility function to track
17422 defines. Set the global settings for TRACE and DEBUG if found.
17424 2002-05-25 Ravi Pratap <ravi@ximian.com>
17426 * interface.cs (Populate*): Pass in the TypeContainer as well as
17427 the DeclSpace as parameters so that we can create EmitContexts and
17428 then use that to apply attributes etc.
17430 (PopulateMethod, PopulateEvent, PopulateProperty)
17431 (PopulateIndexer): Apply attributes everywhere.
17433 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17436 (ApplyAttributes): Update accordingly.
17438 We now apply interface attributes for all members too.
17440 2002-05-26 Miguel de Icaza <miguel@ximian.com>
17442 * class.cs (Indexer.Define); Correctly check if we are explicit
17443 implementation (instead of checking the Name for a ".", we
17444 directly look up if the InterfaceType was specified).
17446 Delay the creation of the PropertyBuilder.
17448 Only create the PropertyBuilder if we are not an explicit
17449 interface implementation. This means that explicit interface
17450 implementation members do not participate in regular function
17451 lookups, and hence fixes another major ambiguity problem in
17452 overload resolution (that was the visible effect).
17454 (DefineMethod): Return whether we are doing an interface
17457 * typemanager.cs: Temporary hack until we get attributes in
17458 interfaces (Ravi is working on that) and we get IndexerName
17459 support in interfaces.
17461 * interface.cs: Register the indexers as properties.
17463 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17464 warning, I have verified that this is a bug in the .NET runtime
17465 (JavaScript suffers of the same problem).
17467 * typemanager.cs (MemberLookup): When looking up members for
17468 interfaces, the parent of an interface is the implicit
17469 System.Object (so we succeed in searches of Object methods in an
17470 interface method invocation. Example: IEnumerable x; x.ToString
17473 2002-05-25 Miguel de Icaza <miguel@ximian.com>
17475 * class.cs (Event): Events should also register if they do
17476 implement the methods that an interface requires.
17478 * typemanager.cs (MemberLookup); use the new GetInterfaces
17481 (GetInterfaces): The code used to lookup interfaces for a type is
17482 used in more than one place, factor it here.
17484 * driver.cs: Track the errors at the bottom of the file, we kept
17487 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17488 instance if the method we are calling is static!
17490 2002-05-24 Miguel de Icaza <miguel@ximian.com>
17492 * attribute.cs (ApplyAttributes): Make this function filter out
17493 the IndexerName attribute (as that attribute in reality is never
17494 applied) and return the string constant for the IndexerName
17497 * class.cs (TypeContainer.Emit): Validate that all the indexers
17498 have the same IndexerName attribute, and if so, set the
17499 DefaultName attribute on the class.
17501 * typemanager.cs: The return value might contain other stuff (not
17502 only methods). For instance, consider a method with an "Item"
17503 property and an Item method.
17505 * class.cs: If there is a problem with the parameter types,
17508 2002-05-24 Ravi Pratap <ravi@ximian.com>
17510 * ecore.cs (ImplicitConversionExists): Wrapper function which also
17511 looks at user defined conversion after making a call to
17512 StandardConversionExists - we need this for overload resolution.
17514 * expression.cs : Update accordingly the various method calls.
17516 This fixes 2 bugs filed against implicit user defined conversions
17518 2002-05-22 Miguel de Icaza <miguel@ximian.com>
17520 * statement.cs: Track the result of the assignment.
17522 2002-05-21 Miguel de Icaza <miguel@ximian.com>
17524 * expression.cs (MemberAccess): Improved error reporting for
17525 inaccessible members.
17527 2002-05-22 Martin Baulig <martin@gnome.org>
17529 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
17530 itself with debugging support.
17532 2002-05-22 Martin Baulig <martin@gnome.org>
17534 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17535 Removed, this isn't needed anymore.
17537 2002-05-20 Martin Baulig <martin@gnome.org>
17539 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17540 be underlying type for an enum.
17542 2002-05-20 Miguel de Icaza <miguel@ximian.com>
17544 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17545 that splits out the loading of just the core types.
17547 * rootcontext.cs (ResolveCore): Split the struct resolution in
17548 two, so we can load the enumeration underlying types before any
17551 * expression.cs (Is): Bandaid until we fix properly Switch (see
17552 bug #24985 for details).
17554 * typemanager.cs (ImplementsInterface): The hashtable will contain
17555 a null if there are no interfaces implemented.
17557 2002-05-18 Miguel de Icaza <miguel@ximian.com>
17559 * cs-parser.jay (indexer_declarator): It is fine to have array
17562 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17564 * typemanager.cs: (RegisterBuilder): New function used to register
17565 TypeBuilders that implement interfaces. Since
17566 TypeBuilder.GetInterfaces (as usual) does not work with lame
17568 (AddUserType): register interfaces.
17570 (ImplementsInterface): Use the builder_to_ifaces hash if we are
17571 dealing with TypeBuilder. Also, arrays are showing up as
17572 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17573 methods can not be invoked on them!
17575 * ecore.cs (ExplicitReferenceConversionExists): Made public.
17576 (ImplicitReferenceConversionExists): Split out from
17577 StandardConversionExists.
17579 * expression.cs (As): We were only implementing one of the three
17580 cases for the as operator. We now implement them all.
17581 (Is): Implement the various other cases for Is as well.
17583 * typemanager.cs (CACHE): New define used to control if we want or
17584 not the FindMembers cache. Seems to have a negative impact on
17585 performance currently
17587 (MemberLookup): Nested types have full acess to
17588 enclosing type members
17590 Remove code that coped with instance/static returns for events, we
17591 now catch this in RealFindMembers.
17593 (RealFindMembers): only perform static lookup if the instance
17594 lookup did not return a type or an event.
17596 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17598 * assign.cs (CompoundAssign): We pass more semantic information
17599 now to Compound Assignments than we did before: now we have all
17600 the information at hand, and now we resolve the target *before* we
17601 do the expression expansion, which allows the "CacheValue" method
17602 to have the effect we intended (before, a [x] += 1 would generate
17603 two differen ArrayAccess expressions from the ElementAccess,
17604 during the resolution process).
17606 (CompoundAssign.DoResolve): Resolve target and original_source here.
17608 2002-05-16 Miguel de Icaza <miguel@ximian.com>
17610 * expression.cs (ArrayAccess): dropped debugging information.
17612 * typemanager.cs: Small bug fix: I was always returning i_members,
17613 instead of one of i_members or s_members (depending on which had
17616 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
17617 method is invoked before any code generation takes place, and it
17618 is a mechanism to inform that the expression will be invoked more
17619 than once, and that the method should use temporary values to
17620 avoid having side effects
17622 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
17624 * ecore.cs (Expression.CacheTemporaries): Provide empty default
17627 * expression.cs (Indirection, ArrayAccess): Add support for
17628 CacheTemporaries in these two bad boys.
17630 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
17631 ldobj or ldind_ref.
17632 (StoreFromPtr): Handle stobj as well.
17634 * expression.cs (UnaryMutator): Share more code.
17636 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
17637 down: I was not tracking the Filter function as well, which
17638 was affecting the results of the cache.
17640 2002-05-15 Miguel de Icaza <miguel@ximian.com>
17642 * attribute.cs: Remove the hack to handle the CharSet property on
17645 2002-05-14 Miguel de Icaza <miguel@ximian.com>
17647 * attribute.cs (DoResolve): More uglyness, we now only try to
17648 resolve the attribute partially, to extract the CharSet
17649 information (only if we are a StructLayout attribute). Otherwise
17651 (GetExtraTypeInfo): Add some code to conditionally kill in the
17652 future this. I am more and more convinced that the .NET
17653 framework has special code to handle the attribute setting on
17656 * expression.cs (IsParamsMethodApplicable): Revert my previous
17657 foreach change here, it was wrong.
17659 2002-05-13 Miguel de Icaza <miguel@ximian.com>
17661 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17662 (pp_expr): do not abort on unknown input, just return.
17663 (eval): abort if there are pending chars.
17665 * attribute.cs (Attribute.Resolve): Positional parameters are
17666 optional. Deal with that case.
17668 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17669 the Ansi/Unicode/Auto information for the type.
17671 (TypeContainer.DefineType): instantiate the EmitContext here, as
17672 we will be using it during the type definition (to resolve
17673 attributes) and during the emit phase.
17675 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17676 to pull type information out of the attributes
17678 (Attribute.Resolve): track the constructor builder, and allow for
17679 multiple invocations (structs and classes will use this).
17681 * ecore.cs (MemberLookupFinal): new version with all the
17682 parameters customizable.
17684 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17685 constructors. Return if the result value is null (as the error
17686 would have been flagged already by MemberLookupFinal)
17688 Do not allow instances of abstract classes or interfaces to be
17691 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17692 We have to compare the assembly property here when dealing with
17693 FamANDAssem and Assembly access modifiers, because we might be
17694 creating an assembly from *modules* (that means that we are not
17695 getting TypeBuilders for types defined in other modules that are
17696 part of this assembly).
17698 (Method.Emit): If the method is marked abstract and has a body,
17701 (TypeContainer.DefineMembers): If both the defined member and the
17702 parent name match are methods, then do not emit any warnings: let
17703 the Method.Define routine take care of flagging warnings. But if
17704 there is a mismatch (method overrides something else, or method is
17705 overriwritten by something, then emit warning).
17707 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17708 set to null, this means `do not check for the return type on the
17711 (Method.Define): set the return type for the method signature to
17712 null, so that we get methods with the same name and parameters and
17713 different return types. This is used to flag warning 114 (you are
17714 hiding a method, and you probably want to use the new/override
17717 * typemanager.cs (MemberLookup): Implemented proper access
17718 control, closing a long standing set of bug reports. The problem
17719 was that the Framework only has two bits: Public and NonPublic,
17720 and NonPublic includes private and protected methods, but we need
17721 to enforce the FamANDAssem, FamOrAssem and Family.
17723 2002-05-11 Miguel de Icaza <miguel@ximian.com>
17725 * statement.cs (GotoCase): Return true: Ammounts to giving up
17726 knowledge on whether we return or not, and letting the other case
17727 be responsible for it.
17729 2002-05-10 Miguel de Icaza <miguel@ximian.com>
17731 * driver.cs: Do not load directories for each file processed, only
17732 do it if there is a pattern.
17734 * ecore.cs: Report readonly assigns here as well, as we might have
17735 been resolved only by MemberAccess.
17737 (SimpleName.SimpleNameResolve): Also be useful for LValue
17738 resolution. We need this to propagate assign to local readonly variables
17740 * typemanager.cs: Use a ptrhashtable for the criteria, because we
17741 do not want to reuse potential criteria memory.
17743 * class.cs (MyEventBuilder): Set reflected_type;
17745 * ecore.cs (Constantify): Added support for constifying bools.
17747 (RootContext.LookupType): Added a cache for values looked up in
17748 the declaration space.
17750 * typemanager.cs (FindMembers): Now is a front-end to
17751 RealFindMembers, and provides a two-level hashtable-based cache to
17754 15% performance improvement: from 22.5 to 19.2 seconds.
17756 * expression.cs (IsParamsMethodApplicable): use foreach.
17757 (Invocation.DoResolve): ditto.
17758 (New.DoResolve): ditto.
17759 (ArrayCreation.DoResolve): ditto.
17761 * ecore.cs (FindMostEncompassingType): use foreach.
17763 * delegate.cs (NewDelegate.DoResolve): Use foreach
17765 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17766 (RemoveMethods): use foreach.
17768 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17769 nested foreach statements instead of for, and also break out of
17770 the inner loop once a match is found.
17772 (Invocation.OverloadResolve): Use foreach, simplify the code.
17774 2002-05-08 Miguel de Icaza <miguel@ximian.com>
17776 * cfold.cs (BinaryFold): During an enumeration evaluation context,
17777 we actually unwrap the expression to allow for extra information
17780 * expression.cs: Use Shr_Un on unsigned operations.
17782 2002-05-08 Ravi Pratap <ravi@ximian.com>
17784 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
17785 applicable operators was not being considered correctly. This closes
17786 the bug Miguel reported.
17788 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17790 * attribute.cs: check that the type derives from System.Attribute
17791 and report the correct error in that case (moved the duplicate code to
17792 its own method, too).
17794 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17796 * attribute.cs: lookup attribute type name as the spec says: first the
17797 bare attribute name and then name + "Attribute" (nant compiles with
17798 mcs after this fix).
17800 2002-05-07 Miguel de Icaza <miguel@ximian.com>
17802 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
17803 Because of the way we parse things, we should try to see if a
17804 UIntConstant can fit in an integer.
17806 2002-05-07 Ravi Pratap <ravi@ximian.com>
17808 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17809 when we are in an explicit context.
17811 (ConvertReferenceExplicit): When converting from Iface type S to Class
17812 T make sure the rules are implemented as an OR.
17814 * parameter.cs (ParameterType): Make it a property for now although the
17815 purpose really isn't anything immediate.
17817 * expression.cs (Is*Applicable): Do better checking on the parameter type
17818 of a ref/out parameter. The ones from the system assemblies are already
17819 marked with the correct type so we don't need to do any correction.
17821 * ecore.cs (StandardConversionExists): Conversion from Interface types to
17822 the object type is standard too so include that.
17824 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17826 * ecore.cs (StandardConversionExists): Augment with missing code:
17827 deal with IntConstant, LongConstants and Enumerations.
17829 * assign.cs: Report the error, instead of failing silently
17831 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17832 typecontainer that they are declared, because the
17833 typecontainer/namespace will have the list of using clauses that
17834 need to be applied.
17836 Assembly Attributes were escaping the normal registration
17839 (EmitCode): Apply attributes within an EmitContext that represents
17840 the container they were declared on.
17842 * cs-parser.jay: Track bases for structs. How did I get this wrong?
17844 2002-05-06 Ravi Pratap <ravi@ximian.com>
17846 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17847 Revamp completely - make much cleaner as we now operate only
17850 (FindMostSpecificSource, FindMostSpecificTarget): New methods
17851 to implement the logic detailed in the spec more correctly.
17853 (UserDefinedConversion): Update accordingly.
17855 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17857 * statement.cs: Return flow analysis information up.
17859 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17862 (token): Do not consume an extra character before calling
17865 2002-05-06 Piers Haken <piersh@friskit.com>
17867 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17869 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17871 * class.cs (Constructor.Emit): Set the IsStatic flag in the
17872 EmitContext during the instance constructor initializer
17873 resolution, to stop access to instance variables.
17875 This is mandated by the spec, last paragraph of the `constructor
17876 initializers' section.
17878 2002-05-05 Miguel de Icaza <miguel@ximian.com>
17880 * cs-parser.jay, class.cs (Accessor): new class used to represent
17881 an accessor (get or set). In the past we used `null' to represent
17882 a missing accessor. But this is ambiguous because there was no
17883 way to tell in abstract indexers/properties if one of them was
17886 Now there is a way of addressing that.
17888 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17889 instead of FindMembers.
17891 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17892 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17894 * attribute.cs: Treat indexers and properties as the same in terms
17895 of applying attributes
17897 * ecore.cs (FindMostEncompassedType): Use statically initialized
17898 EmptyExpressions()s like we do elsewhere to avoid creating useless
17899 objects (and we take this out of the tight loop).
17901 (GetConversionOperators): Move the code to extract the actual
17902 operators to a separate routine to clean things up.
17904 2002-05-04 Miguel de Icaza <miguel@ximian.com>
17906 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17907 events are always registered FieldBuilders.
17909 * class.cs (FieldBase): New class shared by Fields
17911 * delegate.cs: If we are a toplevel delegate, use our full name.
17912 If we are a nested delegate, then only use our tail name.
17914 2002-05-02 Ravi Pratap <ravi@ximian.com>
17916 * expression.cs (IsApplicable): Ensure that we add the "&" to
17917 ref/out types before comparing it with the type of the argument.
17919 (IsParamsMethodApplicable): Ditto.
17921 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
17924 * delegate.cs : Handle the case when we have more than one applicable
17925 method. Flag an error only when we finish checking all.
17927 2002-05-02 Miguel de Icaza <miguel@ximian.com>
17929 * expression.cs: Add support for boolean static initializers.
17931 2002-05-01 Miguel de Icaza <miguel@ximian.com>
17933 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17935 * parameter.cs (ComputeParameterTypes,
17936 ComputeAndDefineParameterTypes): Better error handling: now we
17937 clear the `types' cache if we fail during any of the type lookups.
17938 We also return the status code correctly to our caller
17940 * delegate.cs: If we fail to define a delegate, abort the extra
17943 * expression.cs (Binary.ResolveOperator): for
17944 operator==(object,object) and operator !=(object, object) we also
17945 have to verify that there is an implicit conversion from one to
17948 (ArrayAccess.DoResolve): Array Access can operate on
17951 2002-04-30 Miguel de Icaza <miguel@ximian.com>
17953 * assign.cs (CompoundAssign): A new class used as a "flag" that
17954 the assignment actually is happening as part of a compound
17955 assignment operator.
17957 During compound assignment, a few new rules exist to enable things
17964 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17965 to the type of x) if y is implicitly convertible to the type of x,
17966 and the operator is a builtin operator and the return type of the
17967 operator is explicitly convertible to the type of x.
17969 * rootcontext.cs: Reset warning level to 2. 4 catches various
17970 "interesting" features in mcs, we must clean this up at some
17971 point, but currently am trying to kill other bugs ;-)
17973 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17974 in container classes as well.
17976 * expression.cs (Binary.ResolveOperator): Handle string case
17977 before anything else (as operator overloading does emit an error
17978 before doing anything else).
17980 This code could go away when we move to a table driven model, but
17981 i could not come up with a good plan last night.
17983 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
17985 * typemanager.cs (CSharpName): reimplementation using regex.
17986 * class.cs: added null check for fields in Emit
17987 * rootcontext.cs: set warninglevel to 4
17989 2002-04-29 Miguel de Icaza <miguel@ximian.com>
17991 * typemanager.cs (CSharpName): reimplemented with Lupus
17994 2002-04-28 Miguel de Icaza <miguel@ximian.com>
17996 * statement.cs (If): correclty implement Resolve, because we were
17997 not catching sem errors in there. The same process is needed
17999 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18002 (Statement.Warning_DeadCodeFound): Factorize code.
18003 (While): Report dead code here too.
18005 (Statement): Added Resolve virtual method to allow
18006 for resolution split from the emit code.
18008 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18010 * statement.cs (EmitBoolExpression): No longer try to resolve the
18012 (MakeBoolean): New utility function that resolve, implicitly
18013 converts to boolean and tags the expression.
18016 (If, Do): Implement dead code elimination.
18017 (While): Implement loop inversion
18019 (Do, While, For, If): Resolve the expression prior to calling our
18022 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
18025 - added method Report28 (warning: program has more than one entry point)
18026 - added method IsEntryPoint, implements paragraph 10.1 of the spec
18027 - modified method Method.Define, the part at the end of the method
18029 * rootcontext.cs: added static public Location EntryPointLocation;
18031 * ../errors/cs0028.cs : Add test case for the above warning.
18034 - modified method CSharpName to allow arrays of primitive type to
18035 be printed nicely (e.g. instead of System.Int32[][] it now prints
18037 - added method CSharpSignature: returns the signature of a method
18038 in string format to be used in reporting errors, warnings, etc.
18040 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
18043 2002-04-26 Ravi Pratap <ravi@ximian.com>
18045 * delegate.cs (Define): Fix extremely silly bug where I was
18046 setting the type of the 'object' parameter of the BeginInvoke
18047 method to System.IAsyncResult instead of System.Object ;-)
18049 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18051 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
18054 (Constructor.Emit): return if we fail to initialize the
18055 constructor. Another door closed!
18057 * expression.cs (New.DoResolve): Improve error message (from -6 to
18058 1501). Use DeclaredOnly lookup to find the exact constructor.
18060 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
18061 loop. This is useful.
18063 * cs-parser.jay: Adjust the default parameters so that destructors
18064 have the proper signature.
18066 2002-04-26 Martin Baulig <martin@gnome.org>
18068 * driver.cs (LoadAssembly): If `assembly' contains any characters
18069 which are only valid in path names and not in assembly names
18070 (currently slash, backslash and point), use Assembly.LoadFrom ()
18071 instead of Assembly.Load () on the `assembly' (before iteration
18072 over the link_paths).
18074 2002-04-26 Martin Baulig <martin@gnome.org>
18076 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
18078 2002-04-25 Miguel de Icaza <miguel@ximian.com>
18080 * class.cs (Property): use the new typemanager.MemberLookup
18082 (TypeContainer.MemberLookup): Implement using the
18083 TypeManager.MemberLookup now.
18085 * typemanager.cs: Make MemberLookup a function of the TypeManager,
18086 and return MemberInfos, so that these can be used without an
18087 EmitContext (what we had before).
18089 2002-04-24 Miguel de Icaza <miguel@ximian.com>
18091 * expression.cs: Fix the case where the argument to params if the
18092 type of the params. I omitted handling this before. Fixed
18094 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18096 * driver.cs: Call BootCorlib_PopulateCoreType
18098 * class.cs (Property.CheckBase): Check for properties only, not
18101 * interface.cs: Temporary hack: try/catch around the
18102 CustomAttributeBuilder, because I am getting an exception that I
18105 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
18106 types whose definitions are required to be there (attributes are
18107 defined before standard types).
18109 Compute definitions as we boot the various types, as they are used
18110 immediately (value_type class will need object_type, but if we do
18111 not initialize object_type, we will pass a null, which will let
18112 the runtime pick the System.Object from the existing corlib, which
18113 is not what we want).
18115 2002-04-22 Patrik Torstensson <totte@labs2.com>
18117 * cs-tokenizer.cs: fixed a number of trim() issues.
18119 2002-04-22 Ravi Pratap <ravi@ximian.com>
18121 * expression.cs (Argument.Type): Ensure that we return the correct
18122 type when we have out or ref parameters [in which case we
18125 2002-04-22 Miguel de Icaza <miguel@ximian.com>
18127 * class.cs (Property, Indexer): Allow extern modifier in there.
18129 * typemanager.cs (InitBaseTypes): Initializes object_type and
18130 value_type, since those will be used early on during the bootstrap
18131 process to compile corlib.
18133 (InitCoreTypes): Move code from here to InitBaseTypes.
18135 2002-04-21 Miguel de Icaza <miguel@ximian.com>
18137 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
18138 single-dimension arrays as using the ldlen opcode.
18140 Daniel Lewis discovered this optimization.
18142 * typemanager.cs: Add signature for System.Array::get_Length
18144 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18146 * statement.cs: report the error when the foreach does not apply to an
18147 array nor a collection.
18149 2002-04-19 Miguel de Icaza <miguel@ximian.com>
18151 * expression.cs: Add implicit conversions to the operator ~.
18153 * constant.cs (DecimalConstant.Emit): Emit decimal value.
18155 * typemanager.cs: Locate the decimal constructor.
18157 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18159 * attribute.cs: use the new property of TypeOf.
18160 * expression.cs: added 'get' property around typearg.
18162 These changes fix a build breaker reported by NickD. Is this the
18163 correct way to fix? If not, please, revert my changes and make it
18166 2002-04-17 Miguel de Icaza <miguel@ximian.com>
18168 * attribute.cs: Add support for typeof in attribute invocations.
18169 I am not sure that this is right though.
18171 2002-04-14 Duncan Mak <duncan@ximian.com>
18173 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
18174 Binary.Operator.Division case.
18176 2002-04-13 Ravi Pratap <ravi@ximian.com>
18178 * class.cs (DefineType): Ensure that we do a proper check on
18179 attribute types and also register it with the TypeManager.
18181 (TypeContainer.Targets): The default for attribute types is
18182 AttributeTargets.All.
18184 * attribute.cs (ApplyAttributes): Registering the attribute type
18185 is done elsewhere, not when we discover we have a Usage attribute.
18187 2002-04-12 Ravi Pratap <ravi@ximian.com>
18189 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
18190 and get rid of is_delegate parameter.
18192 * everywhere : update.
18194 2002-04-12 Ravi Pratap <ravi@ximian.com>
18196 * cs-parser.jay (compilation_unit): Revamp completely to use
18197 some new ideas that I got from Rhys' grammar to solve the problems
18198 with assembly level attributes.
18200 (outer_declaration): New grammar production.
18202 (attribute_sections): Add.
18204 (opt_attributes): Base on attribute_sections
18206 (namespace_declaration): Allow opt_attributes to tackle the case
18207 when we have assembly level attributes - we are clever in this
18210 * attribute.cs (ApplyAttributes): Do not worry about assembly
18211 attributes in the non-global context.
18213 * rootcontext.cs (AddGlobalAttributes): Go back to using this
18214 instead of SetGlobalAttributes.
18216 * class.cs, rootcontext.cs : Ensure we define and generate
18217 attribute types before anything else.
18219 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
18220 and flag the new error -20 for the case when the attribute type
18221 does not have valid targets specified. csc does not catch this.
18223 * ../errors/errors.txt : update for error # -20
18225 2002-04-11 Ravi Pratap <ravi@ximian.com>
18227 * support.cs (InternalParameters.ParameterModifier): Do some null
18228 checking and return sane values.
18230 * class.cs (Method.Define): If we are a PInvoke method, ensure
18231 that we are static and extern. Report error # 601
18233 * ../errors/cs0601.cs : Add test case for the above error.
18235 2002-04-07 Ravi Pratap <ravi@ximian.com>
18237 * rootcontext.cs (attribute_types): We need to keep type of
18238 all attribute types separately and emit code for them first.
18240 (RegisterAttribute) : Implement.
18242 * class.cs (DefineType): Check if the current Type is a custom
18243 attribute type and register it accordingly.
18245 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18246 adding the first attribute twice and rename to
18248 (SetGlobalAttributes): this.
18250 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18253 * attribute.cs (ApplyAttributes): Take an additional argument telling us
18254 if we are processing global arguments. Hmm, I am unsure of this.
18256 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18258 * expression.cs: added static array of strings to avoid calling
18259 Enum.ToString () for Operator in Binary. Significant recover of
18262 2002-04-10 Miguel de Icaza <miguel@ximian.com>
18264 * class.cs (FindMembers): Allow the Builders of the various
18265 members to be null. If they are skip them. This only happens
18266 during the PInvoke declaration.
18268 2002-04-09 Miguel de Icaza <miguel@ximian.com>
18270 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18271 failure, so we do not keep going afterwards.
18273 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18274 wanted to pass `false' as the `is_delegate' argument. If this is
18275 the case, why not use delegate_type == null to mean `is_delegate =
18276 false' and anything else as is_delegate = true.
18278 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
18280 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18281 code for the section, not the beginning of the tests.
18283 2002-04-08 Miguel de Icaza <miguel@ximian.com>
18285 * cfold.cs: Handle operator + (Enum x, Underlying x)
18287 * expression.cs (Binary): same. Warn about errors where we have
18288 Enum/Enum in operator + as well.
18290 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
18293 - added support for switch(bool)
18294 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18295 - add TableSwitchEmit() to handle table-based switch statements
18297 2002-04-05 Ravi Pratap <ravi@ximian.com>
18299 * expression.cs (Invocation.OverloadResolve): Factor out code which
18300 does parameter compatibility checking with arguments so that we can
18301 re-use the code even from Delegate.VerifyApplicability
18303 (VerifyArgumentsCompat): Move above code here.
18305 * delegate.cs (VerifyApplicability): Get rid of duplicate code
18306 and instead make a call to the above method.
18308 2002-03-31 Ravi Pratap <ravi@ximian.com>
18310 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18311 We use it to keep track of classes which are attribute types.
18313 2002-04-02 Miguel de Icaza <miguel@ximian.com>
18315 * delegate.cs (Delegate.Define): Correctly define the types in the
18316 presence of fixed and array parameters.
18318 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18321 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18322 include NonPublic after the first iteration.
18324 * class.cs (Indexer.CheckBase): Only check if both parents are
18327 * cs-parser.jay (accessor_body): If empty, set to null.
18329 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18330 same code path here to resolve constants names that we did have in
18331 MemberAccess.DoResolve. There is too much code duplicated here.
18333 2002-04-01 Miguel de Icaza <miguel@ximian.com>
18335 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18337 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18340 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18341 tokens, numbers and strings.
18343 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18346 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18347 asyncronous parameters and the regular parameters.
18349 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18350 specify the target directory.
18352 * expression.cs: (This.DoResolve): Simplify
18353 (As.Emit): Optimize, do not generate IsInst if the expression is
18354 always of the given type.
18356 (Is.DoResolve): Bug fix, we were reporting both always/never for
18359 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18360 creating too many unnecessary arrays.
18362 2002-03-31 Miguel de Icaza <miguel@ximian.com>
18364 * class.cs (EmitFieldInitializer): Use Assign expression to assign
18365 fields instead of rolling our own initializer. Takes care of all
18366 implicit conversions, and drops unnecessary static checks/argument.
18368 2002-03-31 Dick Porter <dick@ximian.com>
18370 * driver.cs: use the GetDirectories() return values properly, and
18371 use "/" as path separator.
18373 2002-03-30 Miguel de Icaza <miguel@ximian.com>
18375 * expression.cs (Unary): Optimize - - expr into expr.
18376 (Binary): Optimize a + (-b) into a -b.
18378 * codegen.cs (CodeGen): Made all methods static.
18380 2002-03-29 Miguel de Icaza <miguel@ximian.com>
18384 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18385 TypeBuilder property.
18387 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18390 * tree.cs: Removed the various RecordXXXX, and replaced with a
18391 single RecordDecl. Removed all the accessor methods, and just
18392 left a single access point Type
18394 * enum.cs: Rename DefineEnum to DefineType.
18396 * decl.cs: New abstract method `DefineType' used to unify the
18397 Defines for Enumerations, Interfaces, TypeContainers and
18400 (FindType): Moved LookupInterfaceOrClass here. Moved the
18401 LookupBaseClasses method that used to live in class.cs and
18402 interface.cs here, and renamed to FindType.
18404 * delegate.cs: Implement DefineType. Take advantage of the
18405 refactored pattern for locating the parent builder without taking
18406 the parent_builder argument (which we know does not work if we are
18407 nested, and triggering a toplevel definition).
18409 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18411 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18412 accessibility of a member has changed during override and report
18415 * class.cs (Method.Define, Property.Define): Only complain on
18416 overrides if the method is private, any other accessibility is
18417 fine (and since we just checked the permission is the same, we are
18420 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18421 and elif are processed always. The other pre-processing
18422 directives are only processed if we are "taking" the path
18424 2002-03-29 Martin Baulig <martin@gnome.org>
18426 * class.cs (Method.Emit): Only emit symbolic debugging info if the
18427 current location is not Null.
18429 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18430 a separate method so we can profile it.
18432 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18433 `span.Seconds' are just seconds, but no minutes or hours.
18434 (MainDriver): Profile the CodeGen.SaveSymbols calls.
18436 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18438 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18439 Remove the gratuitous set of Final:
18441 // If an interface implementation, then we can set Final.
18442 if (((flags & MethodAttributes.Abstract) == 0) &&
18443 implementing.DeclaringType.IsInterface)
18444 flags |= MethodAttributes.Final;
18446 I do not know what I was smoking when I used that.
18449 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18450 step into fixing the name resolution issues for delegates and
18451 unifying the toplevel name resolution.
18453 2002-03-28 Martin Baulig <martin@gnome.org>
18455 * class.cs (Method.Emit): If we have a symbol writer, call its
18456 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18457 tell it about the current method.
18459 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18460 writer that we're going to emit the first byte of IL code for a new
18461 statement (a new source line).
18462 (EmitContext.EmitTopBlock): If we have a symbol writer, call
18463 EmitContext.Mark() before emitting any code.
18465 * location.cs (SymbolDocument): Return null when we're Null.
18467 * statement.cs (Statement): Moved the `Location loc' variable here.
18468 (Statement.EmitBoolExpression): If we have a symbol writer, call
18469 ec.Mark() before emitting any code to tell it that we're at the
18470 beginning of a new statement.
18471 (StatementExpression): Added `Location' argument to the constructor.
18472 (Block): Added public readonly variable `StartLocation' and public
18473 variable `EndLocation'. The latter is to be set using SetEndLocation().
18474 (Block): Added constructor which takes a start and end location.
18475 (Block.SetEndLocation): New method. This sets the end location.
18476 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18477 local variables we create.
18478 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18479 each statement and do also mark the begin and end of the block.
18481 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18482 tell it the current lexer.Location, use Location.Null for the end of the
18484 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18485 current block, set its end location using SetEndLocation().
18486 (statement_expression): StatementExpression constructor now takes the
18487 lexer.Location as additional argument.
18488 (for_statement, declare_local_variables): Likewise.
18489 (declare_local_variables): When creating a new implicit block, use the
18490 new Block constructor and pass it the lexer.Location.
18492 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18494 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18495 members also on the parent interfaces recursively.
18497 2002-03-27 Miguel de Icaza <miguel@ximian.com>
18499 * report.cs: Use new formats, since Gonzalo finished the missing
18502 * expression.cs (Binary.ResolveOperator): added missing operator|
18503 operator& and operator^ for bool/bool.
18505 * cs-parser.jay: CheckDef now takes a Location argument that is
18506 used to report errors more precisly (instead of reporting the end
18507 of a definition, we try to track something which is a lot closer
18508 to the source of the problem).
18510 * cs-tokenizer.cs: Track global token use, so we can properly flag
18511 the use of #define/#undef after the first token has been seen.
18513 Also, rename the reportXXXX to Error_DescriptiveName
18515 * decl.cs (DeclSpace.IsTopLevel): Move property here from
18516 TypeContainer, so that Enum and Interface can use this too.
18518 * class.cs (TypeContainer.LookupInterfaceOrClass,
18519 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18520 `builder' argument. Typically this was used to pass the parent
18521 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18524 The problem is that a nested class could trigger the definition of
18525 a toplevel class, and the builder would be obviously wrong in that
18528 So we drop this argument, and we compute dynamically the
18529 TypeBuilder/ModuleBuilder (the correct information was available
18530 to us anyways from DeclSpace.Parent)
18532 * interface.cs (Interface.DefineInterface): Drop builder
18533 parameter cleanup like class.cs
18535 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
18538 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18541 (Try.Emit): Propagate the returns value from the statement.
18543 (Return.Emit): Even if we are leavning
18545 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18547 * modifiers.cs: Fix the computation of MethodAttributes flags.
18549 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18551 * driver.cs: allow compilation of files that start with '/'.
18552 Add a default case when checking the argument of --target.
18554 2002-03-25 Miguel de Icaza <miguel@ximian.com>
18556 * interface.cs: Implement the same search algorithm for types in
18557 the interface code.
18559 * delegate.cs: Do not allow multiple definition.
18561 * Recovered ChangeLog that got accidentally amputated
18563 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18565 * rootcontext.cs: Load manually enum to allow core classes to
18566 contain enumerations.
18568 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18569 Update to new static methods in TypeManager.
18571 * typemanager.cs (GetMethod, GetConstructor): Use our
18572 implementation of FindMembers to find the members, since during
18573 corlib compilation, the types are TypeBuilders and GetMethod and
18574 GetConstructor do not work.
18576 Make all methods in TypeManager static.
18578 (InitCodeHelpers): Split the functionality from
18579 the InitCodeTypes function.
18581 * driver.cs: Call InitCodeHelpers after we have populated the
18584 * cs-parser.jay (delegate_declaration): we did not used to compute
18585 the delegate name correctly for void delegates.
18587 2002-03-24 Miguel de Icaza <miguel@ximian.com>
18589 * rootcontext.cs (RootContext): Init the interface_resolve_order
18590 and type_container_resolve_order always.
18592 (ResolveCore, BootstrapCorlib_ResolveClass,
18593 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18594 compiler when compiling with --nostdlib
18596 * class.cs (TypeContainer.DefineType): Check that our parent is
18597 not null. This test is most important when we are bootstraping
18600 * codegen.cs: Split out the symbol writing code.
18602 2002-03-25 Martin Baulig <martin@gnome.org>
18604 * driver.cs (-g): Made -g an alias for --debug.
18606 2002-03-24 Martin Baulig <martin@gnome.org>
18608 * codegen.cs (SymbolWriter): New public variable. Returns the
18609 current symbol writer.
18610 (CodeGen): Added `bool want_debugging_support' argument to the
18611 constructor. If true, tell the ModuleBuild that we want debugging
18612 support and ask it for the ISymbolWriter.
18613 (Save): If we have a symbol writer, call it's Close() method after
18614 saving the assembly.
18616 * driver.c (--debug): New command line argument to create a
18617 debugger information file.
18619 * location.cs (SymbolDocument): New public property. Returns an
18620 ISymbolDocumentWriter object for the current source file or null
18621 if we don't have a symbol writer.
18623 2002-03-21 Miguel de Icaza <miguel@ximian.com>
18625 * driver.cs (LoadAssembly): Correctly return when all the paths
18626 have been tried and not before.
18628 * statement.cs (Switch.Emit): return the actual coverage for this
18629 statement (returns/not-returns)
18631 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
18632 switch of the statement if we are the last switch section. That
18633 kills two problems: try/catch problems (we used to emit an empty
18634 nop at the end) and switch statements where all branches would
18637 2002-03-19 Miguel de Icaza <miguel@ximian.com>
18639 * driver.cs: Add default assemblies (the equivalent to the
18640 Microsoft CSC.RSP file)
18642 * cs-tokenizer.cs: When updating `cols and setting it to zero,
18643 also update tokens_seen and set it to false.
18645 * driver.cs: Implement --recurse for Mike.
18647 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18648 correctly splitting out the paths.
18650 2002-03-18 Miguel de Icaza <miguel@ximian.com>
18652 * interface.cs (Interface.PopulateProperty): Instead of using
18653 `parent' as the declaration space for the set parameters, use
18656 * support.cs (InternalParameters): InternalParameters constructor
18657 takes a DeclSpace instead of a TypeContainer.
18659 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18660 types are being initialized, load the address of it before calling
18663 (New): Provide a mechanism to disable the generation of local
18664 value type temporaries when the caller will be providing us with
18665 an address to store it.
18667 (ArrayCreation.EmitDynamicInitializers): Use it.
18669 2002-03-17 Miguel de Icaza <miguel@ximian.com>
18671 * expression.cs (Invocation.EmitArguments): Only probe for array
18672 property if there is more than one argument. Sorry about that.
18674 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18675 empty param arrays.
18677 * class.cs (Method.LabelParameters): Fix incorrect code path that
18678 prevented the `ParamArrayAttribute' from being applied to the
18681 2002-03-16 Miguel de Icaza <miguel@ximian.com>
18683 * support.cs (ReflectionParameters): Correctly compute whether the
18684 last argument is a params array. Fixes the problem with
18687 * typemanager.cs: Make the assemblies array always be non-null
18688 (empty, but non-null)
18690 * tree.cs (RecordDecl): New function that abstracts the recording
18691 of names. This reports error 101, and provides a pointer to the
18692 previous declaration. Fixes a crash in the compiler.
18694 * cs-parser.jay (constructor_declaration): Update to new grammar,
18695 and provide a constructor_body that can be empty.
18697 2002-03-15 Miguel de Icaza <miguel@ximian.com>
18699 * driver.cs: Add support for --resources.
18701 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18702 Make all types for the various array helper methods be integer.
18704 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18705 CheckState to ConvCast.
18707 (ConvCast): Now it takes a `checked' state argument, to avoid
18708 depending on the emit context for the conversion, and just using
18709 the resolve time setting.
18711 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18712 instead of Invocation.EmitArguments. We do not emit the original
18713 arguments, instead we emit those which have been converted to
18714 unsigned int expressions.
18716 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18718 * codegen.cs: ditto.
18720 * expression.cs (LocalVariableReference): Drop the use of the
18721 Store function that depended on the variable index.
18723 * statement.cs (VariableInfo): Drop the `Idx' property from this
18724 class, as this is not taking into account the indexes for
18725 temporaries tat we generate during the execution, getting the
18728 * class.cs: First emit class initializers, then call the parent
18731 * expression.cs (Binary): Fix opcode emision.
18732 (UnaryMutator.EmitCode): Support checked code generation
18734 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18735 matches for events for both the Static and Instance scans,
18736 pointing to the same element. Fix that.
18738 2002-03-14 Miguel de Icaza <miguel@ximian.com>
18740 * rootcontext.cs (ResolveTree): Always set the
18741 interface_resolve_order, because nested interfaces will be calling
18744 * class.cs (GetInterfaceOrClass): Track the same resolution
18745 process used by TypeManager.LookupType. This fixes the nested
18746 type lookups in class declarations (separate path from
18749 (TypeContainer.DefineType): Also define nested interfaces.
18750 (TypeContainer.RegisterOrder): New public function used to
18751 register the order in which child interfaces need to be closed.
18753 Nested interfaces need to be closed after their parents have been
18756 * interface.cs (InterfaceAttr): Put all the logic for computing
18757 the interface attribute here.
18759 (DefineInterface): Register our interface order with the
18760 RootContext or with the TypeContainer depending on the case.
18762 2002-03-12 Miguel de Icaza <miguel@ximian.com>
18764 * cs-parser.jay: rework foreach statement to work with the new
18765 changes to the policy on SimpleNames.
18767 * report.cs: support Stacktrace on warnings as well.
18769 * makefile: drop --unsafe and /unsafe from the compile.
18771 2002-03-13 Ravi Pratap <ravi@ximian.com>
18773 * ecore.cs (StandardConversionExists): Modify to take an Expression
18774 as the first parameter. Ensure we do null -> reference type conversion
18777 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18778 temporary Expression objects.
18780 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18782 * interface.cs: workaround bug in method overloading resolution
18783 (there is already a bugzilla bug for it).
18785 2002-03-12 Miguel de Icaza <miguel@ximian.com>
18787 We could also solve this problem by having a separate path for
18788 performing type lookups, instead of DoResolve, we could have a
18789 ResolveType entry point, and only participating pieces of the
18790 production (simplename, deref, array) would implement this.
18792 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18793 signal SimpleName to only resolve type names and not attempt to
18794 resolve anything else.
18796 * expression.cs (Cast): Set the flag.
18798 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18800 * class.cs: Only report 108 if there is no `new' modifier.
18802 * cs-parser.jay: rework foreach statement to work with the new
18803 changes to the policy on SimpleNames.
18805 * report.cs: support Stacktrace on warnings as well.
18807 * makefile: drop --unsafe and /unsafe from the compile.
18809 2002-03-11 Miguel de Icaza <miguel@ximian.com>
18811 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18812 lookups here, instead of doing that at parse time. This means
18813 that our grammar will not introduce `LocalVariableReferences' as
18814 expressions at this point. That solves the problem of code like
18818 static void Main ()
18822 This is only half the fix. The full fix requires parameters to
18823 also be handled in this way.
18825 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18826 makes the use more obvious of the DeclSpace. The
18827 ec.TypeContainer.TypeBuilder is now only used to pull the
18828 TypeBuilder for it.
18830 My theory is that I can get rid of the TypeBuilder completely from
18831 the EmitContext, and have typecasts where it is used (from
18832 DeclSpace to where it matters).
18834 The only pending problem is that the code that implements Aliases
18835 is on TypeContainer, and probably should go in DeclSpace.
18837 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18838 lookups here, instead of doing that at parse time. This means
18839 that our grammar will not introduce `LocalVariableReferences' as
18840 expressions at this point. That solves the problem of code like
18844 static void Main ()
18848 This is only half the fix. The full fix requires parameters to
18849 also be handled in this way.
18851 * class.cs (Property.DefineMethod): When implementing an interface
18852 method, set newslot, when implementing an abstract method, do not
18853 set the flag (before we tried never setting it, or always setting
18854 it, which is the difference).
18855 (Indexer.DefineMethod): same.
18856 (Method.DefineMethod): same.
18858 * ecore.cs: Only set the status used flag if we get back a Field.
18860 * attribute.cs: Temporary hack, so Paolo can keep working.
18862 2002-03-08 Ravi Pratap <ravi@ximian.com>
18864 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18865 the unmanaged type in the case we have a MarshalAs attribute.
18867 (Resolve): Handle the case when we are parsing the special MarshalAs
18868 attribute [we need to store the unmanaged type to use later]
18870 * typemanager.cs (marshal_as_attr_type): Built in type for the
18871 MarshalAs Attribute.
18873 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
18874 on parameters and accordingly set the marshalling info.
18876 2002-03-09 Miguel de Icaza <miguel@ximian.com>
18878 * class.cs: Optimizing slightly by removing redundant code after
18879 we switched to the `NoTypes' return value.
18880 (Property.DefineMethod): use NoTypes here too.
18882 This fixes the bug I introduced in my last batch of changes.
18884 2002-03-05 Ravi Pratap <ravi@ximian.com>
18886 * tree.cs (RecordEnum): Add. We now keep track of enums too.
18888 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18889 Enums since those are types too.
18891 * cs-parser.jay (enum_declaration): Record enums as we parse them.
18893 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
18894 thanks to a call during the lookup process.
18896 2002-03-07 Miguel de Icaza <miguel@ximian.com>
18898 * statement.cs (Foreach): Lots of work to accomodate a particular
18899 kind of foreach statement that I had not kept in mind. It is
18900 possible to have foreachs on classes that provide a GetEnumerator
18901 method that return objects that implement the "pattern" for using
18902 a foreach, there is no need to support GetEnumerator
18905 This is needed to compile nant.
18907 * decl.cs: Only report 114 if the member is not `Finalize' and if
18908 the warning level is at least 2.
18910 * class.cs: Moved the compare function from Method to
18913 (MethodSignature.InheritableMemberSignatureCompare): Add new
18914 filter function that is used to extract inheritable methods from a
18917 (Method.Define): Use the new `inheritable_method_signature_filter'
18920 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18923 2002-03-06 Miguel de Icaza <miguel@ximian.com>
18925 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18927 * cs-parser.jay: Add opt_semicolon to the interface declaration.
18929 * expression.cs: Pass location information to
18930 ConvertImplicitStandard.
18932 * class.cs: Added debugging code to track return values from
18935 2002-03-05 Miguel de Icaza <miguel@ximian.com>
18937 * expression.cs (Is.DoResolve): If either side of the `is' is an
18938 interface, do not flag the warning.
18940 * ecore.cs (ImplicitReferenceConversion): We need a separate test
18943 * report.cs: Allow for --fatal to be used with --probe.
18945 * typemanager.cs (NoTypes): Move the definition for the empty Type
18948 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18950 (TypeContainer.DefineProxy): New function used to proxy to parent
18951 implementations when implementing interfaces.
18952 (TypeContainer.ParentImplements): used to lookup if our parent
18953 implements a public function that is required by an interface.
18954 (TypeContainer.VerifyPendingMethods): Hook this up.
18956 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18957 `modules' and `assemblies' arraylists into arrays. We only grow
18958 these are the very early start up of the program, so this improves
18959 the speedof LookupType (nicely measured).
18961 * expression.cs (MakeByteBlob): Replaced unsafe code with
18962 BitConverter, as suggested by Paolo.
18964 * cfold.cs (ConstantFold.Binary): Special case: perform constant
18965 folding of string concatenation, but if either side is a string,
18966 and the other is not, then return null, and let the runtime use
18967 the concatenation on the string plus the object (using
18968 `Object.ToString').
18970 2002-03-04 Miguel de Icaza <miguel@ximian.com>
18972 Constant Folding has been implemented now.
18974 * expression.cs (Unary.Reduce): Do not throw an exception, catch
18975 the error instead on types that are not supported in one's
18978 * constant.cs (Constant and all children): New set of functions to
18979 perform implict and explicit conversions.
18981 * ecore.cs (EnumConstant): Implement the new functions to perform
18982 conversion by proxying to the child expression.
18984 * codegen.cs: (ConstantCheckState): Constant evaluation has its
18985 own separate setting that can not be turned off from the command
18986 line using --unchecked or --checked and is only controlled using
18987 the checked/unchecked statements and expressions. This setting is
18988 used by the constant folder to flag errors.
18990 * expression.cs (CheckedExpr, UncheckedExpr): Set the
18991 ConstantCheckState as well.
18993 During Resolve, they also have to flag the state, because the
18994 constant folder runs completely in the Resolve phase.
18996 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18999 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19001 * cfold.cs: New file, this file contains the constant folder.
19003 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19004 argument to track whether we are using the resulting address to
19005 load or store a value and provide better error messages.
19007 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19008 new AddressOf arguments.
19010 * statement.cs (Foreach.EmitCollectionForeach): Update
19012 * expression.cs (Argument.Emit): Call AddressOf with proper
19013 arguments to track usage.
19015 (New.DoEmit): Call AddressOf with new arguments.
19017 (Unary.Emit): Adjust AddressOf call.
19019 2002-03-01 Ravi Pratap <ravi@ximian.com>
19021 * cs-parser.jay (member_access): Change the case for pre-defined types
19022 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
19025 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
19028 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
19029 essentially like methods and apply attributes like MethodImplOptions to them too.
19031 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
19034 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
19035 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
19038 * Update code everywhere accordingly.
19040 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
19042 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
19044 2002-02-28 Ravi Pratap <ravi@ximian.com>
19046 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
19047 try performing lookups against those instead of jumping straight into using
19048 the 'using' clauses.
19050 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
19052 (LookupType): Perform lookups in implicit parents too.
19054 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
19055 sequence as RootContext.LookupType.
19057 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
19058 the various cases of namespace lookups into this method.
19060 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19062 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
19063 in positional arguments)
19065 * class.cs (Operator): Update the AllowedModifiers to contain
19068 * cs-parser.jay: Update operator declaration to allow for the
19069 operator body to be empty.
19071 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
19074 2002-02-27 Miguel de Icaza <miguel@ximian.com>
19076 * class.cs (Method.Emit): Label parameters.
19078 * driver.cs: Return 1 or 0 as the program exit code.
19080 2002-02-26 Miguel de Icaza <miguel@ximian.com>
19082 * expression.cs: Special case the `null' object when trying to
19083 auto-compute the type, as anything can be explicitly converted to
19086 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
19087 spotting this Paolo.
19089 (Expression.ImplicitNumericConversion): Perform comparissions of
19090 the type using the underlying type in the case of an enumeration
19091 rather than using the enumeration type for the compare.
19093 Cope with the underlying == type case, which is not possible to
19096 (Expression.ConvertNumericExplicit): Perform comparissions of
19097 the type using the underlying type in the case of an enumeration
19098 rather than using the enumeration type for the compare.
19100 * driver.cs: If the user does not supply an extension, assume .exe
19102 * cs-parser.jay (if_statement): Rewrote so that we can track the
19103 location for the if statement.
19105 * expression.cs (Binary.ConstantFold): Only concat strings when
19106 the operation is "+", not everything ;-)
19108 * statement.cs (Statement.EmitBoolExpression): Take a location
19110 (If, While, Do): Track location.
19112 * expression.cs (Binary.ResolveOperator): In the object + string
19113 case, I was missing a call to ConvertImplicit
19115 2002-02-25 Ravi Pratap <ravi@ximian.com>
19117 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
19118 Location arguments. Ensure we use RootContext.LookupType to do our work
19119 and not try to do a direct Type.GetType and ModuleBuilder.GetType
19121 * interface.cs (PopulateMethod): Handle the type of the parameter being
19124 * expression.cs (Invocation.BetterFunction): Handle the case when we
19125 have a params method with no fixed arguments and a call is made with no
19128 2002-02-25 Miguel de Icaza <miguel@ximian.com>
19130 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
19131 the verbatim-string-literal
19133 * support.cs (InternalParameters.ParameterModifier): handle null
19135 (InternalParameters.ParameterType): ditto.
19137 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
19138 duplicating the name of the variable parameter.
19139 (GetParameterByName): Fix bug where we were not looking up array
19140 paramters if they were the only present (thanks Paolo!).
19141 (GetParameterInfo): We only have an empty set of types if both
19142 fixed and array are set to null.
19143 (GetParameterInfo-idx): Handle FixedParameter == null
19145 * cs-parser.jay: Handle the case where there is no catch
19146 statements (missing null test).
19148 2002-02-22 Miguel de Icaza <miguel@ximian.com>
19150 * driver.cs (MainDriver): Be conservative on our command line
19153 Catch DirectoryNotFoundException when calling GetFiles.
19155 (SplitPathAndPattern): Used to split the input specification into
19156 a path and a pattern that we can feed to Directory.GetFiles.
19158 2002-02-21 Miguel de Icaza <miguel@ximian.com>
19160 * statement.cs (Fixed): Implement the last case of the Fixed
19161 statement (string handling).
19163 * expression.cs (StringPtr): New class used to return a char * to
19164 a string; Used by the Fixed statement.
19166 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
19168 * expression.cs (Binary.ResolveOperator): Remove redundant
19169 MemberLookup pn parent type.
19170 Optimize union call, we do not need a union if the types are the same.
19171 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
19174 Specialize the use of MemberLookup everywhere, instead of using
19175 the default settings.
19177 (StackAlloc): Implement stackalloc keyword.
19179 * cs-parser.jay: Add rule to parse stackalloc.
19181 * driver.cs: Handle /h, /help, /?
19183 * expression.cs (MakeByteBlob): Removed the hacks we had in place
19184 before we supported unsafe code.
19186 * makefile: add --unsafe to the self compilation of mcs.
19188 2002-02-20 Miguel de Icaza <miguel@ximian.com>
19190 * expression.cs (PointerArithmetic): New class that is used to
19191 perform pointer arithmetic.
19192 (Binary.Resolve): Handle pointer arithmetic
19193 Handle pointer comparission.
19194 (ArrayPtr): Utility expression class that is used to take the
19195 address of an array.
19197 (ElementAccess): Implement array access for pointers
19199 * statement.cs (Fixed): Implement fixed statement for arrays, we
19200 are missing one more case before we are done.
19202 * expression.cs (Indirection): Implement EmitAssign and set the
19203 ExprClass to Variable. This allows pointer dereferences to be
19204 treated as variables, and to have values assigned to them.
19206 * ecore.cs (Expression.StoreFromPtr): New utility function to
19207 store values dereferencing.
19209 2002-02-20 Ravi Pratap <ravi@ximian.com>
19211 * expression.cs (Binary.ResolveOperator): Ensure that we are
19212 not trying to operate on a void type - this fixes the reported
19215 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
19216 the parent implementation is sealed.
19218 * ../errors/cs0239.cs : Add.
19220 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
19222 * typemanager.cs (unverifiable_code_type): Corresponds to
19223 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
19224 which have unsafe code in them.
19226 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
19229 2002-02-19 Miguel de Icaza <miguel@ximian.com>
19231 * cs-tokenizer.cs: Add support for @"litreal strings"
19233 Make tokenizer accept pre-processor directives
19234 on any column (remove the old C-like limitation).
19236 * rootcontext.cs (EmitCode): Emit any global attributes.
19237 (AddGlobalAttributes): Used to keep track of assembly attributes.
19239 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
19241 * cs-parser.jay: Add support for global attributes.
19243 2002-02-17 Miguel de Icaza <miguel@ximian.com>
19245 * expression.cs (Indirection): New helper class. Unary will
19246 create Indirection classes to be able to implement the
19247 IMemoryLocation interface on it.
19249 2002-02-16 Miguel de Icaza <miguel@ximian.com>
19251 * cs-parser.jay (fixed_statement): reference the right statement.
19253 * statement.cs (Fixed.Emit): Finish implementing the fixed
19254 statement for the &x case.
19256 2002-02-14 Miguel de Icaza <miguel@ximian.com>
19258 * class.cs (Property.Define, Method.Define): Remove newslot when
19261 * modifiers.cs: My use of NewSlot when `Abstract' was set was
19262 wrong. NewSlot should only be used if the `new' keyword is present.
19264 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19265 locating our system dir. Sorry about this.
19267 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19269 * driver.cs (GetSystemDir): Compute correctly the location of our
19270 system assemblies. I was using the compiler directory instead of
19271 the library directory.
19273 2002-02-13 Ravi Pratap <ravi@ximian.com>
19275 * expression.cs (BetterFunction): Put back in what Miguel commented out
19276 since it is the correct fix. The problem is elsewhere ;-)
19278 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19279 parameters of the parms method are themselves compatible or not !
19281 (StandardConversionExists): Fix very dangerous bug where we were forgetting
19282 to check that a class implements an interface before saying that an implicit
19283 conversion was allowed. Use ImplementsInterface to do the checking.
19285 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19287 * class.cs (Method.Define): Track whether we are an explicit
19288 implementation or not. And only call DefineMethodOverride if we
19289 are an explicit implementation.
19291 (Property.DefineMethod): Ditto.
19293 2002-02-11 Ravi Pratap <ravi@ximian.com>
19295 * expression.cs (BetterFunction): Catch hideous bug which was
19296 preventing us from detecting ambiguous calls due to implicit casts i.e
19299 2002-01-29 Miguel de Icaza <miguel@ximian.com>
19301 * support.cs (Pair): Remove un-needed method. I figured why I was
19302 getting the error in cs-parser.jay, the variable in a foreach loop
19303 is readonly, and the compiler does not really treat this as a variable.
19305 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
19306 instead of EQUALS in grammar.
19308 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19310 * expression.cs (Unary.DoResolve): Check whether the argument is
19313 2002-01-28 Miguel de Icaza <miguel@ximian.com>
19315 * support.cs: Api for Pair to set a value. Despite the fact that
19316 the variables are public the MS C# compiler refuses to compile
19317 code that accesses the field if the variable is part of a foreach
19320 * statement.cs (Fixed): Begin implementation of the fixed
19323 (Block.AddVariable): Return the VariableInfo on success and null
19324 on failure instead of true/false.
19326 * cs-parser.jay (foreach): Catch errors on variables already
19327 defined (we were ignoring this value before) and properly unwind
19328 the block hierarchy
19330 (fixed_statement): grammar for the fixed statement.
19332 2002-01-25 Miguel de Icaza <miguel@ximian.com>
19334 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19335 pointer types to be incretemented.
19337 (SizeOf): Implement.
19339 * cs-parser.jay (pointer_member_access): Implement
19340 expr->IDENTIFIER production.
19342 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19343 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19346 (Unary): Implement indirection.
19348 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19349 use in non-unsafe context).
19351 (SimpleName.DoResolve): Check for pointers in field access on safe
19354 (Expression.LoadFromPtr): Factor the load-indirect code in this
19355 function. This was duplicated in UnboxCast and ParameterReference
19357 2002-01-24 Miguel de Icaza <miguel@ximian.com>
19359 * expression.cs (ComposedCast): report an error if a pointer cast
19360 is used in a safe region.
19362 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19363 pointer type casts in unsafe context.
19365 * codegen.cs (EmitContext): Set up IsUnsafe.
19367 * cs-parser.jay (non_expression_type): Add productions for pointer
19370 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19371 code. We should not use force into static mode if the method is
19372 not virtual. Fixes bug in MIS
19374 * statement.cs (Do.Emit, While.Emit, For.Emit,
19375 Statement.EmitBoolExpression): Add support to Do and While to
19376 propagate infinite loop as `I do return' semantics.
19378 Improve the For case to also test for boolean constants.
19380 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19381 to the list of attributes we can add.
19383 Remove `EmitContext' argument.
19385 * class.cs (Method.Define): Apply parameter attributes.
19386 (Constructor.Define): Apply parameter attributes.
19387 (MethodCore.LabelParameters): Move here the core of labeling
19390 * support.cs (ReflectionParameters.ParameterModifier,
19391 InternalParameters.ParameterModifier): Use IsByRef on the type and
19392 only return the OUT bit for these parameters instead of in/out/ref
19395 This is because I miss-understood things. The ParameterInfo.IsIn
19396 and IsOut represent whether the parameter has the [In] and [Out]
19399 2002-01-22 Miguel de Icaza <miguel@ximian.com>
19401 * ecore.cs (FieldExpr.Emit): Release temporaries.
19403 * assign.cs (LocalTemporary.Release): new function.
19405 * codegen.cs (EmitContext.GetTemporaryStorage,
19406 EmitContext.FreeTemporaryStorage): Rework the way we deal with
19407 temporary storage. Now we can "put back" localbuilders when we
19410 2002-01-21 Miguel de Icaza <miguel@ximian.com>
19412 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19413 need to make a copy of the variable to generate verifiable code.
19415 2002-01-19 Miguel de Icaza <miguel@ximian.com>
19417 * driver.cs: Compute dynamically the system directory.
19419 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19420 Slower, but more generally useful. Used by the abstract
19421 registering implementation.
19423 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19424 the rules for the special rule on Type/instances. First check if
19425 we have the same name, and if so, try that special static path
19426 rather than the instance path.
19428 2002-01-18 Miguel de Icaza <miguel@ximian.com>
19430 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19433 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19434 Enum, ValueType, Delegate or Array for non-corlib compiles.
19436 * cs-tokenizer.cs: Catch long identifiers (645)
19438 * typemanager.cs (IndexerPropetyName): Ravi never tested this
19441 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19442 fix, we were returning too early, so we were not registering
19443 pending methods from abstract classes.
19445 Do not register pending methods if the class is abstract.
19447 * expression.cs (Conditional.DoResolve): Report circular implicit
19448 conversions when we neecd to compute it for conditional
19451 (Is.DoResolve): If the expression is always of the provided type,
19452 flag warning 183. If the expression can not ever be of the
19453 provided type flag warning 184.
19455 * class.cs: Catch 169 as well.
19457 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19460 2002-01-18 Nick Drochak <ndrochak@gol.com>
19462 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
19464 2002-01-17 Miguel de Icaza <miguel@ximian.com>
19466 * interface.cs: (PopulateMethod): Check for pointers being defined
19467 only if the unsafe context is active.
19468 (PopulateProperty): ditto.
19469 (PopulateIndexer): ditto.
19471 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19472 specified. If pointers are present, make sure that they are
19473 present in an unsafe context.
19474 (Constructor, Constructor.Define): ditto.
19475 (Field, Field.Define): ditto.
19476 (Property, Property.Define): ditto.
19477 (Event, Event.Define): ditto.
19479 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19480 hashtable if there are classes or structs defined.
19482 * expression.cs (LocalVariableReference.DoResolve): Simplify this
19483 code, as the constant resolution moved.
19485 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19486 the metadata, so we can flag error 133.
19488 * decl.cs (MemberCore.UnsafeOK): New function to test that a
19489 pointer is being declared in an unsafe context.
19491 2002-01-16 Miguel de Icaza <miguel@ximian.com>
19493 * modifiers.cs (Modifiers.Check): Require a Location argument.
19494 Report error 227 for Unsafe use.
19496 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19498 * statement.cs (For.Emit): If the test is null, then report that
19499 we do `return', as we wont reach anything afterwards.
19501 (Switch.SwitchGoverningType): Track the expression that matched
19504 * driver.cs: Allow negative numbers as an error code to flag.
19506 * cs-parser.jay: Handle 1551.
19508 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19510 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19512 * cs-parser.jay: Report 1518 (type declaration can only contain
19513 class, struct, interface, enum or delegate)
19515 (switch_label): Report 1523 (keywords `case' or `default' must
19518 (opt_switch_sections): Report 1522 (empty switch)
19520 * driver.cs: Report 1515 (response file specified multiple times)
19521 Report 1516 (Source file specified multiple times).
19523 * expression.cs (Argument.Resolve): Signal 1510
19525 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19526 access not allowed in static code)
19528 2002-01-11 Ravi Pratap <ravi@ximian.com>
19530 * typemanager.cs (IsPointerType): Utility method which we are going
19533 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19534 the object type, so we take care of that.
19536 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19538 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19539 added to non-params parameters :-)
19541 * typemanager.cs (CSharpName): Include 'void' type too.
19543 (void_ptr_type): Include in the set of core types.
19545 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
19548 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
19551 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
19552 completely forgotten about it.
19554 2002-01-10 Ravi Pratap <ravi@ximian.com>
19556 * cs-parser.jay (pointer_type): Add. This begins our implementation
19557 of parsing rules for unsafe code.
19559 (unsafe_statement): Implement.
19561 (embedded_statement): Modify to include the above.
19563 * statement.cs (Unsafe): Implement new class for unsafe blocks.
19565 * codegen.cs (EmitContext.InUnsafe): Add. This determines
19566 if the current context is an unsafe one.
19568 * cs-parser.jay (local_variable_pointer_type): Since local variable types
19569 are handled differently, we need separate rules for them.
19571 (local_variable_declaration): Update to use local_variable_pointer_type
19572 to allow variable declarations of unmanaged pointer types.
19574 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19575 in unsafe contexts.
19577 * ../errors/cs0214.cs : Add.
19579 2002-01-16 Nick Drochak <ndrochak@gol.com>
19581 * makefile: remove 'response' file when cleaning.
19583 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19585 * cs-parser.jay: Report 1524.
19587 2002-01-14 Miguel de Icaza <miguel@ximian.com>
19589 * typemanager.cs (RegisterMethod): drop checking if we have
19590 registered this from here
19592 2002-01-12 Miguel de Icaza <miguel@ximian.com>
19594 * class.cs (Method.EmitDestructor): Implement calling our base
19597 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19598 value of InFinally.
19600 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
19601 this routine and will wrap the call in a try/catch block. Deal
19604 2002-01-11 Miguel de Icaza <miguel@ximian.com>
19606 * ecore.cs (Expression.MemberLookup): instead of taking a
19607 parameter `same_type' that was used to tell whether we could
19608 access private members we compute our containing type from the
19611 (FieldExpr): Added partial support for volatile fields. This does
19612 not work for volatile fields exposed from assemblies, as I can not
19613 figure out how to extract the modreq from it.
19615 Updated all the source files to use this.
19617 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
19618 because it is referenced by MemberLookup very often.
19620 2002-01-09 Ravi Pratap <ravi@ximian.com>
19622 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
19623 TypeBuilder.GetCustomAttributes to retrieve what we need.
19625 Get rid of redundant default_member_attr_type as this is the same as
19626 default_member_type which already exists.
19628 * interface.cs, attribute.cs : Update accordingly.
19630 2002-01-08 Miguel de Icaza <miguel@ximian.com>
19632 * typemanager.cs: Enable IndexerPropertyName again. It does not
19633 work for TYpeBuilders though. Ravi, can you please fix this?
19635 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
19637 * expression.cs (Argument.Emit): Handle the case of ref objects
19638 being passed to ref functions;
19640 (ParameterReference.EmitLoad): Loads the content of the pointer
19641 without dereferencing.
19643 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19645 * cs-tokenizer.cs: Implemented the pre-processing expressions.
19647 2002-01-08 Ravi Pratap <ravi@ximian.com>
19649 * class.cs (Indexer.DefineMethod): Incorporate the interface
19650 type in the name of the method if we are doing explicit interface
19653 * expression.cs (ConversionExists): Remove as it is completely obsolete.
19655 (BetterConversion): Fix extremely trivial bug where we were referring to
19656 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19659 * ../errors/bug16.cs : Add although we have fixed it.
19661 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19663 * expression.cs (BaseIndexer): Begin implementation.
19665 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19667 * cs-parser.jay (indexer_declarator): Use qualified_identifier
19668 production directly to remove a shift/reduce, and implement
19669 explicit interface implementation.
19671 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19672 after a floating point suffix.
19674 * expression.cs (DoNumericPromotions): Improved the conversion for
19675 uint/uint. If we have a constant, we avoid doing a typecast to a
19678 * class.cs (Indexer): Implement explicit interface implementation
19681 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19683 * class.cs: make the default instance constructor public and hidebysig.
19685 2001-01-03 Ravi Pratap <ravi@ximian.com>
19687 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19688 so we can call it from elsewhere.
19690 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19691 we emit it internally if the class has a defined indexer; otherwise the user
19692 emits it by decorating the class definition with the DefaultMemberAttribute.
19694 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19695 attribute is not used on a type which defines an indexer.
19697 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19698 character when we skip whitespace.
19700 * ../errors/cs0646.cs : Add.
19702 2002-01-03 Miguel de Icaza <miguel@ximian.com>
19704 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19707 * makefile: Add practical target `mcs3.exe' which builds the third
19708 generation compiler.
19710 * expression.cs (New): Fix structures constructor calling.
19712 * class.cs (Property, Method, Indexer): Emit Final flag on the
19713 method if we are an interface implementation and we are not
19716 * ecore.cs (PropertyExpr): New public field `IsBase', tells
19717 whether this property is referencing a `base' method.
19719 * expression.cs (Invocation.EmitCall): take an extra argument:
19720 is_base, this is used to determine whether the `call' or
19721 `callvirt' opcode should be used.
19724 * delegate.cs: update EmitCall.
19726 * class.cs (Method.Define): Set NewSlot for the cases where we are
19727 not implementing an interface method.
19729 (Property.Define): ditto.
19731 2002-01-02 Miguel de Icaza <miguel@ximian.com>
19733 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19734 'r'. Allows mcs to parse itself fully.
19736 2002-01-02 Ravi Pratap <ravi@ximian.com>
19738 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19739 of the number of initializers that require the InitializeArray method.
19741 (CheckIndices): Store the Expression in all cases - not the plain value. Also
19742 update the above field where necessary.
19744 (MakeByteBlob): Update accordingly.
19746 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
19749 (EmitDynamicInitializers): Update in accordance with the new optimization.
19751 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19752 same OpCode applies.
19754 * cs-parser.jay : Fix some glaring errors I introduced.
19756 2002-01-01 Ravi Pratap <ravi@ximian.com>
19758 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19759 so that we can check for name clashes there too.
19761 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19762 for interface indexers.
19764 * interfaces.cs (Define): Emit the default member attribute.
19766 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19767 variable was being referred to while setting the value ;-)
19769 2002-01-01 Miguel de Icaza <miguel@ximian.com>
19771 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19772 byte-by-byte information when we know the data is zero.
19774 Make the block always a multiple of 4, because
19775 DefineInitializedData has a bug.
19777 * assign.cs: Fix, we should assign from the temporary, not from
19780 * expression.cs (MakeByteBlob): Fix my incorrect code.
19782 2001-12-31 Miguel de Icaza <miguel@ximian.com>
19784 * typemanager.cs (EnumToUnderlying): This function is used to get
19785 the underlying type from an enumeration, because it does not
19788 * constant.cs: Use the I4_S form for values between -128 and 127.
19790 * statement.cs (Block.LookupLabel): Looks up a label.
19791 (Block): Drop support for labeled blocks.
19793 (LabeledStatement): New kind of statement that represents a label
19796 (Goto): Finally implement this bad boy.
19798 * cs-parser.jay: Update to reflect new mechanism to implement
19801 2001-12-30 Miguel de Icaza <miguel@ximian.com>
19803 * codegen.cs (EmitContext.This): a codegen property that keeps the
19804 a single instance of this instead of creating many different this
19807 * delegate.cs (Delegate.DoResolve): Update to use the property;
19809 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19811 * expression.cs (BaseAccess.DoResolve): Ditto.
19813 2001-12-29 Ravi Pratap <ravi@ximian.com>
19815 * typemanager.cs (methodimpl_attr_type): Add to hold the type
19816 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19818 (InitCoreTypes): Update accordingly.
19820 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19821 so we can quickly store the state.
19823 (ApplyAttributes): Set the correct implementation flags
19824 for InternalCall methods.
19826 2001-12-29 Miguel de Icaza <miguel@ximian.com>
19828 * expression.cs (EmitCall): if a method is not virtual, then do
19829 not use callvirt on it.
19831 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19832 user defined stuff) requires the use of stobj, which takes an
19833 address on the stack instead of an array and an index. So emit
19834 the Ldelema operation for it.
19836 (EmitStoreOpcode): Use stobj for valuetypes.
19838 (UnaryMutator.EmitCode): Use the right 1 value depending on
19839 whether we are dealing with int64/uint64, float or doubles.
19841 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19842 constructors that I implemented last night.
19844 (Constructor.IsDefault): Fix to work properly for static
19847 * cs-parser.jay (CheckDef): report method signature errors.
19848 Update error number 103 to be 132.
19850 * decl.cs: New AdditionResult enumeration value: MethodExists.
19851 Although we do this check for methods later on in the semantic
19852 analysis, catching repeated default constructors is so easy that
19853 we catch these here.
19855 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19858 (ParameterReference.EmitAssign, Emit): handle
19861 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19862 (ArrayAccess.EmitStoreOpcode): ditto.
19864 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19866 * expression.cs (MakeByteBlob): Complete all the missing types
19867 (uint, short, ushort, byte, sbyte)
19869 * class.cs: Only init instance field initializers on instance
19872 Rename `constructors' to instance_constructors.
19874 (TypeContainer.AddConstructor): Only add constructors to the list
19875 if it is not static.
19877 Make sure that we handle default_static_constructor independently
19878 everywhere where we handle instance_constructors
19880 2001-12-28 Miguel de Icaza <miguel@ximian.com>
19882 * class.cs: Do not lookup or create a base initializer for a
19883 static constructor.
19885 (ConstructorInitializer.Resolve): use the proper type to lookup
19888 * cs-parser.jay: Report error 1585 (modifiers between type and name).
19890 * enum.cs, interface.cs: Remove CloseType, this is taken care by
19893 * decl.cs: CloseType is now an virtual method, the default
19894 implementation just closes this type.
19896 2001-12-28 Ravi Pratap <ravi@ximian.com>
19898 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19899 to PreserveSig by default. Also emit HideBySig on such methods.
19901 Basically, set the defaults to standard values.
19903 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19904 argument, if candidate is better, it can't be worse than the best !
19906 (Invocation): Re-write bits to differentiate between methods being
19907 applicable in their expanded form and their normal form - for params
19910 Get rid of use_standard everywhere as only standard conversions are allowed
19911 in overload resolution.
19913 More spec conformance.
19915 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19917 * driver.cs: Add --timestamp, to see where the compiler spends
19920 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19921 `this' in static code.
19923 (SimpleName.DoResolve): Implement in terms of a helper function
19924 that allows static-references to be passed upstream to
19927 (Expression.ResolveWithSimpleName): Resolve specially simple
19928 names when called by MemberAccess to implement the special
19931 (Expression.ImplicitReferenceConversion): Handle conversions from
19932 Null to reference types before others, as Null's type is
19935 * expression.cs (Invocation.EmitCall): Handle the special case of
19936 calling methods declared on a reference type from a ValueType
19937 (Base classes System.Object and System.Enum)
19939 (MemberAccess.Resolve): Only perform lookups on Enumerations if
19940 the left hand side is a TypeExpr, not on every enumeration.
19942 (Binary.Resolve): If types are reference types, then do a cast to
19943 object on operators != and == of both arguments.
19945 * typemanager.cs (FindMembers): Extract instance and static
19946 members if requested.
19948 * interface.cs (PopulateProperty): Use void_type instead of null
19949 as the return type for the setter method.
19951 (PopulateIndexer): ditto.
19953 2001-12-27 Ravi Pratap <ravi@ximian.com>
19955 * support.cs (ReflectionParameters): Fix minor bug where we
19956 were examining the wrong parameter for the ParamArray attribute.
19958 Cope with requests for the type of the parameter at position
19959 greater than the params parameter's. We now return the element
19960 type of the params array as that makes more sense.
19962 * expression.cs (Invocation.IsParamsMethodApplicable): Update
19963 accordingly as we no longer have to extract the element type
19966 (Invocation.OverloadResolve): Update.
19968 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19970 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19971 against IEnumerator, test whether the return value is a descendant
19972 of the IEnumerator interface.
19974 * class.cs (Indexer.Define): Use an auxiliary method to implement
19975 the other bits of the method definition. Begin support for
19976 explicit interface implementation.
19978 (Property.DefineMethod): Use TypeManager.void_type instead of null
19979 for an empty return value.
19981 2001-12-26 Miguel de Icaza <miguel@ximian.com>
19983 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19984 dealing with a FieldExpr which is composed of a FieldBuilder, in
19985 the code path we did extract the constant, but we should have
19986 obtained the underlying value to be able to cast it (otherwise we
19987 end up in an infinite loop, this is what Ravi was running into).
19989 (ArrayCreation.UpdateIndices): Arrays might be empty.
19991 (MemberAccess.ResolveMemberAccess): Add support for section
19992 14.5.4.1 that deals with the special case of E.I when E is a type
19993 and something else, that I can be a reference to a static member.
19995 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19996 handle a particular array type to create byte blobs, it is just
19997 something we dont generate byteblobs for.
19999 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20002 * location.cs (Push): remove the key from the hashtable that we
20003 are about to add. This happens for empty files.
20005 * driver.cs: Dispose files after we have parsed them.
20007 (tokenize): new function that only runs the tokenizer on its
20008 input, for speed testing.
20010 2001-12-26 Ravi Pratap <ravi@ximian.com>
20012 * class.cs (Event.Define): Define the private field only if there
20013 are no accessors defined.
20015 * expression.cs (ResolveMemberAccess): If there is no associated
20016 field with the event, that means we have an event defined with its
20017 own accessors and we should flag error cs0070 since transforming
20018 ourselves into a field is not valid in that case.
20020 * ecore.cs (SimpleName.DoResolve): Same as above.
20022 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
20023 and charset to sane values.
20025 2001-12-25 Ravi Pratap <ravi@ximian.com>
20027 * assign.cs (DoResolve): Perform check on events only if they
20028 are being accessed outside the declaring type.
20030 * cs-parser.jay (event_declarations): Update rules to correctly
20031 set the type of the implicit parameter etc.
20033 (add_accessor, remove_accessor): Set current local parameters.
20035 * expression.cs (Binary): For delegate addition and subtraction,
20036 cast the return value from the method into the appropriate delegate
20039 2001-12-24 Ravi Pratap <ravi@ximian.com>
20041 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
20042 of these as the workaround is unnecessary.
20044 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
20045 delegate data - none of that is needed at all.
20047 Re-write bits to extract the instance expression and the delegate method
20050 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
20053 * attribute.cs (ApplyAttributes): New method to take care of common tasks
20054 of attaching attributes instead of duplicating code everywhere.
20056 * everywhere : Update code to do attribute emission using the above method.
20058 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20060 * expression.cs (IsParamsMethodApplicable): if there are not
20061 parameters, return immediately.
20063 * ecore.cs: The 0 literal can be implicity converted to an enum
20066 (SimpleName.DoResolve): First lookup the type, then lookup the
20069 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
20070 want to get its address. If the InstanceExpression is not
20071 addressable, store the result in a temporary variable, then get
20074 * codegen.cs: Only display 219 errors on warning level or above.
20076 * expression.cs (ArrayAccess): Make it implement the
20077 IMemoryLocation interface.
20079 (Binary.DoResolve): handle the operator == (object a, object b)
20080 and operator != (object a, object b) without incurring into a
20081 BoxedCast (because 5 != o should never be performed).
20083 Handle binary enumerator operators.
20085 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
20086 value type, otherwise use Ldelem_ref.
20088 Use precomputed names;
20090 (AddressOf): Implement address of
20092 * cs-parser.jay (labeled_statement): Fix recursive block
20093 addition by reworking the production.
20095 * expression.cs (New.DoEmit): New has a special case:
20097 If we are dealing with a ValueType, we have a few
20098 situations to deal with:
20100 * The target of New is a ValueType variable, that is
20101 easy, we just pass this as the variable reference
20103 * The target of New is being passed as an argument,
20104 to a boxing operation or a function that takes a
20107 In this case, we need to create a temporary variable
20108 that is the argument of New.
20111 2001-12-23 Ravi Pratap <ravi@ximian.com>
20113 * rootcontext.cs (LookupType): Check that current_type is not null before
20114 going about looking at nested types.
20116 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
20117 not implement the IAssignMethod interface any more.
20119 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
20120 where we tranform them into FieldExprs if they are being resolved from within
20121 the declaring type.
20123 * ecore.cs (SimpleName.DoResolve): Do the same here.
20125 * assign.cs (DoResolve, Emit): Clean up code considerably.
20127 * ../errors/bug10.cs : Add.
20129 * ../errors/cs0070.cs : Add.
20131 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
20133 * assign.cs : Get rid of EventIsLocal everywhere.
20135 2001-12-23 Miguel de Icaza <miguel@ximian.com>
20137 * ecore.cs (ConvertIntLiteral): finished the implementation.
20139 * statement.cs (SwitchLabel): Convert the value we are using as a
20140 key before looking up the table.
20142 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20144 * codegen.cs (EmitTopBlock): Require a Location argument now.
20146 * cs-parser.jay (constructor_declarator): We need to setup
20147 current_local_parameters before we parse the
20148 opt_constructor_initializer, to allow the variables to be bound
20149 to the constructor arguments.
20151 * rootcontext.cs (LookupType): First lookup nested classes in our
20152 class and our parents before we go looking outside our class.
20154 * expression.cs (ConstantFold): Extract/debox the values at the
20157 * rootcontext.cs (EmitCode): Resolve the constants first before we
20158 resolve the types. This is not really needed, but it helps debugging.
20160 * statement.cs: report location.
20162 * cs-parser.jay: pass location to throw statement.
20164 * driver.cs: Small bug fix.
20166 * report.cs: Updated format to be 4-zero filled digits.
20168 2001-12-22 Ravi Pratap <ravi@ximian.com>
20170 * expression.cs (CheckIndices): Fix minor bug where the wrong
20171 variable was being referred to ;-)
20173 (DoEmit): Do not call EmitStaticInitializers when the
20174 underlying type is System.Object.
20176 2001-12-21 Ravi Pratap <ravi@ximian.com>
20178 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
20179 and do the usual workaround for SRE.
20181 * class.cs (MyEventBuilder.EventType): New member to get at the type
20182 of the event, quickly.
20184 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
20186 * assign.cs (Assign.DoResolve): Handle the case when the target
20187 is an EventExpr and perform the necessary checks.
20189 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
20192 (SimpleName.MemberStaticCheck): Include check for EventExpr.
20194 (EventExpr): Set the type in the constructor itself since we
20195 are meant to be born fully resolved.
20197 (EventExpr.Define): Revert code I wrote earlier.
20199 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
20200 instance expression is null. The instance expression is a This in that case
20201 or a null, depending on whether it is a static method or not.
20203 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
20204 refers to more than one method.
20206 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
20207 and accordingly flag errors.
20209 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20211 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
20213 2001-12-22 Miguel de Icaza <miguel@ximian.com>
20215 * location.cs (ToString): Provide useful rutine.
20217 2001-12-21 Miguel de Icaza <miguel@ximian.com>
20219 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
20220 objects, return the actual integral boxed.
20222 * statement.cs (SwitchLabel): define an ILLabel for each
20225 (Switch.CheckSwitch): If the value is a Literal, extract
20226 the underlying literal.
20228 Also in the unused hashtable we had, add the SwitchLabel so we can
20229 quickly look this value up.
20231 * constant.cs: Implement a bunch of new constants. Rewrite
20232 Literal based on this. Made changes everywhere to adapt to this.
20234 * expression.cs (Expression.MakeByteBlob): Optimize routine by
20235 dereferencing array only once, and also copes with enumrations.
20237 bytes are two bytes wide, not one.
20239 (Cast): Perform constant conversions.
20241 * ecore.cs (TryImplicitIntConversion): Return literals instead of
20242 wrappers to the literals here.
20244 * expression.cs (DoNumericPromotions): long literals can converted
20245 to ulong implicity (this is taken care of elsewhere, but I was
20246 missing this spot).
20248 * ecore.cs (Expression.Literalize): Make the return type Literal,
20249 to improve type checking.
20251 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20253 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20255 * literal.cs: Revert code from ravi that checked the bounds. The
20256 bounds are sane by the definition of the type itself.
20258 * typemanager.cs: Fix implementation of ImplementsInterface. We
20259 need to actually look up in our parent hierarchy for interfaces
20262 * const.cs: Use the underlying type for enumerations
20264 * delegate.cs: Compute the basename for the delegate creation,
20265 that should fix the delegate test case, and restore the correct
20266 Type Lookup semantics in rootcontext
20268 * rootcontext.cs: Revert Ravi's last patch. The correct way of
20269 referencing a nested type with the Reflection API is using the "+"
20272 * cs-parser.jay: Do not require EOF token at the end.
20274 2001-12-20 Ravi Pratap <ravi@ximian.com>
20276 * rootcontext.cs (LookupType): Concatenate type names with
20277 a '.' instead of a '+' The test suite passes again.
20279 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20280 field of the enumeration.
20282 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20283 the case when the member is an EventExpr.
20285 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20286 static has an associated instance expression.
20288 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20290 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20292 * class.cs (Event.Define): Register event and perform appropriate checks
20295 We define the Add and Remove methods even if the use provides none because
20296 in that case, we provide default implementations ourselves.
20298 Define a private field of the type of the event. This is done by the CSC compiler
20299 and we should be doing it too ;-)
20301 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20302 More methods we use in code we generate.
20304 (multicast_delegate_type, delegate_type): Two separate types since the distinction
20307 (InitCoreTypes): Update accordingly for the above.
20309 * class.cs (Event.Emit): Generate code for default accessors that we provide
20311 (EmitDefaultMethod): Do the job in the above.
20313 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
20316 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20318 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20319 builders even if we were missing one.
20321 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20322 pass the Basename as our class name instead of the Name. The
20323 basename will be correctly composed for us.
20325 * parameter.cs (Paramters): Now takes a Location argument.
20327 * decl.cs (DeclSpace.LookupType): Removed convenience function and
20328 make all the code call directly LookupType in RootContext and take
20329 this chance to pass the Location information everywhere.
20331 * Everywhere: pass Location information.
20333 2001-12-19 Miguel de Icaza <miguel@ximian.com>
20335 * class.cs (Constructor.Define): Updated way of detecting the
20336 length of the parameters.
20338 (TypeContainer.DefineType): Use basename as the type name for
20341 (TypeContainer.Define): Do not recursively define types here, as
20342 definition is taken care in order by the RootContext.
20344 * tree.cs: Keep track of namespaces in a per-file basis.
20346 * parameter.cs (Parameter.ComputeSignature): Update to use
20349 (Parameters.GetSignature): ditto.
20351 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20352 instead of a TypeContainer.
20354 (Interface.SemanticAnalysis): Use `this' instead of our parent to
20355 resolve names. Because we need to be resolve in our context, not
20358 * driver.cs: Implement response files.
20360 * class.cs (TypeContainer.DefineType): If we are defined, do not
20361 redefine ourselves.
20363 (Event.Emit): Emit the code for add/remove handlers.
20364 (Event.Define): Save the MethodBuilders for add/remove.
20366 * typemanager.cs: Use pair here too.
20368 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20369 DictionaryEntry requires the first argument to be non-null.
20371 (enum_declaration): Compute full name for registering the
20374 (delegate_declaration): Instead of using
20375 formal_parameter_list, use opt_formal_parameter_list as the list
20378 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20379 (EventParsing): New property that controls whether `add' and
20380 `remove' are returned as tokens or identifiers (for events);
20382 2001-12-19 Ravi Pratap <ravi@ximian.com>
20384 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20385 use MyEventBuilder only and let it wrap the real builder for us.
20387 (MyEventBuilder): Revamp constructor etc.
20389 Implement all operations that we perform on EventBuilder in precisely the same
20392 (FindMembers): Update to use the EventBuilder member.
20394 (Event.Emit): Update accordingly.
20396 2001-12-18 Ravi Pratap <ravi@ximian.com>
20398 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20399 by calling the appropriate methods.
20401 (GetCustomAttributes): Make stubs as they cannot possibly do anything
20404 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20406 2001-12-17 Ravi Pratap <ravi@ximian.com>
20408 * delegate.cs (Delegate.Populate): Check that the return type
20409 and various parameters types are indeed accessible.
20411 * class.cs (Constructor.Define): Same here.
20413 (Field.Define): Ditto.
20415 (Event.Define): Ditto.
20417 (Operator.Define): Check that the underlying Method defined itself
20418 correctly - so it's MethodBuilder should not be null.
20420 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20421 expression happens to be null.
20423 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20424 members but as of now we don't seem to be able to do anything really useful with it.
20426 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20427 not the EventBuilder.
20429 2001-12-18 Miguel de Icaza <miguel@ximian.com>
20431 * cs-tokenizer.cs: Add support for defines.
20432 Add support for #if, #elif, #else, #endif
20434 (eval_var): evaluates a variable.
20435 (eval): stubbed for evaluating functions.
20437 * cs-parser.jay: Pass the defines information
20439 * driver.cs: Add --define command line option.
20441 * decl.cs: Move MemberCore here.
20443 Make it the base class for DeclSpace. This allows us to catch and
20444 report 108 and 109 for everything now.
20446 * class.cs (TypeContainer.Define): Extract all the members
20447 before populating and emit the warning 108 (new keyword required
20448 to override) instead of having each member implement this.
20450 (MemberCore.Define): New abstract method, we will be using this in
20451 the warning reporting engine in Populate.
20453 (Operator.Define): Adjust to new MemberCore protocol.
20455 * const.cs (Const): This does not derive from Expression, it is a
20456 temporary object we use to create fields, it is a MemberCore.
20458 * class.cs (Method.Define): Allow the entry point to be in a
20461 * driver.cs: Rewrite the argument handler to clean it up a bit.
20463 * rootcontext.cs: Made it just an auxiliary namespace feature by
20464 making everything static.
20466 * driver.cs: Adapt code to use RootContext type name instead of
20469 * delegate.cs: Remove RootContext argument.
20471 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20474 * class.cs (Event.Define): The lookup can fail.
20476 * cs-tokenizer.cs: Begin implementation of pre-procesor.
20478 * expression.cs: Resolve the this instance before invoking the code.
20480 2001-12-17 Miguel de Icaza <miguel@ximian.com>
20482 * cs-parser.jay: Add a production in element_access that allows
20483 the thing to become a "type" reference. This way we can parse
20484 things like "(string [])" as a type.
20486 Note that this still does not handle the more complex rules of
20490 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
20492 * ecore.cs: (CopyNewMethods): new utility function used to
20493 assemble the list of methods from running FindMembers.
20495 (MemberLookup): Rework FindMembers so that
20497 2001-12-16 Miguel de Icaza <miguel@ximian.com>
20499 * class.cs (TypeContainer): Remove Delegates who fail to be
20502 * delegate.cs (Populate): Verify that we dont get null return
20503 values. TODO: Check for AsAccessible.
20505 * cs-parser.jay: Use basename to emit error 574 (destructor should
20506 have the same name as container class), not the full name.
20508 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20509 possible representation.
20511 Also implements integer type suffixes U and L.
20513 2001-12-15 Miguel de Icaza <miguel@ximian.com>
20515 * expression.cs (ArrayCreation.DoResolve): We need to do the
20516 argument resolution *always*.
20518 * decl.cs: Make this hold the namespace. Hold the root context as
20520 (LookupType): Move here.
20522 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20524 * location.cs (Row, Name): Fixed the code, it was always returning
20525 references to the first file.
20527 * interface.cs: Register properties defined through interfaces.
20529 * driver.cs: Add support for globbing on the command line
20531 * class.cs (Field): Make it derive from MemberCore as well.
20534 2001-12-15 Ravi Pratap <ravi@ximian.com>
20536 * class.cs (Event::Define): Check that the type of the event is a delegate
20537 type else flag error #66.
20539 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20542 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20543 values of EntryPoint, CharSet etc etc.
20545 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20547 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20548 be null and we should ignore this. I am not sure if this is really clean. Apparently,
20549 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20550 which needs this to do its work.
20552 * ../errors/cs0066.cs : Add.
20554 2001-12-14 Miguel de Icaza <miguel@ximian.com>
20556 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20559 * class.cs: (MethodSignature.MethodSignature): Removed hack that
20560 clears out the parameters field.
20561 (MemberSignatureCompare): Cleanup
20563 (MemberCore): New base class used to share code between MethodCore
20566 (RegisterRequiredImplementations) BindingFlags.Public requires
20567 either BindingFlags.Instace or Static. Use instance here.
20569 (Property): Refactored code to cope better with the full spec.
20571 * parameter.cs (GetParameterInfo): Return an empty array instead
20574 * class.cs (Property): Abstract or extern properties have no bodies.
20576 * parameter.cs (GetParameterInfo): return a zero-sized array.
20578 * class.cs (TypeContainer.MethodModifiersValid): Move all the
20579 method modifier validation to the typecontainer so we can reuse
20580 this on properties.
20582 (MethodCore.ParameterTypes): return an empty sized array of types.
20584 (Property.Define): Test property modifier validity.
20586 Add tests for sealed/override too.
20588 (Method.Emit): abstract or extern methods have no bodies.
20590 2001-12-14 Ravi Pratap <ravi@ximian.com>
20592 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20595 (Method::Define, ::Emit): Modify accordingly.
20597 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20599 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
20601 * makefile: Pass in /unsafe.
20603 2001-12-13 Miguel de Icaza <miguel@ximian.com>
20605 * class.cs (MakeKey): Kill routine.
20607 * class.cs (TypeContainer.Define): Correctly define explicit
20608 method implementations (they require the full interface name plus
20611 * typemanager.cs: Deply the PtrHashtable here and stop using the
20612 lame keys. Things work so much better.
20614 This of course broke everyone who depended on `RegisterMethod' to
20615 do the `test for existance' test. This has to be done elsewhere.
20617 * support.cs (PtrHashtable): A hashtable that avoid comparing with
20618 the object stupid Equals method (because, that like fails all over
20619 the place). We still do not use it.
20621 * class.cs (TypeContainer.SetRequiredInterface,
20622 TypeContainer.RequireMethods): Killed these two routines and moved
20623 all the functionality to RegisterRequiredImplementations.
20625 (TypeContainer.RegisterRequiredImplementations): This routine now
20626 registers all the implementations required in an array for the
20627 interfaces and abstract methods. We use an array of structures
20628 which can be computed ahead of time to reduce memory usage and we
20629 also assume that lookups are cheap as most classes will not
20630 implement too many interfaces.
20632 We also avoid creating too many MethodSignatures.
20634 (TypeContainer.IsInterfaceMethod): Update and optionally does not
20635 clear the "pending" bit if we find that there are problems with
20638 (TypeContainer.VerifyPendingMethods): Update to report errors of
20639 methods that look like implementations but are not.
20641 (TypeContainer.Define): Add support for explicit interface method
20644 2001-12-12 Miguel de Icaza <miguel@ximian.com>
20646 * typemanager.cs: Keep track of the parameters here instead of
20647 being a feature of the TypeContainer.
20649 * class.cs: Drop the registration of parameters here, as
20650 InterfaceMethods are also interface declarations.
20652 * delegate.cs: Register methods with the TypeManager not only with
20653 the TypeContainer. This code was buggy.
20655 * interface.cs: Full registation here.
20657 2001-12-11 Miguel de Icaza <miguel@ximian.com>
20659 * expression.cs: Remove reducer for binary expressions, it can not
20662 * const.cs: Put here the code that used to go into constant.cs
20664 * constant.cs: Put here the code for constants, this is a new base
20665 class for Literals.
20667 * literal.cs: Make Literal derive from Constant.
20669 2001-12-09 Miguel de Icaza <miguel@ximian.com>
20671 * statement.cs (Return.Emit): Report error 157 if the user
20672 attempts to return from a finally block.
20674 (Return.Emit): Instead of emitting a return, jump to the end of
20677 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20678 LocalBuilder to store the result of the function. ReturnLabel is
20679 the target where we jump.
20682 2001-12-09 Radek Doulik <rodo@ximian.com>
20684 * cs-parser.jay: remember alias in current namespace
20686 * ecore.cs (SimpleName::DoResolve): use aliases for types or
20689 * class.cs (LookupAlias): lookup alias in my_namespace
20691 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20693 (LookupAlias): lookup alias in this and if needed in parent
20696 2001-12-08 Miguel de Icaza <miguel@ximian.com>
20700 * rootcontext.cs: (ModuleBuilder) Made static, first step into
20701 making things static. I need this to avoid passing the
20702 TypeContainer when calling ParameterType.
20704 * support.cs (InternalParameters.ParameterType): Remove ugly hack
20705 that did string manipulation to compute the type and then call
20706 GetType. Use Parameter.ParameterType instead.
20708 * cs-tokenizer.cs: Consume the suffix for floating values.
20710 * expression.cs (ParameterReference): figure out whether this is a
20711 reference parameter or not. Kill an extra variable by computing
20712 the arg_idx during emission.
20714 * parameter.cs (Parameters.GetParameterInfo): New overloaded
20715 function that returns whether a parameter is an out/ref value or not.
20717 (Parameter.ParameterType): The type of the parameter (base,
20718 without ref/out applied).
20720 (Parameter.Resolve): Perform resolution here.
20721 (Parameter.ExternalType): The full type (with ref/out applied).
20723 * statement.cs (Using.Emit, Using.EmitExpression): Implement
20724 support for expressions on the using statement.
20726 2001-12-07 Miguel de Icaza <miguel@ximian.com>
20728 * statement.cs (Using.EmitLocalVariableDecls): Split the
20729 localvariable handling of the using statement.
20731 (Block.EmitMeta): Keep track of variable count across blocks. We
20732 were reusing slots on separate branches of blocks.
20734 (Try.Emit): Emit the general code block, we were not emitting it.
20736 Check the type of the declaration to be an IDisposable or
20737 something that can be implicity converted to it.
20739 Emit conversions if required.
20741 * ecore.cs (EmptyExpression): New utility class.
20742 (Expression.ImplicitConversionExists): New utility function.
20744 2001-12-06 Miguel de Icaza <miguel@ximian.com>
20746 * statement.cs (Using): Implement.
20748 * expression.cs (LocalVariableReference): Support read only variables.
20750 * statement.cs: Remove the explicit emit for the Leave opcode.
20751 (VariableInfo): Add a readonly field.
20753 2001-12-05 Miguel de Icaza <miguel@ximian.com>
20755 * ecore.cs (ConvCast): new class used to encapsulate the various
20756 explicit integer conversions that works in both checked and
20757 unchecked contexts.
20759 (Expression.ConvertNumericExplicit): Use new ConvCast class to
20760 properly generate the overflow opcodes.
20762 2001-12-04 Miguel de Icaza <miguel@ximian.com>
20764 * statement.cs: The correct type for the EmptyExpression is the
20765 element_type, not the variable type. Ravi pointed this out.
20767 2001-12-04 Ravi Pratap <ravi@ximian.com>
20769 * class.cs (Method::Define): Handle PInvoke methods specially
20770 by using DefinePInvokeMethod instead of the usual one.
20772 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20773 above to do the task of extracting information and defining the method.
20775 2001-12-04 Ravi Pratap <ravi@ximian.com>
20777 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20778 of the condition for string type.
20780 (Emit): Move that here.
20782 (ArrayCreation::CheckIndices): Keep string literals in their expression
20785 (EmitDynamicInitializers): Handle strings appropriately.
20787 2001-12-04 Miguel de Icaza <miguel@ximian.com>
20789 * codegen.cs (EmitContext): Replace multiple variables with a
20790 single pointer to the current Switch statement.
20792 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20795 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20799 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20802 (Foreach.Emit): Foreach on arrays was not setting
20803 up the loop variables (for break/continue).
20805 (GotoCase): Semi-implented.
20807 2001-12-03 Ravi Pratap <ravi@ximian.com>
20809 * attribute.cs (CheckAttribute): Handle system attributes by using
20810 Attribute.GetAttributes to examine information we need.
20812 (GetValidPlaces): Same here.
20814 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20816 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20818 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20820 (Method::Define): Set appropriate flags if we have a DllImport attribute.
20822 (Method::Emit): Handle the case when we are a PInvoke method.
20824 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20826 * expression.cs: Use ResolveWithSimpleName on compound names.
20828 2001-12-02 Ravi Pratap <ravi@ximian.com>
20830 * constant.cs (EmitConstant): Make sure we resolve the associated expression
20831 before trying to reduce it.
20833 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20835 * constant.cs (LookupConstantValue): Implement.
20837 (EmitConstant): Use the above in emitting the constant.
20839 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20840 that are user-defined by doing a LookupConstantValue on them.
20842 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20845 2001-11-29 Miguel de Icaza <miguel@ximian.com>
20847 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20849 (BaseAccess.DoResolve): Implement.
20851 (MemberAccess.DoResolve): Split this routine into a
20852 ResolveMemberAccess routine that can be used independently
20854 2001-11-28 Miguel de Icaza <miguel@ximian.com>
20856 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20857 As that share bits of the implementation. Is returns a boolean,
20858 while As returns the Type that is being probed.
20860 2001-12-01 Ravi Pratap <ravi@ximian.com>
20862 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20863 instead of a Literal - much easier.
20865 (EnumInTransit): Remove - utterly useless :-)
20867 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20869 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20871 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20872 chain when we have no associated expression.
20874 2001-11-30 Ravi Pratap <ravi@ximian.com>
20876 * constant.cs (Define): Use Location while reporting the errror.
20878 Also emit a warning when 'new' is used and there is no inherited
20881 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
20884 (LookupEnumValue): Implement to lookup an enum member's value and define it
20887 (Populate): Re-write accordingly to use the above routine.
20889 2001-11-27 Miguel de Icaza <miguel@ximian.com>
20891 * expression.cs (This): Fix prototype for DoResolveLValue to
20892 override the base class DoResolveLValue.
20894 * cs-parser.cs: Report errors cs574 and cs575 (destructor
20897 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20898 (we need to load the address of the field here). This fixes
20901 (FieldExpr.DoResolveLValue): Call the DoResolve
20902 function to initialize the Instance expression.
20904 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20905 correctly the GetEnumerator operation on a value type.
20907 * cs-parser.jay: Add more simple parsing error catches.
20909 * statement.cs (Switch): Add support for string switches.
20910 Handle null specially.
20912 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
20914 2001-11-28 Ravi Pratap <ravi@ximian.com>
20916 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20918 (declare_local_constant): New helper function.
20920 * statement.cs (AddConstant): Keep a separate record of constants
20922 (IsConstant): Implement to determine if a variable is a constant.
20924 (GetConstantExpression): Implement.
20926 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20928 * statement.cs (IsVariableDefined): Re-write.
20930 2001-11-27 Ravi Pratap <ravi@ximian.com>
20932 * class.cs (TypeContainer::FindMembers): Look for constants
20933 in the case when we are looking for MemberTypes.Field
20935 * expression.cs (MemberAccess::DoResolve): Check that in the
20936 case we are a FieldExpr and a Literal, we are not being accessed
20937 by an instance reference.
20939 * cs-parser.jay (local_constant_declaration): Implement.
20941 (declaration_statement): Implement for constant declarations.
20943 2001-11-26 Miguel de Icaza <miguel@ximian.com>
20945 * statement.cs (Switch): Catch double defaults.
20947 (Switch): More work on the switch() statement
20948 implementation. It works for integral values now, need to finish
20952 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20954 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20955 integer literals into other integer literals. To be used by
20958 2001-11-24 Ravi Pratap <ravi@ximian.com>
20960 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20963 (EmitDynamicInitializers): Cope with the above since we extract data
20964 directly from ArrayData now.
20966 (ExpectInitializers): Keep track of whether initializers are mandatory
20969 (Bounds): Make it a hashtable to prevent the same dimension being
20970 recorded for every element in that dimension.
20972 (EmitDynamicInitializers): Fix bug which prevented the Set array method
20975 Also fix bug which was causing the indices to be emitted in the reverse
20978 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20980 * expression.cs (ArrayCreation): Implement the bits that Ravi left
20981 unfinished. They do not work, because the underlying code is
20984 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20986 * cs-parser.jay: Remove bogus fixme.
20988 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20989 on Switch statement.
20991 2001-11-23 Ravi Pratap <ravi@ximian.com>
20993 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20996 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20997 parameter. Apparently, any expression is allowed.
20999 (ValidateInitializers): Update accordingly.
21001 (CheckIndices): Fix some tricky bugs thanks to recursion.
21003 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
21004 I was being completely brain-dead.
21006 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21007 and re-write acordingly.
21009 (DelegateInvocation): Re-write accordingly.
21011 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
21013 (MakeByteBlob): Handle types more correctly.
21015 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
21016 initialization from expressions but it is incomplete because I am a complete
21019 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21021 * statement.cs (If.Emit): Fix a bug that generated incorrect code
21022 on If. Basically, we have to return `true' (ie, we do return to
21023 our caller) only if both branches of the if return.
21025 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
21026 short-circuit operators, handle them as short circuit operators.
21028 (Cast.DoResolve): Resolve type.
21029 (Cast.Cast): Take an expression as the target type.
21031 * cs-parser.jay (cast_expression): Remove old hack that only
21032 allowed a limited set of types to be handled. Now we take a
21033 unary_expression and we resolve to a type during semantic
21036 Use the grammar productions from Rhys to handle casts (this is
21037 not complete like Rhys syntax yet, we fail to handle that corner
21038 case that C# has regarding (-x), but we will get there.
21040 2001-11-22 Ravi Pratap <ravi@ximian.com>
21042 * class.cs (EmitFieldInitializer): Take care of the case when we have a
21043 field which is an array type.
21045 * cs-parser.jay (declare_local_variables): Support array initialization too.
21047 * typemanager.cs (MakeKey): Implement.
21049 (everywhere): Use the above appropriately.
21051 * cs-parser.jay (for_statement): Update for array initialization while
21052 declaring variables.
21054 * ecore.cs : The error message was correct, it's the variable's names that
21055 were misleading ;-) Make the code more readable.
21057 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
21058 the correct type etc.
21060 (ConvertExplicit): Handle Enum types by examining the underlying type.
21062 2001-11-21 Ravi Pratap <ravi@ximian.com>
21064 * parameter.cs (GetCallingConvention): Always return
21065 CallingConventions.Standard for now.
21067 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21069 * expression.cs (Binary.ResolveOperator): Update the values of `l'
21070 and `r' after calling DoNumericPromotions.
21072 * ecore.cs: Fix error message (the types were in the wrong order).
21074 * statement.cs (Foreach.ProbeCollectionType): Need to pass
21075 BindingFlags.Instance as well
21077 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
21078 implicit int literal conversion in an empty cast so that we
21079 propagate the right type upstream.
21081 (UnboxCast): new class used to unbox value types.
21082 (Expression.ConvertExplicit): Add explicit type conversions done
21085 (Expression.ImplicitNumericConversion): Oops, forgot to test for
21086 the target type before applying the implicit LongLiterals to ULong
21089 2001-11-21 Miguel de Icaza <miguel@ximian.com>
21091 * cs-parser.jay (for_statement): Reworked the way For works: now
21092 we declare manually any variables that are introduced in
21093 for_initializer to solve the problem of having out-of-band code
21094 emition (that is what got for broken).
21096 (declaration_statement): Perform the actual variable declaration
21097 that used to be done in local_variable_declaration here.
21099 (local_variable_declaration): Do not declare anything, just pass
21100 the information on a DictionaryEntry
21102 2001-11-20 Ravi Pratap <ravi@ximian.com>
21104 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
21105 re-write of the logic to now make it recursive.
21107 (UpdateIndices): Re-write accordingly.
21109 Store element data in a separate ArrayData list in the above methods.
21111 (MakeByteBlob): Implement to dump the array data into a byte array.
21113 2001-11-19 Ravi Pratap <ravi@ximian.com>
21115 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
21118 * constant.cs (Define): Implement.
21120 (EmitConstant): Re-write fully.
21122 Pass in location info.
21124 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
21127 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
21128 DictionaryEntry since we need location info too.
21130 (constant_declaration): Update accordingly.
21132 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
21133 code into another method : UpdateIndices.
21135 2001-11-18 Ravi Pratap <ravi@ximian.com>
21137 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
21138 some type checking etc.
21140 2001-11-17 Ravi Pratap <ravi@ximian.com>
21142 * expression.cs (ArrayCreation::ValidateInitializers): Implement
21143 bits to provide dimension info if the user skips doing that.
21145 Update second constructor to store the rank correctly.
21147 2001-11-16 Ravi Pratap <ravi@ximian.com>
21149 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
21150 and try to implement.
21152 * ../errors/cs0150.cs : Add.
21154 * ../errors/cs0178.cs : Add.
21156 2001-11-16 Miguel de Icaza <miguel@ximian.com>
21158 * statement.cs: Implement foreach on multi-dimensional arrays.
21160 * parameter.cs (Parameters.GetParameterByName): Also lookup the
21161 name of the params argument.
21163 * expression.cs: Use EmitStoreOpcode to get the right opcode while
21164 initializing the array.
21166 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
21167 we can use this elsewhere.
21169 * statement.cs: Finish implementation of foreach for single
21172 * cs-parser.jay: Use an out-of-band stack to pass information
21173 around, I wonder why I need this.
21175 foreach_block: Make the new foreach_block the current_block.
21177 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
21178 function used to return a static Parameters structure. Used for
21179 empty parameters, as those are created very frequently.
21181 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
21183 2001-11-15 Ravi Pratap <ravi@ximian.com>
21185 * interface.cs : Default modifier is private, not public. The
21186 make verify test passes again.
21188 2001-11-15 Ravi Pratap <ravi@ximian.com>
21190 * support.cs (ReflectionParameters): Fix logic to determine
21191 whether the last parameter is a params one. Test 9 passes again.
21193 * delegate.cs (Populate): Register the builders we define with
21194 RegisterParameterForBuilder. Test 19 passes again.
21196 * cs-parser.jay (property_declaration): Reference $6 instead
21197 of $$ to get at the location.
21199 (indexer_declaration): Similar stuff.
21201 (attribute): Ditto.
21203 * class.cs (Property): Register parameters for the Get and Set methods
21204 if they exist. Test 23 passes again.
21206 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
21207 call to EmitArguments as we are sure there aren't any params arguments.
21208 Test 32 passes again.
21210 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
21211 IndexOutOfRangeException.
21213 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
21214 Test 33 now passes again.
21216 2001-11-15 Miguel de Icaza <miguel@ximian.com>
21218 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
21219 broke a bunch of things. Will have to come up with a better way
21220 of tracking locations.
21222 * statement.cs: Implemented foreach for single dimension arrays.
21224 2001-11-09 Miguel de Icaza <miguel@ximian.com>
21226 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
21227 an error. This removes the lookup from the critical path.
21229 * cs-parser.jay: Removed use of temporary_loc, which is completely
21232 2001-11-14 Miguel de Icaza <miguel@ximian.com>
21234 * support.cs (ReflectionParameters.ParameterModifier): Report
21235 whether the argument is a PARAMS argument or not.
21237 * class.cs: Set the attribute `ParamArrayAttribute' on the
21238 parameter argument.
21240 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
21241 and cons_param_array_attribute (ConstructorInfo for
21242 ParamArrayAttribute).,
21244 * codegen.cs: Emit the return using the `Return' statement, that
21245 way we can report the error correctly for missing return values.
21247 * class.cs (Method.Emit): Clean up.
21249 * expression.cs (Argument.Resolve): Take another argument: the
21250 location where this argument is used. Notice that this is not
21251 part of the "Argument" class as to reduce the size of the
21252 structure (we know the approximate location anyways).
21254 Test if the argument is a variable-reference, if not, then
21255 complain with a 206.
21257 (Argument.Emit): Emit addresses of variables.
21259 (Argument.FullDesc): Simplify.
21261 (Invocation.DoResolve): Update for Argument.Resolve.
21263 (ElementAccess.DoResolve): ditto.
21265 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21266 method should be virtual, as this method is always virtual.
21268 (NewDelegate.DoResolve): Update for Argument.Resolve.
21270 * class.cs (ConstructorInitializer.DoResolve): ditto.
21272 * attribute.cs (Attribute.Resolve): ditto.
21274 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21276 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21278 * expression.cs (ParameterReference): Drop IStackStorage and implement
21279 IAssignMethod instead.
21281 (LocalVariableReference): ditto.
21283 * ecore.cs (FieldExpr): Drop IStackStorage and implement
21284 IAssignMethod instead.
21286 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21288 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21289 enumerations that are used in heavily used structures derive from
21290 byte in a laughable and pathetic attempt to reduce memory usage.
21291 This is the kind of pre-optimzations that you should not do at
21292 home without adult supervision.
21294 * expression.cs (UnaryMutator): New class, used to handle ++ and
21295 -- separatedly from the other unary operators. Cleans up the
21296 code, and kills the ExpressionStatement dependency in Unary.
21298 (Unary): Removed `method' and `Arguments' from this class, making
21299 it smaller, and moving it all to SimpleCall, so I can reuse this
21300 code in other locations and avoid creating a lot of transient data
21301 strucutres when not required.
21303 * cs-parser.jay: Adjust for new changes.
21305 2001-11-11 Miguel de Icaza <miguel@ximian.com>
21307 * enum.cs (Enum.Populate): If there is a failure during
21310 * cs-parser.jay (opt_enum_base): we used to catch type errors
21311 here, but this is really incorrect. The type error should be
21312 catched during semantic analysis.
21314 2001-12-11 Ravi Pratap <ravi@ximian.com>
21316 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21317 current_local_parameters as expected since I, in my stupidity, had forgotten
21320 * attribute.cs (GetValidPlaces): Fix stupid bug.
21322 * class.cs (Method::Emit): Perform check on applicability of attributes.
21324 (Constructor::Emit): Ditto.
21326 (Field::Emit): Ditto.
21328 (Field.Location): Store location information.
21330 (Property, Event, Indexer, Operator): Ditto.
21332 * cs-parser.jay (field_declaration): Pass in location for each field.
21334 * ../errors/cs0592.cs : Add.
21336 2001-11-12 Ravi Pratap <ravi@ximian.com>
21338 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21340 (InitCoreTypes): Update accordingly.
21342 (RegisterAttrType, LookupAttr): Implement.
21344 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21345 info about the same.
21347 (Resolve): Update to populate the above as necessary.
21349 (Error592): Helper.
21351 (GetValidPlaces): Helper to the above.
21353 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21355 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21357 2001-11-12 Ravi Pratap <ravi@ximian.com>
21359 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21361 * ../errors/cs0617.cs : Add.
21363 2001-11-11 Ravi Pratap <ravi@ximian.com>
21365 * enum.cs (Emit): Rename to Populate to be more consistent with what
21366 we expect it to do and when exactly it is called.
21368 * class.cs, rootcontext.cs : Update accordingly.
21370 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21371 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21373 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21375 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21376 of a fieldinfo using the above, when dealing with a FieldBuilder.
21378 2001-11-10 Ravi Pratap <ravi@ximian.com>
21380 * ../errors/cs0031.cs : Add.
21382 * ../errors/cs1008.cs : Add.
21384 * ../errrors/cs0543.cs : Add.
21386 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21389 (FindMembers): Implement.
21391 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21392 enums and delegates too.
21394 (enum_types): Rename to builder_to_enum.
21396 (delegate_types): Rename to builder_to_delegate.
21398 * delegate.cs (FindMembers): Implement.
21400 2001-11-09 Ravi Pratap <ravi@ximian.com>
21402 * typemanager.cs (IsEnumType): Implement.
21404 * enum.cs (Emit): Re-write parts to account for the underlying type
21405 better and perform checking etc.
21407 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21408 of the underlying type.
21410 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21413 * enum.cs (error31): Helper to report error #31.
21415 * cs-parser.jay (enum_declaration): Store location of each member too.
21417 * enum.cs (member_to_location): New hashtable.
21419 (AddEnumMember): Update location hashtable.
21421 (Emit): Use the location of each member while reporting errors.
21423 2001-11-09 Miguel de Icaza <miguel@ximian.com>
21425 * cs-parser.jay: A for_initializer if is a
21426 local_variable_declaration really ammount to have an implicit
21427 block with the variable declaration and no initializer for for.
21429 * statement.cs (For.Emit): Cope with null initializers.
21431 This fixes the infinite loop on for initializers.
21433 2001-11-08 Miguel de Icaza <miguel@ximian.com>
21435 * enum.cs: More cleanup.
21437 * ecore.cs: Remove dead code.
21439 * class.cs (Property.Emit): More simplification.
21440 (Event.Emit): ditto.
21442 Reworked to have less levels of indentation.
21444 2001-11-08 Ravi Pratap <ravi@ximian.com>
21446 * class.cs (Property): Emit attributes.
21456 * enum.cs (Emit): Ditto.
21458 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21461 * class.cs (Field, Event, etc.): Move attribute generation into the
21462 Emit method everywhere.
21464 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21465 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21466 as we had no way of defining nested enums !
21468 * rootcontext.cs : Adjust code accordingly.
21470 * typemanager.cs (AddEnumType): To keep track of enum types separately.
21472 2001-11-07 Ravi Pratap <ravi@ximian.com>
21474 * expression.cs (EvalConstantExpression): Move into ecore.cs
21476 * enum.cs (Enum): Rename some members and make them public and readonly
21477 according to our convention.
21479 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21482 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21484 (Enum::Emit): Write a simple version for now which doesn't try to compute
21485 expressions. I shall modify this to be more robust in just a while.
21487 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21489 (TypeContainer::CloseType): Create the Enum types too.
21491 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21493 * expression.cs (EvalConstantExpression): Get rid of completely.
21495 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21496 user-defined values and other cases.
21498 (IsValidEnumLiteral): Helper function.
21500 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
21501 out there in the case we had a literal FieldExpr.
21503 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21505 (Literalize): Revamp a bit to take two arguments.
21507 (EnumLiteral): New class which derives from Literal to wrap enum literals.
21509 2001-11-06 Ravi Pratap <ravi@ximian.com>
21511 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21513 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21515 (Resolve): Use the above to ensure we have proper initializers.
21517 2001-11-05 Ravi Pratap <ravi@ximian.com>
21519 * expression.cs (Expression::EvalConstantExpression): New method to
21520 evaluate constant expressions.
21522 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21524 2001-11-07 Miguel de Icaza <miguel@ximian.com>
21526 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21529 (Binary.ResolveOperator): Handle operator != (object a, object b)
21530 and operator == (object a, object b);
21532 (Binary.DoNumericPromotions): Indicate whether the numeric
21533 promotion was possible.
21535 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21538 Made the ArrayAccess implement interface IAssignMethod instead of
21539 IStackStore as the order in which arguments are passed reflects
21542 * assign.cs: Instead of using expr.ExprClass to select the way of
21543 assinging, probe for the IStackStore/IAssignMethod interfaces.
21545 * typemanager.cs: Load InitializeArray definition.
21547 * rootcontext.cs (RootContext.MakeStaticData): Used to define
21548 static data that can be used to initialize arrays.
21550 2001-11-05 Miguel de Icaza <miguel@ximian.com>
21552 * expression.cs: Handle operator== and operator!= for booleans.
21554 (Conditioal.Reduce): Implement reducer for the ?: operator.
21556 (Conditional.Resolve): Implement dead code elimination.
21558 (Binary.Resolve): Catch string literals and return a new
21559 concatenated string.
21561 (Unary.Reduce): Implement reduction of unary expressions.
21563 * ecore.cs: Split out the expression core handling here.
21565 (Expression.Reduce): New method used to perform constant folding
21566 and CSE. This is needed to support constant-expressions.
21568 * statement.cs (Statement.EmitBoolExpression): Pass true and false
21569 targets, and optimize for !x.
21571 2001-11-04 Ravi Pratap <ravi@ximian.com>
21573 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21574 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21575 set custom atttributes.
21577 * literal.cs (Literal::GetValue): New abstract method to return the actual
21578 value of the literal, cast as an object.
21580 (*Literal): Implement GetValue method.
21582 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21583 expressions to the arraylist but objects of type Argument.
21585 * class.cs (TypeContainer::Emit): Emit our attributes too.
21587 (Method::Emit, Constructor::Emit): Ditto.
21589 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21590 to be ignoring earlier.
21592 2001-11-03 Ravi Pratap <ravi@ximian.com>
21594 * attribute.cs (AttributeSection::Define): Implement to do the business
21595 of constructing a CustomAttributeBuilder.
21597 (Attribute): New trivial class. Increases readability of code.
21599 * cs-parser.jay : Update accordingly.
21601 (positional_argument_list, named_argument_list, named_argument): New rules
21603 (attribute_arguments): Use the above so that we are more correct.
21605 2001-11-02 Ravi Pratap <ravi@ximian.com>
21607 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
21608 to perform all checks for a method with a params parameter.
21610 (Invocation::OverloadResolve): Update to use the above method and therefore
21611 cope correctly with params method invocations.
21613 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
21616 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
21617 constructors in our parent too because we can't afford to miss out on
21620 * attribute.cs (AttributeSection): New name for the class Attribute
21622 Other trivial changes to improve readability.
21624 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
21625 use the new class names.
21627 2001-11-01 Ravi Pratap <ravi@ximian.com>
21629 * class.cs (Method::Define): Complete definition for params types too
21631 (Indexer::Define): Ditto.
21633 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
21634 Cope everywhere with a request for info about the array parameter.
21636 2001-11-01 Ravi Pratap <ravi@ximian.com>
21638 * tree.cs (RecordNamespace): Fix up to check for the correct key.
21640 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
21641 local_variable_type to extract the string corresponding to the type.
21643 (local_variable_type): Fixup the action to use the new helper method.
21645 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
21648 * expression.cs : Clean out code which uses the above.
21650 2001-10-31 Ravi Pratap <ravi@ximian.com>
21652 * typemanager.cs (RegisterMethod): Check if we already have an existing key
21653 and bale out if necessary by returning a false.
21655 (RegisterProperty): Ditto.
21657 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21658 and print out appropriate error messages.
21660 * interface.cs (everywhere): Ditto.
21662 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21663 location to constructor.
21665 * class.cs (Property, Event, Indexer): Update accordingly.
21667 * ../errors/cs111.cs : Added.
21669 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21670 of a method, as laid down by the spec.
21672 (Invocation::OverloadResolve): Use the above method.
21674 2001-10-31 Ravi Pratap <ravi@ximian.com>
21676 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21677 now take a TypeContainer and a Parameters object.
21679 (ParameterData): Modify return type of ParameterModifier method to be
21680 Parameter.Modifier and not a string.
21682 (ReflectionParameters, InternalParameters): Update accordingly.
21684 * expression.cs (Argument::GetParameterModifier): Same here.
21686 * support.cs (InternalParameters::ParameterType): Find a better way of determining
21687 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21688 symbol in it at all so maybe this is only for now.
21690 2001-10-30 Ravi Pratap <ravi@ximian.com>
21692 * support.cs (InternalParameters): Constructor now takes an extra argument
21693 which is the actual Parameters class.
21695 (ParameterDesc): Update to provide info on ref/out modifiers.
21697 * class.cs (everywhere): Update call to InternalParameters to pass in
21698 the second argument too.
21700 * support.cs (ParameterData): Add ParameterModifier, which is a method
21701 to return the modifier info [ref/out etc]
21703 (InternalParameters, ReflectionParameters): Implement the above.
21705 * expression.cs (Argument::ParameterModifier): Similar function to return
21706 info about the argument's modifiers.
21708 (Invocation::OverloadResolve): Update to take into account matching modifiers
21711 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21712 a new SetFormalParameters object which we pass to InternalParameters.
21714 2001-10-30 Ravi Pratap <ravi@ximian.com>
21716 * expression.cs (NewArray): Merge into the ArrayCreation class.
21718 2001-10-29 Ravi Pratap <ravi@ximian.com>
21720 * expression.cs (NewArray): Merge classes NewBuiltinArray and
21721 NewUserdefinedArray into one as there wasn't much of a use in having
21724 * expression.cs (Argument): Change field's name to ArgType from Type.
21726 (Type): New readonly property which returns the proper type, taking into
21727 account ref/out modifiers.
21729 (everywhere): Adjust code accordingly for the above.
21731 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21732 whether we are emitting for a ref or out parameter.
21734 * expression.cs (Argument::Emit): Use the above field to set the state.
21736 (LocalVariableReference::Emit): Update to honour the flag and emit the
21739 * parameter.cs (Attributes): Set the correct flags for ref parameters.
21741 * expression.cs (Argument::FullDesc): New function to provide a full desc.
21743 * support.cs (ParameterData): Add method ParameterDesc to the interface.
21745 (ReflectionParameters, InternalParameters): Implement the above method.
21747 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21750 (Invocation::FullMethodDesc): Ditto.
21752 2001-10-29 Miguel de Icaza <miguel@ximian.com>
21754 * cs-parser.jay: Add extra production for the second form of array
21757 * expression.cs (ArrayCreation): Update to reflect the above
21760 * Small changes to prepare for Array initialization.
21762 2001-10-28 Miguel de Icaza <miguel@ximian.com>
21764 * typemanager.cs (ImplementsInterface): interface might be null;
21765 Deal with this problem;
21767 Also, we do store negative hits on the cache (null values), so use
21768 this instead of calling t.GetInterfaces on the type everytime.
21770 2001-10-28 Ravi Pratap <ravi@ximian.com>
21772 * typemanager.cs (IsBuiltinType): New method to help determine the same.
21774 * expression.cs (New::DoResolve): Get rid of array creation code and instead
21775 split functionality out into different classes.
21777 (New::FormArrayType): Move into NewBuiltinArray.
21779 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21782 (NewBuiltinArray): New class to handle creation of built-in arrays.
21784 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21785 account creation of one-dimensional arrays.
21787 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21789 (NewUserdefinedArray::DoResolve): Implement.
21791 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21793 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21794 we maintain inside the TypeManager. This is necessary to perform lookups on the
21797 (LookupType): Update to perform GetType on the module builders too.
21799 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21801 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21803 2001-10-23 Ravi Pratap <ravi@ximian.com>
21805 * expression.cs (New::DoResolve): Implement guts of array creation.
21807 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21809 2001-10-27 Miguel de Icaza <miguel@ximian.com>
21811 * expression.cs: Fix bug I introduced lsat night that broke
21814 (Expression.Resolve): Report a 246 error (can not resolve name)
21815 if we find a SimpleName in the stream.
21817 (Expression.ResolveLValue): Ditto.
21819 (Expression.ResolveWithSimpleName): This function is a variant of
21820 ResolveName, this one allows SimpleNames to be returned without a
21821 warning. The only consumer of SimpleNames is MemberAccess
21823 2001-10-26 Miguel de Icaza <miguel@ximian.com>
21825 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21826 might arrive here. I have my doubts that this is correct.
21828 * statement.cs (Lock): Implement lock statement.
21830 * cs-parser.jay: Small fixes to support `lock' and `using'
21832 * cs-tokenizer.cs: Remove extra space
21834 * driver.cs: New flag --checked, allows to turn on integer math
21837 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21838 Threading.Monitor.Exit
21840 2001-10-23 Miguel de Icaza <miguel@ximian.com>
21842 * expression.cs (IndexerAccess::DoResolveLValue): Set the
21843 Expression Class to be IndexerAccess.
21845 Notice that Indexer::DoResolve sets the eclass to Value.
21847 2001-10-22 Miguel de Icaza <miguel@ximian.com>
21849 * class.cs (TypeContainer::Emit): Emit code for indexers.
21851 * assign.cs (IAssignMethod): New interface implemented by Indexers
21852 and Properties for handling assignment.
21854 (Assign::Emit): Simplify and reuse code.
21856 * expression.cs (IndexerAccess, PropertyExpr): Implement
21857 IAssignMethod, clean up old code.
21859 2001-10-22 Ravi Pratap <ravi@ximian.com>
21861 * typemanager.cs (ImplementsInterface): New method to determine if a type
21862 implements a given interface. Provides a nice cache too.
21864 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21867 (ConvertReferenceExplicit): Ditto.
21869 * delegate.cs (Delegate::Populate): Update to define the parameters on the
21870 various methods, with correct names etc.
21872 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
21873 Operator.UnaryNegation.
21875 * cs-parser.jay (operator_declarator): Be a little clever in the case where
21876 we have a unary plus or minus operator.
21878 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
21881 * everywhere : update accordingly.
21883 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21886 * class.cs (Method::Define): For the case where we are implementing a method
21887 inherited from an interface, we need to set the MethodAttributes.Final flag too.
21888 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21890 2001-10-21 Ravi Pratap <ravi@ximian.com>
21892 * interface.cs (FindMembers): Implement to work around S.R.E
21895 * typemanager.cs (IsInterfaceType): Implement.
21897 (FindMembers): Update to handle interface types too.
21899 * expression.cs (ImplicitReferenceConversion): Re-write bits which
21900 use IsAssignableFrom as that is not correct - it doesn't work.
21902 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21903 and accordingly override EmitStatement.
21905 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21906 using the correct logic :-)
21908 2001-10-19 Ravi Pratap <ravi@ximian.com>
21910 * ../errors/cs-11.cs : Add to demonstrate error -11
21912 2001-10-17 Miguel de Icaza <miguel@ximian.com>
21914 * assign.cs (Assign::Resolve): Resolve right hand side first, and
21915 then pass this as a hint to ResolveLValue.
21917 * expression.cs (FieldExpr): Add Location information
21919 (FieldExpr::LValueResolve): Report assignment to readonly
21922 (Expression::ExprClassFromMemberInfo): Pass location information.
21924 (Expression::ResolveLValue): Add new method that resolves an
21927 (Expression::DoResolveLValue): Default invocation calls
21930 (Indexers): New class used to keep track of indexers in a given
21933 (IStackStore): Renamed from LValue, as it did not really describe
21934 what this did. Also ResolveLValue is gone from this interface and
21935 now is part of Expression.
21937 (ElementAccess): Depending on the element access type
21939 * typemanager.cs: Add `indexer_name_type' as a Core type
21940 (System.Runtime.CompilerServices.IndexerNameAttribute)
21942 * statement.cs (Goto): Take a location.
21944 2001-10-18 Ravi Pratap <ravi@ximian.com>
21946 * delegate.cs (Delegate::VerifyDelegate): New method to verify
21947 if two delegates are compatible.
21949 (NewDelegate::DoResolve): Update to take care of the case when
21950 we instantiate a delegate from another delegate.
21952 * typemanager.cs (FindMembers): Don't even try to look up members
21953 of Delegate types for now.
21955 2001-10-18 Ravi Pratap <ravi@ximian.com>
21957 * delegate.cs (NewDelegate): New class to take care of delegate
21960 * expression.cs (New): Split the delegate related code out into
21961 the NewDelegate class.
21963 * delegate.cs (DelegateInvocation): New class to handle delegate
21966 * expression.cs (Invocation): Split out delegate related code into
21967 the DelegateInvocation class.
21969 2001-10-17 Ravi Pratap <ravi@ximian.com>
21971 * expression.cs (New::DoResolve): Implement delegate creation fully
21972 and according to the spec.
21974 (New::DoEmit): Update to handle delegates differently.
21976 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21977 because of which we were printing out arguments in reverse order !
21979 * delegate.cs (VerifyMethod): Implement to check if the given method
21980 matches the delegate.
21982 (FullDelegateDesc): Implement.
21984 (VerifyApplicability): Implement.
21986 * expression.cs (Invocation::DoResolve): Update to accordingly handle
21987 delegate invocations too.
21989 (Invocation::Emit): Ditto.
21991 * ../errors/cs1593.cs : Added.
21993 * ../errors/cs1594.cs : Added.
21995 * delegate.cs (InstanceExpression, TargetMethod): New properties.
21997 2001-10-16 Ravi Pratap <ravi@ximian.com>
21999 * typemanager.cs (intptr_type): Core type for System.IntPtr
22001 (InitCoreTypes): Update for the same.
22003 (iasyncresult_type, asynccallback_type): Ditto.
22005 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22008 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
22011 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
22012 the builders for the 4 members of a delegate type :-)
22014 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
22017 * expression.cs (New::DoResolve): Implement guts for delegate creation.
22019 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
22021 2001-10-15 Miguel de Icaza <miguel@ximian.com>
22023 * statement.cs (Break::Emit): Implement.
22024 (Continue::Emit): Implement.
22026 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
22027 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
22028 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
22029 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
22032 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
22033 properties that track the label for the current loop (begin of the
22034 loop and end of the loop).
22036 2001-10-15 Ravi Pratap <ravi@ximian.com>
22038 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
22039 use of emitting anything at all.
22041 * class.cs, rootcontext.cs : Get rid of calls to the same.
22043 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
22045 (Populate): Define the constructor correctly and set the implementation
22048 * typemanager.cs (delegate_types): New hashtable to hold delegates that
22051 (AddDelegateType): Implement.
22053 (IsDelegateType): Implement helper method.
22055 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
22057 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
22058 and accordingly handle it.
22060 * delegate.cs (Populate): Take TypeContainer argument.
22061 Implement bits to define the Invoke method. However, I still haven't figured out
22062 how to take care of the native int bit :-(
22064 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
22065 Qualify the name of the delegate, not its return type !
22067 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
22070 (StandardConversionExists): Checking for array types turns out to be recursive.
22072 (ConvertReferenceExplicit): Implement array conversion.
22074 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
22076 2001-10-12 Ravi Pratap <ravi@ximian.com>
22078 * cs-parser.jay (delegate_declaration): Store the fully qualified
22079 name as it is a type declaration.
22081 * delegate.cs (ReturnType, Name): Rename members to these. Make them
22084 (DefineDelegate): Renamed from Define. Does the same thing essentially,
22085 as TypeContainer::DefineType.
22087 (Populate): Method in which all the definition of the various methods (Invoke)
22090 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
22093 (CloseDelegate): Finally creates the delegate.
22095 * class.cs (TypeContainer::DefineType): Update to define delegates.
22096 (Populate, Emit and CloseType): Do the same thing here too.
22098 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
22099 delegates in all these operations.
22101 2001-10-14 Miguel de Icaza <miguel@ximian.com>
22103 * expression.cs: LocalTemporary: a new expression used to
22104 reference a temporary that has been created.
22106 * assign.cs: Handle PropertyAccess back here, so that we can
22107 provide the proper semantic access to properties.
22109 * expression.cs (Expression::ConvertReferenceExplicit): Implement
22110 a few more explicit conversions.
22112 * modifiers.cs: `NEW' modifier maps to HideBySig.
22114 * expression.cs (PropertyExpr): Make this into an
22115 ExpressionStatement, and support the EmitStatement code path.
22117 Perform get/set error checking, clean up the interface.
22119 * assign.cs: recognize PropertyExprs as targets, and if so, turn
22120 them into toplevel access objects.
22122 2001-10-12 Miguel de Icaza <miguel@ximian.com>
22124 * expression.cs: PropertyExpr::PropertyExpr: use work around the
22127 * typemanager.cs: Keep track here of our PropertyBuilders again to
22128 work around lameness in SRE.
22130 2001-10-11 Miguel de Icaza <miguel@ximian.com>
22132 * expression.cs (LValue::LValueResolve): New method in the
22133 interface, used to perform a second resolution pass for LValues.
22135 (This::DoResolve): Catch the use of this in static methods.
22137 (This::LValueResolve): Implement.
22139 (This::Store): Remove warning, assigning to `this' in structures
22142 (Invocation::Emit): Deal with invocation of
22143 methods on value types. We need to pass the address to structure
22144 methods rather than the object itself. (The equivalent code to
22145 emit "this" for structures leaves the entire structure on the
22146 stack instead of a pointer to it).
22148 (ParameterReference::DoResolve): Compute the real index for the
22149 argument based on whether the method takes or not a `this' pointer
22150 (ie, the method is static).
22152 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
22153 value types returned from functions when we need to invoke a
22154 method on the sturcture.
22157 2001-10-11 Ravi Pratap <ravi@ximian.com>
22159 * class.cs (TypeContainer::DefineType): Method to actually do the business of
22160 defining the type in the Modulebuilder or Typebuilder. This is to take
22161 care of nested types which need to be defined on the TypeBuilder using
22162 DefineNestedMethod.
22164 (TypeContainer::GetClassBases): Implement. Essentially the code from the
22165 methods in RootContext, only ported to be part of TypeContainer.
22167 (TypeContainer::GetInterfaceOrClass): Ditto.
22169 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
22171 * interface.cs (Interface::DefineInterface): New method. Does exactly
22172 what RootContext.CreateInterface did earlier, only it takes care of nested types
22175 (Interface::GetInterfaces): Move from RootContext here and port.
22177 (Interface::GetInterfaceByName): Same here.
22179 * rootcontext.cs (ResolveTree): Re-write.
22181 (PopulateTypes): Re-write.
22183 * class.cs (TypeContainer::Populate): Populate nested types too.
22184 (TypeContainer::Emit): Emit nested members too.
22186 * typemanager.cs (AddUserType): Do not make use of the FullName property,
22187 instead just use the name argument passed in as it is already fully
22190 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
22191 to TypeContainer mapping to see if a type is user-defined.
22193 * class.cs (TypeContainer::CloseType): Implement.
22195 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
22196 the default constructor.
22198 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
22201 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
22203 * interface.cs (CloseType): Create the type here.
22205 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
22208 Remove all the methods which are now in TypeContainer.
22210 2001-10-10 Ravi Pratap <ravi@ximian.com>
22212 * delegate.cs (Define): Re-write bits to define the delegate
22215 2001-10-10 Miguel de Icaza <miguel@ximian.com>
22217 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
22219 * expression.cs (ImplicitReferenceConversion): handle null as well
22220 as a source to convert to any reference type.
22222 * statement.cs (Return): Perform any implicit conversions to
22223 expected return type.
22225 Validate use of return statement.
22227 * codegen.cs (EmitContext): Pass the expected return type here.
22229 * class.cs (Method, Constructor, Property): Pass expected return
22230 type to EmitContext.
22232 2001-10-09 Miguel de Icaza <miguel@ximian.com>
22234 * expression.cs: Make DoResolve take an EmitContext instead of a
22237 Replaced `l' and `location' for `loc', for consistency.
22239 (Error, Warning): Remove unneeded Tc argument.
22241 * assign.cs, literal.cs, constant.cs: Update to new calling
22244 * codegen.cs: EmitContext now contains a flag indicating whether
22245 code is being generated in a static method or not.
22247 * cs-parser.jay: DecomposeQI, new function that replaces the old
22248 QualifiedIdentifier. Now we always decompose the assembled
22249 strings from qualified_identifier productions into a group of
22252 2001-10-08 Miguel de Icaza <miguel@ximian.com>
22254 * rootcontext.cs: Deal with field-less struct types correctly now
22255 by passing the size option to Define Type.
22257 * class.cs: Removed hack that created one static field.
22259 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22261 * statement.cs: Moved most of the code generation here.
22263 2001-10-09 Ravi Pratap <ravi@ximian.com>
22265 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22268 (ElementAccess): Remove useless bits for now - keep checks as the spec
22271 2001-10-08 Ravi Pratap <ravi@ximian.com>
22273 * expression.cs (ElementAccess::DoResolve): Remove my crap code
22274 and start performing checks according to the spec.
22276 2001-10-07 Ravi Pratap <ravi@ximian.com>
22278 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22279 rank_specifiers instead.
22281 (rank_specifiers): Change the order in which the rank specifiers are stored
22283 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22285 * expression.cs (ElementAccess): Implement the LValue interface too.
22287 2001-10-06 Ravi Pratap <ravi@ximian.com>
22289 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22290 except that user defined conversions are not included.
22292 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
22293 perform the conversion of the return type, if necessary.
22295 (New::DoResolve): Check whether we are creating an array or an object
22296 and accordingly do the needful.
22298 (New::Emit): Same here.
22300 (New::DoResolve): Implement guts of array creation.
22302 (New::FormLookupType): Helper function.
22304 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22306 * codegen.cs: Removed most of the code generation here, and move the
22307 corresponding code generation bits to the statement classes.
22309 Added support for try/catch/finalize and throw.
22311 * cs-parser.jay: Added support for try/catch/finalize.
22313 * class.cs: Catch static methods having the flags override,
22314 virtual or abstract.
22316 * expression.cs (UserCast): This user cast was not really doing
22317 what it was supposed to do. Which is to be born in fully resolved
22318 state. Parts of the resolution were being performed at Emit time!
22322 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22324 * expression.cs: Implicity convert the result from UserCast.
22326 2001-10-05 Ravi Pratap <ravi@ximian.com>
22328 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22329 prevented it from working correctly.
22331 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22332 merely ConvertImplicit.
22334 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22336 * typemanager.cs: Make the LookupTypeContainer function static,
22337 and not per-instance.
22339 * class.cs: Make static FindMembers (the one that takes a Type
22342 * codegen.cs: Add EmitForeach here.
22344 * cs-parser.jay: Make foreach a toplevel object instead of the
22345 inline expansion, as we need to perform semantic analysis on it.
22347 2001-10-05 Ravi Pratap <ravi@ximian.com>
22349 * expression.cs (Expression::ImplicitUserConversion): Rename to
22350 UserDefinedConversion.
22352 (Expression::UserDefinedConversion): Take an extra argument specifying
22353 whether we look for explicit user conversions too.
22355 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22357 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22359 (ExplicitUserConversion): Make it a call to UserDefinedConversion
22360 with the appropriate arguments.
22362 * cs-parser.jay (cast_expression): Record location too.
22364 * expression.cs (Cast): Record location info.
22366 (Expression::ConvertExplicit): Take location argument.
22368 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22369 to determine if we are doing explicit conversions.
22371 (UserCast::Emit): Update accordingly.
22373 (Expression::ConvertExplicit): Report an error if everything fails.
22375 * ../errors/cs0030.cs : Add.
22377 2001-10-04 Miguel de Icaza <miguel@ximian.com>
22379 * modifiers.cs: If the ABSTRACT keyword is present, also set the
22380 virtual and newslot bits.
22382 * class.cs (TypeContainer::RegisterRequiredImplementations):
22383 Record methods we need.
22385 (TypeContainer::MakeKey): Helper function to make keys for
22386 MethodBases, since the Methodbase key is useless.
22388 (TypeContainer::Populate): Call RegisterRequiredImplementations
22389 before defining the methods.
22391 Create a mapping for method_builders_to_methods ahead of time
22392 instead of inside a tight loop.
22394 (::RequireMethods): Accept an object as the data to set into the
22395 hashtable so we can report interface vs abstract method mismatch.
22397 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22399 * report.cs: Make all of it static.
22401 * rootcontext.cs: Drop object_type and value_type computations, as
22402 we have those in the TypeManager anyways.
22404 Drop report instance variable too, now it is a global.
22406 * driver.cs: Use try/catch on command line handling.
22408 Add --probe option to debug the error reporting system with a test
22411 * report.cs: Add support for exiting program when a probe
22412 condition is reached.
22414 2001-10-03 Ravi Pratap <ravi@ximian.com>
22416 * expression.cs (Binary::DoNumericPromotions): Fix the case when
22417 we do a forcible conversion regardless of type, to check if
22418 ForceConversion returns a null.
22420 (Binary::error19): Use location to report error.
22422 (Unary::error23): Use location here too.
22424 * ../errors/cs0019.cs : Check in.
22426 * ../errors/cs0023.cs : Check in.
22428 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22429 case of a non-null MethodInfo object with a length of 0 !
22431 (Binary::ResolveOperator): Flag error if overload resolution fails to find
22432 an applicable member - according to the spec :-)
22433 Also fix logic to find members in base types.
22435 (Unary::ResolveOperator): Same here.
22437 (Unary::report23): Change name to error23 and make first argument a TypeContainer
22438 as I was getting thoroughly confused between this and error19 :-)
22440 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22441 (::FindMostEncompassedType): Implement.
22442 (::FindMostEncompassingType): Implement.
22443 (::StandardConversionExists): Implement.
22445 (UserImplicitCast): Re-vamp. We now need info about most specific
22446 source and target types so that we can do the necessary conversions.
22448 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22449 mathematical union with no duplicates.
22451 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22453 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22454 in order from base classes to child classes, so that we can in
22455 child classes look up in our parent for method names and
22456 attributes (required for handling abstract, virtual, new, override
22457 constructs: we need to instrospect our base class, and if we dont
22458 populate the classes in order, the introspection might be
22459 incorrect. For example, a method could query its parent before
22460 the parent has any methods and would determine that the parent has
22461 no abstract methods (while it could have had them)).
22463 (RootContext::CreateType): Record the order in which we define the
22466 2001-10-02 Miguel de Icaza <miguel@ximian.com>
22468 * class.cs (TypeContainer::Populate): Also method definitions can
22469 fail now, keep track of this.
22471 (TypeContainer::FindMembers): Implement support for
22472 DeclaredOnly/noDeclaredOnly flag.
22474 (Constructor::Emit) Return the ConstructorBuilder.
22476 (Method::Emit) Return the MethodBuilder.
22477 Check for abstract or virtual methods to be public.
22479 * rootcontext.cs (RootContext::CreateType): Register all the
22480 abstract methods required for the class to be complete and the
22481 interface methods that must be implemented.
22483 * cs-parser.jay: Report error 501 (method requires body if it is
22484 not marked abstract or extern).
22486 * expression.cs (TypeOf::Emit): Implement.
22488 * typemanager.cs: runtime_handle_type, new global type.
22490 * class.cs (Property::Emit): Generate code for properties.
22492 2001-10-02 Ravi Pratap <ravi@ximian.com>
22494 * expression.cs (Unary::ResolveOperator): Find operators on base type
22495 too - we now conform exactly to the spec.
22497 (Binary::ResolveOperator): Same here.
22499 * class.cs (Operator::Define): Fix minor quirk in the tests.
22501 * ../errors/cs0215.cs : Added.
22503 * ../errors/cs0556.cs : Added.
22505 * ../errors/cs0555.cs : Added.
22507 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22509 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22510 single integer which is really efficient
22512 2001-10-01 Ravi Pratap <ravi@ximian.com>
22514 * expression.cs (Expression::ImplicitUserConversion): Use location
22515 even in the case when we are examining True operators.
22517 * class.cs (Operator::Define): Perform extensive checks to conform
22518 with the rules for operator overloading in the spec.
22520 * expression.cs (Expression::ImplicitReferenceConversion): Implement
22521 some of the other conversions mentioned in the spec.
22523 * typemanager.cs (array_type): New static member for the System.Array built-in
22526 (cloneable_interface): For System.ICloneable interface.
22528 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22529 we start resolving the tree and populating types.
22531 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22533 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22535 * expression.cs (Expression::ExprClassFromMemberInfo,
22536 Expression::Literalize): Create literal expressions from
22537 FieldInfos which are literals.
22539 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22540 type casts, because they were wrong. The test suite in tests
22543 (ImplicitNumericConversion): ushort to ulong requires a widening
22546 Int32 constant to long requires widening cast as well.
22548 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22549 for integers because the type on the stack is not i4.
22551 2001-09-30 Miguel de Icaza <miguel@ximian.com>
22553 * expression.cs (report118): require location argument.
22555 * parameter.cs: Do not dereference potential null value.
22557 * class.cs: Catch methods that lack the `new' keyword when
22558 overriding a name. Report warnings when `new' is used without
22559 anything being there to override.
22561 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22563 * class.cs: Only add constructor to hashtable if it is non-null
22564 (as now constructors can fail on define).
22566 (TypeManager, Class, Struct): Take location arguments.
22568 Catch field instance initialization in structs as errors.
22570 accepting_filter: a new filter for FindMembers that is static so
22571 that we dont create an instance per invocation.
22573 (Constructor::Define): Catch errors where a struct constructor is
22576 * cs-parser.jay: Pass location information for various new
22579 * delegate.cs (Delegate): take a location argument.
22581 * driver.cs: Do not call EmitCode if there were problesm in the
22582 Definition of the types, as many Builders wont be there.
22584 * decl.cs (Decl::Decl): Require a location argument.
22586 * cs-tokenizer.cs: Handle properly hex constants that can not fit
22587 into integers, and find the most appropiate integer for it.
22589 * literal.cs: Implement ULongLiteral.
22591 * rootcontext.cs: Provide better information about the location of
22592 failure when CreateType fails.
22594 2001-09-29 Miguel de Icaza <miguel@ximian.com>
22596 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22599 * expression.cs (Binary::CheckShiftArguments): Add missing type
22601 (Binary::ResolveOperator): Add type to the logical and and logical
22602 or, Bitwise And/Or and Exclusive Or code paths, it was missing
22605 (Binary::DoNumericPromotions): In the case where either argument
22606 is ulong (and most signed types combined with ulong cause an
22607 error) perform implicit integer constant conversions as well.
22609 2001-09-28 Miguel de Icaza <miguel@ximian.com>
22611 * expression.cs (UserImplicitCast): Method should always be
22613 (Invocation::BetterConversion): Simplified test for IntLiteral.
22615 (Expression::ImplicitNumericConversion): Split this routine out.
22616 Put the code that performs implicit constant integer conversions
22619 (Expression::Resolve): Become a wrapper around DoResolve so we can
22620 check eclass and type being set after resolve.
22622 (Invocation::Badness): Remove this dead function
22624 (Binary::ResolveOperator): Do not compute the expensive argumnets
22625 unless we have a union for it.
22627 (Probe::Emit): Is needs to do an isinst and then
22628 compare against null.
22630 (::CanConvert): Added Location argument. If the Location argument
22631 is null (Location.Null), then we do not report errors. This is
22632 used by the `probe' mechanism of the Explicit conversion. We do
22633 not want to generate an error for something that the user
22634 explicitly requested to be casted. But the pipeline for an
22635 explicit cast first tests for potential implicit casts.
22637 So for now, if the Location is null, it means `Probe only' to
22638 avoid adding another argument. Might have to revise this
22641 (ClassCast): New class used to type cast objects into arbitrary
22642 classes (used in Explicit Reference Conversions).
22644 Implement `as' as well.
22646 Reverted all the patches from Ravi below: they were broken:
22648 * The use of `level' as a mechanism to stop recursive
22649 invocations is wrong. That was there just to catch the
22650 bug with a strack trace but not as a way of addressing
22653 To fix the problem we have to *understand* what is going
22654 on and the interactions and come up with a plan, not
22655 just get things going.
22657 * The use of the type conversion cache that I proposed
22658 last night had an open topic: How does this work across
22659 protection domains. A user defined conversion might not
22660 be public in the location where we are applying the
22661 conversion, a different conversion might be selected
22662 (ie, private A->B (better) but public B->A (worse),
22663 inside A, A->B applies, but outside it, B->A will
22666 * On top of that (ie, even if the above is solved),
22667 conversions in a cache need to be abstract. Ie, `To
22668 convert from an Int to a Short use an OpcodeCast', not
22669 `To convert from an Int to a Short use the OpcodeCast on
22670 the variable 5' (which is what this patch was doing).
22672 2001-09-28 Ravi Pratap <ravi@ximian.com>
22674 * expression.cs (Invocation::ConversionExists): Re-write to use
22675 the conversion cache
22677 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22678 cache all conversions done, not just user-defined ones.
22680 (Invocation::BetterConversion): The real culprit. Use ConversionExists
22681 to determine if a conversion exists instead of acutually trying to
22682 perform the conversion. It's faster too.
22684 (Expression::ConvertExplicit): Modify to use ConversionExists to check
22685 and only then attempt the implicit conversion.
22687 2001-09-28 Ravi Pratap <ravi@ximian.com>
22689 * expression.cs (ConvertImplicit): Use a cache for conversions
22690 already found. Check level of recursion and bail out if necessary.
22692 2001-09-28 Miguel de Icaza <miguel@ximian.com>
22694 * typemanager.cs (string_concat_string_string, string_concat_object_object):
22695 Export standard methods that we expect for string operations.
22697 * statement.cs (Block::UsageWarning): Track usage of variables and
22698 report the errors for not used variables.
22700 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22703 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22705 * codegen.cs: remove unnneded code
22707 * expression.cs: Removed BuiltinTypeAccess class
22709 Fix the order in which implicit conversions are
22712 The previous fixed dropped support for boxed conversions (adding a
22713 test to the test suite now)
22715 (UserImplicitCast::CanConvert): Remove test for source being null,
22716 that code is broken. We should not feed a null to begin with, if
22717 we do, then we should track the bug where the problem originates
22718 and not try to cover it up here.
22720 Return a resolved expression of type UserImplicitCast on success
22721 rather than true/false. Ravi: this is what I was talking about,
22722 the pattern is to use a static method as a "constructor" for
22725 Also, do not create arguments until the very last minute,
22726 otherwise we always create the arguments even for lookups that
22727 will never be performed.
22729 (UserImplicitCast::Resolve): Eliminate, objects of type
22730 UserImplicitCast are born in a fully resolved state.
22732 * typemanager.cs (InitCoreTypes): Init also value_type
22733 (System.ValueType).
22735 * expression.cs (Cast::Resolve): First resolve the child expression.
22737 (LValue): Add new method AddressOf to be used by
22740 Change the argument of Store to take an EmitContext instead of an
22741 ILGenerator, because things like FieldExpr need to be able to call
22742 their children expression to generate the instance code.
22744 (Expression::Error, Expression::Warning): Sugar functions for
22747 (Expression::MemberLookup): Accept a TypeContainer instead of a
22748 Report as the first argument.
22750 (Expression::ResolvePrimary): Killed. I still want to improve
22751 this as currently the code is just not right.
22753 (Expression::ResolveMemberAccess): Simplify, but it is still
22756 (Unary::Resolve): Catch errors in AddressOf operators.
22758 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22759 index to a byte for the short-version, or the compiler will choose
22760 the wrong Emit call, which generates the wrong data.
22762 (ParameterReference::Emit, ::Store): same.
22764 (FieldExpr::AddressOf): Implement.
22766 * typemanager.cs: TypeManager: made public variable instead of
22769 * driver.cs: document --fatal.
22771 * report.cs (ErrorMessage, WarningMessage): new names for the old
22772 Error and Warning classes.
22774 * cs-parser.jay (member_access): Turn built-in access to types
22775 into a normal simplename
22777 2001-09-27 Ravi Pratap <ravi@ximian.com>
22779 * expression.cs (Invocation::BetterConversion): Fix to cope
22780 with q being null, since this was introducing a bug.
22782 * expression.cs (ConvertImplicit): Do built-in conversions first.
22784 2001-09-27 Ravi Pratap <ravi@ximian.com>
22786 * expression.cs (UserImplicitCast::Resolve): Fix bug.
22788 2001-09-27 Ravi Pratap <ravi@ximian.com>
22790 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22791 I had introduced long ago (what's new ?).
22793 * expression.cs (UserImplicitCast::CanConvert): Static method to do
22794 the work of all the checking.
22795 (ConvertImplicit): Call CanConvert and only then create object if necessary.
22796 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22798 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22799 that is the right way.
22801 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
22802 overloading resolution. Use everywhere instead of cutting and pasting code.
22804 (Binary::ResolveOperator): Use MakeUnionSet.
22806 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
22807 we have to convert to bool types. Not complete yet.
22809 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22811 * typemanager.cs (TypeManager::CSharpName): support ushort.
22813 * expression.cs (Expression::TryImplicitIntConversion): Attempts
22814 to provide an expression that performsn an implicit constant int
22815 conversion (section 6.1.6).
22816 (Expression::ConvertImplicitRequired): Reworked to include
22817 implicit constant expression conversions.
22819 (Expression::ConvertNumericExplicit): Finished.
22821 (Invocation::Emit): If InstanceExpression is null, then it means
22822 that we perform a call on this.
22824 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22826 * expression.cs (Unary::Emit): Remove some dead code.
22827 (Probe): Implement Resolve and Emit for `is'.
22828 (Expression::ConvertImplicitRequired): Attempt to do constant
22829 expression conversions here. Maybe should be moved to
22830 ConvertImplicit, but I am not sure.
22831 (Expression::ImplicitLongConstantConversionPossible,
22832 Expression::ImplicitIntConstantConversionPossible): New functions
22833 that tell whether is it possible to apply an implicit constant
22834 expression conversion.
22836 (ConvertNumericExplicit): Started work on explicit numeric
22839 * cs-parser.jay: Update operator constants.
22841 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22842 (Parameters::GetSignature): Hook up VerifyArgs here.
22843 (Parameters::VerifyArgs): Verifies that no two arguments have the
22846 * class.cs (Operator): Update the operator names to reflect the
22847 ones that the spec expects (as we are just stringizing the
22850 * expression.cs (Unary::ResolveOperator): Fix bug: Use
22851 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22852 previous usage did only work for our methods.
22853 (Expression::ConvertImplicit): Handle decimal implicit numeric
22854 conversions as well.
22855 (Expression::InternalTypeConstructor): Used to invoke constructors
22856 on internal types for default promotions.
22858 (Unary::Emit): Implement special handling for the pre/post
22859 increment/decrement for overloaded operators, as they need to have
22860 the same semantics as the other operators.
22862 (Binary::ResolveOperator): ditto.
22863 (Invocation::ConversionExists): ditto.
22864 (UserImplicitCast::Resolve): ditto.
22866 2001-09-26 Ravi Pratap <ravi@ximian.com>
22868 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22869 operator, return after emitting body. Regression tests pass again !
22871 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22872 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22873 (Invocation::OverloadResolve): Ditto.
22874 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22876 * everywhere : update calls to the above methods accordingly.
22878 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22880 * assign.cs (Assign): Make it inherit from ExpressionStatement.
22882 * expression.cs (ExpressionStatement): New base class used for
22883 expressions that can appear in statements, so that we can provide
22884 an alternate path to generate expression that do not leave a value
22887 (Expression::Emit, and all the derivatives): We no longer return
22888 whether a value is left on the stack or not. Every expression
22889 after being emitted leaves a single value on the stack.
22891 * codegen.cs (EmitContext::EmitStatementExpression): Use the
22892 facilties of ExpressionStatement if possible.
22894 * cs-parser.jay: Update statement_expression.
22896 2001-09-25 Miguel de Icaza <miguel@ximian.com>
22898 * driver.cs: Change the wording of message
22900 2001-09-25 Ravi Pratap <ravi@ximian.com>
22902 * expression.cs (Binary::ResolveOperator): Had forgottten to set
22903 the type of the expression to the return type of the method if
22904 we have an overloaded operator match ! The regression tests pass again !
22905 (Unary::ResolveOperator): Ditto.
22907 * expression.cs (Invocation::ConversionExists): Correct the member lookup
22908 to find "op_Implicit", not "implicit" ;-)
22909 (UserImplicitCast): New class to take care of user-defined implicit conversions.
22910 (ConvertImplicit, ForceConversion): Take TypeContainer argument
22912 * everywhere : Correct calls to the above accordingly.
22914 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22915 (ConvertImplicit): Do user-defined conversion if it exists.
22917 2001-09-24 Miguel de Icaza <miguel@ximian.com>
22919 * assign.cs: track location.
22920 (Resolve): Use implicit conversions on assignment.
22922 * literal.cs: Oops. Not good, Emit of short access values should
22923 pass (Bytes) or the wrong argument will be selected.
22925 * expression.cs (Unary::Emit): Emit code for -expr.
22927 (Unary::ResolveOperator): Handle `Substract' for non-constants
22928 (substract from zero from the non-constants).
22929 Deal with Doubles as well.
22931 (Expression::ConvertImplicitRequired): New routine that reports an
22932 error if no implicit conversion exists.
22934 (Invocation::OverloadResolve): Store the converted implicit
22935 expressions if we make them
22937 2001-09-24 Ravi Pratap <ravi@ximian.com>
22939 * class.cs (ConstructorInitializer): Take a Location argument.
22940 (ConstructorBaseInitializer): Same here.
22941 (ConstructorThisInitializer): Same here.
22943 * cs-parser.jay : Update all calls accordingly.
22945 * expression.cs (Unary, Binary, New): Take location argument.
22946 Update accordingly everywhere.
22948 * cs-parser.jay : Update all calls to the above to take a location
22951 * class.cs : Ditto.
22953 2001-09-24 Ravi Pratap <ravi@ximian.com>
22955 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22956 (Invocation::BetterConversion): Same here
22957 (Invocation::ConversionExists): Ditto.
22959 (Invocation::ConversionExists): Implement.
22961 2001-09-22 Ravi Pratap <ravi@ximian.com>
22963 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22964 Also take an additional TypeContainer argument.
22966 * All over : Pass in TypeContainer as argument to OverloadResolve.
22968 * typemanager.cs (CSharpName): Update to check for the string type and return
22971 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22974 2001-09-21 Ravi Pratap <ravi@ximian.com>
22976 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22977 (Invocation::BetterFunction): Implement.
22978 (Invocation::BetterConversion): Implement.
22979 (Invocation::ConversionExists): Skeleton, no implementation yet.
22981 Okay, things work fine !
22983 2001-09-21 Miguel de Icaza <miguel@ximian.com>
22985 * typemanager.cs: declare and load enum_type, delegate_type and
22988 * expression.cs (Expression::Emit): Now emit returns a value that
22989 tells whether a value is left on the stack or not. This strategy
22990 might be reveted tomorrow with a mechanism that would address
22991 multiple assignments.
22992 (Expression::report118): Utility routine to report mismatches on
22995 (Unary::Report23): Report impossible type/operator combination
22998 (Unary::IsIncrementableNumber): Whether the type can be
22999 incremented or decremented with add.
23000 (Unary::ResolveOperator): Also allow enumerations to be bitwise
23002 (Unary::ResolveOperator): Implement ++, !, ~,
23004 (Invocation::Emit): Deal with new Emit convetion.
23006 * All Expression derivatives: Updated their Emit method to return
23007 whether they leave values on the stack or not.
23009 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23010 stack for expressions that are statements.
23012 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23014 * expression.cs (LValue): New interface. Must be implemented by
23016 (LocalVariableReference, ParameterReference, FieldExpr): Implement
23019 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
23020 interface for generating code, simplifies the code.
23022 2001-09-20 Ravi Pratap <ravi@ximian.com>
23024 * expression.cs (everywhere): Comment out return statements in ::Resolve
23025 methods to avoid the warnings.
23027 2001-09-20 Miguel de Icaza <miguel@ximian.com>
23029 * driver.cs (parse): Report error 2001 if we can not open the
23032 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
23035 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
23038 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
23039 otherwise nested blocks end up with the same index.
23041 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
23043 * expression.cs: Instead of having FIXMEs in the Resolve
23044 functions, throw exceptions so it is obvious that we are facing a
23047 * cs-parser.jay (invocation_expression): Pass Location information.
23049 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
23050 Use a basename for those routines because .NET does not like paths
23053 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
23056 2001-09-19 Miguel de Icaza <miguel@ximian.com>
23058 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
23059 are loading the correct data types (throws an exception if not).
23060 (TypeManager::InitCoreTypes): Use CoreLookupType
23062 * expression.cs (Unary::ResolveOperator): return the child
23063 expression for expressions which are just +expr.
23064 (Unary::ResolveOperator): Return negative literals for -LITERAL
23065 expressions (otherwise they are Unary {Literal}).
23066 (Invocation::Badness): Take into account `Implicit constant
23067 expression conversions'.
23069 * literal.cs (LongLiteral): Implement long literal class.
23070 (IntLiteral): export the `Value' of the intliteral.
23072 2001-09-19 Ravi Pratap <ravi@ximian.com>
23074 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
23076 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
23077 instead of 'Operator'
23079 * expression.cs (Binary::ResolveOperator): Update accordingly.
23080 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
23083 * cs-parser.jay (unary_expression): Update to use the new names.
23085 * gen-treedump.cs (GetUnary): Same here.
23087 * expression.cs (Unary::Resolve): Implement.
23088 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
23089 operators are found instead of making noise ;-)
23090 (Unary::ResolveOperator): New method to do precisely the same thing which
23091 Binary::ResolveOperator does for Binary expressions.
23092 (Unary.method, .Arguments): Add.
23093 (Unary::OperName): Implement.
23094 (Unary::ForceConversion): Copy and Paste !
23096 * class.cs (Operator::Define): Fix a small bug for the case when we have
23099 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
23100 for the inbuilt operators. Only overloading works for now ;-)
23102 2001-09-18 Miguel de Icaza <miguel@ximian.com>
23104 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
23105 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
23107 * expression.cs (This::Emit): Implement.
23108 (This::Resolve): Implement.
23109 (TypeOf:Resolve): Implement.
23110 (Expression::ResolveSimpleName): Add an implicit this to instance
23112 (MemberAccess::Resolve): Deal with Parameters and Fields.
23113 Bind instance variable to Field expressions.
23114 (FieldExpr::Instance): New field used to track the expression that
23115 represents the object instance.
23116 (FieldExpr::Resolve): Track potential errors from MemberLookup not
23118 (FieldExpr::Emit): Implement.
23120 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
23121 the last instruction contains a return opcode to avoid generating
23122 the last `ret' instruction (this generates correct code, and it is
23123 nice to pass the peverify output).
23125 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
23126 initializer for static and instance variables.
23127 (Constructor::Emit): Allow initializer to be null in the case of
23128 static constructors. Only emit initializer for instance
23131 (TypeContainer::FindMembers): Return a null array if there are no
23134 Also fix the code for the MemberTypes.Method branch, as it was not
23135 scanning that for operators (or tried to access null variables before).
23137 * assign.cs (Assign::Emit): Handle instance and static fields.
23141 * driver.cs: Stop compilation if there are parse errors.
23143 * cs-parser.jay (constructor_declaration): Provide default base
23144 initializer for non-static constructors.
23145 (constructor_declarator): Do not provide a default base
23146 initializers if none was specified.
23147 Catch the fact that constructors should not have parameters.
23149 * class.cs: Do not emit parent class initializers for static
23150 constructors, that should be flagged as an error.
23152 2001-09-18 Ravi Pratap <ravi@ximian.com>
23154 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
23155 Move back code into TypeContainer::Populate.
23157 2001-09-18 Ravi Pratap <ravi@ximian.com>
23159 * class.cs (TypeContainer::AddConstructor): Fix the check to
23160 compare against Name, not Basename.
23161 (Operator::OpType): Change Plus and Minus to Add and Subtract.
23163 * cs-parser.jay : Update accordingly.
23165 * class.cs (TypeContainer::FindMembers): For the case where we are searching
23166 for methods, don't forget to look into the operators too.
23167 (RegisterMethodBuilder): Helper method to take care of this for
23168 methods, constructors and operators.
23169 (Operator::Define): Completely revamp.
23170 (Operator.OperatorMethod, MethodName): New fields.
23171 (TypeContainer::Populate): Move the registering of builders into
23172 RegisterMethodBuilder.
23173 (Operator::Emit): Re-write.
23175 * expression.cs (Binary::Emit): Comment out code path to emit method
23176 invocation stuff for the case when we have a user defined operator. I am
23177 just not able to get it right !
23179 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23181 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
23184 (Expression::MemberLookup): Provide a version that allows to
23185 specify the MemberTypes and BindingFlags.
23187 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
23188 so it was not fetching variable information from outer blocks.
23190 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
23191 Beforefieldinit as it was buggy.
23193 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
23194 that Ravi put here.
23196 * class.cs (Constructor::Emit): Only emit if block is not null.
23197 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
23198 deal with this by semantically definining it as if the user had
23201 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
23202 constructors as we now "emit" them at a higher level.
23204 (TypeContainer::DefineDefaultConstructor): Used to define the
23205 default constructors if none was provided.
23207 (ConstructorInitializer): Add methods Resolve and Emit.
23209 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
23211 2001-09-17 Ravi Pratap <ravi@ximian.com>
23213 * class.cs (TypeContainer::EmitDefaultConstructor): Register
23214 the default constructor builder with our hashtable for methodbuilders
23217 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
23218 and argument_count is 0 in which case we have a match.
23219 (Binary::ResolveOperator): More null checking and miscellaneous coding
23222 2001-09-17 Ravi Pratap <ravi@ximian.com>
23224 * rootcontext.cs (IsNameSpace): Compare against null.
23226 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
23228 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
23229 and Unary::Operator.
23231 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
23234 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
23235 we have overloaded operators.
23236 (Binary::ResolveOperator): Implement the part which does the operator overload
23239 * class.cs (Operator::Emit): Implement.
23240 (TypeContainer::Emit): Emit the operators we have too.
23242 * expression.cs (Binary::Emit): Update to emit the appropriate code for
23243 the case when we have a user-defined operator.
23245 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23247 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23249 2001-09-16 Ravi Pratap <ravi@ximian.com>
23251 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23252 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23253 (Constructor::Emit): Implement.
23254 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23255 if we have no work to do.
23256 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
23259 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23260 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23262 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23265 2001-09-15 Ravi Pratap <ravi@ximian.com>
23267 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23269 (Tree::RecordNamespace): Method to do what the name says ;-)
23270 (Tree::Namespaces): Property to get at the namespaces hashtable.
23272 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
23275 * rootcontext.cs (IsNamespace): Fixed it :-)
23277 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23279 * class.cs (TypeContainer::FindMembers): Add support for
23281 (MethodCore): New class that encapsulates both the shared aspects
23282 of a Constructor and a Method.
23283 (Method, Constructor): Factored pieces into MethodCore.
23285 * driver.cs: Added --fatal which makes errors throw exceptions.
23286 Load System assembly as well as part of the standard library.
23288 * report.cs: Allow throwing exceptions on errors for debugging.
23290 * modifiers.cs: Do not use `parent', instead use the real type
23291 container to evaluate permission settings.
23293 * class.cs: Put Ravi's patch back in. He is right, and we will
23294 have to cope with the
23296 2001-09-14 Ravi Pratap <ravi@ximian.com>
23298 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23299 FamORAssem, not FamANDAssem.
23301 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23303 * driver.cs: Added --parse option that only parses its input files
23306 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
23307 incorrect. IsTopLevel is not used to tell whether an object is
23308 root_types or not (that can be achieved by testing this ==
23309 root_types). But to see if this is a top-level *class* (not
23310 necessarly our "toplevel" container).
23312 2001-09-14 Ravi Pratap <ravi@ximian.com>
23314 * enum.cs (Enum::Define): Modify to call the Lookup method on the
23315 parent instead of a direct call to GetType.
23317 2001-09-14 Ravi Pratap <ravi@ximian.com>
23319 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23320 Modifiers.TypeAttr. This should just be a call to that method.
23322 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23323 object so that we can determine if we are top-level or not.
23325 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
23328 * enum.cs (Enum::Define): Ditto.
23330 * modifiers.cs (FieldAttr): Re-write.
23332 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23333 (TypeContainer::HaveStaticConstructor): New property to provide access
23334 to precisely that info.
23336 * modifiers.cs (MethodAttr): Re-write.
23337 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23339 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23340 of top-level types as claimed.
23342 2001-09-13 Miguel de Icaza <miguel@ximian.com>
23344 * expression.cs (MemberLookup): Fruitless attempt to lookup
23345 constructors. Maybe I need to emit default constructors? That
23346 might be it (currently .NET emits this for me automatically).
23347 (Invocation::OverloadResolve): Cope with Arguments == null.
23348 (Invocation::EmitArguments): new function, shared by the new
23349 constructor and us.
23350 (Invocation::Emit): Handle static and instance methods. Emit
23351 proper call instruction for virtual or non-virtual invocations.
23352 (New::Emit): Implement.
23353 (New::Resolve): Implement.
23354 (MemberAccess:Resolve): Implement.
23355 (MethodGroupExpr::InstanceExpression): used conforming to the spec
23356 to track instances.
23357 (FieldExpr::Resolve): Set type.
23359 * support.cs: Handle empty arguments.
23361 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23362 SimpleLookup): Auxiliary routines to help parse a qualifier
23365 Update qualifier_identifier rule.
23367 * codegen.cs: Removed debugging messages.
23369 * class.cs: Make this a global thing, this acts just as a "key" to
23370 objects that we might have around.
23372 (Populate): Only initialize method_builders_to_methods once.
23374 * expression.cs (PropertyExpr): Initialize type from the
23377 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23378 Resolve pattern. Attempt to implicitly convert value to boolean.
23381 * expression.cs: Set the type for the int32/int32 argument case.
23382 (Binary::ResolveOperator): Set the return type to boolean for
23383 comparission operators
23385 * typemanager.cs: Remove debugging print code.
23387 (Invocation::Resolve): resolve type.
23389 * class.cs: Allocate a MemberInfo of the correct size, as the code
23390 elsewhere depends on the test to reflect the correct contents.
23392 (Method::) Keep track of parameters, due to System.Reflection holes
23394 (TypeContainer::Populate): Keep track of MethodBuilders to Method
23397 (TypeContainer::FindMembers): Use ArrayList and then copy an array
23398 of the exact size and return that.
23400 (Class::LookupMethodByBuilder): New function that maps
23401 MethodBuilders to its methods. Required to locate the information
23402 on methods because System.Reflection bit us again.
23404 * support.cs: New file, contains an interface ParameterData and
23405 two implementations: ReflectionParameters and InternalParameters
23406 used to access Parameter information. We will need to grow this
23409 * expression.cs (Invocation::GetParameterData): implement a cache
23410 and a wrapper around the ParameterData creation for methods.
23411 (Invocation::OverloadResolve): Use new code.
23413 2001-09-13 Ravi Pratap <ravi@ximian.com>
23415 * class.cs (TypeContainer::EmitField): Remove and move into
23416 (Field::Define): here and modify accordingly.
23417 (Field.FieldBuilder): New member.
23418 (TypeContainer::Populate): Update accordingly.
23419 (TypeContainer::FindMembers): Implement.
23421 2001-09-13 Miguel de Icaza <miguel@ximian.com>
23423 * statement.cs: (VariableInfo::VariableType): New field to be
23424 initialized with the full type once it is resolved.
23426 2001-09-12 Miguel de Icaza <miguel@ximian.com>
23428 * parameter.cs (GetParameterInfo): Use a type cache to compute
23429 things only once, and to reuse this information
23431 * expression.cs (LocalVariableReference::Emit): Implement.
23432 (OpcodeCast::Emit): fix.
23434 (ParameterReference::Resolve): Implement.
23435 (ParameterReference::Emit): Implement.
23437 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23438 that are expressions need to stay as Expressions.
23440 * typemanager.cs (CSharpName): Returns the C# name of a type if
23443 * expression.cs (Expression::ConvertImplicit): New function that
23444 implements implicit type conversions.
23446 (Expression::ImplicitReferenceConversion): Implements implicit
23447 reference conversions.
23449 (EmptyCast): New type for transparent casts.
23451 (OpcodeCast): New type for casts of types that are performed with
23452 a sequence of bytecodes.
23454 (BoxedCast): New type used for casting value types into reference
23455 types. Emits a box opcode.
23457 (Binary::DoNumericPromotions): Implements numeric promotions of
23458 and computation of the Binary::Type.
23460 (Binary::EmitBranchable): Optimization.
23462 (Binary::Emit): Implement code emission for expressions.
23464 * typemanager.cs (TypeManager): Added two new core types: sbyte
23467 2001-09-12 Ravi Pratap <ravi@ximian.com>
23469 * class.cs (TypeContainer::FindMembers): Method which does exactly
23470 what Type.FindMembers does, only we don't have to use reflection. No
23471 implementation yet.
23473 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23474 typecontainer objects as we need to get at them.
23475 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23477 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23478 typecontainer object.
23480 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23481 of just a Report object.
23483 2001-09-11 Ravi Pratap <ravi@ximian.com>
23485 * class.cs (Event::Define): Go back to using the prefixes "add_" and
23487 (TypeContainer::Populate): Now define the delegates of the type too.
23488 (TypeContainer.Delegates): Property to access the list of delegates defined
23491 * delegates.cs (Delegate::Define): Implement partially.
23493 * modifiers.cs (TypeAttr): Handle more flags.
23495 2001-09-11 Ravi Pratap <ravi@ximian.com>
23497 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23499 (Operator::Define): Re-write logic to get types by using the LookupType method
23500 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23501 (Indexer::Define): Ditto.
23502 (Event::Define): Ditto.
23503 (Property::Define): Ditto.
23505 2001-09-10 Ravi Pratap <ravi@ximian.com>
23507 * class.cs (TypeContainer::Populate): Now define operators too.
23508 (TypeContainer.Operators): New property to access the list of operators
23510 (Operator.OperatorMethodBuilder): New member to hold the method builder
23511 for the operator we are defining.
23512 (Operator::Define): Implement.
23514 2001-09-10 Ravi Pratap <ravi@ximian.com>
23516 * class.cs (Event::Define): Make the prefixes of the accessor methods
23517 addOn_ and removeOn_
23519 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23520 of the location being passed in too. Ideally, this should go later since all
23521 error reporting should be done through the Report object.
23523 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23524 (Populate): Iterate thru the indexers we have and define them too.
23525 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23526 for the get and set accessors.
23527 (Indexer::Define): Implement.
23529 2001-09-09 Miguel de Icaza <miguel@ximian.com>
23531 * expression.cs (Binary::Resolve): Beginning of it. I scratched
23532 my previous implementation, did not work.
23534 * typemanager.cs: Add a couple of missing types (the longs).
23536 * literal.cs: Use TypeManager.bool_type instead of getting it.
23538 * expression.cs (EventExpr): New kind of expressions.
23539 (Expressio::ExprClassFromMemberInfo): finish
23541 2001-09-08 Miguel de Icaza <miguel@ximian.com>
23543 * assign.cs: Emit stores to static fields differently.
23545 2001-09-08 Ravi Pratap <ravi@ximian.com>
23547 * Merge in changes and adjust code to tackle conflicts. Backed out my
23548 code in Assign::Resolve ;-)
23550 2001-09-08 Ravi Pratap <ravi@ximian.com>
23552 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23553 instead Report.Error and also pass in the location.
23554 (CSharpParser::Lexer): New readonly property to return the reference
23555 to the Tokenizer object.
23556 (declare_local_variables): Use Report.Error with location instead of plain
23560 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23561 (Operator.CheckBinaryOperator): Ditto.
23563 * cs-parser.jay (operator_declarator): Update accordingly.
23565 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23566 (CheckBinaryOperator): Same here.
23568 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23569 on the name without any prefixes of namespace names etc. This is because we
23570 already might have something already fully qualified like
23571 'System.Console.WriteLine'
23573 * assign.cs (Resolve): Begin implementation. Stuck ;-)
23575 2001-09-07 Ravi Pratap <ravi@ximian.com>
23577 * cs-tokenizer.cs (location): Return a string which also contains
23580 * expression.cs (ElementAccess): New class for expressions of the
23581 type 'element access.'
23582 (BaseAccess): New class for expressions of the type 'base access.'
23583 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23586 * cs-parser.jay (element_access): Implement action.
23587 (base_access): Implement actions.
23588 (checked_expression, unchecked_expression): Implement.
23590 * cs-parser.jay (local_variable_type): Correct and implement.
23591 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23593 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23595 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23596 name and the specifiers.
23598 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23600 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
23601 making them all public ;-)
23603 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
23606 2001-09-07 Miguel de Icaza <miguel@ximian.com>
23608 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
23610 (FieldExpr, PropertyExprs): New resolved expressions.
23611 (SimpleName::MemberStaticCheck): Perform static checks for access
23612 to non-static fields on static methods. Maybe this should be
23613 generalized for MemberAccesses.
23614 (SimpleName::ResolveSimpleName): More work on simple name
23617 * cs-parser.jay (primary_expression/qualified_identifier): track
23618 the parameter index.
23620 * codegen.cs (CodeGen::Save): Catch save exception, report error.
23621 (EmitContext::EmitBoolExpression): Chain to expression generation
23622 instead of temporary hack.
23623 (::EmitStatementExpression): Put generic expression code generation.
23625 * assign.cs (Assign::Emit): Implement variable assignments to
23626 local variables, parameters and fields.
23628 2001-09-06 Miguel de Icaza <miguel@ximian.com>
23630 * statement.cs (Block::GetVariableInfo): New method, returns the
23631 VariableInfo for a variable name in a block.
23632 (Block::GetVariableType): Implement in terms of GetVariableInfo
23634 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
23635 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
23637 2001-09-06 Ravi Pratap <ravi@ximian.com>
23639 * cs-parser.jay (operator_declaration): Continue on my quest : update
23640 to take attributes argument.
23641 (event_declaration): Ditto.
23642 (enum_declaration): Ditto.
23643 (indexer_declaration): Ditto.
23645 * class.cs (Operator::Operator): Update constructor accordingly.
23646 (Event::Event): Ditto.
23648 * delegate.cs (Delegate::Delegate): Same here.
23650 * enum.cs (Enum::Enum): Same here.
23652 2001-09-05 Ravi Pratap <ravi@ximian.com>
23654 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23656 * ../tests/cs0658.cs : New file to demonstrate error 0658.
23658 * attribute.cs (Attributes): New class to encapsulate all attributes which were
23659 being passed around as an arraylist.
23660 (Attributes::AddAttribute): Method to add attribute sections.
23662 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23663 (struct_declaration): Update accordingly.
23664 (constant_declaration): Update.
23665 (field_declaration): Update.
23666 (method_header): Update.
23667 (fixed_parameter): Update.
23668 (parameter_array): Ditto.
23669 (property_declaration): Ditto.
23670 (destructor_declaration): Ditto.
23672 * class.cs (Struct::Struct): Update constructors accordingly.
23673 (Class::Class): Ditto.
23674 (Field::Field): Ditto.
23675 (Method::Method): Ditto.
23676 (Property::Property): Ditto.
23677 (TypeContainer::OptAttribute): update property's return type.
23679 * interface.cs (Interface.opt_attributes): New member.
23680 (Interface::Interface): Update to take the extra Attributes argument.
23682 * parameter.cs (Parameter::Parameter): Ditto.
23684 * constant.cs (Constant::Constant): Ditto.
23686 * interface.cs (InterfaceMemberBase): New OptAttributes field.
23687 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
23688 the attributes as a parameter.
23689 (InterfaceProperty): Update constructor call.
23690 (InterfaceEvent): Ditto.
23691 (InterfaceMethod): Ditto.
23692 (InterfaceIndexer): Ditto.
23694 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
23695 pass the attributes too.
23696 (interface_event_declaration): Ditto.
23697 (interface_property_declaration): Ditto.
23698 (interface_method_declaration): Ditto.
23699 (interface_declaration): Ditto.
23701 2001-09-05 Miguel de Icaza <miguel@ximian.com>
23703 * class.cs (Method::Define): Track the "static Main" definition to
23704 create an entry point.
23706 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23707 EntryPoint if we find it.
23709 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23710 (EmitContext::ig): Make this variable public.
23712 * driver.cs: Make the default output file be the first file name
23713 with the .exe extension.
23715 Detect empty compilations
23717 Handle various kinds of output targets. Handle --target and
23718 rename -t to --dumper.
23720 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23721 methods inherited from Expression return now an Expression. This
23722 will is used during the tree rewriting as we resolve them during
23725 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23726 the spec. Missing entirely is the information about
23727 accessability of elements of it.
23729 (Expression::ExprClassFromMemberInfo): New constructor for
23730 Expressions that creates a fully initialized Expression based on
23731 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23734 (Invocation::Resolve): Begin implementing resolution of invocations.
23736 * literal.cs (StringLiteral): Implement Emit.
23738 2001-09-05 Ravi Pratap <ravi@ximian.com>
23740 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23743 2001-09-04 Ravi Pratap <ravi@ximian.com>
23745 * cs-parser.jay (attribute_arguments): Implement actions.
23746 (attribute): Fix bug in production. Implement action.
23747 (attribute_list): Implement.
23748 (attribute_target): Implement.
23749 (attribute_target_specifier, opt_target_specifier): Implement
23750 (CheckAttributeTarget): New method to check if the attribute target
23752 (attribute_section): Implement.
23753 (opt_attributes): Implement.
23755 * attribute.cs : New file to handle attributes.
23756 (Attribute): Class to hold attribute info.
23758 * cs-parser.jay (opt_attribute_target_specifier): Remove production
23759 (attribute_section): Modify production to use 2 different rules to
23760 achieve the same thing. 1 s/r conflict down !
23761 Clean out commented, useless, non-reducing dimension_separator rules.
23763 * class.cs (TypeContainer.attributes): New member to hold list
23764 of attributes for a type.
23765 (Struct::Struct): Modify to take one more argument, the attribute list.
23766 (Class::Class): Ditto.
23767 (Field::Field): Ditto.
23768 (Method::Method): Ditto.
23769 (Property::Property): Ditto.
23771 * cs-parser.jay (struct_declaration): Update constructor call to
23772 pass in the attributes too.
23773 (class_declaration): Ditto.
23774 (constant_declaration): Ditto.
23775 (field_declaration): Ditto.
23776 (method_header): Ditto.
23777 (fixed_parameter): Ditto.
23778 (parameter_array): Ditto.
23779 (property_declaration): Ditto.
23781 * constant.cs (Constant::Constant): Update constructor similarly.
23782 Use System.Collections.
23784 * parameter.cs (Parameter::Parameter): Update as above.
23786 2001-09-02 Ravi Pratap <ravi@ximian.com>
23788 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23789 (TypeContainer.delegates): New member to hold list of delegates.
23791 * cs-parser.jay (delegate_declaration): Implement the action correctly
23792 this time as I seem to be on crack ;-)
23794 2001-09-02 Miguel de Icaza <miguel@ximian.com>
23796 * rootcontext.cs (RootContext::IsNamespace): new function, used to
23797 tell whether an identifier represents a namespace.
23799 * expression.cs (NamespaceExpr): A namespace expression, used only
23800 temporarly during expression resolution.
23801 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23802 utility functions to resolve names on expressions.
23804 2001-09-01 Miguel de Icaza <miguel@ximian.com>
23806 * codegen.cs: Add hook for StatementExpressions.
23808 * class.cs: Fix inverted test for static flag in methods.
23810 2001-09-02 Ravi Pratap <ravi@ximian.com>
23812 * class.cs (Operator::CheckUnaryOperator): Correct error number used
23813 to make it coincide with MS' number.
23814 (Operator::CheckBinaryOperator): Ditto.
23816 * ../errors/errors.txt : Remove error numbers added earlier.
23818 * ../errors/cs1019.cs : Test case for error # 1019
23820 * ../errros/cs1020.cs : Test case for error # 1020
23822 * cs-parser.jay : Clean out commented cruft.
23823 (dimension_separators, dimension_separator): Comment out. Ostensibly not
23824 used anywhere - non-reducing rule.
23825 (namespace_declarations): Non-reducing rule - comment out.
23827 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23828 with TypeContainer::AddEnum.
23830 * delegate.cs : New file for delegate handling classes.
23831 (Delegate): Class for declaring delegates.
23833 * makefile : Update.
23835 * cs-parser.jay (delegate_declaration): Implement.
23837 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
23839 * class.cs (Event::Define): Implement.
23840 (Event.EventBuilder): New member.
23842 * class.cs (TypeContainer::Populate): Update to define all enums and events
23844 (Events): New property for the events arraylist we hold. Shouldn't we move to using
23845 readonly fields for all these cases ?
23847 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23849 * class.cs (Property): Revamp to use the convention of making fields readonly.
23850 Accordingly modify code elsewhere.
23852 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23853 the Define method of the Property class.
23855 * class.cs : Clean up applied patch and update references to variables etc. Fix
23857 (TypeContainer::Populate): Update to define all the properties we have. Also
23858 define all enumerations.
23860 * enum.cs (Define): Implement.
23862 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23864 * cs-parser.jay (overloadable_operator): The semantic value is an
23865 enum of the Operator class.
23866 (operator_declarator): Implement actions.
23867 (operator_declaration): Implement.
23869 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23870 validity of definitions.
23871 (Operator::CheckBinaryOperator): Static method to check for binary operators
23872 (TypeContainer::AddOperator): New method to add an operator to a type.
23874 * cs-parser.jay (indexer_declaration): Added line to actually call the
23875 AddIndexer method so it gets added ;-)
23877 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
23878 already taken care of by the MS compiler ?
23880 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23882 * class.cs (Operator): New class for operator declarations.
23883 (Operator::OpType): Enum for the various operators.
23885 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23887 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23888 ostensibly handle this in semantic analysis.
23890 * cs-parser.jay (general_catch_clause): Comment out
23891 (specific_catch_clauses, specific_catch_clause): Ditto.
23892 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23893 (catch_args, opt_catch_args): New productions.
23894 (catch_clause): Rewrite to use the new productions above
23895 (catch_clauses): Modify accordingly.
23896 (opt_catch_clauses): New production to use in try_statement
23897 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23898 and re-write the code in the actions to extract the specific and
23899 general catch clauses by being a little smart ;-)
23901 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23902 Hooray, try and catch statements parse fine !
23904 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23906 * statement.cs (Block::GetVariableType): Fix logic to extract the type
23907 string from the hashtable of variables.
23909 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23910 I end up making that mistake ;-)
23911 (catch_clauses): Fixed gross error which made Key and Value of the
23912 DictionaryEntry the same : $1 !!
23914 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23916 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23918 * cs-parser.jay (event_declaration): Correct to remove the semicolon
23919 when the add and remove accessors are specified.
23921 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23923 * cs-parser.jay (IndexerDeclaration): New helper class to hold
23924 information about indexer_declarator.
23925 (indexer_declarator): Implement actions.
23926 (parsing_indexer): New local boolean used to keep track of whether
23927 we are parsing indexers or properties. This is necessary because
23928 implicit_parameters come into picture even for the get accessor in the
23929 case of an indexer.
23930 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23932 * class.cs (Indexer): New class for indexer declarations.
23933 (TypeContainer::AddIndexer): New method to add an indexer to a type.
23934 (TypeContainer::indexers): New member to hold list of indexers for the
23937 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23939 * cs-parser.jay (add_accessor_declaration): Implement action.
23940 (remove_accessor_declaration): Implement action.
23941 (event_accessors_declaration): Implement
23942 (variable_declarators): swap statements for first rule - trivial.
23944 * class.cs (Event): New class to hold information about event
23946 (TypeContainer::AddEvent): New method to add an event to a type
23947 (TypeContainer::events): New member to hold list of events.
23949 * cs-parser.jay (event_declaration): Implement actions.
23951 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23953 * cs-parser.jay (dim_separators): Implement. Make it a string
23954 concatenating all the commas together, just as they appear.
23955 (opt_dim_separators): Modify accordingly
23956 (rank_specifiers): Update accordingly. Basically do the same
23957 thing - instead, collect the brackets here.
23958 (opt_rank_sepcifiers): Modify accordingly.
23959 (array_type): Modify to actually return the complete type string
23960 instead of ignoring the rank_specifiers.
23961 (expression_list): Implement to collect the expressions
23962 (variable_initializer): Implement. We make it a list of expressions
23963 essentially so that we can handle the array_initializer case neatly too.
23964 (variable_initializer_list): Implement.
23965 (array_initializer): Make it a list of variable_initializers
23966 (opt_array_initializer): Modify accordingly.
23968 * expression.cs (New::NType): Add enumeration to help us
23969 keep track of whether we have an object/delegate creation
23970 or an array creation.
23971 (New:NewType, New::Rank, New::Indices, New::Initializers): New
23972 members to hold data about array creation.
23973 (New:New): Modify to update NewType
23974 (New:New): New Overloaded contructor for the array creation
23977 * cs-parser.jay (array_creation_expression): Implement to call
23978 the overloaded New constructor.
23980 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
23982 * class.cs (TypeContainer::Constructors): Return member
23983 constructors instead of returning null.
23985 2001-08-26 Miguel de Icaza <miguel@ximian.com>
23987 * typemanager.cs (InitCoreTypes): Initialize the various core
23988 types after we have populated the type manager with the user
23989 defined types (this distinction will be important later while
23990 compiling corlib.dll)
23992 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23993 on Expression Classification. Now all expressions have a method
23994 `Resolve' and a method `Emit'.
23996 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23997 generation from working. Also add some temporary debugging
24000 2001-08-24 Miguel de Icaza <miguel@ximian.com>
24002 * codegen.cs: Lots of code generation pieces. This is only the
24003 beginning, will continue tomorrow with more touches of polish. We
24004 handle the fundamentals of if, while, do, for, return. Others are
24005 trickier and I need to start working on invocations soon.
24007 * gen-treedump.cs: Bug fix, use s.Increment here instead of
24010 * codegen.cs (EmitContext): New struct, used during code
24011 emission to keep a context. Most of the code generation will be
24014 * cs-parser.jay: Add embedded blocks to the list of statements of
24015 this block. So code generation proceeds in a top down fashion.
24017 2001-08-23 Miguel de Icaza <miguel@ximian.com>
24019 * statement.cs: Add support for multiple child blocks.
24021 2001-08-22 Miguel de Icaza <miguel@ximian.com>
24023 * codegen.cs (EmitCode): New function, will emit the code for a
24024 Block of code given a TypeContainer and its ILGenerator.
24026 * statement.cs (Block): Standard public readonly optimization.
24027 (Block::Block constructors): Link children.
24028 (Block::Child): Child Linker.
24029 (Block::EmitVariables): Emits IL variable declarations.
24031 * class.cs: Drop support for MethodGroups here, delay until
24033 (Method::): Applied the same simplification that I did before, and
24034 move from Properties to public readonly fields.
24035 (Method::ParameterTypes): Returns the parameter types for the
24036 function, and implements a cache that will be useful later when I
24037 do error checking and the semantic analysis on the methods is
24039 (Constructor::GetCallingConvention): Renamed from CallingConvetion
24040 and made a method, optional argument tells whether this is a class
24041 or a structure to apply the `has-this' bit.
24042 (Method::GetCallingConvention): Implement, returns the calling
24044 (Method::Define): Defines the type, a second pass is performed
24045 later to populate the methods.
24047 (Constructor::ParameterTypes): implement a cache similar to the
24048 one on Method::ParameterTypes, useful later when we do semantic
24051 (TypeContainer::EmitMethod): New method. Emits methods.
24053 * expression.cs: Removed MethodGroup class from here.
24055 * parameter.cs (Parameters::GetCallingConvention): new method.
24057 2001-08-21 Miguel de Icaza <miguel@ximian.com>
24059 * class.cs (TypeContainer::Populate): Drop RootContext from the
24062 (Constructor::CallingConvention): Returns the calling convention.
24063 (Constructor::ParameterTypes): Returns the constructor parameter
24066 (TypeContainer::AddConstructor): Keep track of default constructor
24067 and the default static constructor.
24069 (Constructor::) Another class that starts using `public readonly'
24070 instead of properties.
24072 (Constructor::IsDefault): Whether this is a default constructor.
24074 (Field::) use readonly public fields instead of properties also.
24076 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
24077 track of static constructors; If none is used, turn on
24078 BeforeFieldInit in the TypeAttributes.
24080 * cs-parser.jay (opt_argument_list): now the return can be null
24081 for the cases where there are no arguments.
24083 (constructor_declarator): If there is no implicit `base' or
24084 `this', then invoke the default parent constructor.
24086 * modifiers.cs (MethodAttr): New static function maps a set of
24087 modifiers flags into a MethodAttributes enum
24088 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
24089 MethodAttr, TypeAttr to represent the various mappings where the
24090 modifiers are used.
24091 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
24093 2001-08-19 Miguel de Icaza <miguel@ximian.com>
24095 * parameter.cs (GetParameterInfo): Fix bug where there would be no
24098 * interface.cs (PopulateIndexer): Implemented the code generator
24099 for interface indexers.
24101 2001-08-17 Miguel de Icaza <miguel@ximian.com>
24103 * interface.cs (InterfaceMemberBase): Now we track the new status
24106 (PopulateProperty): Implement property population. Woohoo! Got
24107 Methods and Properties going today.
24109 Removed all the properties for interfaces, and replaced them with
24110 `public readonly' fields.
24112 2001-08-16 Miguel de Icaza <miguel@ximian.com>
24114 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
24115 initialize their hashtables/arraylists only when they are needed
24116 instead of doing this always.
24118 * parameter.cs: Handle refs and out parameters.
24120 * cs-parser.jay: Use an ArrayList to construct the arguments
24121 instead of the ParameterCollection, and then cast that to a
24124 * parameter.cs: Drop the use of ParameterCollection and use
24125 instead arrays of Parameters.
24127 (GetParameterInfo): Use the Type, not the Name when resolving
24130 2001-08-13 Miguel de Icaza <miguel@ximian.com>
24132 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
24133 and instead use public readonly fields.
24135 * class.cs: Put back walking code for type containers.
24137 2001-08-11 Miguel de Icaza <miguel@ximian.com>
24139 * class.cs (MakeConstant): Code to define constants.
24141 * rootcontext.cs (LookupType): New function. Used to locate types
24144 2001-08-08 Miguel de Icaza <miguel@ximian.com>
24146 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
24147 this System.Reflection code is. Kudos to Microsoft
24149 * typemanager.cs: Implement a type cache and avoid loading all
24150 types at boot time. Wrap in LookupType the internals. This made
24151 the compiler so much faster. Wow. I rule!
24153 * driver.cs: Make sure we always load mscorlib first (for
24154 debugging purposes, nothing really important).
24156 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
24157 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
24159 * rootcontext.cs: Lookup types on their namespace; Lookup types
24160 on namespaces that have been imported using the `using' keyword.
24162 * class.cs (TypeContainer::TypeAttr): Virtualize.
24163 (Class::TypeAttr): Return attributes suitable for this bad boy.
24164 (Struct::TypeAttr): ditto.
24165 Handle nested classes.
24166 (TypeContainer::) Remove all the type visiting code, it is now
24167 replaced with the rootcontext.cs code
24169 * rootcontext.cs (GetClassBases): Added support for structs.
24171 2001-08-06 Miguel de Icaza <miguel@ximian.com>
24173 * interface.cs, statement.cs, class.cs, parameter.cs,
24174 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
24175 Drop use of TypeRefs, and use strings instead.
24177 2001-08-04 Miguel de Icaza <miguel@ximian.com>
24181 * class.cs (Struct::Struct): set the SEALED flags after
24182 checking the modifiers.
24183 (TypeContainer::TypeAttr): new property, returns the
24184 TypeAttributes for a class.
24186 * cs-parser.jay (type_list): Oops, list production was creating a
24187 new list of base types.
24189 * rootcontext.cs (StdLib): New property.
24190 (GetInterfaceTypeByName): returns an interface by type name, and
24191 encapsulates error handling here.
24192 (GetInterfaces): simplified.
24193 (ResolveTree): Encapsulated all the tree resolution here.
24194 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
24197 * driver.cs: Add support for --nostdlib, to avoid loading the
24198 default assemblies.
24199 (Main): Do not put tree resolution here.
24201 * rootcontext.cs: Beginning of the class resolution.
24203 2001-08-03 Miguel de Icaza <miguel@ximian.com>
24205 * rootcontext.cs: Provide better error reporting.
24207 * cs-parser.jay (interface_base): set our $$ to be interfaces.
24209 * rootcontext.cs (CreateInterface): Handle the case where there
24210 are no parent interfaces.
24212 (CloseTypes): Routine to flush types at the end.
24213 (CreateInterface): Track types.
24214 (GetInterfaces): Returns an array of Types from the list of
24215 defined interfaces.
24217 * typemanager.c (AddUserType): Mechanism to track user types (puts
24218 the type on the global type hash, and allows us to close it at the
24221 2001-08-02 Miguel de Icaza <miguel@ximian.com>
24223 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
24224 RecordInterface instead.
24226 * cs-parser.jay: Updated to reflect changes above.
24228 * decl.cs (Definition): Keep track of the TypeBuilder type that
24229 represents this type here. Not sure we will use it in the long
24230 run, but wont hurt for now.
24232 * driver.cs: Smaller changes to accomodate the new code.
24234 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
24237 * rootcontext.cs (CreateInterface): New method, used to create
24238 the System.TypeBuilder type for interfaces.
24239 (ResolveInterfaces): new entry point to resolve the interface
24241 (CodeGen): Property, used to keep track of the code generator.
24243 2001-07-26 Miguel de Icaza <miguel@ximian.com>
24245 * cs-parser.jay: Add a second production for delegate_declaration
24248 (enum_body): Put an opt_comma here instead of putting it on
24249 enum_body or enum_member_declarations so we can handle trailing
24250 commas on enumeration members. Gets rid of a shift/reduce.
24252 (type_list): Need a COMMA in the middle.
24254 (indexer_declaration): Tell tokenizer to recognize get/set
24256 * Remove old targets.
24258 * Re-add the parser target.
24260 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24262 * cs-parser.jay: Add precendence rules for a number of operators
24263 ot reduce the number of shift/reduce conflicts in the grammar.
24265 2001-07-17 Miguel de Icaza <miguel@ximian.com>
24267 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24270 Get rid of old crufty code.
24272 * rootcontext.cs: Use this to keep track of the parsed
24273 representation and the defined types available to the program.
24275 * gen-treedump.cs: adjust for new convention.
24277 * type.cs: Split out the type manager, and the assembly builder
24280 * typemanager.cs: the type manager will live here now.
24282 * cil-codegen.cs: And the code generator here.
24284 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
24286 * makefile: Fixed up for easy making.
24288 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24290 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24293 (unary_expression): Expand pre_increment_expression and
24294 post_decrement_expression to reduce a shift/reduce.
24296 2001-07-11 Simon Cozens
24298 * cs-tokenizer.cs: Hex numbers should begin with a 0.
24300 Improve allow_keyword_as_indent name.
24302 2001-06-19 Miguel de Icaza <miguel@ximian.com>
24304 * Adjustments for Beta2.
24306 2001-06-13 Miguel de Icaza <miguel@ximian.com>
24308 * decl.cs: Added `Define' abstract method.
24309 (InTransit): new property, used to catch recursive definitions.
24311 * interface.cs: Implement `Define'.
24313 * modifiers.cs: Map Modifiers.constants to
24314 System.Reflection.TypeAttribute flags.
24316 * class.cs: Keep track of types and user-defined types.
24317 (BuilderInit): New method for creating an assembly
24318 (ResolveType): New function to launch the resolution process, only
24319 used by interfaces for now.
24321 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24322 that are inserted into the name space.
24324 2001-06-08 Miguel de Icaza <miguel@ximian.com>
24326 * ARGH. I have screwed up my tree so many times due to the use of
24327 rsync rather than using CVS. Going to fix this at once.
24329 * driver.cs: Objetify driver. Load assemblies, use assemblies to
24332 2001-06-07 Miguel de Icaza <miguel@ximian.com>
24334 * Experiment successful: Use System.Type rather that our own
24337 2001-05-25 Miguel de Icaza <miguel@ximian.com>
24339 * cs-parser.jay: Removed nsAliases from here.
24341 Use new namespaces, handle `using XXX;'
24343 * namespace.cs: Reimplemented namespace handling, use a recursive
24344 definition of the class. Now we can keep track of using clauses
24345 and catch invalid using clauses.
24347 2001-05-24 Miguel de Icaza <miguel@ximian.com>
24349 * gen-treedump.cs: Adapted for all the renaming.
24351 * expression.cs (Expression): this class now has a Type property
24352 which returns an expression Type.
24354 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24355 `Type', as this has a different meaning now in the base
24357 2001-05-22 Miguel de Icaza <miguel@ximian.com>
24359 * interface.cs, class.cs: Removed from all the sources the
24360 references to signature computation, as we can not do method
24361 signature computation during the parsing time, as we are not
24362 trying to solve at that point distinguishing:
24366 void a (NS.Blah x) {}
24369 Which depending on the context might be valid or not, as we do not
24370 know if Blah is the same thing as NS.Blah at that point.
24372 * Redid everything so the code uses TypeRefs now instead of
24373 Types. TypeRefs are just temporary type placeholders, that need
24374 to be resolved. They initially have a pointer to a string and the
24375 current scope in which they are used. This is used later by the
24376 compiler to resolve the reference to an actual Type.
24378 * DeclSpace is no longer a CIR.Type, and neither are
24379 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
24380 are all DeclSpaces, but no Types.
24382 * type.cs (TypeRefManager): This implements the TypeRef manager,
24383 which keeps track of all the types that need to be resolved after
24384 the parsing has finished.
24386 2001-05-13 Miguel de Icaza <miguel@ximian.com>
24388 * ARGH. We are going to have to store `foreach' as a class rather
24389 than resolving it, as we need to verify error 1579 after name
24390 resolution. *OR* we could keep a flag that says `This request to
24391 IEnumerator comes from a foreach statement' which we can then use
24392 to generate the error.
24394 2001-05-10 Miguel de Icaza <miguel@ximian.com>
24396 * class.cs (TypeContainer.AddMethod): we now add methods to the
24397 MethodGroup instead of the method hashtable.
24399 * expression.cs: Add MethodGroup abstraction, which gets us one
24400 step closer to the specification in the way we handle method
24403 * cs-parser.jay (primary_expression): qualified_identifier now
24404 tried to match up an identifier to a local variable reference or
24405 to a parameter reference.
24407 current_local_parameters is now a parser global variable that
24408 points to the current parameters for the block, used during name
24411 (property_declaration): Now creates an implicit `value' argument to
24414 2001-05-09 Miguel de Icaza <miguel@ximian.com>
24416 * parameter.cs: Do not use `param' arguments as part of the
24417 signature, per the spec.
24419 2001-05-08 Miguel de Icaza <miguel@ximian.com>
24421 * decl.cs: Base class for classes, structs and interfaces. This
24422 is the "Declaration Space"
24424 * cs-parser.jay: Use CheckDef for checking declaration errors
24425 instead of having one on each function.
24427 * class.cs: Factor out some code for handling error handling in
24428 accordance to the "Declarations" section in the "Basic Concepts"
24429 chapter in the ECMA C# spec.
24431 * interface.cs: Make all interface member classes derive from
24432 InterfaceMemberBase.
24434 2001-05-07 Miguel de Icaza <miguel@ximian.com>
24436 * Many things: all interfaces are parsed and generated in
24437 gen-treedump. Support for member variables, constructors,
24438 destructors, properties, constants is there.
24440 Beginning of the IL backend, but very little done, just there for
24443 2001-04-29 Miguel de Icaza <miguel@ximian.com>
24445 * cs-parser.jay: Fix labeled statement.
24447 * cs-tokenizer.cs (escape): Escape " and ' always.
24448 ref_line, ref_name: keep track of the line/filename as instructed
24449 by #line by the compiler.
24452 2001-04-27 Miguel de Icaza <miguel@ximian.com>
24454 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24455 to match the values in System.CodeDOM.
24457 Divid renamed to Divide.
24459 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24461 (Statements.set): remove.
24463 * System.CodeDOM/CodeCatchClause.cs: always have a valid
24466 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24467 falseStatements always have valid values.
24469 * cs-parser.jay: Use System.CodeDOM now.