1 2006-10-04 Martin Baulig <martin@ximian.com>
3 Merged the Anonymous Methods patch.
5 * anonymous.cs, iterators.cs: The new anonymous methods code.
7 * statement.cs (Variable): New public abstract class.
8 (LocalInfo.Variable): New public property.
9 (LocalInfo.ResolveVariable): New public method.
10 (Block.Flags): Add `IsIterator'.
11 (Block.AddVariable): Improved the CS0136 check.
12 (Block.AnonymousChildren): New public property.
13 (Block.AddAnonymousChild): New public method.
14 (ToplevelBlock): Update to use the new anonymous method framework.
15 (ToplevelBlock.ctor): `container' is now a `Block' and not a
16 `ToplevelBlock'; this is required to correctly implement the
18 (Fixed, Using): Use `TemporaryVariable' instead of directly
19 creating the `LocalBuilder'.
21 * parameter.cs (Parameter.ResolveVariable): New public method.
22 (Parameters.ResolveVariable): Likewise.
24 * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
26 * class.cs (TypeContainer): Replaced the `iterators' list and
27 corresponding methods with a list of `CompilerGeneratedClass'es.
28 (TypeContainer.ResolveMembers): New public method.
29 (Method): `IIteratorContainer' has been replaced by
32 * expression.cs (VariableReference): New public abstract base
33 class for `LocalVariableReference', `ParameterReference' and
36 * codegen.cs (EmitContext): Removed `capture_context',
37 `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
38 (EmitContext.EmitThis): Removed.
40 * cs-parser.jay: Replace `iterator_container' with
43 2006-10-04 Martin Baulig <martin@ximian.com>
45 * generic.cs (GenericMethod): Don't make this abstract.
46 (Constraints.Clone): Added dummy implementation.
48 2006-10-04 Raja R Harinath <harinath@gmail.com>
51 * namespace.cs (LookForAnyGenericType): Avoid nullref on
52 'declspaces'. Avoid allocating arrays willy-nilly.
55 * cfold.cs (BinaryFold): Move boolean Equality and Inequality
56 cases out of the switch.
58 2006-09-28 Marek Safar <marek.safar@seznam.cz>
60 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
61 message when non-generic type is used with the type arguments.
62 * expression.cs: Updated.
64 2006-09-28 Raja R Harinath <rharinath@novell.com>
67 * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
68 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
69 Change semantics slightly. Don't insist on having only one
70 temporary EmptyExpression -- just throttle the creation of new ones.
73 * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
74 non-interfaces too. If no methods are found, don't try to create
77 2006-09-28 Marek Safar <marek.safar@seznam.cz>
79 * ecore.cs (ResolveAsTypeStep): Print better error when type can be
82 * namespace.cs (Namespace.LookForAnyGenericType): New method to help
83 us produce better error message.
85 2006-09-27 Marek Safar <marek.safar@seznam.cz>
87 * expression.cs (Binary.ResolveOperator): Warn about a side effect
90 * report.cs: A new warning added.
92 2006-09-27 Martin Baulig <martin@ximian.com>
94 * generic.cs (GenericMethod): Don't make this abstract.
96 2006-09-27 Martin Baulig <martin@ximian.com>
99 (InternalErrorException): Added overloaded ctor taking a params array.
101 2006-09-26 Marek Safar <marek.safar@seznam.cz>
103 * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
104 Fixed the cases when same error was reported twice.
106 * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
107 now report symbol information.
109 2006-09-25 Martin Baulig <martin@ximian.com>
111 * class.cs: Completely unified with the gmcs version.
113 2006-09-25 Martin Baulig <martin@ximian.com>
115 * typemanager.cs (TypeManager.IsNullableType): New public function.
116 (TypeManager.IsNullableTypeOf): Likewise.
117 (TypeManager.IsNullableValueType): Likewise.
119 * class.cs (MethodCore): Added the `GenericMethod' argument from
120 gmcs and also unified all classes derived from `MethodCore' with gmcs.
122 2006-09-24 Raja R Harinath <harinath@gmail.com>
124 * convert.cs: Unify with gmcs version.
126 2006-09-24 Marek Safar <marek.safar@seznam.cz>
128 * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
131 * report.cs: New warning.
133 2006-09-24 Marek Safar <marek.safar@seznam.cz>
135 * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
136 for anonymous block with out argument.
138 2006-09-24 Marek Safar <marek.safar@seznam.cz>
140 * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
141 not used private events only.
143 2006-09-23 Marek Safar <marek.safar@seznam.cz>
145 * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
147 * const.cs (Const.Define): Check for constant type.
148 (Const.IsConstantTypeValid): Looks for valid constant types.
150 * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
152 * ecore.cs (EmptyConstantCast): New common class for all constant based
155 * expression.cs (Is.DoResolve): Handle null constant especially.
156 (New.DoResolve): Check for new void().
157 (MemberAccess.DoResolve): Cope with all kind of nulls.
159 * literal.cs (NullConstant): Uses EmptyConstantCast.
160 (NullDefault): Based on EmptyConstantCast.
161 (NullLiteral): Uses EmptyConstantCast.
163 * statement.cs (Block.ResolveMeta): Check for constant type.
165 2006-09-22 Martin Baulig <martin@ximian.com>
167 * delegate.cs, attribute.cs: Merged with the gmcs versions.
169 2006-09-22 Raja R Harinath <rharinath@novell.com>
171 * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
175 * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
176 * decl.cs (DeclSpace.FindMemberToOverride): Likewise. Reorganize
179 2006-09-22 Martin Baulig <martin@ximian.com>
181 * ecore.cs: Merged with the gmcs version.
183 * generic.cs (ConstructedType): New dummy class.
184 (TypeArguments): Don't make this abstract.
187 (TypeManager.IsGenericTypeDefinition): New method.
188 (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
190 2006-09-22 Raja R Harinath <rharinath@novell.com>
192 * expression.cs (ComposedCast): Check for arrays of TypedReference
193 before creating the type, not after.
195 2006-09-21 Marek Safar <marek.safar@seznam.cz>
197 * cfold.cs, const.cs, enum.cs, statement.cs: Updated
200 * constant.cs (Constant.ImplicitConversionRequired): Designed to used
201 when constant must be implicitly convertible.
203 * convert.cs (ImplicitReferenceConversion): Reuse ToType.
205 * ecore.cs (NullCast): Derives from NullConstant.
207 * expression.cs (Is.DoResolve): Removed useless variables.
208 (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
209 (New.Constantify): Add enum support.
210 (MemberAccess.DoResolve): Add warning when accessing null constant or
213 * generic.cs (GenericConstraints.IsReferenceType): Another dummy
216 * literal.cs (NullConstant): New abstract class with common
217 functionality for all null specializations.
218 (NullDefault): Represents default(X) when result can be
220 (NullLiteral): Updated.
222 * report.cs: Add new warning.
224 2006-09-21 Martin Baulig <martin@ximian.com>
226 * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
228 2006-09-21 Martin Baulig <martin@ximian.com>
230 * generic.cs (GenericConstraints): New dummy class.
231 (Constraints): Likewise.
232 (TypeParameter): Likewise.
233 (TypeParameterName): Likewise.
234 (GenericMethod): Likewise.
236 * typemanager.cs (TypeManager.GetGenericArguments): New method.
238 * decl.cs: Merged with the gmcs version.
240 2006-09-21 Raja R Harinath <rharinath@novell.com>
242 * generic.cs (TypeParameter): Implement IMemberContainer.
243 (GenericTypeParameterBuilder): New. An abominable repugnant hack.
245 * rootcontext.cs: Unify with gmcs version.
247 * report.cs: Unify with gmcs version.
248 * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
249 from gmcs/generics.cs.
250 * generics.cs (TypeParameter): New dummy class.
252 * support.cs: Unify with gmcs version.
254 2006-09-20 Raja R Harinath <rharinath@novell.com>
256 * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
257 * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
259 * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
260 * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
261 * mcs.exe.sources: Add generic.cs.
263 * codegen.cs: Unify with gmcs version.
265 * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
266 (EmitContext): Add GenericDeclContainer implementation.
267 * decl.cs (MemberCore, DeclSpace): Likewise.
268 * namespace.cs: Remove #ifdef GMCS_SOURCE.
270 * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
271 MCS TypeManager has a corresponding dummy method.
273 2006-09-19 Martin Baulig <martin@ximian.com>
275 * expression.cs: Completely merged with the gmcs version.
277 2006-09-19 Martin Baulig <martin@ximian.com>
279 * expression.cs (Invocation): Merged with the gmcs version.
280 (ArrayAccess.GetStoreOpcode): Likewise.
282 2006-09-19 Martin Baulig <martin@ximian.com>
285 (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
286 (TypeManager.IsGenericMethodDefinition): Likewise.
288 2006-09-19 Martin Baulig <martin@ximian.com>
291 (TypeManager.IsEqual): Moved the gmcs implementation here.
292 (TypeManager.DropGenericTypeArguments): Likewise.
293 (TypeManager.DropGenericMethodArguments): Likewise.
294 (TypeManager.GetTypeArguments): Moved here from gmcs.
295 (TypeManager.HasGenericArguments): Likewise.
297 2006-09-19 Martin Baulig <martin@ximian.com>
299 * expression.cs (Binary): Merged with the gmcs version.
301 2006-09-19 Martin Baulig <martin@ximian.com>
303 * expression.cs (Probe, As, Is): Merged with the gmcs version.
305 2006-09-19 Martin Baulig <martin@ximian.com>
307 * typemanager.cs: Merged with the gmcs version.
309 2006-09-16 Raja R Harinath <rharinath@novell.com>
311 * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
312 * driver.cs: Likewise.
314 2006-09-16 Marek Safar <marek.safar@seznam.cz>
317 * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
318 only if parent type is class.
319 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
322 2006-09-15 Marek Safar <marek.safar@seznam.cz>
325 * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
327 * typemanager.cs(CSharpName): Converts NullType to null.
329 2006-09-15 Martin Baulig <martin@ximian.com>
332 (TypeManager.GetMethodName): Added mcs implementation.
333 (TypeManager.IsEqual): Likewise.
336 (SimpleName.RemoveGenericArity): Added dummy implementation.
338 * pending.cs: Merged with the gmcs version.
340 2006-09-15 Martin Baulig <martin@ximian.com>
342 * statement.cs: Merge with the gmcs version.
344 2006-09-15 Martin Baulig <martin@ximian.com>
346 * statement.cs (Switch): Merge with the gmcs implementation
347 (without nullables), which is newer.
349 2006-09-15 Martin Baulig <martin@ximian.com>
351 * statement.cs (Block.Variables): Make this public.
352 (ToplevelBlock.Parameters): Make this a property.
353 (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
355 2006-09-15 Martin Baulig <martin@ximian.com>
357 * namespace.cs: Merge with the gmcs version.
359 2006-09-15 Martin Baulig <martin@ximian.com>
361 * decl.cs (MemberName): Minor code cleanups.
363 2006-09-15 Martin Baulig <martin@ximian.com>
365 * parameter.cs: Merge with the gmcs version.
367 2006-09-15 Martin Baulig <martin@ximian.com>
369 * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
372 2006-09-15 Martin Baulig <martin@ximian.com>
374 * flowanalysis.cs: Merged from GMCS; added the generics code into
375 a `GMCS_SOURCE' conditional so we can share this file.
377 2006-09-08 Martin Baulig <martin@ximian.com>
379 * typemanager.cs (TypeManager.interlocked_type): New public field.
380 (TypeManager.int_interlocked_compare-exchange): New public field.
381 (TypeManager.InitEnumUnderlyingTypes): Also initialize the
382 enumerator types here and call InitGenericCoreTypes().
383 (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
384 after calling InitEnumUnderlyingTypes().
387 (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
388 `classes_second_stage'.
390 2006-09-14 Marek Safar <marek.safar@seznam.cz>
392 * assign.cs, ecore.cs, expression.cs: Share error message text.
393 * class.cs (FieldMember.Define): Check for varible of static type.
394 * driver.cs (LoadAssembly): Uses error output for errors.
395 * statement.cs: Updated.
397 2006-09-08 Marek Safar <marek.safar@seznam.cz>
399 * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
402 2006-09-07 Martin Baulig <martin@ximian.com>
405 (MainDriver): Revert r62663 from Marek; see #70506 for details.
407 2006-08-29 Miguel de Icaza <miguel@novell.com>
409 * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
411 2006-08-17 Miguel de Icaza <miguel@novell.com>
413 * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
414 #52019 and #79064, the use of the \uXXXX sequence in source code
415 to represent unicode characters.
417 2006-08-15 Marek Safar <marek.safar@seznam.cz>
419 * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
421 * class.cs, ecore.cs, statement.cs: Merged to one error message.
423 2006-08-13 Miguel de Icaza <miguel@novell.com>
425 * assign.cs: Catch attempts to assign to a method groups in += and
428 2006-08-13 Marek Safar <marek.safar@seznam.cz>
431 * cs-parser.jay: Don't destroy current array type by typeof of array's.
433 2006-08-12 Marek Safar <marek.safar@seznam.cz>
435 * class.cs (Method.Define): Issue a warning when generic method looks like
437 * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
440 2006-08-09 Marek Safar <marek.safar@seznam.cz>
442 * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
444 * decl.cs (MemberCache.FindMembers): When container is interface we need to
445 search all base interfaces as a member can be ambiguous.
446 * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
447 Constructor member type filter.
448 (Delegate.ResolveConstructorMethod) Uses Constructor filter.
449 * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
450 reporting for returned memberinfos.
451 * report.cs: Updated.
452 * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
453 version to work on all runtimes.
454 (TypeManager.RealMemberLookup): Removed members filtering.
456 2006-08-08 Raja R Harinath <rharinath@novell.com>
458 * ecore.cs (FieldExpr.EmitAssign): Release temporary.
459 (PropertyExpr.EmitAssign): Likewise.
460 * expression.cs (Indirection.EmitAssign): Likewise.
461 (LocalVariableReference.EmitAssign): Likewise.
462 (ParameterReference.EmitAssign): Likewise.
463 (Invocation.EmitArguments): Likewise.
464 (ArrayAccess.EmitAssign): Likewise.
465 (IndexerAccess.EmitAssign): Likewise.
466 (This.EmitAssign): Likewise.
467 (ConditionalLogicalOperator.Emit): Likewise.
470 * codegen.cs (EmitContext.GetTemporaryLocal): Simplify. Use Stack
471 instead of ArrayList. If the hashtable has a LocalBuilder, don't
472 leave it in after returning it.
473 (EmitContext.FreeTemporaryLocal): Simplify. Update to changes.
475 2006-08-06 Marek Safar <marek.safar@seznam.cz>
477 * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
480 2006-08-03 Raja R Harinath <rharinath@novell.com>
482 Fix cs0146-3.cs and cs0146-4.cs.
483 * class.cs (TypeManager.CheckRecursiveDefinition): Check that
484 enclosing types don't depend on the current type.
486 2006-08-02 Raja R Harinath <rharinath@novell.com>
489 * class.cs (TypeContainer.DoDefineMembers): Use
490 FindBaseMemberWithSameName on Parent, since we're interested in
491 whether we hide inherited members or not.
492 (FindBaseMemberWithSameName): Make slightly more robust.
494 Fix the non-generic testcase from #77396
495 * decl.cs (DeclSpace.DeclContainer): Remove override.
497 * namespace.cs (NamespaceEntry.Doppelganger): Create slave
498 declspaces for doppelgangers too.
499 (UsingEntry): Implement IResolveContext.
500 (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace. Use
501 'this' as the resolve context.
502 (LocalAliasEntry): Likewise.
504 Implement parts of #77403
505 * roottypes.cs (RootDeclSpace): New. Used to represent the
506 toplevel declaration space. Each namespace declaration introduces
507 a "partial" root declaretion space.
508 * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
509 (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
510 * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
511 from 'current_namespace.SlaveDeclSpace'.
512 (namespace_declaration): Likewise.
513 * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
514 check. It can't happen now.
515 * decl.cs (DeclSpace.LookupType): Likewise.
516 * driver.cs (MainDriver): Sanity check.
518 2006-08-01 Raja R Harinath <rharinath@novell.com>
520 * decl.cs (DeclSpace.FindNestedType): Remove.
521 (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
522 LookupTypeContainer to get the container of the nested type.
523 * class.cs (TypeContainer.FindNestedType): Make non-override.
525 2006-07-31 Raja R Harinath <rharinath@novell.com>
527 * decl.cs (DeclSpace.PartialContainer): Move field from ...
528 * class.cs (TypeContainer.PartialContainer): ... here.
529 (TypeContainer.AddBasesForPart): New helper.
530 (MemberBase.ParentContainer): Remove. Use Parent.PartialContainer
532 * cs-parser.jay (current_class): Convert to DeclSpace.
533 (struct_declaration, interface_declaration, class_declaration):
534 Use AddBasesForPart instead of .Bases directly.
535 * const.cs, iterators.cs: Update to changes.
537 2006-07-28 Raja R Harinath <rharinath@novell.com>
539 * class.cs (TypeContainer.AddMemberType): Rename from
541 (TypeContainer.AddMember): Rename from AddToMemberContainer.
542 (AddTypeContainer): New. Combine AddClassOrStruct and
544 (AddPartial): Update. Add 'is_partial' argument.
545 * roottypes.cs: Update to changes.
546 * cs-parser.jay (push_current_class): New helper for handling
547 current_container and current_class.
548 (struct_declaration, interface_declaration, class_declaration):
551 2006-07-26 Raja R Harinath <rharinath@novell.com>
553 * roottypes.cs: Rename from tree.cs.
555 Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
556 * tree.cs (Tree, ITreeDump): Remove types.
557 * rootcontext.cs (tree, Tree): Remove fields.
558 (root, ToplevelTypes): New.
559 * *.cs: Update to rename.
561 * tree.cs (Tree.RecordDecl): Remove.
562 (RootTypes.AddToTypeContainer): Record the toplevel type in its
564 * class.cs, cs-parser.jay: Remove mention of RecordDecl.
566 2006-07-23 Raja R Harinath <harinath@gmail.com>
568 * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
569 DoFlowAnalysis and OmitStructFlowAnalysis here.
570 (ec.With): Rename from WithUnsafe and generalize.
571 (ec.WithCheckState): Remove. All users can be handled by 'With'.
572 (ec.WithFlowAnalyis): New.
573 * ecore.cs, expression.cs, statement.cs: Update.
575 2006-07-22 Raja R Harinath <harinath@gmail.com>
577 * statement.cs (Block.ResolveMeta): Simplify slightly.
579 * codegen.cs (EmitContext.Flags): New enum. Used to represent the
580 multiple boolean fields. Convert InUnsafe, constant_check_state,
581 check_state to flags.
582 (CheckState, ConstantCheckState): Update.
583 (InUnsafe): New read-only property.
584 (FlagsHandle): Rename from CheckStateHandle and convert to handle
586 (WithUnsafe): New helper similar to WithCheckState.
587 * statement.cs (Block.ResolveMeta): Use WithUnsafe.
588 (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
590 2006-07-21 Raja R Harinath <rharinath@novell.com>
592 Make comparisons use the same IL irrespective of whether they're
593 in a 'checked' or 'unchecked' context: one of the issues in #78899
594 * codegen.cs (EmitContext.CheckState): Make read-only property.
595 (EmitContext.ConstantCheckState): Likewise.
596 (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
597 helper that implement a save/restore stack for CheckState
598 values. This is the only way to change check-state.
599 * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
600 * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
601 (CheckedExpr.EmitBranchable): New forwarding method.
602 (UnCheckedExpr): Likewise.
603 * statement.cs (Block.ResolveMeta): Use WithCheckState.
604 (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
605 (Checked.Resolve, checked.DoEmit): Likewise.
607 2006-07-20 Miguel de Icaza <miguel@novell.com>
609 * anonymous.cs: Cache the resolved anonymous delegate, and return
610 this so that the ResolveTopBlock is only triggered once, not
613 Currently we trigger ResolvetopBlock twice due to a first pass of
614 argument check compatibility, and a second pass that does the
617 2006-07-15 Marek Safar <marek.safar@seznam.cz>
619 * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
621 * rootcontext.cs (Reset): Add helper_classes.
623 2006-07-15 Marek Safar <marek.safar@seznam.cz>
626 * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
629 2006-07-13 Miguel de Icaza <miguel@novell.com>
631 * statement.cs (Lock): Handle expressions of type
632 TypeManager.null_type specially. Fixes #78770
634 2006-07-08 Marek Safar <marek.safar@seznam.cz>
636 * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
639 2006-07-08 Marek Safar <marek.safar@seznam.cz>
641 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
642 for accessors as well.
643 * ecore.cs (EventExpr): Add AccessorTable.
645 2006-07-01 Marek Safar <marek.safar@seznam.cz>
648 * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
649 for CS0122 where appropriate.
650 * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
652 (Filter): Assembly can be null in the case of top level attributes.
654 2006-06-25 Marek Safar <marek.safar@seznam.cz>
658 * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
659 is done at global level.
661 2006-06-24 Marek Safar <marek.safar@seznam.cz>
663 A fix for #77002, Implemented TypeForwarder support.
665 * attribute.cs (Attribute.GetArgumentType): Reads type argument.
666 * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
667 * typemanager.cs (): Add type_forwarder_attr_type.
669 2006-06-24 Marek Safar <marek.safar@seznam.cz>
671 * report.cs: Add CS0469 warning.
673 2006-06-21 Martin Baulig <martin@ximian.com>
675 * codegen.cs (CodeGen.Save): Moved the symbol file generation into
676 the `try'-block, so we also report CS0016 etc. there.
678 2006-06-21 Martin Baulig <martin@ximian.com>
681 (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
683 2006-06-21 Martin Baulig <martin@ximian.com>
685 * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
686 also report CS1686 for parameters.
688 2006-06-21 Martin Baulig <martin@ximian.com>
690 * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
691 instead of an error if the value is not implicitly convertible to
692 the switch types; fixes #77964.
694 2006-06-21 Raja R Harinath <rharinath@novell.com>
697 * class.cs (FieldBase.ResolveInitializer): Stop resolution if
698 FieldBuilder is null.
701 * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
702 'left' and 'right' before error-checking.
704 2006-06-16 Juraj Skripsky <js@hotfeet.ch>
706 * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
708 (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
709 (FieldExpr.DoResolve): likewise.
710 (PropertyExpr.InstanceResolve): likewise.
711 (EventExpr.InstanceResolve): likewise.
713 2006-06-04 Marek Safar <marek.safar@seznam.cz>
715 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
716 attribute applicable tests for attribute argument.
718 2006-06-02 Raja R Harinath <rharinath@novell.com>
721 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
722 (Binary.OverloadResolve_PredefinedIntegral): New.
723 (Binary.OverloadResolve_PredefinedFloating): New.
724 (Binary.OverloadResolve_PredefinedString): New.
725 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
726 Follow the standard more closely, and treat numeric promotions in
727 terms of overload resolution.
728 (Binary.CheckShiftArguments): Simplify.
730 2006-06-01 Raja R Harinath <rharinath@novell.com>
732 * flowanalysis.cs (MyBitVector): Simplify representation.
733 (MyBitVector.Clone): Avoid allocating BitArray.
734 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
735 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
736 (*): Update. Change all references to MyBitVector.And and
737 MyBitVector.Or to &= and |=.
739 2006-05-29 Raja R Harinath <rharinath@novell.com>
742 * cs-parser.jay (formal_parameter_list): Extend the pattern below
743 to param arguments too.
745 2006-05-26 Miguel de Icaza <miguel@novell.com>
747 * cs-parser.jay: Catch another parsing form for arglist being
748 followed by other arguments. Fixes #78313.
750 2006-05-24 Raja R Harinath <rharinath@novell.com>
752 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
753 checking of out parameters to ...
754 (FlowBranchingToplevel.Merge): ... here.
755 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
756 set, propagate the origin upward, and only complain if there was
758 (FlowBranchingException.AddContinueOrigin): Likewise.
759 (FlowBranchingException.AddReturnOrigin): Likewise.
760 (FlowBranchingException.AddGotoOrigin): Likewise.
762 2006-05-23 Raja R Harinath <rharinath@novell.com>
764 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
765 unreachable, skip it.
766 (FlowBranchingException.Merge): Always propagate jumps, even if
767 the finally block renders subsequent code unreachable.
769 2006-05-18 Raja R Harinath <rharinath@novell.com>
772 * statement.cs (Goto.Resolve): Move responsibility for resolving
773 'goto' to FlowBranching.AddGotoOrigin.
774 (Goto.SetResolvedTarget): New. Callback to set the
775 LabeledStatement that's the target of the goto.
776 (Goto.DoEmit): Use Leave instead of Br when crossing an
777 unwind-protect boundary.
778 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
779 LookupLabel and adjust to new semantics.
780 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
781 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
782 Goto.SetResolvedTarget to update target.
783 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
784 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
785 AddBreakOrigin & co. Delay propagation until ...
786 (FlowBranchingException.Merge): ... this.
788 * statement.cs (Block.Resolve): Always depend on flow-branching to
789 determine unreachability. Kill workaround that originally emitted
790 only one statement after an "unreachable" label (see infloop in
793 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
794 This is still "wrong", but anything better would probably need a
795 multi-pass algorithm.
796 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
797 usage vector. Force current usage vector to be reachable, to
798 optimistically signify backward jumps.
799 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
801 (FlowBranchingLabeled.Merge): New. If no backward jump was
802 detected, return the original salted-away usage vector instead,
803 updated with appropriate changes. Print unreachable warning if
805 * statement.cs (Block.Resolve): Don't print unreachable warning on
808 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
810 * driver.cs: Pass filename without path to AssemblyBuilder's
811 AddResourceFile. Fixes bug #78407.
813 2006-05-17 Raja R Harinath <rharinath@novell.com>
815 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
816 * flowanalysis.cs (FlowBranchingLabeled): ... here.
817 (FlowBranching.MergeChild): Overwrite
818 reachability information from Labeled branchings too.
820 2006-05-16 Raja R Harinath <rharinath@novell.com>
822 * statement.cs (Goto.Resolve): Merge jump origins here ...
823 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
825 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
826 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
827 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
828 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
830 * statement.cs (Goto.Resolve): ... not here.
831 (Goto.Emit): Remove CS1632 check.
833 2006-05-14 Marek Safar <marek.safar@seznam.cz>
835 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
838 2006-05-11 Raja R Harinath <rharinath@novell.com>
840 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
841 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
842 (FlowBranchingException.Label): Likewise.
844 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
846 (MyBitVector.Or): Use it to avoid losing information (Count).
847 (FlowBranching.MergeOrigins): Likewise.
849 * flowanalysis.cs (UsageVector.IsDirty): Remove.
850 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
851 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
852 (UsageVector.ToString): Simplify.
853 (UsageVector.MergeSiblings): Move here from ...
854 (FlowBranching.Merge): ... here.
855 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
858 2006-05-10 Raja R Harinath <rharinath@novell.com>
860 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
861 null bitvector is treated as all-true.
863 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
864 (MyBitVector): Rationalize invariants. 'vector != null' implies
865 that we have our own copy of the bitvector. Otherwise,
866 'InheritsFrom == null' implies all inherited bits are true.
868 2006-05-09 Marek Safar <marek.safar@seznam.cz>
870 * statement.cs (LocalInfo): Add IsConstant.
871 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
872 local variable for constants.
874 2006-05-09 Raja R Harinath <rharinath@novell.com>
876 * flowanalysis.cs (MyBitVector.Empty): New.
877 (MyBitVector): Don't allow InheritedFrom to be null.
878 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
879 (UsageVector, FlowBranching): Update to changes.
881 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
882 recursion. The 'Parent == null' condition isn't sufficient for
884 (FlowBranching.AddBreakOrigin): Likewise.
885 (FlowBranching.AddContinueOrigin): Likewise.
886 (FlowBranching.AddReturnOrigin): Likewise.
887 (FlowBranching.StealFinallyClauses): Likewise.
888 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
889 (FlowBranching.CheckOutParameters): Likewise.
890 (FlowBranchingToplevel): Terminate all the above recursions here.
891 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
892 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
894 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
896 (FlowBranchingToplevel): New. Empty for now.
897 (FlowBranching.MergeTopBlock): Update.
898 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
899 branching for the anonymous delegate.
900 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
902 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
903 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
904 information at the start of the merge. Reorganize.
906 2006-05-07 Marek Safar <marek.safar@seznam.cz>
908 * class.cs (MethodData.Define): Method cannot implement interface accessor.
910 2006-05-07 Marek Safar <marek.safar@seznam.cz>
912 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
913 to newly introduced ctor.
915 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
916 message to one place.
917 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
920 2006-05-07 Marek Safar <marek.safar@seznam.cz>
922 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
924 * ecore.cs (Expression.ResolveAsConstant): Updated.
926 * statement.cs (ResolveMeta): Updated.
928 2006-05-06 Marek Safar <marek.safar@seznam.cz>
930 * cs-parser.jay: __arglist cannot be used in initializer.
932 2006-05-06 Marek Safar <marek.safar@seznam.cz>
935 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
938 2006-05-05 Raja R Harinath <rharinath@novell.com>
940 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
941 (LabeledStatement): Add 'name' parameter.
942 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
943 (Block.AddLabel): Update to changes.
944 * cs-parser.jay (labeled_statement): Likewise.
946 * flowanalysis.cs (BranchingType.Labeled): New.
947 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
948 (FlowBranchingLabeled): New. Does nothing for now, but will
949 eventually handle 'goto' flows.
950 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
951 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
952 that's terminated ...
953 (Block.Resolve): ... here.
955 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
956 (UsageVector.MergeFinallyOrigins): Likewise.
957 (FlowBranching.InTryOrCatch): Likewise.
958 (FlowBranching.AddFinallyVector): Likewise.
959 (FlowBranchingException): Update to changes.
962 * statement.cs (Return.Resolve): Move error checking to ...
963 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
964 (FlowBranchingException): Handle return origins like break and
966 (FlowBranching.UsageVector.CheckOutParameters): Remove.
968 2006-05-04 Marek Safar <marek.safar@seznam.cz>
971 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
974 2006-05-04 Marek Safar <marek.safar@seznam.cz>
977 * class.cs (MethodData.Define): Do public accessor check only when method
978 implements an interface.
980 2006-05-04 Raja R Harinath <rharinath@novell.com>
982 Remove special handling of 'break'
983 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
984 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
985 (UsageVector.Break): Remove.
986 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
988 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
990 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
991 UsageVector.Breaks (). Don't set NeedsReturnLabel.
993 2006-05-03 Marek Safar <marek.safar@seznam.cz>
996 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
997 be the interface member.
999 2006-05-03 Marek Safar <marek.safar@seznam.cz>
1002 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
1003 for emitting small (int) values.
1005 2006-05-03 Raja R Harinath <rharinath@novell.com>
1008 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
1009 control-flow passes through the 'finally' after merging-in all the
1010 control-flows from 'try' and the 'catch' clauses.
1012 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
1013 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
1014 always true at the only non-recursive entry point.
1015 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
1016 FlowBranchingBreakable.
1017 (FlowBranchingLoop): Remove.
1018 * statement.cs (Return.DoResolve): Update to changes.
1021 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
1022 (FlowBranching.CreateBranching): Handle it: create a
1023 FlowBranchingContinuable.
1024 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
1025 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
1026 except that it handles the 'continue' command.
1027 (FlowBranching.UsageVector.MergeOrigins): Rename from
1029 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
1030 except that it overrides AddContinueOrigin.
1031 (FlowBranchingException): Override AddContinueOrigin, similar to
1033 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
1034 Create a new branching around the embedded statement.
1035 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
1036 control flow after the embedded statement.
1037 (Continue.Resolve): Move all error checking to AddContinueOrigin.
1039 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
1040 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
1041 FlowBranchingBreakable.
1042 (FlowBranchingSwitch): Remove.
1045 * statement.cs (Break.Resolve): Simplify. Move responsibility for
1046 error reporting to ...
1047 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
1048 Rename from 'AddBreakVector'. Add new location argument. Return
1049 a bool indicating whether the 'break' crosses an unwind-protect.
1050 (FlowBranchingException.AddBreakOrigin): Add.
1051 (FlowBranchingException.Merge): Propagate 'break's to surrounding
1052 flowbranching after updating with the effects of the 'finally'
1054 (FlowBranchingBreakable): New common base class for
1055 FlowBranchingLoop and FlowBranchingSwitch.
1057 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
1059 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
1061 2006-05-02 Raja R Harinath <rharinath@novell.com>
1063 * statement.cs (Do.Resolve): If the loop is infinite, set the
1065 (While.Resolve, For.Resolve): Set a barrier after the embedded
1066 statement. There's no direct control flow that goes from the end
1067 of the embedded statement to the end of the loop.
1068 * flowanalysis.cs (FlowBranching.Infinite): Remove.
1069 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
1070 above ensure that the reachability is correctly computed.
1072 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
1073 (UsageVector.MergeBreakOrigins): If the current path is
1074 unreachable, treat it as if all parameters/locals are initialized.
1075 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
1076 infinite loops before merging-in break origins.
1078 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
1079 (Reachability.Reachable): Split part into ...
1080 (Reachability.Unreachable): ... this. Simplify.
1081 (Reachability.IsUnreachable): Use 'Unreachable' instead.
1083 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
1084 (Reachability.SetThrowsSometimes): Likewise.
1085 (FlowBranchingBlock.MergeTopBlock): Don't compare against
1086 TriState.Always, use corresponding property.
1087 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
1088 (Block.Resolve): Likewise. Remove some redundant checks.
1090 2006-05-02 Raja R Harinath <harinath@gmail.com>
1092 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
1093 (Reachability.Meet): Don't bother checking AlwaysThrows --
1094 barrier is always set.
1095 (FlowBranchingBlock.Merge): Likewise.
1097 2006-05-01 Raja R Harinath <harinath@gmail.com>
1099 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
1100 checks for unreachable.
1102 2006-05-01 Marek Safar <marek.safar@seznam.cz>
1105 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
1107 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
1108 whether field is really assigned.
1110 2006-04-30 Raja R Harinath <harinath@gmail.com>
1112 * flowanalysis.cs (Reachability): Make 4-argument constructor
1114 (Reachability.Meet): Rename from 'And'. Remove static variant.
1115 (Reachability.Always): Rename from the highly misleading
1116 'Reachability.Never'.
1117 (FlowBranching.Merge): Update to changes. Mark an impossible
1118 situation with a 'throw'.
1119 (*): Update to changes.
1121 2006-04-29 Raja R Harinath <harinath@gmail.com>
1123 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
1125 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
1126 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
1127 (*): Update to changes.
1128 * statement.cs: Update to changes.
1130 2006-04-28 Marek Safar <marek.safar@seznam.cz>
1133 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
1135 2006-04-28 Raja R Harinath <harinath@gmail.com>
1137 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
1140 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
1141 argument to two arguments: an usage-vector and a bool. Move call
1142 to FlowBranching.Merge () ...
1143 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
1145 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
1146 handling of loop and switch reachability to ...
1147 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
1149 2006-04-27 Raja R Harinath <harinath@gmail.com>
1151 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
1152 handling to FlowBranchingLoop.InLoop.
1153 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
1155 2006-04-26 Marek Safar <marek.safar@seznam.cz>
1158 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
1159 anonymous method is allowed from AnonymousContainer here.
1161 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
1163 2006-04-24 Raja R Harinath <rharinath@novell.com>
1166 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
1168 2006-04-23 Marek Safar <marek.safar@seznam.cz>
1171 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
1172 (DoubleConstant.Reduce): Ditto.
1174 2006-04-23 Raja R Harinath <rharinath@novell.com>
1176 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
1177 Remove 'lvalue_right_side' argument. Move parts to ...
1178 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
1179 (LocalVariable.DoResolveLValue): ... these.
1181 2006-04-21 Raja R Harinath <rharinath@novell.com>
1184 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
1185 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
1186 (LocalVariableReference.DoResolveBase): Use it to implement new
1188 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
1189 (Argument.Resolve): Simplify. Move CS1510 check ...
1190 * ecore.cs (Expression.ResolveLValue): ... here.
1191 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
1192 (PropertyExpr.DoResolveLValue): Likewise.
1193 (FieldExpr.Report_AssignToReadonly): Likewise.
1194 (FieldExpr.DoResolve): Add 'out_access' argument. Use
1195 LValueMemberAccess or LValueMemberOutAccess on instance depending
1197 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
1198 DoResolve as appropriate.
1200 2006-04-20 Raja R Harinath <rharinath@novell.com>
1203 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
1204 implicit conversions on 'out' and 'ref' arguments.
1206 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
1207 improve clarity. Remove dead code.
1210 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
1211 (Catch.Resolve): Resolve VarBlock if it exists.
1213 2006-04-19 Miguel de Icaza <miguel@novell.com>
1215 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
1216 twice, this was some residual code, the enumerator was emitted
1217 properly in the two branche of if later.
1219 2006-04-19 Raja R Harinath <rharinath@novell.com>
1221 * expression.cs (Cast.ResolveLValue): Remove. The result of a
1222 cast is never an lvalue.
1223 (Cast.DoResolve, Cast.ResolveRest): Combine.
1224 (Argument.Emit): Simplify slightly. Move 'Expr is
1225 IMemoryLocation' check ...
1226 (Argument.Resolve): ... here.
1227 (Argument.Error_LValueRequired): Remove. Inline into only user.
1229 Simplifications. Fix cs0191-2.cs
1230 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
1231 CS1649 and CS1651 to ...
1232 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
1233 the actual selection of the error code and message to a lookup
1234 table. Add a dummy return value to simplify callsites.
1235 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
1236 readonly fields of other instances of the same type. Move CS0197
1238 * expression.cs (Argument.Resolve): ... here. Simplify code.
1239 Ensure that ec.InRefOutArgumentResolving is only set during LValue
1240 resolution of an out or ref argument. The code simplification
1241 above uses this invariant.
1243 2006-04-18 Raja R Harinath <rharinath@novell.com>
1245 Possibly fix #77752. Fix cs1690-[4-7].cs.
1246 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
1247 CheckMarshallByRefAccess. Drop parameter.
1248 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
1250 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
1252 * report.cs (AllWarnings): Add CS1690.
1253 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
1255 (LocalVariableReference.DoResolveBase): Update.
1257 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1259 * class.cs (MethodOrOperator): Moved common parts from method class.
1260 detect obsolete attributes.
1261 (Method.Define): Simplified as it reuses code from base.
1262 (Constructor.ValidAttributeTargets): Fixed issue found during
1264 (Destructor.ValidAttributeTargets): Fixed issue found during
1266 (Operator): Finished refactoring set off by #78020. Operator class is now
1267 ordinary method class.
1269 * anonymous.cs: Updated.
1271 * decl.cs (DeclSpace): Add IsGeneric
1273 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1275 * class.cs (Constructor.Emit): Don't emit the attributes twice.
1277 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1279 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
1280 detect obsolete attributes.
1281 (Method.CreateEmitContext): Moved to MethodOrOperator.
1283 2006-04-09 Marek Safar <marek.safar@seznam.cz>
1286 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
1287 customized exception to make crash detection easier.
1288 (MethodOrOperator): Started to work on new base class for methods and
1290 (Method): Derives from MethodOrOperator.
1291 (Constructor.Emit): Emits its own attributes.
1292 (AbstractPropertyEventMethod.Emit): Ditto.
1293 (Operator): Derives from MethodOrOperator, will refactor fully in extra
1295 (Operator.Emit): It's temporary more tricky than should be.
1297 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
1299 * report.cs (InternalErrorException): Add ctor with inner exception.
1301 2006-04-08 Marek Safar <marek.safar@seznam.cz>
1304 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
1307 2006-04-07 Marek Safar <marek.safar@seznam.cz>
1310 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
1313 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1315 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
1316 attribute is present and Guid not.
1317 (Interface.ApplyAttributeBuilder): Ditto.
1319 * attribute.cs: Add error message.
1321 2006-04-06 Marek Safar <marek.safar@seznam.cz>
1325 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
1326 sources (it's composite) so hold them in extra array as they are used in
1327 Emit phase only. It worked in the previous versions by mistake.
1328 (Attribute.Emit): Emit attribute for more owners when exist.
1330 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
1331 it has now different behaviour.
1333 2006-04-04 Marek Safar <marek.safar@seznam.cz>
1335 * constant.cs (Constant.IsDefaultInitializer): New method.
1337 * class.cs: Updated.
1339 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
1340 re-initialize default values. It saves KBs almost for every assembly.
1341 Thanks Zoltan for the idea.
1342 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
1343 (ArrayCreation.DoResolve): Resolve only once.
1344 (ArrayCreation.Emit): Emit static initializer only when it is faster.
1345 (ArrayCreation.GetAttributableValue): Cope with optimized values.
1347 2006-04-03 Zoltan Varga <vargaz@gmail.com>
1349 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
1352 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1354 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1355 in an embedded statement too.
1357 2006-04-01 Raja R Harinath <rharinath@novell.com>
1360 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1362 2006-04-01 Marek Safar <marek.safar@seznam.cz>
1366 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1369 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1371 2006-03-31 Marek Safar <marek.safar@seznam.cz>
1373 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1376 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1377 LocalTemporary change.
1379 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1381 (ClassOrStruct.DefineFieldInitializers): Implemented static field
1382 initializers optimization.
1383 (ClassOrStruct.TypeAttr): Moved from modifiers.
1384 (Constructor.CheckBase): Don't crash when static ctor has parameters.
1385 (FieldBase.ResolveInitializer): Resolves initializer.
1386 (FieldBase.HasDefaultInitializer): New property.
1388 * cs-parser.jay: Removed message.
1390 * expression.cs (CompilerGeneratedThis): New specialization.
1392 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1394 2006-03-28 Marek Safar <marek.safar@seznam.cz>
1396 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1398 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1400 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1401 be now EnumConstants only.
1403 2006-03-27 Marek Safar <marek.safar@seznam.cz>
1405 * attribute.cs, driver.cs: Reset more caches.
1407 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1409 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1411 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1413 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1414 for easier reuse. Updated all overrides.
1415 (IntegralConstant): New base class for all integral constants.
1416 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1417 of the constant range, report custom error.
1418 (UIntConstant.Reduce): Fixed uint conversion.
1420 * ecore.cs, literal.cs: Reduce updates.
1422 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1426 * class.cs (Constructor.Define): Removed extra if for default ctors.
1427 A patch from Atsushi Enomoto.
1429 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1431 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1432 GetAttributableValue.
1434 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1437 * convert.cs (ImplicitConversionRequired): Error message moved to
1440 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1441 automatic implicit conversion of an output value.
1442 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1444 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1446 (TypeOf.GetAttributableValue): Add extra handling for object type.
1448 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1449 special error message.
1451 2006-03-25 Marek Safar <marek.safar@seznam.cz>
1453 * class.cs (Constructor.Emit): Don't crash when struct ctor is
1455 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1456 compatible with MS runtime.
1458 2006-03-23 Marek Safar <marek.safar@seznam.cz>
1460 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1461 attribute arguments here.
1463 * class.cs (Indexer.Define): The check was moved to attribute class.
1465 2006-03-22 Marek Safar <marek.safar@seznam.cz>
1467 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
1468 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
1471 2006-03-22 Raja R Harinath <rharinath@novell.com>
1473 Support ParameterDefaultValueAttribute in gmcs. Also applied to
1474 mcs to keep code differences small.
1475 * attribute.cs (Attribute.GetParameterDefaultValue): New.
1476 * typemanager.cs (parameter_default_value_attribute_type): New.
1477 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
1480 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1482 * expression.cs (StringConcat.Append): Reverted back to no warning state.
1484 2006-03-21 Marek Safar <marek.safar@seznam.cz>
1486 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1488 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1491 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
1493 * doc-bootstrap.cs : fix build.
1495 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1497 * expression.cs (StringConcat.Append): Issue a warning when empty string
1500 2006-03-20 Marek Safar <marek.safar@seznam.cz>
1502 * assign.cs (CompoundAssign.ResolveSource): Removed.
1504 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1507 * class.cs (TypeContainer.FindMethods): Removed.
1508 (TypeContainer.CheckMemberUsage): Made static.
1510 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1512 * constant.cs (CheckRange): Removed unused type argument.
1513 (CheckUnsigned): Removed unused type argument.
1515 * cs-parser.jay: Updated after MemberAccess clean up.
1516 Uses Length for empty string test.
1518 * cs-tokenizer.cs: Uses Length for empty string test.
1519 (IsCastToken): Made static.
1520 (is_hex): Made static.
1521 (real_type_suffix): Made static.
1523 * decl.cs (SetupCache): Made static.
1524 (OnGenerateDocComment): Removed unused ds argument.
1526 * delegate.cs (VerifyDelegate): Removed unused argument.
1528 * doc.cs: Uses Length for empty string test.
1530 * driver.cs: Uses Length for empty string test.
1532 * enum.cs (IsValidEnumType): Made static
1534 * expression.cs (EnumLiftUp): Removed unused argument.
1535 (ResolveMethodGroup): Ditto.
1536 (BetterConversion): Ditto.
1537 (GetVarargsTypes): Ditto.
1538 (UpdateIndices): Ditto.
1539 (ValidateInitializers): Ditto.
1540 (MemberAccess.ctor): Ditto.
1541 (GetIndexersForType): Ditto.
1543 * flowanalysis.cs: (MergeFinally): Removed unused argument.
1545 * iterators.cs: Updated after MemberAccess clean up.
1547 * location.cs: Uses Length for empty string test.
1549 * namespace.cs: Uses Length for empty string test.
1551 * report.cs (CheckWarningCode): Made static.
1553 * statement.cs (LabeledStatement): Removed unused argument.
1555 * typemanager.cs (FilterNone): Removed.
1557 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1559 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1562 * class.cs: Updated.
1564 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1566 * cs-parser.jay.cs: __arglist is not allowed for delegates.
1568 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1572 * expression.cs (VerifyArgumentsCompat): Reverted to double error
1573 reporting, it's more tricky than I thought.
1575 2006-03-18 Marek Safar <marek.safar@seznam.cz>
1579 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
1581 (AnonymousMethod.ImplicitStandardConversionExists): New method.
1582 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1583 Add more error reporting; Fixed issue with params.
1585 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1587 * cs-parser.jay: AnonymousMethod requires host container.
1589 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1591 2006-03-18 Raja R Harinath <harinath@gmail.com>
1593 * class.cs: Change 'TypeContainer ds' constructor argument to
1594 'DeclSpace parent'. Some classes were missed below due to
1595 different naming convention.
1597 * class.cs (MemberCore.Parent): Delete. This makes the
1598 ParentContainer changes below enforceable by the compiler.
1600 Treat pointers to enclosing declaration space as 'DeclSpace', not
1602 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1603 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1605 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1607 (Block.AddThisVariable): Likewise.
1608 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1609 (AbstractPropertyEventMethod.Emit): Likewise.
1610 (AbstractPropertyEventMethod.EmitMethod): Likewise.
1611 (GetMethod.Define, SetMethod.Define): Likewise.
1612 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1613 (DelegateMethod.EmitMethod): Likewise.
1615 Fix regression test-partial-13.cs.
1616 Rationalize use of PartialContainer. Ensure that the partial
1617 class semantics can be tied to type-correctness, i.e., any
1618 violation will cause a compile error.
1619 * class.cs, const.cs: Access all fields that belong to class
1620 TypeContainer via ParentContainer. Arguments of EmitContexts and
1621 Resolve()-like functions still use 'Parent'.
1623 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1624 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1625 (PropertyMethod.CheckModifiers): Remove unused argument.
1626 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1629 2006-03-17 Raja R Harinath <harinath@gmail.com>
1631 Make semantics of PartialContainer simpler.
1632 * decl.cs (DeclSpace.IsPartial): Remove.
1633 * class.cs (TypeContainer.IsPartial): Likewise.
1634 (TypeContainer..ctor): Set PartialContainer to point to self.
1635 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1636 (TypeContainer.FindNestedType): Likewise.
1637 (MemberCore.ParentContainer): Simplify. Remove deprecation.
1639 2006-03-17 Marek Safar <marek.safar@seznam.cz>
1641 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1643 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1645 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1648 2006-03-15 Marek Safar <marek.safar@seznam.cz>
1650 * class.cs (Operator.Define): An error for base conversion was not
1653 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
1655 * iterator.cs : yield break is allowed in try statement which has
1656 catch clauses. Fixed bug #77767.
1658 2006-03-13 Marek Safar <marek.safar@seznam.cz>
1660 A fix for #77593, #77574.
1662 * class.cs (MethodCore.CheckBase): Another if for operator.
1664 2006-03-09 Marek Safar <marek.safar@seznam.cz>
1666 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1669 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1670 (DelegateCreation.ImplicitStandardConversionExists): New method for just
1673 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1676 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
1677 Updated after another emitcontext usage was clean up. It should help us to
1678 synchronize with gmcs easier.
1680 2006-03-04 Marek Safar <marek.safar@seznam.cz>
1684 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1685 (Event.Define): ditto
1686 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1688 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1689 Removed redundant code and set NewSlot for Invoke method too.
1691 * parameter.cs (Parameters.ctor): Add custom, type ctor.
1692 (Parameters.MergeGenerated): New method. Use this method when you merge
1693 compiler generated argument with user arguments.
1695 2006-03-03 Marek Safar <marek.safar@seznam.cz>
1697 * attribute.cs (ResolveAsTypeTerminal): Removed.
1699 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1700 specialization for predefined types; 30% speed up.
1701 Finally placed obsolete check to right place.
1702 (Expression.ResolveType): Removed.
1704 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1705 Updated after ResolveType was removed.
1707 * expression.cs (Cast.ctor): Check void cast.
1708 (Binary.ResolveAsTypeTerminal): Is never type.
1709 (Conditional.ResolveAsTypeTerminal): Is never type.
1711 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1713 2006-03-01 Raja R Harinath <rharinath@novell.com>
1716 * expression.cs (ParameterReference.DoResolveBase): Change return
1718 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1722 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1725 * typemanager.cs (GetFullNameSignature): Don't nullref on
1726 protected accessors.
1728 2006-02-27 Marek Safar <marek.safar@seznam.cz>
1730 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1731 these two separated members to simplify the code.
1732 (Attribute.Resolve): Refactored to use new fields and methods.
1733 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1734 implemented obsolete attribute checking.
1735 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1736 implemented obsolete checking again. It look line never ending quest ;-)
1737 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1739 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1741 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1743 *class.cs (Property.Define): Add RegisterProperty call.
1745 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1746 argument groups (only 2).
1748 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1749 encoding expression to arguments.
1750 (Expression.ExprClassToResolveFlags): Just turned to property.
1752 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1753 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1754 optimized as well as implemented support for zero-length attributes.
1756 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1757 Add caching of PropertyInfo's.
1759 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1761 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1762 error multiple times.
1764 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1766 New partial class implementation.
1767 A fix for #77027, #77029, #77403
1769 * attribute.cs (Attributable): Made attributes protected.
1771 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1772 the replacements of ClassPart and PartialContainer.
1773 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1774 (TypeContainer.AddInterface): Ditto.
1775 (TypeContainer.AddPartial): The main method for partial classes. It checks
1776 for errors and merges ModFlags and attributes. At the end class is added to
1778 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1780 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1781 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1782 from the rest of partial classes.
1783 (TypeContainer.GetClassBases): Simplified.
1784 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1786 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1787 (TypeContainer.HasExplicitLayout): Uses Flags now.
1788 (PartialContainer): Removed.
1789 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1790 (StaticClass): Was merged with Class.
1791 (Class.GetClassBases): class and static class bases are verified here.
1792 (Class.TypeAttr): Added static attributes when class is static.
1793 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1794 (MemberBase): In some cases we need to call parent container for partial
1795 class. It should be eliminated but it's not easy now.
1797 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1799 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1800 partial classed to accumulate class comments.
1801 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1803 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1805 * driver.cs (MainDriver): Tree.GetDecl was removed.
1807 * modifiers.cs (Modifiers): Add partial modifier.
1809 * tree.cs (Tree.decl): Removed.
1810 (RootTypes): Started to use this class more often for root types
1813 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1817 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1818 external interface does not have an attribute.
1820 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1822 Another prerequisites for new partial classs implementation.
1824 * attribute.cs (Attribute.Equal): Implemented.
1825 (Attribute.Emit): Changed as attributes can be applied more than twice.
1826 (Attributes.Emit): Check for duplicate attributes here.
1828 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1829 as a parameter, clean-up.
1831 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1835 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1836 contains obsolete attribute check which can in some cases look for base
1837 type of current class which is not initialized yet.
1838 (TypeContainer.BaseType): Replacement of ptype.
1840 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1842 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1844 First of prerequisites for new partial classs implemention.
1846 * attribute.cs (Attributable): Extended by ResolveContext;
1847 Attributes finally have correct context for resolving in all cases.
1848 (AttachTo): Attribute owner is assigned here.
1850 * codegen.cs (IResolveContext): Introduce new interface to hold
1851 all information needed in resolving phase.
1852 (EmitContext): Implements IResolveContext; more clean-up needed here.
1854 * decl.cs (MemberCore): Implemented IResolveContext.
1856 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1857 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1858 parameter.cs, statement.cs, tree.cs, typemanager.cs:
1859 Refactored to use new IResolveContext instead of EmitContext; cleanup
1861 2006-02-06 Miguel de Icaza <miguel@novell.com>
1863 * codegen.cs (EmitScopeInitFromBlock): check here the
1864 capture_context, there is no need to make two calls to the
1867 * anonymous.cs: Add some debugging messages that might help me
1868 track other instances of this problem in the future (the
1869 regression of test 467).
1871 * cs-parser.jay: track the variable block, as we need to initalize
1872 any captured variables declared in this block for the "catch"
1873 portion of the "Try" statement.
1875 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1876 scope initialization for captured variables.
1878 Also, move the emit for the variables after the block location has
1881 2006-02-06 Marek Safar <marek.safar@seznam.cz>
1883 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1885 2006-02-02 Miguel de Icaza <miguel@novell.com>
1887 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1888 commit yesterday, the initialization for the roots is necessary.
1889 What is not necessary is the scope activation.
1891 2006-02-02 Raja R Harinath <rharinath@novell.com>
1893 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1894 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1896 (Argument.Resolve): Remove CS0206 checks.
1898 2006-02-01 Miguel de Icaza <miguel@novell.com>
1900 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1901 scopes for all the roots, the scopes will now be emitted when the
1902 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1904 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1905 code. This reduces a lot of existing cruft.
1907 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1908 that the ScopeInfo is generated as we enter the scope, not at the
1909 time of use, which is what we used to do before.
1911 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1912 every time a Block is about to be emitted if we have a
1915 2006-02-01 Raja R Harinath <rharinath@novell.com>
1917 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1919 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1921 * typemanager.cs (cons_param_array_attribute): Make private.
1922 (Reset): Set it to null.
1923 (InitCoreHelpers): Don't initialize it.
1924 (ConsParamArrayAttribute): New. Initialize it as needed.
1925 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1927 2006-01-31 Miguel de Icaza <miguel@novell.com>
1929 * expression.cs: There might be errors reported during the
1930 selection of applicable methods. If there are errors, do not
1931 continue execution as it will lead the compiler to crash.
1933 2006-01-30 Miguel de Icaza <miguel@novell.com>
1935 * expression.cs: Member access is not allowed on anonymous
1936 methods. Fixes #77402.
1938 2006-01-30 Raja R Harinath <rharinath@novell.com>
1941 * cs-parser.jay (VariableDeclaration): Don't set
1942 current_array_type to null.
1943 (field_declaration, event_declaration, declaration_statement):
1944 Set it to null here.
1946 2006-01-28 Raja R Harinath <harinath@gmail.com>
1948 * typemanager.cs (GenericParameterPosition): New.
1951 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
1953 * doc.cs : To process "include" elements, first we should create
1954 another list than XmlNodeList, because it could result in node
1955 removal, which could result in that the XmlNodeList gives up
1958 (Also made code identical to gmcs again.)
1960 2006-01-25 Miguel de Icaza <miguel@novell.com>
1962 * ecore.cs: Introduce an error report that we were not catching
1963 before, if not silent, we must report the error. Gonzalo ran into
1966 2006-01-23 Miguel de Icaza <miguel@novell.com>
1968 A fix for bug: #76957
1970 * iterators.cs (MoveNextMethod.CreateMethodHost): call
1971 ComputeMethodHost before creating the method, this is a new
1974 * anonymous.cs (AnonymousContainer): Now we track all the scopes
1975 that this method references (RegisterScope). The actual scope
1976 where the method is hosted is computed with the ComputeMethodHost
1977 before we create the method.
1979 Moved the Deepest routine here.
1981 (AnonymousContainer.ComputeMethodHost): New routine used to
1982 compute the proper ScopeInfo that will host the anonymous method.
1984 (ScopeInfo): Deal with multiple roots. The problem was that we
1985 did not have a unique root where all ScopeInfos could be hanged
1986 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
1989 Remove AdjustMethodScope which is now computed at the end. Remove
1990 LinkScope which did a partial link, instead link all ScopeInfos
1991 before code generation from the new "LinkScopes" routine.
1993 Simplify all the Add* routines as they no longer need to maintain
1994 the tree, they just need to record that they are using variables
1997 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1998 routines to produce the forest of ScopeInfo trees.
2000 * class.cs (TypeContainer.AppendMethod): This is just like
2001 AddMethod, but ensures that an interface implementation method
2002 (IEnumerable.XXX) is not inserted at the beginning of the queue of
2003 methods, but at the end.
2005 We use this functionality to ensure that the generated MoveNext
2006 method in the iterator class is resolved/emitted before the
2007 enumerator methods created.
2009 This is required because the MoveNext method computes the right
2010 ScopeInfo for the method. And the other methods will eventually
2011 need to resolve and fetch information computed from the anonymous
2014 2006-01-21 Raja R Harinath <harinath@gmail.com>
2015 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2018 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
2020 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
2021 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
2023 2006-01-18 Raja R Harinath <rharinath@novell.com>
2025 Fix #76656, cs0231-2.cs.
2026 * cs-parser.jay (formal_parameter_list): Make error case catch
2028 (parenthesized_expression_0): Add CS1026 check.
2029 (invocation_expression): Remove unused { $$ = lexer.Location }.
2031 2006-01-17 Raja R Harinath <rharinath@novell.com>
2034 * cs-parser.jay (statement_expression): Don't list out the
2035 individual statement-expressions. Convert syntax error into
2038 2006-01-16 Raja R Harinath <rharinath@novell.com>
2041 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
2042 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
2043 CheckIntermediateModification.
2044 (FieldExpr.DoResolve): Add new two-argument version that
2045 allows us to resolve the InstanceExpression as an lvalue.
2046 The one-argument variant is now just a wrapper.
2047 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
2048 Resolve the lhs as an lvalue if the it has a value type.
2049 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
2050 from Assign.DoResolve.
2051 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
2052 resolved as an lvalue.
2053 (PropertyExpr.DoResolve): Update.
2054 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
2055 has a value type. Move CS1612 check here from
2056 CheckIntermediateModification.
2057 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
2058 * expression.cs (EmptyExpression.OutAccess): New. Used as the
2059 'right_side' of a ResolveLValue on an 'out' argument.
2060 (EmptyExpression.LValueMemberAccess): New. Used as the
2061 'right_side' of a propagated ResolveLValue on a value type.
2062 (LocalVariableReference.DoResolveBase): Recognize
2063 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
2065 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
2066 EmptyExpression.Null.
2068 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
2070 * typemanager.cs : added IsGenericParameter(). In mcs it always
2072 * doc.cs : for generic parameters, use GenericParameterPosition,
2075 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
2077 * expression.cs: Fix Console.WriteLine ((this = x).foo);
2079 2006-01-12 Miguel de Icaza <miguel@novell.com>
2081 This fixes the problem where we used ldfld instead of ldflda to
2082 load the "THIS" pointer on captured parameters, when THIS is a
2083 value type. See bug #77205.
2085 * iterators.cs (CapturedThisReference.Emit): Pass false to
2086 EmitThis (we do not need the address).
2088 * codegen.cs (EmitThis): it needs to know whether we need the
2089 address of `this' or not. This is used by value types.
2091 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
2092 every other call passes false.
2094 2006-01-12 Raja R Harinath <rharinath@novell.com>
2097 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
2099 * expression.cs (Invocation.OverloadResolve): Update.
2100 (Invocation.DoResolve): Avoid double resolution of invocation.
2102 2006-01-11 Raja R Harinath <rharinath@novell.com>
2105 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
2106 unary negation of floating point types as 0-expr; negation cannot
2107 overflow in floating point types.
2110 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
2111 on operands of 'void' type.
2114 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
2115 and ExclusiveOr for boolean constants too.
2117 2006-01-09 Raja R Harinath <rharinath@novell.com>
2120 * expression.cs (Invocation.OverloadResolve): Replace reflected
2121 override methods with their base virtual methods, rather than
2123 * typemanager.cs (TypeManager.GetOverride): New.
2125 2006-01-05 Jb Evain <jbevain@gmail.com>
2127 * class.cs (Property.Define, Indexer.Define): do not tag the
2128 properties as SpecialName | RTSpecialName.
2130 2006-01-04 Miguel de Icaza <miguel@novell.com>
2132 * class.cs (MethodCore.IsDuplicateImplementation): This method was
2133 doing a low-level comparission of parameter types. It was lacking
2134 a check for __argslist.
2136 2005-12-30 Miguel de Icaza <miguel@novell.com>
2138 * expression.cs (ParameterReference.DoResolveBase): Allow
2139 reference parameters if they are local to this block.
2141 This allows the ref and out parameters of a delegate to be used in
2142 an anonymous method, for example:
2144 delegate void set (out int x);
2146 set s = delegate (out int x){
2150 This is used by functionality introduced late in the C# language.
2152 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2153 method that take ref and out parameters.
2155 Fixes #77119 which was a late change in the spec.
2157 2005-12-23 Miguel de Icaza <miguel@novell.com>
2159 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2160 parent if its the same scope. Fixes #77060.
2162 2005-12-21 Miguel de Icaza <miguel@novell.com>
2164 * driver.cs: Report the case of no source files and no -out:
2167 2005-12-20 Raja R Harinath <rharinath@novell.com>
2170 * expression.cs (ComposedCast.GetSignatureForError): Define.
2172 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2176 * namespace.cs (NamespaceEntry): Add extern_aliases as a
2177 ListDictionary, to contain the ExternAliasEntry entries (in
2178 addition to the NamespaceEntry.aliases hashtable). This field is
2179 shared between the original entry and its doppelganger (bodyless
2181 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2182 extern_aliases field.
2183 (NamespaceEntry.Lookup): Move the IsImplicit check after the
2184 lookup in extern_aliases.
2186 2005-12-16 Raja R Harinath <rharinath@novell.com>
2189 * class.cs (TypeContainer.Mark_HasEquals): New.
2190 (TypeContainer.Mark_HasGetHashCode): New.
2191 (ClassPart): Override them.
2192 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2195 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2196 'parent' argument to the base constructor.
2198 Remove all mention of TypeContainer from decl.cs.
2199 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2200 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2201 (DeclSpace.DeclSpace): Likewise.
2202 (DeclSpace.DefineMembers): Remove unused argument.
2203 * cs-parser.jay (pop_current_class): Update to changes. Simplify
2204 debugging check -- we don't care if the debug code throws an
2205 InvalidCastException instead of an InternalErrorException.
2206 * class.cs (TypeContainer.DefineMembers): Update to changes.
2207 (TypeContainer.DoDefineMembers): Likewise.
2208 (TypeContainer.GetMethods): Likewise.
2209 (PropertyMember.Define): Likewise.
2210 (MemberBase.Parent): New property that forwards to
2211 MemberCore.Parent, but ensures that we get a TypeContainer.
2212 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2213 (RootContext.PopulateTypes): Likewise. Remove special case code
2214 for !RootContext.StdLib: DefineMembers is idempotent.
2216 2005-12-14 Miguel de Icaza <miguel@novell.com>
2218 * convert.cs (ExplicitConversionCore): Check the return value from
2219 ExplicitConversionCore which can return null on failure. Fixes #76914
2221 2005-12-13 Marek Safar <marek.safar@seznam.cz>
2223 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2225 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
2227 * doc.cs : The search for referenced namespace was insufficient to
2228 get global one as it used to do. Fixed bug #76965.
2230 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
2232 * doc.cs : check name in cref in the last phase that whether it is
2235 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2237 * cs-tokenizer.cs : reverted the latest change: it somehow broke
2240 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2242 * doc.cs : so it turned out that we cannot skip override check for
2243 interface members. Fixed bug #76954.
2245 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
2247 * cs-tokenizer.cs : fixed bug #75984:
2248 - #warning and #error should not be handled when the source line
2250 - #line is not checked strictly when the source line is disabled.
2251 - #define and #undef is on the other hand checked strictly at any
2254 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
2256 * cs-tokenizer.cs : missing Location (actually, filename) in one of
2259 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2261 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2263 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2265 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2266 (FieldBase.Initializer): Initializer is now optional.
2267 (EventField.Define): Only event field can have initializer.
2269 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2271 * const.cs (Const): Reuse initializer.
2273 * cs-parser.jay: Updated after FieldBase changes.
2274 Added current_array_type to simplify array initializers.
2276 * ecore.cs (NullCast.IsDefaultValue): Implemented.
2278 * expression.cs, iterators.cs: Updated.
2280 * namespace.cs (NamespaceEntry): Made UsingFound private.
2282 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2284 * parameterCollection.cs: Obsolete, removed.
2285 * parser.cs: Obsolete, removed.
2287 2005-12-05 Marek Safar <marek.safar@seznam.cz>
2290 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2292 * enum.cs (Enum.Define): Set obsolete context here.
2294 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2297 - FindDocumentedMember() now expects 1) paramList as null
2298 when "we don't have to check the number of parameters" and
2299 2) Type.EmptyTypes when "there is no arguments".
2300 - Introduced FoundMember struct to hold the exact type which was
2301 used to find the documented member (the above change broke
2302 test-xml-044; it might be better just to use DeclaringType than
2303 what MS does, like this change does, but it depends on usage.)
2305 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
2307 * doc.cs : documented member might be from DeclaringType for nested
2308 types. Fixed bug #76782.
2310 2005-12-03 Ben Maurer <bmaurer@ximian.com>
2312 * anonymous.cs: Have the param code handle leaving copies on the
2313 stack etc. Allows anonymous params to take part in the assignment
2314 code (++, +=, etc). Fixes bug #76550
2316 * expression.cs: Handle the prepare_for_load/leave_copy by passing
2317 it down to the anon code.
2319 * iterators.cs: Use dummy var here
2321 * codegen.cs: Handle new vars
2323 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2326 * class.cs (MethodData.Define): Set proper Obsolete context.
2328 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2330 (FieldExpr.DoResolve): Ditto.
2332 2005-12-01 Marek Safar <marek.safar@seznam.cz>
2335 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2336 parent is not obsolete.
2338 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
2340 * doc.cs : (FindDocumentedMember) find parameterless members first
2341 and get CS0419 in the early stage. Fixed first case of bug #76727.
2343 2005-11-30 Marek Safar <marek.safar@seznam.cz>
2346 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2347 no error was reported.
2349 *expression.cs (Binary.DoResolve): left can be null.
2351 2005-11-22 Marek Safar <marek.safar@seznam.cz>
2354 * class.cs (MethodData.Emit): Parameters should be labeled first.
2356 2005-11-21 Marek Safar <marek.safar@seznam.cz>
2359 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2361 2005-11-18 Marek Safar <marek.safar@seznam.cz>
2363 * attribute.cs (AreParametersCompliant): Moved to Parameter.
2365 * class.cs (MethodCore): Parameter clean up.
2366 (IMethodData): Added ParameterInfo.
2367 (MethodData): Parameter clean up.
2368 (Indexer.Define): Parameter clean up.
2380 * typemanager.cs: Parameter clean up.
2382 * delegate.cs (Define): Get rid of duplicated code.
2384 * expression.cs (ParameterReference): Removed useless parameters
2386 (Invocation): Ditto.
2388 * parameter.cs (ParamsParameter): New class, params specialization.
2389 (ArglistParameter): Attemp to separate arglist.
2390 (Parameter): Refactored to be reusable and faster.
2391 (Parameter.Modifier): Made understandable.
2392 (Parameters): Changed to be used as a class for `this' assembly
2393 parameters. Refactored to use new specialized classes.
2395 * support.cs (ParameterData): Added Types property.
2396 (InternalParameters): Deleted.
2398 2005-08-20 Martin Baulig <martin@ximian.com>
2400 Merging this patch from GMCS to fix #75867.
2402 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2403 scope if we don't already have it.
2405 2005-11-17 Martin Baulig <martin@ximian.com>
2408 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2409 inherit the scope from our parent. Fixes #76653.
2411 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2413 * doc.cs : the previous patch does not actually fix the bug.
2414 PropertyInfo override check is now implemented and really fixed it.
2415 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2417 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2419 * doc.cs : apply "override filter" also to properties.
2422 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2424 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2425 no need to check overrides. For classes, omit those results from
2426 interfaces since they must exist in the class. Fixed bug #76726.
2428 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2430 * typemanager.cs : (GetFullNameSignature) differentiate indexers
2431 with different parameters. Fixed the second problem in #76685.
2433 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2435 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2436 get expected 'protected' access in CheckValidFamilyAccess()).
2439 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2441 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2442 Fixed bug #76705. CS1569 was incorrectly commented out.
2444 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2446 * doc.cs : use Invocation.IsOverride() to do real override check.
2447 * expression.cs : made Invocation.IsOverride() internal.
2449 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2451 * doc.cs : use TypeManager.FindMembers() instead of (possible)
2452 TypeBuilder.FindMembers() and filter overriden base members out.
2455 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2457 * doc.cs : ref/out parameters are represented as '@' (instead of
2458 '&' in type FullName). Fixed bug #76630 (additionally crefs).
2460 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2462 * doc.cs : when there was no '.' in cref to methods in doc comment,
2463 then parameters were missing in the output. Fixed bug #76691.
2465 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2467 * driver.cs : don't output docs when there is an error.
2470 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2473 Now it should detect indexers. Fixed primary concern in bug #76685.
2474 Fixed CS0419 message to not show the identical member signature in
2477 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2479 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2480 instead of Type.FindMembers() since it does not handle events.
2483 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
2485 * codegen.cs: Fixed typo (speficied -> specified).
2487 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2490 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2492 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2494 * attribute.cs: Changed error message.
2496 * cs-tokenizer.cs: One more check.
2498 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2500 * statement.cs (Block.Resolve): Ignore empty statement.
2502 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2504 * report.cs: Made error/warning methods more strict to avoid
2507 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2508 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2509 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2510 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2512 2005-11-08 Marek Safar <marek.safar@seznam.cz>
2514 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2515 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2517 * class.cs (TypeContainer.IsComImport): New property.
2518 (Constructor.Define): Create proper ctor for ComImport types.
2520 * expression.cs (New.CheckComImport): Fixed.
2522 2005-11-07 Miguel de Icaza <miguel@novell.com>
2524 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2525 that a parameter has been captured does not mean that we do not
2526 have to do the rest of the processing. This fixes the second part
2527 of #76592. If there was another anonymous method capturing
2528 values in the past, the Scope would never be set for the second
2529 method that captured the same parameter.
2531 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2532 properly manipulate the stack. Second part of fix for #76592.
2534 * expression.cs (New): Add support for invoking "new" on
2535 interfaces that have been flagged with the ComImport attribute and
2536 the CoClass. Fixes #76637
2538 * statement.cs (Try.DoEmit): When a variable is captured, do not
2539 try to emit the vi.LocalBuilder variable as it has been captured.
2540 Create a temporary variable and store the results on the
2541 FieldBuilder. Fixes #76642
2543 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2545 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2547 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2549 * expression.cs (Binary.DoResolve): Added && optimalization.
2551 * typemanager.cs (AddUserType): Removed useless argument.
2553 2005-11-04 Marek Safar <marek.safar@seznam.cz>
2555 * statement.cs (Block.variables): Uses ListDictionary.
2557 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2560 * class.cs (PartialContainer.EmitType): Customized to emit
2561 security attributes.
2562 (ClassPart.ApplyAttributeBuilder): Transform security attribute
2563 for partial classes.
2565 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2568 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2569 access has to be fixed.
2571 * typemanager.cs (IsUnmanagedType): Wrong common field type.
2573 2005-11-01 Marek Safar <marek.safar@seznam.cz>
2576 * ecore.cs (NullCast.Reduce): Implemented.
2578 * expression.cs (ArrayCreation.CheckIndices): Correcly check
2581 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2583 (Foreach.Resolve): Catch null properly.
2585 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2587 * cs-tokenizer.cs: Warning text fix.
2589 * driver.cs: AllWarningNumbers exposed on public interface.
2591 * report.cs (): Reviewed warning numbers.
2592 (IsValidWarning): Use binary search.
2594 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2596 * driver.cs: Implemeted resource visibility.
2597 (Resources): New class for code sharing between /res: and
2600 2005-10-28 Marek Safar <marek.safar@seznam.cz>
2603 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2606 * convert (Convert.ImplicitReferenceConversion): NullCast holds
2609 * ecore.cs (NullCast): Child is contant only.
2611 * literal.cs (NullLiteral.Reduce): null can be converted to any
2614 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
2616 * driver.cs: Use Encoding.Default as default code page instead
2619 2005-10-27 Raja R Harinath <rharinath@novell.com>
2622 * expression.cs (Invocation.Error_InvalidArguments): Handle
2623 __arglist parameters.
2624 (Invocation.VerifyArgumentsCompat): Likewise.
2625 * support.cs (ReflectionParameters.GetSignatureForError): Print
2626 __arglist parameters.
2627 (InternalParamters.GetSignatureForError): Likewise.
2628 * parameter.cs (Parameters.GetSignatureForError): Likewise.
2630 2005-10-26 Marek Safar <marek.safar@seznam.cz>
2632 * attribute.cs (GetPropertyValue): Made public.
2634 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2636 Add new property WrapNonExceptionThrows to handle 2.0 assembly
2638 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2641 * driver.cs: Reflect method name change.
2643 * statement.cs (Try.Resolve): Warn when try has both general
2646 * typemanager.cs: runtime_compatibility_attr_type new predefined
2649 2005-10-26 Raja R Harinath <harinath@gmail.com>
2652 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2653 treat it as an empty parameter list.
2655 2005-10-26 Raja R Harinath <rharinath@novell.com>
2658 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
2659 ResolveAsTypeStep silent.
2660 * statement.cs (Block.AddConstant): Mark block as used.
2661 (Block.ResolveMeta): Avoid piling on error messages
2662 if a constant initializer resolution fails.
2664 2005-10-25 Raja R Harinath <rharinath@novell.com>
2666 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2668 (NamespaceEntry.VerifyAllUsing): New.
2669 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
2670 behaviour. Delegates actual resolution of alias to ...
2671 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
2672 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2674 * driver.cs (Driver.MainDriver): Update.
2676 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2677 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2679 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2681 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2682 RootNamespace.DefineNamespacesForAll.
2684 2005-10-24 Raja R Harinath <harinath@gmail.com>
2686 * typemanager.cs (assemblies, external_aliases, modules)
2687 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2688 (ComputeNamespaces, GetRootNamespace): Remove extra staging
2689 overhead. Move resposibility ...
2690 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
2691 * driver.cs, attribute.cs, codegen.cs: Update to changes.
2693 2005-10-23 Raja R Harinath <harinath@gmail.com>
2695 * namespace.cs (RootNamespace.all_namespaces): Renamed from
2696 cached_namespaces. Improve usage.
2697 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2698 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2699 Move from GlobalRootNamespace and simplify.
2700 (RootNamespace.Global): Make instance variable.
2701 (RootNamespace.RootNamespace): Add "alias name" parameter.
2702 (GlobalRootNamespace): Simplify drastically.
2703 (Namespace.Lookup): Don't use GetNamespace.
2704 * typemanager.cs (GetRootNamespace): Rename from
2705 ComputeNamespaceForAlias.
2706 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2708 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2710 * anonymous.cs (AnonymousContainer): Don't crash when container
2713 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2715 * expression.cs (Binary.DoResolve): Warn when comparing same
2718 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2721 * expression.cs (Binary.DoResolve): It looks like there are no
2722 convetsion rules in enum context.
2724 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2726 Add support for extern alias qualifiers.
2727 * typemanager.cs: Move some LookupTypeReflection code
2728 to namespace.cs, to have cleaner code. Added some methods
2729 to help us keep track of the extern aliased references.
2730 * driver.cs: Add suport for extern alias assemblies on command
2731 line and check for their warnings/errors. Also keep track of the
2732 extern aliased assemblies.
2733 * namespace.cs: Move the global functionality of Namespace
2734 to GlobalRootNamespace/RootNamespace. Now the global namespace
2735 is GlobalRootNamespace.Globa. Also the code moved from
2736 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
2737 Finally added LocalAliasEntry (AliasEntry before) and
2738 ExternAliasEntry, to handle alias statements.
2739 * cs-parser.jay: Add support in the grammar for extern alias
2741 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
2742 Update callings to Namespace (now in GlobalRootNamespace).
2744 2005-10-18 Raja R Harinath <rharinath@novell.com>
2747 * class.cs (TypeContainer.DefineType): Move updating of
2748 topological sort earlier in the code.
2749 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2751 2005-10-18 Marek Safar <marek.safar@seznam.cz>
2754 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2756 * constant.cs (Constant.TryReduce): Moved from Cast class.
2757 (Reduce): Made little bit more OO and fixed missing conversions.
2759 * ecore.cs (Reduce): Implemented.
2760 (Binary.EnumLiftUp): New method to upgrade values to enum values.
2762 * literal.cs (Reduce): Implemented.
2764 * class.cs: Reverted Miguel's wrong commit.
2766 2005-10-14 Miguel de Icaza <miguel@novell.com>
2768 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2770 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
2772 * cs-parser.jay, expression.cs : CS0214 was missing error location
2773 for constants. Fixed bug #76404.
2775 2005-10-11 Marek Safar <marek.safar@seznam.cz>
2778 * convert.cs (ExplicitConversionCore): Fixed object->enum
2781 2005-10-10 Raja R Harinath <rharinath@novell.com>
2783 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2785 (PropertyExpr.EmitCall): Likewise.
2786 * expression.cs (Invocation.EmitArguments): Handle case where
2788 (Invocation.EmitCall): Avoid allocating temporary variable if
2789 there are no arguments.
2791 2005-10-07 Raja R Harinath <rharinath@novell.com>
2794 * convert.cs (ImplicitConversionStandard): Move conversion of
2795 void* to arbitrary pointer types ...
2796 (ExplicitConversionStandard): .. here.
2797 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2798 error to always print typenames.
2800 2005-10-07 Raja R Harinath <rharinath@novell.com>
2802 * convert.cs (GetConversionOperator): Rename from
2803 GetConversionOperators. Move operator selection code from ...
2804 (UserDefinedConversion): ... here.
2806 2005-10-06 Marek Safar <marek.safar@seznam.cz>
2808 * convert.cs (ExplicitConversionCore): Removed duplicate enum
2811 2005-10-05 Marek Safar <marek.safar@seznam.cz>
2813 * assign.cs (Assign.DoResolve): Error method changed.
2815 * cfold.cs (DoConstantNumericPromotions): Error method changed.
2817 * const.cs (ResolveValue): Reset in_transit immediately.
2819 * constant.cs: Error method changed.
2821 * convert.cs: Removed useless location parameter.
2822 (ExplicitNumericConversion): Don't do double enum check.
2823 (ExplicitConversionCore): Renamed from ExplicitConversion.
2824 (ExplicitUnsafe): Extracted from ExplicitConversion.
2825 (ExplicitConversion): Uses for error reporting.
2827 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2829 (ResolveBoolean): Uses common error method.
2830 (CastToDecimal): Get rid of ec.
2831 (CastFromDecimal): Optimized.
2832 (ConvCast): Get rid of ec.
2834 * enum.cs (ResolveValue): Reset in_transit immediately.
2835 (Emit): Return after first error.
2837 * expression.cs: Convert changes.
2839 * literal.cs: Error method changed.
2841 * statement.cs: Error method changed.
2843 2005-10-03 Raja R Harinath <rharinath@novell.com>
2845 * support.cs (SeekableStreamReader.Position): Don't error out when
2846 the requested position is just beyond the end of the current
2849 2005-09-28 Raja R Harinath <rharinath@novell.com>
2851 * support.cs (SeekableStreamReader): Simplify drastically. Don't
2852 try to keep in sync with the byte count of the underlying Stream.
2853 However, this limits us to a window size of 2048 characters: i.e.,
2854 the maximum lookahead of our lexer/parser can be 2048 characters.
2856 2005-09-28 Marek Safar <marek.safar@seznam.cz>
2859 * driver.cs: Fix compilation files with full root path.
2861 2005-09-25 Miguel de Icaza <miguel@novell.com>
2863 * report.cs (SymbolRelatedToPreviousError): Format the output so
2864 it does not use an open parenthesis that is never closed.
2866 * driver.cs: Follow coding guidelines
2868 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2871 * const.cs (Const.ResolveValue): Check for assigning non-null
2872 value to reference type.
2874 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2876 * anonymous.cs: Implemented ExprClassName.
2878 * assign.cs (Assign.DoResolve): Don't chrash when type is not
2881 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2884 * class.cs (StaticClass.DefineContainerMembers): Report protected
2887 * codegen.cs: if(ed) PRODUCTION.
2889 * convert.cs (Error_CannotImplicitConversion): Better error
2892 * cs-parser.jay: More error checks.
2894 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2896 * driver.cs (CSCParseOption): Enabled wrong option check.
2898 * ecore.cs (Expression.ExprClassName): Turned to property.
2899 (MemberExpr.CheckIntermediateModification): For checking boxed
2900 value types modification.
2902 * statement.cs (Fixed.Resolve): Expression type must be
2903 convertible to fixed type.
2904 (CollectionForeach.GetEnumeratorFilter,TryType):
2905 Small refactoring for easier error checking.
2907 2005-09-26 Marek Safar <marek.safar@seznam.cz>
2909 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2912 * class.cs (GeneratedBaseInitializer): New class for customization
2913 compiler generated initializers.
2914 (MemberBase.DoDefine): Check Obsolete attribute here.
2915 (FieldMember.DoDefine): Ditto.
2917 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2920 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2921 (MemberCore.GetObsoleteAttribute): Removed argument.
2922 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2923 (MemberCore.CheckObsoleteType): New helper.
2927 * statement.cs: Updates after MemberCore changes.
2929 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2930 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2932 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2933 obsolete attribute for compiler construct.
2934 (As.DoResolve): Cache result.
2936 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2938 2005-09-26 Raja R Harinath <rharinath@novell.com>
2941 * expression.cs (This.VerifyFixed): In a value type T, the type of
2942 'this' is T&, iow, 'this' is either an out or ref parameter. In a
2943 value type R, 'this' is treated as a value parameter.
2945 2005-09-22 Miguel de Icaza <miguel@novell.com>
2947 * statement.cs (Lock): Use the TemporaryVariable class instead of
2948 manually using local variables as those do not work when variables
2951 * ecore.cs: Moved the TemporaryVariable class from being a nested
2952 class inside Foreach to be a public class that can be employed in
2955 2005-09-19 Marek Safar <marek.safar@seznam.cz>
2957 * cs-parser.jay: interface_accessors replaced by
2958 accessor_declarations.
2960 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2963 * statement.cs (GotoCase.Resolve): Convert null constant to
2965 (SwitchLabel.ResolveAndReduce): Ditto.
2966 (SwitchLabel.NullStringCase): Custom null stamp.
2967 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2969 typemanager.cs (CSharpSignature): Don't skip first argument
2972 2005-09-18 Miguel de Icaza <miguel@novell.com>
2974 * driver.cs: Set InEmacs based on the environment variable EMACS.
2976 * location.cs (InEmacs): in this mode, do not report column
2977 location as it confuses Emacs.
2979 2005-09-16 Marek Safar <marek.safar@seznam.cz>
2981 * cfold.cs, constant.cs, convert.cs, ecore.cs,
2982 expression.cs, iterators.cs, literal.cs: Store constants and
2985 * class.cs (MemberBase.ShortName): Pass location.
2987 * cs-parser.jay: Some location fixes.
2989 * ecore.cs (Expression.Location): Made virtual.
2991 2005-09-05 Miguel de Icaza <miguel@novell.com>
2993 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2994 if the underlying types are the same, otherwise we need to produce
2995 code that will do the proper cast.
2997 This was exposed by Marek's constant rewrite which produced
2998 invalid code for the call site:
3001 void Method (X v) {}
3005 This fixes test-49.cs
3007 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3009 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3010 Type/Object should be allowed as well. Fixed bug #75968.
3012 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
3014 * expression.cs : (Binary.DoResolve): when one is enum constant and
3015 another is constant 0, then return enum one *as enum type*.
3018 2005-09-02 Raja R Harinath <rharinath@novell.com>
3020 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3024 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3025 flow-branching for LocalVariableReferences in case we were invoked
3026 from a MemberAccess.
3027 * expression.cs (LocalVariableReference.VerifyAssigned): New.
3029 (LocalVariableReference.DoResolveBase): ... this.
3030 (MemberAccess.Resolve): Do the check that was disabled during
3033 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3036 (PartialContainer.Create): check abstract/sealed/static strictly
3037 but abstract/sealed can exist only at one side. Fixed bug #75883.
3039 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
3042 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3043 specified, don't default to UnmanagedType.I4.
3045 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
3047 * expression.cs : conditional operator should check possibly
3048 incorrect assign expression. Fixed bug #75946.
3050 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
3052 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
3053 Reverting the change. gmcs is much complex than mcs on this matter.
3055 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
3057 * cs-tokenizer.cs : To read another token ahead of the actual
3058 consumption, use new SavedToken and cache token instead of moving
3059 back the stream with SeekableStreamReader (it seemed problematic).
3061 driver.cs : Thus use StreamReader directly.
3062 * support.cs : Thus removed SeekableStreamReader.
3064 2005-08-30 Raja R Harinath <rharinath@novell.com>
3067 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3068 (ScopeInfo.EmitScopeType): Use it to construct field names from
3069 names of captured locals.
3072 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3073 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3074 Pass 'target_type' to BoxedCast. Don't default to 'object'.
3075 (ExplicitConversion): Remove enum cases already handled by
3076 implicit conversion. Move implicit conversion check to the beginning.
3077 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3078 * expression.cs (ArrayCreation.EmitDynamicInitializers):
3079 Don't treat System.Enum as a struct.
3081 2005-08-30 Jb Evain <jbevain@gmail.com>
3083 * attribute.cs: handles as expression in parameters.
3085 2005-08-30 Raja R Harinath <rharinath@novell.com>
3088 * class.cs (TypeContainer.VerifyClsName): Don't use a
3089 PartialContainer when verifying CLS compliance.
3090 (AbstractPropertyEventMethod): Set Parent here, ...
3091 (PropertyMethod): ... not here.
3093 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
3095 * attribute.cs : escaped attribute name should not be allowed to be
3096 resolved (e.g. @class as classAttribute). Fixed bug #75930.
3098 2005-08-29 Raja R Harinath <rharinath@novell.com>
3101 * convert.cs (ImplicitStandardConversionExists): Allow zero also
3102 when converting a long constant to unsigned long.
3103 * expression.cs (Invocation.OverloadResolve): Add sanity check to
3104 detect where IsApplicable and VerifyArgumentsCompat disagree.
3106 2005-08-29 Raja R Harinath <rharinath@novell.com>
3107 and Carlos Alberto Cortez <carlos@unixmexico.org>
3110 * class.cs (TypeContainer.CanElideInitializer): New helper.
3111 (TypeContainer.EmitFieldInitializers): Use it to determine if we
3112 can safely emitting the initializer of a field.
3114 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3116 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3117 allowed inside a switch (without loop). Fixed bug #75433.
3119 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3121 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3122 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3124 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3126 * driver.cs : kinda reverting the default encoding changes (not exact
3127 revert since I noticed that "codepage:reset" might not work fine).
3129 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3131 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3132 Location. Now getter and setter store location correctly.
3133 (errors/cs0111-12.cs now reports the expected location.)
3135 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3137 * driver.cs : Use default encoding on the environment.
3138 Removed (now that) extra parameter for SeekableStreamReader.
3139 * support.cs : (SeekableStreamReader) third .ctor() argument for
3140 StreamReader is not required (always true). preamble size could
3141 be acquired in simpler and safe way.
3143 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
3145 * cs-parser.jay: report CS0642 at warning level 3
3146 and report CS0642 for an if else statement also
3147 fixes bug #74745. Patch by John Luke (and a bit
3149 Removed extra CS0642 warning check for "while",
3151 * statement.cs: In Block.Resolve(), CS0642 check
3152 is reimplemented to check a sequence of an empty
3153 statement and a block.
3155 Both fix bug #66777.
3157 2005-08-24 Marek Safar <marek.safar@seznam.cz>
3159 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3160 detection until I fix it.
3162 * cs-tokenizer.cs: Changed error message.
3164 * cs-parser.jay: Fixed 2 error locations.
3166 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3167 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3170 * enum.cs (GetSignatureForError): Fixed.
3172 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3176 * typemanager.cs (RegisterProperty): Removed.
3178 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3180 2005-08-24 Raja R Harinath <rharinath@novell.com>
3183 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3184 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3186 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3188 * expression.cs : tiny fix is required for not warning positive ulong.
3191 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3193 * expression.cs : add CS0652 check for constant and integral
3194 expression. Fixed bug #53974.
3196 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3198 * expression.cs : in DoNumericPromotions(), check if there is implicit
3199 conversion overload for string (to check CS0034). Fixed bug #52492.
3201 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3203 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3205 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3207 * ecore.cs : report location when it is *not* Null.
3209 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3215 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3216 correctly. Fixed bug #75721.
3218 2005-08-23 Raja R Harinath <rharinath@novell.com>
3220 * support.cs (SeekableStreamReader.Position): Avoid an expensive
3221 loop that performs 'min (pos, char_count)'.
3224 * expression.cs (Unary.ResolveOperator): Don't discard implicit
3225 converted value in Operator.OnesComplement.
3227 2005-08-22 Ben Maurer <bmaurer@ximian.com>
3229 * anonymous.cs: If the anon method is pulled into a helper class,
3230 it needs to be `internal' not `private'. Fixes runtime behavior on
3233 2005-08-20 Martin Baulig <martin@ximian.com>
3235 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3236 scope if we don't already have it.
3238 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3239 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3242 2005-08-17 Marek Safar <marek.safar@seznam.cz>
3245 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3248 2005-08-16 Marek Safar <marek.safar@seznam.cz>
3250 The big constants rewrite
3251 Fix #75746, #75685 and more
3252 As a side effect saved 1MB for MWF ;-)
3254 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3255 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3256 enum based for corlib compilation.
3258 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3261 * class.cs (FixedField.Define): Use ResolveAsConstant.
3263 * const.cs (IConstant): Interface constants and enums.
3264 (Const.ResolveValue): New method for constant resolvning.
3265 (ExternalConstant): Constants from imported assemblies.
3267 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3268 conversion; like enums.
3269 (Constant.ToType): Converts this constant to different type.
3270 (Constant.Increment): Adds 1.
3272 * convert.cs (ImplicitConversionRequired): Simplified.
3274 * cs-parser.jay: Create EnumMember directly.
3276 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3278 * doc.cs (GenerateEnumDocComment): Removed.
3280 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3281 (ConvertIntLiteral): Removed.
3282 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3284 * enum.cs (EnumMember): Implement IConstant.
3285 (Enum.IsValidEnumConstant): Removed.
3286 (Enum.GetNextDefaultValue): Removed.
3287 (Enum.FindMembers): Updated.
3288 (Enum.GenerateDocComment): Iterate enum members.
3290 * expression.cs (Cast.TryReduce): Handle enums correctly.
3291 (New.Constantify): Made public.
3292 (MemberAccess.DoResolve): Removed contant specific if(s).
3294 * literal.cs (NullLiteral): Implement new abstract methods.
3296 * statement.cs (GotoCase.Resolve): Use new constant methods.
3297 (SwitchLabel.ResolveAndReduce): Use new constant methods.
3299 * typemanager.cs (LookupEnum): Removed.
3300 (IsEnumType): Fixed to work with corlib.
3301 (RegisterConstant): Removed.
3302 (LookupConstant): Removed.
3303 (GetConstant): Changed to work with IConstant.
3305 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
3307 * location.cs : Fixed overflown (>255) column number.
3309 2005-08-03 Raja R Harinath <rharinath@novell.com>
3311 First cut of the qualified-alias-member feature.
3312 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3314 * cs-parser.jay (DOUBLE_COLON): New token.
3315 (namespace_or_type_name): Add rule for recognizing
3316 qualified-alias-members.
3317 (primary_expression): Likewise.
3318 (element_access): Allow QualifiedAliasMember as a possible
3319 type-bearing expression.
3320 (local_variable_type, local_variable_pointer_type): Likewise.
3321 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
3322 aliases in the current and enclosing namespace declarations.
3323 (NamespaceEntry.UsingAlias): Add CS0440 warning.
3324 * decl.cs (MemberName.is_double_colon): New.
3325 (MemberName.MemberName): Add new constructor for alias-member.
3326 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3327 * expression.cs (QualifiedAliasMember): New expression type.
3329 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3331 * location.cs : it borked when no argument was specified.
3333 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3335 * location.cs : tiny ToString() format fix.
3337 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3339 * statement.cs : oops, it was missing.
3341 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3343 A set of fixes for precise line/column location.
3346 "token" field now holds a file/line "delta", a line number offset
3347 from the segment, and a column number. See also:
3348 http://lists.ximian.com/pipermail/mono-devel-list/2004-
3349 December/009508.html
3350 Removed static IsNull. Use instance IsNull property instead.
3352 For some tokens it stores Location. For Identifier it stores
3353 LocatedToken which is a pair of string name and location.
3354 Column numbers are adjusted only at getChar().
3356 Use Location.ToString() for reporting (it now contains column).
3358 Largely modified to use LocatedToken instead of
3359 string (IDENTIFIER), and to acquire Location from some tokens.
3360 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3361 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3363 Now MemberName holds Location. DeclSpace.ctor() receives Location
3364 as a parameter. Removed extra parameters to all derived classes.
3365 Replaced Location.IsNull() with instance property.
3366 * assign.cs, expression.cs :
3367 Added .ctor() overload that omits Location.
3369 Added "nameEscaped" flag that indicates the identifier was escaped
3370 in the source file. This fixes bug #57047.
3372 2005-08-02 Marek Safar <marek.safar@seznam.cz>
3374 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3375 New method, looking for lo-case imported cls type.
3377 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3380 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3382 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3384 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3386 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3388 Optimized to save 3.5 MB for SWF compilation.
3390 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3392 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3393 (PartialContainer.Create): Moved logic AddToContainer.
3394 (PartialContainer.MarkForDuplicationCheck): Shares name.
3396 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3399 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3401 (Namespace.GetSignatureForError): New method.
3403 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3404 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3406 2005-08-01 Raja R Harinath <rharinath@novell.com>
3409 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3410 member lookup rather than qualifier_type, since qualifier_type can
3413 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3415 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3418 2005-07-31 Miguel de Icaza <miguel@novell.com>
3420 * statement.cs: Copy the local exception into the exception
3421 captured local. Fixes 75674
3423 2005-07-31 Raja R Harinath <harinath@gmail.com>
3426 * expression.cs (Invocation.OverloadResolve): Don't report error
3427 CS1501 if error CS1502 has been reported.
3428 (New.DoResolve): Delegate CS1501 reporting to
3429 Invocation.OverloadResolve.
3432 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3433 invariant-meaning-in-block property in an enclosing block if
3436 2005-07-29 Marek Safar <marek.safar@seznam.cz>
3438 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3439 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3440 (Switch.CheckSwitch): Just save 50kb for SWF.
3442 2005-07-27 Martin Baulig <martin@ximian.com>
3444 * anonymous.cs (CaptureContext.AddField): Added
3445 `AnonymousContainer am' argument; compute its toplevel scope if
3446 it's not already computed. Fixes #75649.
3448 2005-07-26 Raja R Harinath <rharinath@novell.com>
3451 * class.cs (Constructor.Emit): Reset block to null if the block
3454 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3456 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3458 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3460 * class.cs (MethodData.Define): Check whether accessor implementing
3461 interface is public.
3463 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3465 2005-07-22 Marek Safar <marek.safar@seznam.cz>
3468 * namespace.cs (LookupType): Moved same type check to...
3470 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3473 2005-07-21 Raja R Harinath <rharinath@novell.com>
3475 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3476 already found a typebuilder.
3477 * class.cs (MethodCore.IsDuplicateImplementation): Compare
3478 MemberNames, not strings.
3480 * const.cs (Error_ExpressionMustBeConst):
3481 Rename from Error_EpressionMustBeConst.
3482 * const.cs, class.cs, statement.cd: Update.
3484 2005-07-21 Marek Safar <marek.safar@seznam.cz>
3488 * const.cs (Const.LookupConstantValue): Report missing contant expression
3490 (Error_EpressionMustBeConstant): Only one error method.
3492 * class.cs, statement.c: Updated.
3494 2005-07-20 Raja R Harinath <rharinath@novell.com>
3496 * statement.cs (Block.Flags): Add back HasVarargs.
3497 (Block.flags): Make protected.
3498 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3500 * typemanager.cs (types, typecontainers, user_types): Remove.
3501 (UserTypes, TypeContainers): Likewise.
3502 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3503 (CleanUp, Reset): Update.
3504 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
3505 (GetNestedType): Use Type.GetNestedType.
3506 (CoreLookupType): Take two arguments, the namespace and the
3507 basename of the type. Update to use the Namespace.Lookup
3509 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3510 (RealMemberLookup): Use IsNestedChildOf instead of playing with
3511 string concatenation and substring matches.
3512 * class.cs, enum.cs, delegate.cs: Update to changes.
3514 2005-07-20 Marek Safar <marek.safar@seznam.cz>
3516 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3517 Expression and made virtual.
3519 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3520 (ImplicitStandardConversionExists): Fixed `byte' typo ?
3522 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3524 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3527 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3530 2005-07-18 Marek Safar <marek.safar@seznam.cz>
3533 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3534 AssemblyCultureAttribute is not used on executable.
3537 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3539 2005-07-16 Raja R Harinath <rharinath@novell.com>
3542 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3543 New. Reports CS0252/CS0253.
3544 Mostly taken from preliminary patch by Duncak Mak.
3545 (Binary.DoResolveOperator): Store results of operator lookup.
3546 Use them to detect if we need to warn about unintended reference
3549 2005-07-15 Raja R Harinath <rharinath@novell.com>
3552 * namespace.cs (Namespace.Lookup): Add back location parameter.
3553 (Namespace.LookupType): Add CS0436 report. Add location parameter.
3554 * delegate.cs, ecore.cs, expression.cs: Update to changes.
3556 * codegen.cs (EmitContext.DeclSpace): Make readonly.
3557 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3558 (Namespace.LookupType): ... this.
3559 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3561 * typemanager.cs (LookupTypeReflection): Remove buggy code that
3562 purported to handle pointers.
3563 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3566 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3568 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3571 2005-07-15 Raja R Harinath <rharinath@novell.com>
3573 * namespace.cs (Namespace.Lookup): Drop location parameter.
3574 (NamespaceEntry.LookupAlias): Remove. Merge into ...
3575 (NamespaceEntry.Lookup): ... this.
3576 (NamespaceEntry.Error_AmbiguousTypeReference):
3577 Move here from DeclSpace.
3578 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3580 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3581 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3582 Move to NamespaceEntry.
3583 * delegate.cs, expression.cs: Update to changes.
3585 2005-07-14 Marek Safar <marek.safar@seznam.cz>
3587 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3588 CheckAttributeType and refactored.
3589 (Attribute.ResolvePossibleAttributeType): Changed to reuse
3590 ResolveAsTypeTerminal error handling.
3591 (ResolveAsTypeTerminal): Introduced because of global attributes extra
3593 (GetSignatureForError): Print errors in same way.
3596 * codegen.cs: Reflect attribute GetSignatureForError change.
3599 * expression.cs: Add silent parameter to ResolveAsTypeStep.
3601 * namespace.cs (UsingEntry): Refactored to make fields private.
3604 statement.cs: Error_UnexpectedKind has extra parameter.
3606 2005-07-14 Raja R Harinath <rharinath@novell.com>
3608 * ecore.cs (IAlias): Remove.
3609 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
3610 that implement the interface.
3611 * namespace.cs (Namespace): Likewise.
3612 (Namespace.declspaces): Renamed from 'defined_names'.
3613 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
3614 DeclSpace instead of an IAlias.
3615 * tree.cs (Tree.AddDecl): Update.
3617 2005-07-12 Raja R Harinath <rharinath@novell.com>
3619 * statement.cs (Block.Flags); Remove HasVarargs.
3620 (Block.HasVarargs): Move to ToplevelBlock.
3621 (Block.ThisVariable, Block.AddThisVariable): Likewise.
3622 (Block.Variables): Make protected. Initialize variable hashtable
3624 (Block.AddVariable): Update.
3625 (Block.Resolve): Update to changes.
3626 (ToplevelBlock.HasVarargs): New boolean.
3627 (ToplevelBlock.ThisVariable): Move here from Block.
3628 (ToplevelBlock.AddThisVariable): Likewise.
3629 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
3630 * expression.cs (This.ResolveBase): Update to changes.
3631 (ArglistAccess.DoResolve): Likewise.
3633 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3636 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3638 * class.cs (TypeContainer.VerifyMembers): Distinguish between
3639 not used and not used & assigned.
3640 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3642 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3645 * expression.cs (Is.DoResolve): null is never provided type.
3647 2005-07-08 Marek Safar <marek.safar@seznam.cz>
3650 * cs-parser.jay: Less strict event error rule to catch more errors.
3652 2005-07-08 Martin Baulig <martin@ximian.com>
3654 Fix test-iter-10.cs - distinguish whether we `yield' in a property
3655 gettter (allowed) or setter (not allowed).
3657 * class.cs (Accessor): Implement IIteratorContainer.
3658 (Accessor.Yields): New public field.
3659 (PropertyBase.PropertyMethod.Define): Handle iterators on a
3663 (get_accessor_declaration, set_accessor_declaration): Set the
3664 `yields' flag on the accessor, not the property.
3665 (property_declaration): Do the iterators check on a per-accessor
3666 basis and not for the whole property.
3668 2005-07-08 Martin Baulig <martin@ximian.com>
3670 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3671 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3673 2005-07-07 Marek Safar <marek.safar@seznam.cz>
3676 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3677 (ExtractSecurityPermissionSet): Cope with self referencing security
3678 attributes properly.
3680 * driver.cs (SetOutputFile): Made public property OutputFile.
3682 2005-07-07 Raja R Harinath <rharinath@novell.com>
3685 * class.cs (TypeContainer.first_nonstatic_field): Rename from
3686 has_nonstatic_fields. Make into a FieldBase pointer.
3687 (TypeContainer.AddField): Add CS0282 check.
3688 (TypeContainer.EmitType): Update.
3690 2005-07-06 Miguel de Icaza <miguel@novell.com>
3692 * cs-tokenizer.cs (consume_identifier): Do not create strings to
3693 compare if they start with __.
3695 2005-07-06 Raja R Harinath <rharinath@novell.com>
3697 * statement.cs (Switch.SwitchGoverningType): Only look at
3698 UserCasts that don't need implicit standard conversions to one of
3699 the allowed switch types (Fixes test-322.cs).
3700 (LocalInfo.Resolve): Re-enable sanity-test.
3702 2005-07-06 Marek Safar <marek.safar@seznam.cz>
3704 * cs-tokenizer.cs (consume_identifier): Detect double undescores
3706 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3708 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3710 2005-07-06 Raja R Harinath <rharinath@novell.com>
3713 * ecore.cs (SimpleName.GetSignatureForError): Add.
3714 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3715 (MemberAccess.GetSignatureForError): Add.
3717 2005-07-05 Marek Safar <marek.safar@seznam.cz>
3719 The big error and warning messages review.
3749 * typemanager.cs: Updated.
3751 * class.cs: (MethodCore.SetYields): Moved here to share.
3752 (PropertyMethod.Define): Moved iterator setup here.
3754 * iterators.cs: Add orig_method to have full access to parent
3757 2005-07-05 Raja R Harinath <rharinath@novell.com>
3759 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3760 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3761 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3762 variable of struct type.
3763 * expression.cs (Unary.ResolveOperator): Update to change.
3764 (Indirection.VerifyFixed): Likewise.
3765 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3766 (ParameterReference.VerifyFixed): Value parameters are fixed.
3767 (This.VerifyFixed): Treat 'this' as a value parameter.
3768 * statement.cs (LocalInfo.IsFixed): Remove.
3770 2005-07-01 Martin Baulig <martin@ximian.com>
3772 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3773 `ec.EmitThis ()' to get the correct scope.
3775 2005-07-01 Martin Baulig <martin@ximian.com>
3777 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3778 instance is a ParameterReference; fixes #75299.
3780 2005-07-01 Martin Baulig <martin@ximian.com>
3782 Reverted Marek's latest patch (r46725):
3783 - it contains structural changes which are neither mentioned in
3784 the ChangeLog nor explained anywhere; for example the additional
3785 argument of EmitContext's and Iterator's .ctor's and the
3786 TypeContainer.DefineMembers() change.
3787 - structural changes like this should go in in seperate patches
3788 and not be hidden in a huge patch which just seems to affect
3789 warnings and errors.
3790 a big and hard to understand patch.
3791 - it breaks iterators and causes regressions, for instance in
3794 2005-06-30 Raja R Harinath <rharinath@novell.com>
3797 * expression.cs (Indexers.map): Remove.
3798 (Indexers.Append): Filter out inaccessible setters and getters.
3799 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3802 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
3804 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3805 (FieldExpr.Emit, PropertyExpr.Emit): Update.
3806 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3807 * expression.cs (Invocation.EmitCall): Add CS0120 check.
3809 2005-06-30 Marek Safar <marek.safar@seznam.cz>
3812 * class.cs (FieldBase.GetInitializerExpression): One more field
3815 2005-06-28 Miguel de Icaza <miguel@novell.com>
3817 * pending.cs: Do not define a proxy if the base method is virtual,
3818 it will be picked up by the runtime (bug 75270).
3820 2005-06-08 Martin Baulig <martin@ximian.com>
3822 The big Iterators rewrite :-)
3824 * iterators.cs: Rewrite this to use the anonymous methods framework.
3826 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3827 before the TypeContainers; see 2test-21.cs.
3830 (TypeContainer.DefineType): Don't create a new EmitContext if we
3831 already have one (this only happens if we're an Iterator).
3832 (TypeContainer.Define): Also call Define() on all our iterators.
3833 (Method.CreateEmitContext): Added support for iterators.
3836 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3837 (AnonymousContainer.CreateMethodHost): Moved here from
3838 AnonymousMethod and made abstract.
3839 (AnonymousContainer.CreateScopeType): New abstract method.
3840 (AnonymousContainer.IsIterator): New public property.
3841 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3842 get the ScopeTypeBuilder rather than manually defining it here.
3843 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3846 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3847 before RootContext.DefineTypes().
3849 * codegen.cs (EmitContext.RemapToProxy): Removed.
3850 (EmitContext.CurrentAnonymousMethod): Changed type from
3851 AnonymousMethod -> AnonymousContainer.
3852 (EmitContext.ResolveTopBlock): Protect from being called twice.
3853 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3854 (EmitContext.EmitThis): Removed the iterators hacks; use the
3855 anonymous methods framework for that.
3858 (ToplevelBlock.Container): Make this a property, not a field.
3859 (ToplevelBlock.ReParent): New public method; move the
3860 ToplevelBlock into a new container.
3861 (Foreach.TemporaryVariable): Simplify.
3863 2005-06-05 Martin Baulig <martin@ximian.com>
3865 * statement.cs (LocalInfo.CompilerGenerated): New flag.
3866 (Block.AddTemporaryVariable): New public method; creates a new
3867 `LocalInfo' for a temporary variable.
3868 (Block.EmitMeta): Create the LocalBuilders for all the temporary
3870 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3871 non-iterator variables.
3873 2005-06-05 Martin Baulig <martin@ximian.com>
3875 * statement.cs (Foreach.TemporaryVariable): Create the
3876 LocalBuilder in the Emit phase and not in Resolve since in some
3877 situations, we don't have an ILGenerator during Resolve; see
3878 2test-19.cs for an example.
3880 2005-06-04 Martin Baulig <martin@ximian.com>
3882 **** Merged r45395 from GCS ****
3884 The big Foreach rewrite - Part II.
3886 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3887 with `PropertyInfo ienumerator_getcurrent'.
3889 * codegen.cs (VariableStorage): Removed.
3892 (Foreach): Derive from Statement, not ExceptionStatement.
3893 (Foreach.CollectionForeach): New nested class. Moved all the code
3894 dealing with collection foreach here.
3895 (Foreach.ForeachHelperMethods): Removed.
3896 (Foreach.TemporaryVariable): Implement IMemoryLocation.
3898 2005-05-23 Martin Baulig <martin@ximian.com>
3900 * statement.cs (Try.DoResolve): Don't create a `finally' if we
3901 don't need to. Fix #75014.
3903 2005-05-20 Martin Baulig <martin@ximian.com>
3905 Merged r44808 from GMCS.
3907 * class.cs (TypeContainer.CircularDepException): Removed.
3908 (TypeContainer.DefineType): Removed the `InTransit' stuff.
3909 (TypeContainer.CheckRecursiveDefinition): Check for circular class
3910 (CS0146) and interface (CS0529) dependencies here.
3912 2005-06-21 Raja R Harinath <rharinath@novell.com>
3914 * expression.cs (Invocation.EmitCall): Fix initialization
3915 'this_call' to reflect current behaviour. Fix indentation.
3917 * convert.cs (FindMostEncompassedType): Add two trivial special
3918 cases (number_of_types == 0 || number_of_types == 1).
3919 (FindMostEncompasingType): Likewise.
3921 2005-06-17 Raja R Harinath <rharinath@novell.com>
3923 Some cleanups preparing for the fix of #75283.
3924 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3926 (EventExpr.InstanceResolve): Likewise.
3927 (EventExpr.DoResolve): Remove redundant checks.
3929 2005-06-10 Duncan Mak <duncan@novell.com>
3931 * cs-tokenizer.cs (process_directives): New flag for controlling
3932 the processing of preprocessor directives.
3933 (x_token): After seeing a '#', return Token.NONE instead of going
3934 to handle_preprocessing_directive() when not processing
3935 directives. This avoids unnecessary processing during the token peek in
3940 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
3941 the existing error reporting methods instead of Report.Error.
3943 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
3944 after Raja's rewrite.
3946 2005-06-08 Miguel de Icaza <miguel@novell.com>
3948 * class.cs: Small fix.
3950 2005-06-08 Raja R Harinath <rharinath@novell.com>
3953 * class.cs (GetPartialBases): Fix return value check of
3956 2005-06-07 Raja R Harinath <rharinath@novell.com>
3958 Ensure that partial classes are registered in their enclosing
3959 namespace. Initial part of fix of #75160.
3960 * tree.cs (Tree.RecordDecl): Add new namespace argument.
3961 Register declspace with namespace here, not in
3962 DeclSpace.RecordDecl.
3963 * cs-parser.jay: Pass namespace to RecordDecl.
3964 * class.cs (PartialContainer.Create): Likewise.
3965 (ClassPart.DefineType): New sanity-check. Throws an exception if
3967 * decl.cs (Declspace.RecordDecl): Remove.
3968 * namespace.cs (NamespaceEntry.DefineName): Remove.
3970 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3972 * rootcontext.cs: Reset TargetExt as well.
3974 2005-06-03 Raja R Harinath <rharinath@novell.com>
3976 * ecore.cs (Expression.Resolve): Emit CS0654 error when
3979 2005-06-02 Raja R Harinath <rharinath@novell.com>
3981 Fix #75080, cs0119.cs.
3982 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
3984 (Expression.Resolve): ... this. Use it. Remove bogus code
3985 allowing ExprClass.Type and ExprClass.Namespace for
3986 ResolveFlags.VariableOrValue.
3987 (Expression.Resolve) [1-argument variant]: Change default resolve
3988 flags based on language version.
3989 (Expression.Error_UnexpectedKind): Use a simple string array
3990 rather than an ArrayList.
3991 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3993 (TypeOfVoid.DoResolve): Likewise.
3994 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
3995 flags argument -- it always has the same value.
3997 2005-05-31 Raja R Harinath <rharinath@novell.com>
4000 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4001 Use it in the error message.
4002 * assign.cs, expression.cs, statement.cs: Update.
4004 2005-05-30 Raja R Harinath <rharinath@novell.com>
4007 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4008 the "almostMatchedMember" case too.
4009 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4010 that failed the accessibility checks to 'almost_match'.
4012 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
4014 * attribute.cs: Use internal MethodBuilder methods to set
4015 ExactSpelling and SetLastError on PInvoke methods, instead
4016 of passing them via charset. Fixes #75060.
4018 2005-05-27 Raja R Harinath <rharinath@novell.com>
4020 * parameter.cs (Parameter): Remove TODO comment.
4021 (Parameter.DefineParameter): Remove Location parameter.
4022 (Parameters.LabelParameters): Likewise.
4023 * class.cs (Constructor.Emit): Update to change.
4024 (MethodData.Emit): Likewise.
4025 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
4026 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4028 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
4031 Removed Parameters.Location and added Parameter.Location instead.
4032 Removed Location parameter from Emit() and GetSignature().
4039 Modified all related calls.
4041 2005-05-26 Raja R Harinath <rharinath@novell.com>
4043 Improve user-defined conversion handling.
4044 * convert.cs (GetConversionOperators): Rewrite. Return only the
4045 applicable operators.
4046 (AddConversionOperators): New. Helper for GetConversionOperators.
4047 (FindMostEncompassedType, FindMostEncompassingType): Verify that
4048 there is only one most encompassed/encompassing type.
4049 (FindMostSpecificSource, FindMostSpecificTarget): Remove
4050 "applicable operator" handling.
4051 (UserConversion): Move cache here from GetConversionOperators.
4052 Directly cache the chosen operator, rather than the whole
4054 (ExplicitNumericConversion): Fix buggy implementation of Decimal
4055 case. Allow conversion of decimal to sbyte and byte too.
4056 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4057 New static methods. Used to avoid allocating EmptyExpressions in
4060 2005-05-24 Duncan Mak <duncan@novell.com>
4062 * ecore.cs (CastFromDecimal): New class for casting a decimal to
4063 another class, used in Convert.ExplicitNumericConversion.
4064 (CastToDecimal): New class, similar to above, but casts to
4065 System.Decimal, used in Convert.ImplicitNumericConversion and also
4066 in explicit convesion from double/float to decimal.
4068 * convert.cs (ImplicitNumericConversion): Handle implicit
4069 conversions to System.Decimal.
4070 (ExplicitNumericConversion): handle explicit conversions to
4075 2005-05-20 Miguel de Icaza <miguel@novell.com>
4077 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
4078 know the type at this stage, just break through. Fixes #75008
4080 2005-05-19 Martin Baulig <martin@ximian.com>
4083 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4084 to disable error reporting.
4086 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4087 here since we don't want to report an error; see the new test-336.cs.
4089 2005-05-19 Raja R Harinath <rharinath@novell.com>
4091 * statement.cs (ToplevelBlock.GetParameterReference)
4092 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4093 Move here from class Block.
4094 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4095 * expression.cs (ParameterReference.DoResolveBase): Likewise.
4097 2005-05-18 Martin Baulig <martin@ximian.com>
4102 (FlowBranching.Reachability): Add non-static public And() and Or()
4104 (FlowBranchingSwitch): New class; do the `break_origins' thing
4105 like in FlowBranchingLoop.
4106 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4107 reachability, not just locals and parameters.
4108 (FlowBranching.MergeChild): Remove some of the hacks for loop and
4109 switch; MergeBreakOrigins() now takes care of that.
4111 2005-05-18 Martin Baulig <martin@ximian.com>
4113 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4114 a loop and may leave it, reset the barrier; fixes #74974.
4116 2005-05-17 Marek Safar <marek.safar@seznam.cz>
4118 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4121 * cs-parser.jay: Catch more lexical errors.
4123 * report.cs: Add one more Error method.
4126 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4128 2005-05-17 Martin Baulig <martin@ximian.com>
4130 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4133 2005-05-16 Raja R Harinath <rharinath@novell.com>
4135 Fix test-382.cs. Emit values of decimal constants.
4136 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4138 (TypeContainer.AddField): ... this.
4139 (TypeContainer.EmitFieldInitializers): Allow the list of fields
4140 with initializers to include 'Const's.
4141 (ClassPart.RegisterFieldForInitialization): Forward to
4143 * const.cs (Const.Const): Pass initializer to base class.
4144 (Const.Define): In case of decimal constants, register them for
4145 initialization in a static constructor.
4147 2005-05-14 Martin Baulig <martin@ximian.com>
4149 * statement.cs (Block.Resolve): Correctly handle unreachable code;
4150 do not call ResolveUnreachable() on unreachable statements in
4151 here, see the comment in the source code.
4153 2005-05-13 Raja R Harinath <rharinath@novell.com>
4156 * expression.cs (BinaryResolveOperator): If one of the operands of
4157 an equality comparison is 'null' and the other is a pointer type,
4158 convert the null to a NullPointer.
4159 * convert.cs (ImplicitReferenceConversion): If the expression is a
4160 NullLiteral and the target type is a pointer type, return a
4161 NullPointer instead.
4162 (ImplicitConversionStandard): Likewise.
4164 2005-05-13 Marek Safar <marek.safar@seznam.cz>
4166 * cs-parser.jay: Set readonly context based on special constructs.
4168 * expression.cs (LocalVariableReference.DoResolveBase): Improved
4169 readonly variable error handling.
4171 * rootcontext.cs (EmitCode): Don't verify members when error
4174 * statement.cs (LocalInfo): Add reaodnly context information.
4175 (SetReadOnlyContext, GetReadOnlyContext): New methods.
4177 2005-05-13 Raja R Harinath <rharinath@novell.com>
4179 * statement.cs (Block.Resolve): Revert change below. Modify fix
4180 for #74041 to initialize 'resolved' to false only for explicit
4181 blocks. Fixes #74873.
4183 2005-05-12 Raja R Harinath <harinath@gmail.com>
4186 * typemanager.cs (unmanaged_enclosing_types): New.
4187 (IsUnmanagedType): Avoid infloops by using
4188 'unmanaged_enclosing_types' to talk with recursive invocations.
4190 2005-05-13 Martin Baulig <martin@ximian.com>
4192 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4193 instance variable, not a local. Fix #74873.
4194 (Block.ResolveUnreachable): Set it to true here.
4196 2005-05-11 Duncan Mak <duncan@novell.com>
4198 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4199 continuing to process for 'arg'.
4200 (handle_preprocessing_directive): Check the argument of the #endif
4201 directive and report error CS1025 if there are any trailing
4204 According to the C# spec, having even whitespace after the #endif
4205 directive is illegal; however, because we call arg.TrimEnd ()
4206 beforehand, we have the same behavior as csc, allowing whitespace
4207 after the directive.
4211 2005-05-11 Marek Safar <marek.safar@seznam.cz>
4215 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4216 (Constructor.GetObsoleteAttribute): Implemented correctly.
4218 2005-05-10 Martin Baulig <martin@ximian.com>
4220 * support.cs (ReflectionParameters.ParameterModifier): Use
4221 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4222 and `ParameterAttributes.In'. Fixes #74884.
4224 2005-05-10 Marek Safar <marek.safar@seznam.cz>
4226 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4228 * expression.cs (Argument.GetParameterModifier): Turned to property.
4229 (Invocation.Error_InvalidArguments): Add more descriptive errors.
4231 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4234 2005-05-09 Raja R Harinath <rharinath@novell.com>
4237 * decl.cs (MemberCache.AddMethods): Register override methods,
4238 rather than non-override methods.
4239 * typemanager.cs (RegisterOverride): New.
4240 (IsOverride): Update.
4242 2005-05-09 Marek Safar <marek.safar@seznam.cz>
4246 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4247 recursive declaration.
4249 * statement.cs (Block.ResolveMeta): Report any error in resolving.
4251 2005-05-06 Marek Safar <marek.safar@seznam.cz>
4253 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4255 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4257 2005-05-05 Raja R Harinath <rharinath@novell.com>
4260 * decl.cs (DeclSpace.FamilyAccessible):
4261 Use TypeManager.IsNestedFamilyAccessible.
4263 Fix reopened #64812.
4264 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4267 2005-05-04 Raja R Harinath <rharinath@novell.com>
4268 Abin Thomas <projectmonokochi@rediffmail.com>
4269 Anoob V E <projectmonokochi@rediffmail.com>
4270 Harilal P R <projectmonokochi@rediffmail.com>
4273 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4274 allow access to all static members.
4276 2005-05-04 Martin Baulig <martin@ximian.com>
4278 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4280 2005-05-04 Martin Baulig <martin@ximian.com>
4284 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4285 section at the end; make things work if `default' is not the last
4288 2005-05-04 Martin Baulig <martin@ximian.com>
4292 * statement.cs (Switch): Replaced the `got_default' field with a
4293 `default_section' one.
4294 (Switch.CheckSwitch): Set `default_section' here.
4295 (Switch.Resolve): If we're a constant switch and the constant is
4296 not found, use the default section.
4298 2005-05-03 Martin Baulig <martin@ximian.com>
4300 * expression.cs (ArrayAccess.EmitGetLength): New public method.
4302 * statement.cs (Foreach.ArrayForeach): New nested class.
4303 (Foreach.TemporaryVariable): New nested class.
4304 (Foreach.EmitArrayForeach): Removed; this is now in the new
4307 2005-05-03 Raja R Harinath <rharinath@novell.com>
4309 * pending.cs (BaseImplements): Move the #74773 fix here. This is
4311 (VerifyPendingMethods): Revert change below.
4313 * typemanager.cs (IsOverride, RegisterNonOverride): New.
4314 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4315 that used to trigger warning -28. Remove warning -28.
4316 * expression.cs (Invocation.OverloadResolve): Use
4317 TypeManager.IsOverride to distinguish override methods.
4320 * pending.cs (VerifyPendingMethods): If a base type implements the
4321 requested interface, don't bother checking individual methods of
4322 the base type. As a side-effect, this prevents the creation of
4323 unnecessary proxies.
4325 2005-05-02 Martin Baulig <martin@ximian.com>
4329 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4330 Also `And' the locals if the old vector is null.
4331 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4332 null; in this case we basically reset all the variables.
4334 2005-05-02 Martin Baulig <martin@ximian.com>
4338 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4339 Added `FlowBranching branching' argument; always `and' the
4340 variables instead of `or'ing them unless we're an infinite loop.
4342 * statement.cs (While.Resolve): Create a new sibling unless we're
4345 2005-05-02 Martin Baulig <martin@ximian.com>
4349 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4350 arguments; use it instead of creating a new TopLevelBlock.
4351 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4352 our ConstructorInitializer.
4355 (TopLevelBlock.TopLevelBranching): New public property.
4356 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4357 and create our `TopLevelBranching'.
4359 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4360 anonymous method host, use `block.TopLevelBranching' rather than
4361 creating a new branching.
4363 2005-04-20 Miguel de Icaza <miguel@novell.com>
4365 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4366 a ScopeInfo, if any of the current children is a child of the new
4367 entry, move those children there.
4369 2005-04-30 Martin Baulig <martin@ximian.com>
4371 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4372 at the beginning of a SwitchSection. Fix #73335.
4374 2005-04-27 Marek Safar <marek.safar@seznam.cz>
4377 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4379 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4380 (FieldExpr.DoResolve): Obsolete members are ignored for field
4383 2005-04-26 Marek Safar <marek.safar@seznam.cz>
4385 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4386 of arrays detection.
4388 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4390 (Field.VerifyClsCompliance): Volatile fields are not compliant.
4392 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4395 2005-04-25 Ben Maurer <bmaurer@ximian.com>
4397 * cs-parser.jay: Use the prefered version of -unsafe in error
4400 2005-04-22 Marek Safar <marek.safar@seznam.cz>
4402 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4405 2005-04-20 John Luke <john.luke@gmail.com>
4407 * driver.cs: fix typo in error message, --outout to --output
4409 2005-04-20 Marek Safar <marek.safar@seznam.cz>
4411 * codegen.cs (InRefOutArgumentResolving): New field.
4413 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4414 fields outside contructor.
4416 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4418 2005-04-19 Miguel de Icaza <miguel@novell.com>
4420 * anonymous.cs (CaptureContext.EmitParameterInstance): The
4421 parameter code was not completed ever, so it was not as up-to-date
4422 as local variables. Must finish it.
4424 The bug fix was to compare the Toplevel of the block, not the
4425 current block. Thanks for Ben for pointing this out.
4427 2005-04-19 Raja R Harinath <rharinath@novell.com>
4429 * decl.cs (AddMethods): Use the declaring type of the problem
4430 method to determine if we want to squash a warning.
4432 2005-04-19 Marek Safar <marek.safar@seznam.cz>
4434 * attribute.cs: Removed debug output.
4436 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4438 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4441 2005-04-18 Raja R Harinath <rharinath@novell.com>
4444 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4445 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4446 all null comparisons against reference types.
4448 2005-04-18 Marek Safar <marek.safar@seznam.cz>
4451 * class.cs (TypeContainer.CircularDepException) New nested
4453 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4454 (TypeContainer.DefineType): Removed error, reset InTransit before
4456 (Class.DefineType): Throw exception when is in Transit.
4457 Catch exception and report error.
4458 (Struct.DefineType): Throw exception when is in Transit.
4459 Catch exception and report error.
4460 (Interface.DefineType): Throw exception when is in Transit.
4461 Catch exception and report error.
4463 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4464 handle nested exception handlers.
4466 * flowanalysis.cs (InTryWithCatch): New method, search for try with
4469 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4470 InFinally and InCatch storage.
4472 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4473 (Catch.Resolve): Set and Restore ec.InCatch.
4474 (Try.Resolve): Set and Restore ec.InFinally.
4475 (Try.HasCatch): True when try has catch.
4477 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
4479 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4480 for the same event member, so exclude such cases from warning 419.
4483 2005-04-16 Miguel de Icaza <miguel@novell.com>
4485 * expression.cs (Binary.ResolveOperator): Apply patch from John
4486 Luke to fix bug 59864: operators &, | and ^ on enumerations
4487 require that the same enum type on both sides.
4489 * driver.cs: Add warnings to old flag usage, this is to assist
4490 people who produce Makefiles and hope that the Makefiles will be
4493 * class.cs (TypeContainer.EmitType): Moved the definition of the
4494 special $PRIVATE$ field from the resolve phase to the Emit phase.
4495 During resolve we do not know if we are a struct with
4496 HasExplicitLayout, we know this only after the attributes for the
4499 Set the FieldOffset to zero on the dummy field that we create for
4500 the class. Fixes 74590.
4502 2005-04-16 Raja R Harinath <rharinath@novell.com>
4505 * ecore.cs (PropertyExpr.resolved): New.
4506 (DoResolve): Use it to handle a case of double resolution here.
4507 Handle a case of identical-name-and-type-name.
4508 * expression.cs (ArrayCreation.CheckIndices): Avoid double
4509 resolution by storing the results of expression resolution back
4510 into the "probes" array.
4512 2005-04-15 Raja R Harinath <rharinath@novell.com>
4514 Fix cs0208-7.cs and cs0208-8.cs.
4515 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4516 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
4517 error reporting to point out the reason a struct is not unmanaged.
4519 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4521 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
4522 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4524 2005-04-13 Raja R Harinath <rharinath@novell.com>
4527 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4528 IdenticalNameAndTypeName here.
4529 (EventExpr.InstanceResolve): Likewise.
4531 2005-04-13 Marek Safar <marek.safar@seznam.cz>
4533 C# 2.0 DefaultCharSetAttribute implementation
4535 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4536 which allows us to set GlobalNamespace for every resolve.
4537 (Attribute.ResolveArguments): Cut from Resolve.
4538 (Attribute.GetCharSetValue): Returns CharSet named argument.
4539 (Attribute.DefinePInvokeMethod): Gets default charset from
4541 (GlobalAttribute.ResolveAsTypeStep): Override.
4542 (GlobalAttribute.ResolveArguments): Override.
4544 * class.cs (TypeAttr): Is protected.
4546 * codegen.cs (ModuleClass.DefaultCharSet): New member.
4547 (ModuleClass.DefaultCharSetType): New memeber.
4548 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4550 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4551 charset from module.
4553 * delegate.cs (TypeAttr): Override.
4554 (Delegate.DefineType): Use this TypeAttr.
4556 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4557 at very early stage (before types are defined) to resolve model
4558 module attributes. It will probably not work with corlib but it
4561 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4562 charset from module.
4564 * typemanager.cs (default_charset_type): New type.
4566 2005-04-13 Raja R Harinath <rharinath@novell.com>
4568 * decl.cs (MemberCache.AddMethods): Don't warn if
4569 System.Object.Finalize has buggy MethodAttributes.
4571 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4574 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4576 * doc.cs : detect ambiguous reference to overloaded members.
4577 Fixed bug #71603. MS 1.1 csc does not detect it.
4579 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4581 * doc.cs : delegates must not be referenced with parameters.
4584 2005-04-12 Miguel de Icaza <miguel@novell.com>
4586 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4588 2005-04-10 Miguel de Icaza <miguel@novell.com>
4590 * driver.cs (MainDriver): Stop processing if the CLS stage found
4593 (CompilerCallableEntryPoint.InvokeCompiler): Always
4594 reset after execution; Take a TextWriter argument for the
4597 * report.cs: Use the error stream instead of hardcoding stderr.
4599 2005-04-09 Miguel de Icaza <miguel@novell.com>
4601 * class.cs: Reduce code paths to test, too small of an
4602 optimization to make it worth the extra testing. Always perform
4605 2005-04-08 Raja R Harinath <rharinath@novell.com>
4608 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4609 operators that had errors reported on them.
4611 2005-04-08 Marek Safar <marek.safar@seznam.cz>
4613 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4615 (Attribute.Resolve): Add named argument type checking.
4617 * class.cs (FixedField.Define): Use IsPrimitiveType
4619 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4621 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4622 unsafe parameter types.
4624 * statement.cs (Using.ResolveExpression): Add better error description.
4626 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4628 2005-04-08 Raja R Harinath <rharinath@novell.com>
4631 * attribute.cs (Attribute.GetAttributeUsage): Resolve
4632 AttributeUsageAttribute in the emitcontext of the attribute class,
4633 not in the emitcontext of the attributable entity it was attached to.
4634 * cs-parser.jay: Use 'current_class', not 'current_container',
4635 when creating a GlobalAttribute.
4637 2005-04-08 Alp Toker <alp@atoker.com>
4639 * pending.cs: The fix to #58413 failed to compile methods implementing
4640 interfaces with/without params modifiers and vice versa, even though
4641 params modifiers aren't part of the signature. Make the modifier check
4642 less strict as in csc.
4644 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
4645 Anoob V E <projectmonokochi@rediffmail.com>
4646 Harilal P R <projectmonokochi@rediffmail.com>
4649 * pending.cs (TypeAndMethods.mods): New. Store the parameter
4650 modifiers of pending methods.
4651 (PendingImplementation.PendingImplementation): Initialize it.
4652 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4653 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4654 with ParameterData. Add check for modifiers.
4655 * class.cs (MethodData.Define): Update to changes.
4657 2005-04-07 Raja R Harinath <rharinath@novell.com>
4659 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4661 2005-04-07 Marek Safar <marek.safar@seznam.cz>
4663 * class.cs (PropertyMethod.Define): Check private accessor in abstract
4666 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4669 * typemanager.cs: Registered RequiredAttributeAttribute.
4671 2005-04-06 Marek Safar <marek.safar@seznam.cz>
4673 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4674 Warning CS0169 is back at level 3.
4675 (IMethodData.SetMemberIsUsed): New method.
4677 * decl.cs (IsUsed): New value; moved from FieldBase.Status
4678 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4680 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4682 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4684 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4687 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4690 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4691 to avoid the problems with nested types.
4693 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
4694 Anoob V.E <projectmonokochi@rediffmail.com>
4695 Harilal P.R <projectmonokochi@rediffmail.com>
4696 Raja R Harinath <rharinath@novell.com>
4699 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4701 * typemanager (GetConstructor): Make public.
4703 2005-04-05 John Luke <john.luke@gmail.com>
4704 Raja R Harinath <rharinath@novell.com>
4707 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4708 struct too. Return false quicker in a few cases.
4709 (VerifyUnManaged): Use it.
4711 2005-04-05 Raja R Harinath <rharinath@novell.com>
4714 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4715 not 'unreachable_seen'.
4717 2005-04-04 Marek Safar <marek.safar@seznam.cz>
4719 * attribute.cs (Attribute.GetValue): Removed unused.
4721 * codegen.cs (CodeGen.TrimExt): Removed unused.
4723 * cs-parser.jay (output): Removed unused.
4725 * cs-tokenizer.cs (hex_digits): Removed unused.
4727 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4729 * expression.cs (Indirection.LoadExprValue): Removed unused.
4730 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4732 * iterators.cs (Iterator.param_types): Removed unused.
4734 * statement.cs (Goto.block): Removed unused.
4735 (ToplevelBlock.did): Removed unused.
4736 (Switch.ResolveConstantSwitch): Removed unused.
4738 2005-04-01 Ben Maurer <bmaurer@ximian.com>
4740 * rootcontext.cs: Allow mcs to bootstrap with the compilation
4743 2005-04-01 Raja R Harinath <rharinath@novell.com>
4745 Fix #74232 and cs0208-3.cs.
4746 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4747 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4748 unmanaged type. Don't use FieldBuilders when 't' is a
4749 TypeBuilder. Use ModFlags and MemberType fields.
4750 * class.cs (MemberBase.member_type): Rename from MemberType.
4751 (MemberBase.MemberType): New property. Determines member_type on
4753 (MemberBase.DoDefine): Don't initialize MemberType here.
4754 (FieldMember.Define): Likewise.
4756 2005-04-01 Marek Safar <marek.safar@seznam.cz>
4759 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4760 Attributes are emitted there.
4762 2005-04-01 Raja R Harinath <rharinath@novell.com>
4764 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4765 keyword in 'partial enum' too.
4766 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4768 Report from Kamil Skalski <nazgul@omega.pl>.
4771 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4772 have partial containers too.
4774 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4775 in block' checks to Block.CheckInvariantMeaningInBlock.
4776 * statement.cs (Block.GetKnownVariableInfo): Make private.
4777 (Block.IsVariableUsedInChildBlock): Remove.
4778 (Block.IsVariableUsedInBlock): Likewise.
4779 (Block.CheckInvariantMeaningInBlock): New. Show location of
4780 conflicting declaration.
4781 (Block.AddVariable): Make error messages less long-winded and more
4782 specific. Show location of conflicting declaration.
4783 * parameter.cs (Parameters.Location): New readonly property.
4785 2005-03-31 Raja R Harinath <rharinath@novell.com>
4787 Clean up semantics of invoking ResolveMemberAccess.
4788 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4789 can have an instance, ensure that we pass in a non-TypeExpression
4790 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
4791 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4792 argument. Update to changes and simplify.
4793 (FieldExpr.Emitinstance): Remove CS0120 check.
4794 (PropertyExpr.EmitInstance): Likewise.
4795 * expression.cs (Argument.Resolve): Likewise.
4796 (Invocation.DoResolve): Update to changes in semantics of
4799 2005-03-31 Marek Safar <marek.safar@seznam.cz>
4802 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4805 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4807 2005-03-31 Raja R Harinath <rharinath@novell.com>
4809 Fix difference in behaviour with commandline invocation.
4810 * driver.cs (Driver.Reset): New.
4811 (CompilerCallableEntryPoint): Call it.
4813 * statement.cs (If.Resolve): Avoid spurious "uninitialized
4814 variable" warnings if the boolean expression failed to resolve.
4816 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
4818 * attribute.cs: Fix the union of several permissions when some of them
4819 are unrestricted (so the result isn't an unrestricted permission set).
4822 2005-03-30 Raja R Harinath <rharinath@novell.com>
4824 * ecore.cs (MemberExpr): New class. Convert from interface
4826 (MemberExpr.ResolveMemberAccess): Refactor and move here from
4827 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
4829 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4830 (MethodGroupExpr.IsExplicitImpl): Remove.
4831 (Expression.GetFieldFromEvent): Remove.
4832 (SimpleName.MemberStaticCheck): Remove.
4833 (SimpleName.DoSimpleNameResolve): Update to changes.
4834 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4835 (MemberAccess.IdenticalNameAndTypeName): Remove.
4836 (MemberAccess.error176): Move to MemberExpr.
4837 (MemberAccess.DoResolve): Update to changes.
4838 (BaseAccess.DoResolve): Likewise.
4840 2005-03-30 Marek Safar <marek.safar@seznam.cz>
4842 C# 2.0 Conditional attribute class implementation
4844 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4845 Analyzes class whether it has attribute which has ConditionalAttribute
4846 and its condition is not defined.
4848 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4849 (Class.IsExcluded): New method. Search for at least one defined
4850 condition in ConditionalAttribute of attribute class.
4852 2005-03-30 Raja R Harinath <rharinath@novell.com>
4854 * ecore.cs (PropertyExpr): Derive from Expression, not
4855 ExpressionStatement.
4856 (PropertyExpr.EmitStatement): Remove.
4858 2005-03-29 Raja R Harinath <rharinath@novell.com>
4861 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4862 internal field "value__" of an enum be private. The examples for
4863 "value__" that I found on MSDN all used FieldAttributes.Private.
4865 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4866 Don't mention IL method attribute names.
4868 Fix #47991. Remove a TODO.
4869 * statement.cs (Block.Toplevel): Make into a field.
4870 (Block.Parameters): Move into ToplevelBlock.
4871 (Block.known_variables): Rename from child_variable_names.
4872 (Block.Block): Remove variants that take Parameters. Initialize
4873 'Toplevel' with the immediately surrounding toplevel block.
4874 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
4875 LocalInfo parameter.
4876 (Block.GetKnownVariableInfo): New.
4877 (Block.IsVariableNameUsedInChildBlock): Update.
4878 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
4879 the block, even though it may not be in scope.
4880 (Block.AddVariable): Remove Parameters parameter. Use
4881 Toplevel.Parameters instead.
4882 (Block.AddConstant): Remove Parameters parameter.
4883 (Block.GetParameterReference): Update to use Toplevel.Parameters.
4884 (Block.IsParamaterReference): Likewise.
4885 (Block.IsLocalParameter): Likewise. Simplify a lot.
4886 (ToplevelBlock.Parameters): New. Moved from Block.
4887 (ToplevelBlock.ToplevelBlock): Update to changes. Always
4888 initialize Parameters to a non-null value.
4889 * cs-parser.jay: Update to changes.
4890 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4891 simple names that mean different things in the same block. Use
4892 Block.IsVariableNameUsedInBlock.
4894 2005-03-28 Raja R Harinath <rharinath@novell.com>
4896 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4897 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4898 GetTypeHandle. It is possible for a reflected type to derive from
4899 a TypeBuilder (e.g., int[] derives from the TypeBuilder
4900 System.Array during mscorlib compilation).
4901 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4902 contain a method_hash, don't create one either. Don't create a
4903 deep copy of the base cache's method_hash.
4904 (MemberCache.SetupCache): Rename back from DeepCopy.
4905 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4906 already initialized. If we see an override function, add its
4907 underlying base virtual function to the member_hash too.
4909 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4911 2005-03-26 Raja R Harinath <harinath@acm.org>
4914 * assign.cs (Assign.DoResolve): When the RHS of an assignment
4915 fails to resolve, ensure that the LHS is still resolved as an
4918 2005-03-25 Raja R Harinath <harinath@acm.org>
4920 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4922 (Enum.current_ec): Remove.
4923 (Enum.LookupEnumValue): Remove EmitContext argument.
4924 Just uses the one created during DefineType.
4925 (Enum.FindMembers): Update.
4926 * expression.cs (MemberAccess.DoResolve): Update.
4928 2005-03-22 Marek Safar <marek.safar@seznam.cz>
4930 * assign.cs (Assign.DoResolve): Check for CS1717 when
4931 source and target are same (uses Equals).
4933 * expression.cs (LocalVariableReference, ParameterReference,
4934 This): Implemented Equals, GetHashCode.
4936 * statement.cs (Block.GetParameterReference): Removed useless
4939 2005-03-22 Raja R Harinath <rharinath@novell.com>
4942 * statement.cs (Block.AddVariable): Ensure that we skip implicit
4943 blocks before deciding whether the error is cs0136 or cs0128.
4945 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4946 (using_alias_directive, using_namespace_directive): Pass
4947 MemberName, not an expression to Namespace.UsingAlias and
4949 (MakeName): Use the MemberName of the namespace.
4950 * namespace.cs (Namespace.MemberName): New.
4951 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4952 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4954 * decl.cs (MemberName.Name): Make readonly.
4955 (MemberName.FromDotted): New "constructor".
4956 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4957 (MemberCore.Name): Compute from MemberName on demand.
4958 (MemberCore.SetMemberName): Provide a way to change the
4960 (MemberCore.AddToContainer): Don't take a fullname parameter.
4961 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4962 fully qualified name of the container to the member name.
4963 (TypeContainer.AddToTypeContainer): Use a fully qualified name
4964 only if the type is a member of the root container.
4965 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4966 MemberName.Left rather than searching for an embedded ".".
4967 (PartialContainer.CreatePart): Update to changes in RootContext.
4968 (MemberBase.ShortName): Turn into a property. Use
4969 MemberCore.SetMemberName.
4970 (MemberBase.ExplicitInterfaceName): Remove.
4971 (MemberBase.UpdateMemberName): Remove.
4972 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4973 (PropertyBase.SetMemberName): New override.
4974 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4975 (Tree.GetDecl): New.
4976 (Tree.AllDecls): Rename from Decls.
4977 * attribute.cs, enum.cs, report.cs: Update to changes.
4978 * driver.cs (MainDriver): Use MemberName.FromDotted on
4979 RootContext.MainClass.
4981 2005-03-21 Marek Safar <marek.safar@seznam.cz>
4983 * class.cs (FixedField.Define): Check for CS1664 and more sanity
4986 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4988 2005-03-18 Marek Safar <marek.safar@seznam.cz>
4990 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4991 property accessor modifiers.
4993 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4994 fixed buffer attribute (CS1716).
4995 (PropertyMethod.HasCustomAccessModifier): When property accessor
4996 has custom modifier.
4998 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5000 (PropertyExpr.DoResolveLValue): Add CS0272.
5002 2005-03-17 Miguel de Icaza <miguel@novell.com>
5004 * convert.cs: When converting to a pointer, use the proper Conv.U
5005 or Conv.I depending on the source data type.
5007 * cs-tokenizer.cs: Make the size for large decimal constants,
5010 2005-03-17 Martin Baulig <martin@ximian.com>
5012 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5013 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
5015 2005-03-17 Martin Baulig <martin@ximian.com>
5017 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5018 to bool so we can return an error condition.
5019 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5022 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
5024 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5027 2005-03-16 Raja R Harinath <rharinath@novell.com>
5029 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5030 Refactor to avoid traversing the list of assemblies, and to avoid
5031 string concatenation.
5032 * typemanager.cs (guid_attr_type): Remove.
5033 (negative_hits, pointers, references): Remove hashes.
5035 (GetConstructedType): New. Uses type_hash to handle constructed
5036 types (arrays, references, pointers).
5037 (GetReferenceType, GetPointerType): Use it.
5038 (GetNestedType): New. Uses type_hash to handle nested types of
5040 (LookupType, LookupTypeDirect): Remove.
5041 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
5042 'types' hash and LookupTypeReflection directly.
5043 (params_string, params_object): Use GetConstructedType.
5044 * namespace.cs (Namespace.cached_types): New. Cache of reflected
5046 (Namespace.Lookup): Use cached_types.
5047 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5048 provided by old TypeManager.LookupType.
5049 * rootcontext.cs (MakeFQN): Remove.
5050 * decl.cs (DeclSpace.MakeFQN): Likewise.
5051 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5052 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5053 TypeManager.GetConstructedType.
5054 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5056 2005-03-15 Marek Safar <marek.safar@seznam.cz>
5058 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
5061 * cs-parser.jay: Reports CS1527 for any namespace element.
5063 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5066 * expression.cs (ParameterReference.IsAssigned): Changed error to
5068 (Error_WrongNumArguments): Moved CS0245 detection here.
5070 * statement.cs (Return.Resolve): Add CS1622 report.
5072 2005-03-11 Marek Safar <marek.safar@seznam.cz>
5074 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5076 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
5078 * attribute.cs expression.cs: Get rid of some allocations.
5080 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
5082 * doc.cs : just eliminate the latest change.
5084 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5086 * doc.cs : commented out the latest change. It breaks xml-030.cs
5088 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5090 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5091 fail. So invoke CreateType() in FindDocumentedType().
5093 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5095 * cs-tokenizer.cs : added IsKeyword().
5096 * doc.cs : Detect keyword incorrectly used as identifier.
5097 Allow identifiers prefixed by @.
5099 2005-03-10 Marek Safar <marek.safar@seznam.cz>
5101 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5102 It caused exception in namespace resolving (again!).
5104 * class.cs (Class.ctor): Removed exit.
5105 (PropertyMethod.ctor): ditto.
5107 * codegen.cs (Codegen.Reset): Reset static data.
5108 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5110 * cs-tokenizer.cs (Cleanup): Removed.
5112 * driver.cs (GetSystemDir): Rewrote to one line command.
5113 It caused problem with unloaded dynamic modules.
5114 (UnixParseOption): Removed Exit.
5115 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5116 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5117 Now can be mcs used as library.
5119 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5122 * location.cs (Reset): Reset static data.
5124 * namespace.cs (Reset): Reset static data.
5126 * report.cs (Report.Reset): Reset static data.
5128 * rootcontext.cs (RootContext.Reset): Reset static data.
5130 * tree.cs (RootTypes.ctor): Use Location.Null
5132 * typemanager.cs (TypeManager.Reset): Reset static data.
5133 (CoreLookupType): Removed Exit.
5134 (TypeHandle.Reset): Reset static data.
5136 2005-03-10 Raja R Harinath <rharinath@novell.com>
5139 * typemanager.cs (ComputeNamespaces): Import namespaces from
5140 referenced modules too.
5142 2005-03-09 Raja R Harinath <rharinath@novell.com>
5144 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5147 2005-03-09 Raja R Harinath <rharinath@novell.com>
5149 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5150 enclosing DeclSpace. This ensures that a name-lookup populates
5151 more caches and there are fewer 'TypeExpression's. Carve out
5152 nested type lookup into ...
5153 (LookupNestedTypeInHierarchy): ... this.
5155 2005-03-09 Raja R Harinath <rharinath@novell.com>
5157 Clean up a few partial-class semantics.
5158 Fixes test-357.cs and cs1618-2.cs.
5159 * cs-parser.jay (struct_declaration): Use 'current_class' as
5160 parent of newly-created struct. Remove call to Register ().
5161 Use 'pop_current_class' to complete handing the current struct.
5162 (interface_declaration): Likewise.
5163 (class_declaration): Likewise.
5164 (enum_declaration): Use 'current_class' as parent of newly created
5166 (delegate_declaration): Likewise.
5167 (pop_current_class): New function. This is used to handle closing
5168 up the 'current_class' and 'current_container', and pointing them
5169 to the enclosing class/container.
5170 (CSharpParser): Initialize 'current_class' too.
5171 * decl.cs (MemberCore): Add check for invariant: a partial
5172 container is not a parsed entity, and thus does not enclose any
5174 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5175 (DeclSpace.BaseTypeExpr): Use it.
5176 (DeclSpace.LookupType): Add check for invariant.
5177 * class.cs (TypeContainer): Add check for invariant: a nested
5178 class should have the same NamespaceEntry as its enclosing class.
5179 (TypeContainer.EmitFieldInitializers): Make virtual.
5180 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5182 (TypeContainer.Register): Remove.
5183 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5184 null. Use TypeResolveEmitContext for resolving base types and
5185 interfaces. Move initialization of Parts.TypeBuilder here from
5187 (TypeContainer.DefineNestedTypes): ... here.
5188 (PartialContainer): Take a Namespace not a NamespaceEntry.
5189 (PartialContainer.Create): Don't use Register. Call the
5190 appropriate Add... function directly.
5191 (ClassPart): Take both the PartialContainer and the enclosing
5192 class as constructor arguments.
5193 (ClassPart.EmitFieldInitializers): Override.
5194 (ClassPart.PartFindNestedTypes): Remove.
5195 (FieldBase.GetInitializerExpression): Resolve the initializer
5196 expression in the emit context of the enclosing class.
5197 * tree.cs (RootTypes): Remove Register ().
5199 2005-03-08 Marek Safar <marek.safar@seznam.cz>
5201 * cs-parser.jay: Removed CS0134.
5203 * driver.cs: Removed CS1901.
5205 * expression.cs (SizeOf.DoResolve): Don't report CS0233
5206 for predefined types.
5208 2005-03-07 Duncan Mak <duncan@novell.com>
5210 * codegen.cs (Save): Catch UnauthorizedAccessException as
5211 well. Fixes bug #73454.
5213 2005-03-07 Marek Safar <marek.safar@seznam.cz>
5215 * cs-tokenizer.cs (xtoken): Add CS1035.
5217 * class.cs (MethodData.Define): Add CS0683.
5218 (FieldMember.ctor): Add CS0681.
5220 2005-03-07 Raja R Harinath <rharinath@novell.com>
5222 * ecore.cs (SimpleName.DoResolve): Rename from
5223 SimpleName.DoResolveAllowStatic.
5224 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5225 Pass 'intermediate' flag to MemberStaticCheck.
5226 (SimpleName.MemberStaticCheck): Skip "static check" only in case
5227 of "intermediate" lookups via MemberAccess.
5228 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
5229 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5231 2005-03-07 Raja R Harinath <rharinath@novell.com>
5234 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5235 slipped in because of variable names that are identical to a
5236 builtin type's BCL equivalent ('string String;', 'int Int32;').
5237 (PropertyExpr.EmitInstance): Likewise.
5239 2005-03-04 Marek Safar <marek.safar@seznam.cz>
5241 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5243 * report.cs (warning_ignore_table): Made public.
5245 2005-03-04 Raja R Harinath <rharinath@novell.com>
5248 * class.cs (MethodData.Emit): Pass 'container' to
5249 container.GetObsoleteAttribute instead of 'container.Parent'.
5251 2005-03-03 Marek Safar <marek.safar@seznam.cz>
5253 * cs-parser.jay: Add 1534 error test.
5255 * iterators.cs (Yield.CheckContext): Add error 1629.
5256 (Iterator.ctor): Save unsafe modifier.
5257 (MoveNextMethod.DoEmit): Restore unsafe context.
5259 * namespace.cs (UsingAlias): Better error message.
5261 2005-03-03 Dan Winship <danw@novell.com>
5263 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5264 the warning message [#73219]
5266 2005-03-03 Raja R Harinath <rharinath@novell.com>
5268 Fix compile with MCS 1.0.0.0.
5269 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5270 w_restore to not depend on string constant folding.
5272 2005-03-03 Raja R Harinath <rharinath@novell.com>
5274 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
5275 CS0246 check to users who passed 'silent = false'.
5276 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5278 (SimpleName.SimpleNameResolve): Update.
5279 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5280 (MemberAccess.IdenticalNameAndTypeName): Update.
5281 * doc.cs (FindDocumentedTypeNonArray): Update.
5283 2005-03-03 Raja R Harinath <rharinath@novell.com>
5285 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5286 * parameters.cs (ComputeAndDefineParameters): Remove.
5287 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5288 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5289 Use GetParameterInfo.
5291 2005-03-02 Marek Safar <marek.safar@seznam.cz>
5293 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5295 2005-03-02 Raja R Harinath <rharinath@novell.com>
5297 Unify DeclSpace.LookupType and DeclSpace.FindType.
5298 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
5299 is in charge of defining nested types on demand.
5300 (DeclSpace.LookupType): Use it when the current_type is a
5301 TypeBuilder. Use LookupTypeDirect for reflected types.
5302 (DeclSpace.FindType): Remove.
5303 (DeclSpace.LookupInterfaceOrClass): Likewise.
5304 (DeclSpace.DefineTypeAndParents): Likewise.
5305 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5306 DeclSpace.LookupType.
5307 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5308 * typemanager.cs (LookupType): Simplify.
5309 (AddUserType): Remove type from negative_hits.
5310 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5311 * class.cs (TypeContainer.FindMembers): Move handling of nested
5313 (TypeContainer.FindMembers_NestedTypes): ... here.
5314 (TypeContainer.FindNestedType): Implement override.
5315 (ClassPart.FindNestedType): Delegate to PartialContainer.
5316 (ClassPart.PartFindNestedType): Looks up the nested types of the
5319 2005-03-02 Martin Baulig <martin@ximian.com>
5321 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5322 static constructor in static classes.
5324 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
5326 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5327 sizeParamIndex is not specified.
5329 2005-03-01 Marek Safar <marek.safar@seznam.cz>
5332 * report.cs (WarningMessage.IsEnabled): Missing null check.
5334 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5336 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5337 in the fields and not in the properties.
5339 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
5341 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
5344 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5346 * attribute.cs: Small refactoring (improved robustness).
5347 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5348 (ValidateGuid): Removed.
5349 (Resolve): Removed referenced to above mentioned.
5350 (GetAttributeUsage): Made private and changed to work without
5352 (GetIndexerAttributeValue): Don't crash.
5353 (GetConditionalAttributeValue): Ditto.
5354 (GetClsCompliantAttributeValue): Ditto.
5355 (ExtractSecurityPermissionSet): All attributes exceptions are
5357 (GetPropertyValue): New helper.
5358 (GetMethodImplOptions): New method.
5359 (DefinePInvokeMethod): Reuse common code. Implemented handling of
5360 some missing properties.
5362 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5363 (Method.ApplyAttributeBuilder): Updated.
5365 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5368 2005-02-28 Raja R Harinath <rharinath@novell.com>
5371 * report.cs (Report.SymbolRelatedToPreviousError): Handle
5372 non-simple types (array, pointer, reference).
5374 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5376 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5378 * class.cs (MethodCore.IsDuplicateImplementation): Special error
5380 (Method.CheckBase): Catch wrong destructor here.
5381 (MethodData.Define): Add errors 550, 668.
5383 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5385 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5387 * pending.cs (VerifyPendingMethods): Add error 551.
5389 * typemanager.cs (CSharpName): Next error report helper.
5391 2005-02-25 Marek Safar <marek.safar@seznam.cz>
5393 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5394 attributes. Removed useless attribute double check.
5395 It saves almost 2MBs for corlib.
5397 2005-02-25 Raja R Harinath <rharinath@novell.com>
5400 * statement.cs (ExpressionStatement.Resolve): Make robust to being
5401 called twice in case of error.
5403 2005-02-23 Chris Toshok <toshok@ximian.com>
5405 Fix compiler portions of #72827.
5406 * statement.cs (Block.Emit): call Begin/EndScope on the
5407 EmitContext instead of the ILGenerator.
5409 * codegen.cs (EmitContext.BeginScope): new method, call
5410 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5412 (EmitContext.BeginScope): same, but EndScope and CloseScope
5414 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5415 offset and call the superclass's OpenScope(int) with it.
5416 (SymbolWriter.CloseScope): get the current il
5417 offset and call superclass's CloseScope(int) with it.
5419 2005-02-23 Marek Safar <marek.safar@seznam.cz>
5421 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5422 CS1677 for out and ref as well.
5424 * class.cs (Method.Define): Add error CS1599 detection.
5426 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5428 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5430 * delegate.cs (Delegate.Define): Add error CS1599 detection.
5432 * support.cs.cs (ModifierDesc): New helper method.
5434 2005-02-23 Raja R Harinath <rharinath@novell.com>
5435 Abin Thomas <projectmonokochi@rediffmail.com>
5436 Anoob V E <projectmonokochi@rediffmail.com>
5437 Harilal P R <projectmonokochi@rediffmail.com>
5440 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5441 MemberLookup (used for error reporting) actually returns a result.
5442 Fix error report number (122, not 112).
5444 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
5445 Anoob V E <projectmonokochi@rediffmail.com>
5446 Harilal P R <projectmonokochi@rediffmail.com>
5449 * pending.cs (PendingImplementation.GetAbstractMethods):
5450 Find NonPublic members too.
5452 2005-02-22 Marek Safar <marek.safar@seznam.cz>
5454 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5457 * class.cs (MethodCore.CheckMethodAgainstBase):
5458 Add error 239 report.
5460 2005-02-21 Raja R Harinath <rharinath@novell.com>
5463 * expression.cs (Invocation.IsApplicable): Make public.
5464 (Invocation.IsParamsMethodApplicable): Likewise.
5465 * delegate.cs (Delegate.VerifyApplicability): Don't use
5466 Invocation.VerifyArgumentCompat for parameter applicability
5467 testing. Use Invocation.IsApplicable and
5468 Invocation.IsParamsMethodApplicable.
5470 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5472 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5474 * class.cs (Operator.Define): Add error 217 report.
5476 2005-02-21 Raja R Harinath <rharinath@novell.com>
5478 * namespace.cs (UsingEntry.Resolve): Undo change below.
5480 2005-02-21 Raja R Harinath <rharinath@novell.com>
5483 * ecore.cs (Expression.MemberLookupFailed): Add argument to
5484 disable the error message when the extended MemberLookup also
5486 (Expression.MemberLookupFinal): Update.
5487 (SimpleName.DoSimpleNameResolve): Update.
5488 * expression.cs (MemberAccess.ResolveNamespaceOrType):
5489 Don't use MemberLookupFinal.
5490 (New.DoResolve): Update.
5491 (BaseAccess.CommonResolve): Update.
5493 2005-02-21 Raja R Harinath <rharinath@novell.com>
5496 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5497 occured previously, don't resolve again.
5499 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5502 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5503 argument. Call ResolveAttributeUsage for unresolved.
5504 when types doesn't match ctor arguments.
5506 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5507 for nested attribute classes.
5508 (Class.attribute_usage): Removed.
5509 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5510 for attribute class.
5512 * ecore.cs (IsAttribute): Removed.
5514 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5516 * rootcontext.cs (RegisterAttribute): Removed, attributes are
5518 (attribute_types): Removed.
5519 (EmitCode): Global attributes are emited as the latest.
5521 2005-02-18 Marek Safar <marek.safar@seznam.cz>
5523 * class.cs (EmitFieldInitializers): Don't emit field initializer
5524 for default values when optimilization is on.
5526 * constant.cs (Constant.IsDefaultValue): New property.
5528 * driver.cs: Add /optimize handling.
5532 * literal.cs: Implement new IsDefaultValue property.
5534 * rootcontext.cs (Optimize): New field, holds /optimize option.
5536 2005-02-18 Raja R Harinath <rharinath@novell.com>
5538 Fix crasher in re-opened #72347.
5539 * namespace.cs (Namespace.Lookup): Return null if
5540 DeclSpace.DefineType returns null.
5543 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5545 2005-02-18 Raja R Harinath <rharinath@novell.com>
5547 Fix remainder of #63202. Change semantics of DoResolveLValue: it
5548 now returns null if it cannot resolve to an lvalue.
5549 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5550 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5551 returned null. Remove check for SimpleName.
5552 (EventExpr.DoResolveLValue): New.
5553 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5554 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
5556 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
5558 (Unary.ResolveOperator): Move CS0211 check ...
5559 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
5561 (Unary.DoResolveLValue): Simplify.
5562 (AddressOf.DoResolveLValue): New.
5563 (ArrayAccess.DoResolveLValue): New.
5565 2005-02-16 Marek Safar <marek.safar@seznam.cz>
5567 * attribute.cs (Attribute.Resolve): Add arguments casting for
5568 when types doesn't match ctor arguments.
5570 2005-02-16 Raja R Harinath <rharinath@novell.com>
5572 Fix parts of #63202.
5573 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5574 lookup of operator in base type. Ensure that all checks happen
5575 when the operator resolves to an "op_..." method.
5577 2005-02-15 Raja R Harinath <rharinath@novell.com>
5580 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5581 'ignore_cs0104' parameter. Pass it to ...
5582 (NamespaceEntry.Lookup): ... this.
5583 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5584 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5585 (TypeLookupExpression.DoResolveAsTypeStep): Update.
5586 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5587 Update. Request that cs0104 errors be ignored.
5588 (ComposedCast.ResolveAsTypeStep): Update.
5590 2005-02-14 Raja R Harinath <rharinath@novell.com>
5593 * expression.cs (Invocation.BetterFunction): Remove support for
5594 comparing virtual functions and their overrides.
5595 (Invocation.IsOverride): New.
5596 (Invocation.OverloadResolve): Don't consider 'override' functions
5597 during candidate selection. Store them in a lookaside list.
5598 If the selected method is a 'virtual' function, use the list to
5599 find any overrides that are closer to the LHS type.
5601 2005-02-14 Marek Safar <marek.safar@seznam.cz>
5603 * expression.cs (New.DoResolve): Add complex core type reduction.
5604 (New.Constantify): Converts complex core type syntax like 'new int ()'
5607 2005-02-14 Raja R Harinath <rharinath@novell.com>
5609 * decl.cs (EntryType.EntryType): New constructor to create an
5610 updated copy of a cache entry.
5611 (MemberCache.AddMethods): Use it.
5612 (MemberCache.ClearDeclaredOnly): Remove.
5613 (MemberCache.MemberCache): Update.
5615 2005-02-11 Miguel de Icaza <miguel@novell.com>
5617 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5618 variable. This one is represents the actual low-level declaration
5619 of the method, as opposed to the semantic level `IsStatic'.
5621 An anonymous method which is hosted into a static method might be
5622 actually an instance method. IsStatic would reflect the
5623 container, while MethodIsStatic represents the actual code
5626 * expression.cs (ParameterReference): Use the new MethodIsStatic
5627 instead of IsStatic.
5629 * anonymous.cs (AnonymousMethod.Compatible): Pass the
5630 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5631 set on the current EmitContext.
5633 * expression.cs (Cast): Overload DoResolveLValue so we can pass
5634 resolve our casted expression as an LValue. This triggers the
5635 proper LValue processing that is later required by Assign.
5639 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5641 2005-02-11 Marek Safar <marek.safar@seznam.cz>
5643 C# 2.0 Fixed buffer implementation
5645 * anonymous.cs: Update after RegisterHelperClass renaming.
5647 * attribute.cs (AttributeTester.fixed_buffer_cache):
5648 Cache of external fixed buffers.
5649 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5650 implementation if field is fixed buffer else null.
5653 (TypeContainer.AddField): Accept FieldMember instead of Field.
5654 (FieldBase.IsFieldClsCompliant): Extracted code from
5655 VerifyClsCompliance descendant customization.
5656 (FixedField): New class handles fixed buffer fields.
5657 (FixedFieldExternal): Keeps information about imported fixed
5659 (IFixedField): Make access to internal or external fixed buffer
5662 * cs-parser.jay: Add fixed buffer parsing.
5664 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5667 * expression.cs (Indirection): Extended implementation to accept
5669 (PointerArithmetic.Emit): Get element from fixed buffer as well.
5670 (ElementAccess.MakePointerAccess): Get type as parameter.
5671 (DoResolve): Add fixed buffer field expression conversion.
5672 (DoResolveLValue): Ditto.
5673 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5674 (ArrayPtr): Derives from FixedBufferPtr.
5675 (ArrayPtr.Emit): Add extra emit for array elements.
5677 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5679 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5680 for compiler generated types.
5681 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5683 * statement.cs (Fixed): Refactored to be easier add fixed buffer
5684 and consume less memory.
5685 (Fixed.Resolve): Add fixed buffer case.
5687 * typemanager.cs (compiler_generated_attr_ctor,
5688 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5689 (HasElementType): Add our own implementation to work on every
5692 2005-02-11 Miguel de Icaza <miguel@novell.com>
5694 * anonymous.cs (CaptureContext): Track whether `this' has been
5697 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
5698 only captured `this' if it was implicitly done (instance
5699 methods/variables were used).
5701 * codegen.cs (EmitContext.CaptureThis): New method to flag that
5702 `this' must be captured.
5704 2005-01-30 Miguel de Icaza <miguel@novell.com>
5706 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5707 is null it means that there has been no need to capture anything,
5708 so we just create a sibling.
5710 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5712 Just a partial fix. The other half is fairly elusive.
5714 2005-02-10 Raja R Harinath <rharinath@novell.com>
5716 Fix #52586, cs0121-4.cs.
5717 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
5718 and return a hashtable.
5719 (MemberCache.ClearDeclaredOnly): New.
5720 (MemberCache.MemberCache): Update to change. Make a deep copy of
5721 the method_hash of a base type too.
5722 (MemberCache.AddMethods): Adapt to having a deep copy of the base
5723 type methods. Overwrite entries with the same MethodHandle so
5724 that the ReflectedType is correct. The process leaves in base
5725 virtual functions and their overrides as distinct entries.
5726 (CacheEntry): Now a class instead of a struct. It shouldn't alter
5727 matters since it was boxed in a ArrayList before.
5728 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5730 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
5731 case of a virtual function and its override (choose the overload
5733 (Invocation.OverloadResolve): Avoid 'override' members during
5734 'applicable_type' calculation.
5736 2005-02-09 Raja R Harinath <rharinath@novell.com>
5738 Combine two near-redundant caches.
5739 * typemanager.cs (method_params): Rename from method_internal_params.
5740 (TypeManager.GetParameterData): New. Replace
5741 Invocation.GetParameterData.
5742 (TypeManager.LookupParametersByBuilder): Remove.
5743 * expression.cs (Invocation.method_parameter_cache): Remove.
5744 (Invocation.GetParameterData): Remove.
5746 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5749 2005-02-08 Raja R Harinath <rharinath@novell.com>
5752 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5753 TypeManager.multicast_delegate_type is null, resolve it by looking
5754 up "System.MulticastDelegate".
5755 * rootcontext.cs (RootContext.ResolveCore): Simplify.
5757 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
5758 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
5759 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
5762 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5763 (LabeledStatement.AddReference): New. Set 'referenced'.
5764 (Goto.Resolve): Use it.
5766 2005-02-05 John Luke <john.luke@gmail.com>
5768 * driver.cs: remove duplicate -doc line in Usage ()
5770 2005-02-04 Raja R Harinath <rharinath@novell.com>
5772 * location.cs (Location.AddFile): Fix CS2002 error report.
5774 2005-02-02 Martin Baulig <martin@ximian.com>
5776 * delegate.cs (Delegate.DefineType): Report an internal error if
5777 TypeManager.multicast_delegate_type is null. See bug #72015 for
5780 2005-02-02 Raja R Harinath <rharinath@novell.com>
5782 Fix a crasher in a variant of #31984.
5783 * const.cs (Constant.CheckBase): New override that defers the
5784 new-or-override check in case the base type hasn't been populated
5786 (Constant.Define): Ensure the new-or-override check is performed.
5788 2005-02-01 Duncan Mak <duncan@ximian.com>
5790 * const.cs (LookupConstantValue): Check that `ce' is not null
5791 before calling GetValue ().
5793 2005-02-01 Raja R Harinath <rharinath@novell.com>
5795 Fix test-334.cs (#69519).
5796 * cs-parser.jay (using_alias_directive): Pass in an expression to
5797 NamespaceEntry.UsingAlias.
5798 (using_namespace_directive): Pass in an expression to
5799 NamespaceEntry.Using.
5800 (namespace_name): Don't flatten to a string.
5801 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5802 (NamespaceEntry.AliasEntry.Resolve): Lookup using
5804 (NamespaceEntry.UsingEntry): Likewise.
5805 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5807 (NamespaceEntry.LookupForUsing): Remove.
5808 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5810 (NamespaceEntry.Lookup): Remove support for dotted names.
5812 2005-02-01 Raja R Harinath <rharinath@novell.com>
5814 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5816 (NamespaceEntry.ImplicitParent): Compute on demand.
5817 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5818 parallels the current.
5819 (NamespaceEntry.LookupForUsing): Use it.
5820 (NamespaceEntry.Lookup): If the current namespace-entry is
5821 implicit, don't search aliases and using tables.
5823 2005-02-01 Raja R Harinath <rharinath@novell.com>
5826 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5828 (TypeContainer.BaseCache): Compute on demand.
5829 (TypeContainer.FindMembers): Define constants and types if they're
5830 not already created.
5831 (FieldMember.Define): Move resetting of ec.InUnsafe before error
5833 * const.cs (Constant.Define): Make idempotent.
5835 2005-01-29 Miguel de Icaza <miguel@novell.com>
5837 * pending.cs: Produce better code (no nops produced by using Ldarg
5840 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5841 i - 1' it should be arg + 1.
5845 2005-01-28 Raja R Harinath <rharinath@novell.com>
5847 * attribute.cs (Attribute.CheckAttributeType): Make private
5849 (Attribute.ResolveType): Make virtual.
5850 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5851 handling of RootContext.Tree.Types.
5853 2005-01-27 Raja R Harinath <rharinath@novell.com>
5855 Update attribute-handling to use the SimpleName/MemberAccess
5857 * cs-parser.jay (attribute): Pass in an expression to the
5858 constructors of Attribute and GlobalAttribute.
5859 * attribute.cs (Attribute): Take an expression for the name.
5860 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
5861 passed in attribute name expression.
5862 (Attribute.CheckAttributeType): Use it.
5863 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5864 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5865 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
5866 argument to prevent error messages if the lookup fails.
5868 2005-01-27 Marek Safar <marek.safar@seznam.cz>
5870 * expression.cs (Indirection): Implemented IVariable interface
5871 to support indirection in AddressOf operator.
5872 (PointerArithmetic.Emit): Add optimalization for case where
5873 result can be precomputed.
5875 2005-01-26 Martin Baulig <martin@ximian.com>
5877 * class.cs (TypeContainer.AttributeTargets): Return the correct
5878 AttributeTargets depending on our `Kind' instead of throwing an
5879 exception; fixes #71632.
5881 2005-01-26 Marek Safar <marek.safar@seznam.cz>
5884 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5887 2005-01-25 Raja R Harinath <rharinath@novell.com>
5890 * expression.cs (MemberAccess.DoResolve): Don't complain with
5891 cs0572 when the LHS of a member access has identical name and type
5894 2005-01-25 Marek Safar <marek.safar@seznam.cz>
5897 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5899 Create custom PermissionSet only for PermissionSetAttribute.
5901 2005-01-24 Marek Safar <marek.safar@seznam.cz>
5904 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5905 delegates in static class.
5907 2005-01-24 Martin Baulig <martin@ximian.com>
5909 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5910 merging an implicit block, just use its reachability.
5912 * statement.cs (Block.Resolve): Make the unreachable code check
5913 work wrt. implicit blocks; see test-337 from #63842.
5915 2005-01-21 Alp Toker <alp@atoker.com>
5917 * cs-parser.jay: destructor_declaration's container is PartialContainer
5918 not Class when partial types are used, so use Kind prop instead of
5921 2005-01-22 Miguel de Icaza <miguel@ximian.com>
5923 * cs-parser.jay: Improve error reporting when an interface
5926 2005-01-20 Dick Porter <dick@ximian.com>
5928 * support.cs: SeekableStreamReader fix from Sandor Dobos
5929 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5930 chars are read. Fixes bug 70369.
5932 2005-01-20 Raja R Harinath <rharinath@novell.com>
5934 * cs-parser.jay (catch_clause): Simplify current_block handling
5937 2005-01-17 Miguel de Icaza <miguel@ximian.com>
5939 * convert.cs (ImplicitStandardConversionExists): Synchronize the
5940 code with ImplicitStandardConversion to handle the implicit
5941 conversion of method groups into valid delegate invocations.
5943 The problem is that in parameter handling we were using this code
5944 path. Fixes bug #64698
5946 2005-01-19 Raja R Harinath <rharinath@novell.com>
5948 * cs-parser.jay: Fix several infelicities.
5949 - Avoid assigning to the parser value stack. Code like
5950 '$3 = null' is unclean. Synthesize a value for the code block
5952 - Avoid using oob_stack for storing location information. Use ...
5953 (_mark_): ... this. New (empty) rule. Saves the current location
5955 (foreach_statement): Avoid using oob_stack for current_block
5956 handling. Use technique used in for_statement and
5957 using_statement. Synthesize a value for the code block to store
5958 additional intermediate information.
5960 2005-01-13 Miguel de Icaza <miguel@ximian.com>
5962 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5963 of a different type is only allowed to private fields of a
5964 containing type, not on fields of a base class.
5966 See test-174.cs and error cs0122-9.cs
5968 2005-01-13 Raja R Harinath <rharinath@novell.com>
5970 Fix test-335.cs (bug #58126).
5971 * cs-parser.jay (argument): Split out non-expression parts of the
5972 rule into 'non_simple_argument'.
5973 (invocation_expression): Support parenthesized invocations with
5974 multiple arguments, and with single non-simple arguments.
5976 2005-01-13 Raja R Harinath <rharinath@novell.com>
5978 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5981 2005-01-12 Raja R Harinath <rharinath@novell.com>
5983 Fix cs0038-1.cs, cs1640-6.cs.
5984 * ecore.cs (Expression.Resolve): Remove special-case for
5985 SimpleName in error-handling.
5986 (Expression.almostMatchedMembers): Relax access permission to
5988 (Expression.MemberLookupFailed): Handle duplicates in
5989 almostMatchedMembers list.
5990 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5991 * expression.cs (New.DoResolve): Report CS1540 for more cases.
5992 * typemanager.cs (GetFullNameSignature): Use the MethodBase
5993 overload if the passed in MemberInfo is a MethodBase.
5995 2005-01-12 Marek Safar <marek.safar@seznam.cz>
5998 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5999 for non-CAS & merge permission sets properly.
6001 2005-01-11 Raja R Harinath <rharinath@novell.com>
6003 Improve standard-compliance of simple name and member access
6004 resolution. Fixes bugs #52697, #57200, #67520, #69519.
6005 * ecore.cs (FullNamedExpression): New abstract base class
6006 for Namespaces and TypeExpressions.
6007 (ResolveFlags.SimpleName): Remove.
6008 (SimpleName): Remove support for dotted names.
6009 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
6010 DeclSpace.FindType and DeclSpace.LookupType.
6011 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6012 (Expression.ExprClassName): Make member function.
6013 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6014 a namespace. Remove creation of dotted "SimpleName"s.
6015 (MemberAccess.DoResolve): Likewise.
6016 * decl.cs (DeclSpace.Cache): Make private.
6017 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6018 (DeclSpace.FindType): Update.
6019 (DeclSpace.LookupType): Move here from RootContext. Return a
6020 FullNamedExpression.
6021 * namespace.cs (Namespace): Derive from FullNamedExpression
6022 so that it can be part of expression resolution.
6023 (Namespace.Lookup): Return an FullNamedExpression.
6024 (NamespaceEntry.LookupAlias): Lookup aliases only in current
6026 * rootcontext.cs (NamespaceLookup): Remove.
6027 (LookupType): Move to DeclSpace.
6028 * attribute.cs (CheckAttributeType): Update.
6029 * doc.cs (FindDocumentedType): Remove allowAlias argument.
6030 (FindDocumentedTypeNonArray): Likewise.
6032 2005-01-11 Raja R Harinath <rharinath@novell.com>
6034 Fix cs0509.cs, cs1632.cs.
6035 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6036 is the same as IsInterface.
6037 (TypeContainer.GetClassBases): Likewise.
6038 * statement.cs (LabeledStatement.ig): New field.
6039 (LabeledStatement.LabelTarget): Save ILGenerator which created the
6041 (LabeledStatement.DoEmit): Check that the label was created with
6042 the same ILGenerator.
6044 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6047 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6048 accessors to its properties.
6050 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6051 from accessors to property.
6053 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6056 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6059 2005-01-08 Miguel de Icaza <miguel@ximian.com>
6061 * attribute.cs: Check for null and empty strings.
6063 I have lost another battle to Paolo.
6065 2005-01-07 Marek Safar <marek.safar@seznam.cz>
6068 * class.cs (PropertyMethod): Set Parent field in ctors.
6069 (SetMethod.InternalParameters): Add unsafe switch hack.
6070 Override MarkForDuplicationCheck where it is appropriate.
6072 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6073 It says whether container allows members with the same name.
6075 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6076 Removed is_method parameter.
6078 2005-01-06 Duncan Mak <duncan@ximian.com>
6080 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6081 because the previous change led to incorrect reporting of CS1032
6082 ("Cannot define/undefine preprocessor symbols after first token in
6083 file"). Instead of using `tokens_seen' as the only flag that
6084 triggers CS1040, introduce `comments_seen'. This new flag is used
6085 to signify having seen comments on the current line, so it is
6086 unset after a newline.
6088 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6090 * doc.cs : When searching for a type, find nested type too.
6091 This fixes bug #71040.
6093 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6096 - Warn missing member comment on those classes which also does not
6097 have doc comments. Fixed bug #71041.
6098 - Don't warn missing doc comment on default constructor.
6101 2005-01-06 Duncan Mak <duncan@ximian.com>
6103 * cs-tokenizer.cs (xtoken): After handling traditional C-style
6104 comments, set `tokens_seen' to true. This allows us to detect
6105 misplaced preprocessor directives (i.e. not at the beginning of
6106 the a line, nor after whitespaces). In that case, report error
6107 CS1040. This fixes bug #56460.
6109 * cs-parser.jay (interface_member_declaration): Add checks for
6110 IsExplicitImpl, and report CS0541 error if an interface member is
6111 defined as an explicit interface declaration.
6113 2005-01-06 Marek Safar <marek.safar@seznam.cz>
6116 * class.cs (PropertyMethod): Set Parent field in ctors.
6117 (SetMethod.InternalParameters): Add unsafe switch hack.
6119 * decl.cs (MemberCore.Parent): Cannot be readonly.
6121 2005-01-06 Raja R Harinath <rharinath@novell.com>
6123 * decl.cs (DeclSpace.ResolveType): Remove.
6124 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6125 Merge in code from ...
6126 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
6127 * class.cs, enum.cs: Update to changes.
6129 2005-01-06 Miguel de Icaza <miguel@ximian.com>
6131 * anonymous.cs: Ensure that we init the scope of our parent if it
6132 has not been initialized yet.
6134 2004-12-30 Duncan Mak <duncan@ximian.com>
6136 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6137 if field.FieldBuilder is null. Fixes #70758.
6139 * convert.cs: Fixed some typos and updated some of the comments.
6140 (ImplicitStandardConversionExists):
6141 (TryImplicitIntConversion): If `target_type' is an interface and
6142 the type of `ic' implements this interface, return true or a new
6143 BoxedCast instead of null. This fixes #70468.
6145 2004-12-29 Duncan Mak <duncan@ximian.com>
6147 * expression.cs (Argument.Emit): Check that Expr is
6148 IMemoryLocation before casting to it, and report CS1510 otherwise.
6152 2004-12-21 Ben Maurer <bmaurer@ximian.com>
6154 * statement.cs (Block.ThisVariable): remove the recursion here, to
6155 make the --profile more sane.
6157 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
6159 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6160 assembly, by JB Evain.
6162 2004-12-17 Raja R Harinath <rharinath@novell.com>
6164 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
6165 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6166 "parent" refers to enclosing type/class. "base" refers to superclass.
6168 2004-12-17 Raja R Harinath <rharinath@novell.com>
6170 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6171 Ensure that we only have GlobalAttributes.
6172 * attribute.cs (Attribute.Emit): Make non-virtual.
6173 (GlobalAttribute.Emit): Remove.
6174 (Attribute.Resolve): Make virtual.
6175 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
6176 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6177 the argument. Don't create one.
6178 (Attribute.GetObsoleteAttribute): Likewise.
6179 (Attribute.GetClsCompliantAttributeValue): Likewise.
6180 * class.cs, decl.cs: Update to changes.
6182 2004-12-17 Marek Safar <marek.safar@seznam.cz>
6184 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6186 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6188 * statement.cs (Foreach.Resolve): Add error 186 report.
6190 2004-12-16 Marek Safar <marek.safar@seznam.cz>
6192 * expression.cs (Conditional.DoResolve): Add warning 429.
6194 * statement.cs (If.Resolve): Add warning 665.
6196 2004-12-16 Raja R Harinath <rharinath@novell.com>
6198 New invariant: RootContext.Tree.Types.NamespaceEntry == null
6199 except when in the parser, and in GlobalAttribute.
6200 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6201 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6202 RootContext.Tree.Types.NamespaceEntry once work is done.
6203 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
6204 and resets RootContext.Tree.Types.NamespaceEntry.
6206 2004-12-15 Marek Safar <marek.safar@seznam.cz>
6208 * cs-parser.jay: Don't create a block for every variable.
6210 2004-12-14 Miguel de Icaza <miguel@ximian.com>
6212 * location.cs: Provide extra information.
6214 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6215 variables from the captured environment, it is the ldarg_0.
6217 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6219 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6222 * class.cs: Changed warning level for 169 to avoid developer
6223 displeasure from warning flooding. It will be changed back when they
6224 fix most of current BCL warnings.
6226 * RootContext.cs: Pushed default WarningLevel to 3.
6228 * statement.cs: Removed unused variable.
6230 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6232 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6233 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6234 Add error 502 report.
6235 (StaticClass.DefineType): Add error 441 report.
6236 (Class.AllowedModifiersProp): New virtual property as temporary
6237 extension to AllowedModifiers.
6238 (Class.DefineType): Add error 418 report. Moved ModFlags check here
6239 to share implementation with StaticClass and don't call virtual
6242 * driver.cs (MainDriver): Add error 1558 test.
6244 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6245 report. Moved error 36 test here.
6247 * statement.cs (Throw.Resolve): Add error 724 report.
6249 * typemanager.cs: Add out_attribute_type core type.
6251 2004-12-13 Marek Safar <marek.safar@seznam.cz>
6253 * class.cs (TypeContainer.VerifyClsCompliance): Add error
6255 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6257 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6260 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6262 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
6263 Add error 3023 report.
6264 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6266 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6269 2004-12-12 John Luke <john.luke@gmail.com>
6271 * driver.cs (AddArgs): take -- into account when
6272 adding arguments, fixes bug 65710
6274 2004-12-12 Martin Baulig <martin@ximian.com>
6276 * expression.cs (Unary.TryReduceNegative): Added support for
6277 SByteConstant and ByteConstant.
6278 (Unary.Reduce): Check error values from TryReduceNegative().
6280 2004-12-10 Marek Safar <marek.safar@seznam.cz>
6282 * attributes.cs (Attribute.Resolve): Avoid multiple error report
6283 and report exception as error 182.
6285 2004-12-10 Raja R Harinath <rharinath@novell.com>
6287 * driver.cs (Main): Fix message when there are warnings.
6289 2004-12-09 Miguel de Icaza <miguel@ximian.com>
6291 * delegate.cs: Fixed my fix from yesterday, sorry about that.
6293 2004-12-09 Marek Safar <marek.safar@seznam.cz>
6295 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
6296 Reduced number of warnings.
6298 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6300 2004-12-08 Miguel de Icaza <miguel@ximian.com>
6302 * driver.cs: Removed message.
6304 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6306 2004-12-08 <vargaz@freemail.hu>
6308 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6310 2004-12-08 Martin Baulig <martin@ximian.com>
6312 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6313 instead of a CS3002 for properties and indexer.
6315 2004-12-08 Martin Baulig <martin@ximian.com>
6317 * decl.cs (MemberName.ToString): Make this work again.
6319 2004-12-08 Marek Safar <marek.safar@seznam.cz>
6321 * attribute.cs (Resolve): Add error 591 detection.
6323 * class.cs (FieldMember.Define): Add error 1547 detection.
6324 (Indexer.Define): Add error 620 detection.
6325 (Operator.Define): Add error 590 detection.
6327 * ecore.cs: Missing argument for error 79.
6329 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6332 2004-12-07 Marek Safar <marek.safar@seznam.cz>
6335 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6338 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6340 * cs-parser.jay : handle doc comments on implicit/explicit operators.
6341 Some operator comments were suppressed.
6342 * doc.cs : Implicit/explicit operator name in doc comments are like
6343 "op_Explicit(type)~returnType", so added suffix handling.
6345 2004-12-07 Martin Baulig <martin@ximian.com>
6348 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
6349 (MemberCore.GetClsCompliantAttributeValue): Likewise.
6350 (DeclSpace.ec): New protected field; store the EmitContext here.
6351 (DeclSpace.EmitContext): New public property; moved here from
6353 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
6356 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
6357 (Enum.Emit): Don't create a new EmitContext.
6359 * delegate.cs (Delegate.DefineType): Always create the
6362 * iterators.cs (Iterators.DefineIterator): Create a new
6363 EmitContext and store it in `ec'.
6365 2004-08-24 Martin Baulig <martin@ximian.com>
6368 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
6369 this for accessibility checks.
6370 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
6371 IsNestedFamilyAccessible.
6372 (TypeManager.IsSubclassOf): New method, do what the name actually
6375 2004-12-06 Raja R Harinath <rharinath@novell.com>
6377 Fix crash on cs0657-17.cs.
6378 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6379 Use RootContext.Tree.Types, not 'new RootTypes ()'.
6380 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6381 the case where the NamespaceEntry gets overwritten.
6383 2004-12-06 Marek Safar <marek.safar@seznam.cz>
6385 Fixed #69195, #56821
6386 * ecore.cs (ResolveBoolean): Tiny refactoring.
6388 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6389 of right expression resolving when left is false constant and
6390 operator is LogicalAnd OR true constant and operator is LogicalOr.
6392 * statement.cs (ResolveUnreachable): Always reports warning.
6394 2004-12-05 Miguel de Icaza <miguel@ximian.com>
6396 * class.cs: Distinguish between 1721 and 1722 (just a little help
6397 for the programmer).
6399 2004-12-03 Miguel de Icaza <miguel@ximian.com>
6401 * delegate.cs: Only allow this on new versions of the language.
6403 2004-12-02 Duncan Mak <duncan@ximian.com>
6405 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6407 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6408 here as a static method. Take an additional bool out parameter
6409 `must_do_cs1540_check' for signaling to InstanceResolve.
6410 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6411 member field from PropertyExpr class and made it an argument of
6413 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6414 check for MarshalByRefObject, and report CS0122 instead of CS1540.
6415 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6416 and `remove_accessor' as well as InstanceResolve: report CS0122
6421 2004-12-03 Raja R Harinath <rharinath@novell.com>
6423 Fix test-327.cs, test-328.cs, and put in early infrastructure
6424 for eventually fixing #52697.
6425 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6426 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6428 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6429 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6430 (VerifyUsing, error246): Update.
6431 * rootcontext.cs (RootContext.NamespaceLookup): Just use
6432 'NamespaceEntry.LookupNamespaceOrType'.
6434 2004-12-03 Martin Baulig <martin@ximian.com>
6436 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6437 method as our child, call AnonymousMethod.Compatible() on it.
6439 2004-12-03 Raja R Harinath <rharinath@novell.com>
6441 Disable XML documentation support in 'basic' profile.
6442 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
6443 Redirect XmlElement to System.Object.
6444 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
6445 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
6446 * mcs.exe.sources: Add doc-bootstrap.cs.
6447 * doc-bootstrap.cs: New file. Contains empty stub implementation
6450 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
6452 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6453 comments are allowed.
6455 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6457 * delegate.cs: Add checks for subtypes in paramaters and return values
6458 in VerifyMethod () to add support for Covariance/Contravariance
6461 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6463 * report.cs: Remove extra closing parenthesis.
6465 * convert.cs (Error_CannotImplicitConversion): If the name of the
6466 types are the same, provide some extra information.
6468 * class.cs (FieldBase): Use an unused bit field from the field to
6469 encode the `has_offset' property from the FieldMember. This saves
6470 a couple of Ks on bootstrap compilation.
6472 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6473 method as our child, return the AnonymousMethod resolved
6476 * expression.cs (New.DoResolve): Allow return values from
6477 NewDelegate to also include AnonymousMethods.
6481 2004-12-02 Marek Safar <marek.safar@seznam.cz>
6484 * attribute.cs (Resolve): Improved implementation of params
6485 attribute arguments.
6487 * support.cs (ParameterData): Add HasParams to be faster.
6489 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
6491 all things are for /doc support:
6493 * doc.cs: new file that supports XML documentation generation.
6494 * mcs.exe.sources: added doc.cs.
6496 Handle /doc command line option.
6497 Report error 2006 instead of 5 for missing file name for /doc.
6498 Generate XML documentation when required, after type resolution.
6500 Added support for picking up documentation (/// and /** ... */),
6501 including a new XmlCommentState enumeration.
6503 Added lines to fill Documentation element for field, constant,
6504 property, indexer, method, constructor, destructor, operator, event
6505 and class, struct, interface, delegate, enum.
6506 Added lines to warn incorrect comment.
6508 Added Documentation field (passed only when /doc was specified).
6510 Added DocComment, DocCommentHeader, GenerateDocComment() and
6511 OnGenerateDocComment() and some supporting private members for
6512 /doc feature to MemberCore.
6514 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6516 Added overriden DocCommentHeader.
6518 Added overriden DocCommentHeader and GenerateDocComment().
6520 2004-12-01 Miguel de Icaza <miguel@ximian.com>
6522 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6523 unwrapping the enumeration values, chain to
6524 DoConstantNumericPromotions again, so we can promote things to the
6525 fundamental types (takes care of enums that are bytes, sbytes).
6529 2004-12-01 Raja R Harinath <rharinath@novell.com>
6531 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6532 Fix long-standing bug in type-lookup. Use FindType instead of
6533 LookupType when ec.ResolvingTypeTree.
6534 (Attribute.ResolveType, Attribute.Resolve)
6535 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6537 (Attributes.Search): Remove internal version. Update.
6538 (Attributes.SearchMulti): Update.
6539 (Attributes.GetClsCompliantAttribute): Remove.
6540 (Attributes.GetIndexerNameAttribute): Remove.
6541 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6542 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6543 * class.cs (Indexer.Define): Likewise.
6545 2004-12-01 Marek Safar <marek.safar@seznam.cz>
6548 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6549 MarshallByReference members access.
6551 * expression.cs: Use CheckMarshallByRefAccess;
6552 Better error CS0197 message.
6554 * report.cs: Print whole related error message.
6556 2004-11-30 Raja R Harinath <rharinath@novell.com>
6558 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
6559 the current directory to help debugging.
6561 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6563 * class (GetClassBases): Better error 60 report.
6564 (EventProperty): Disabled warning 67 detection.
6566 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6569 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6571 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6574 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6577 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6579 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6581 2004-11-26 Miguel de Icaza <miguel@ximian.com>
6583 * attribute.cs (Attribute.Resolve): Refine error reporting and
6584 report a cs0117 if the identifier does not exist, to distinguish
6585 from 0617 which is a miss-use of the actual identifier.
6587 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6588 between cs0070 and cs0079.
6590 * class.cs (MemberBase.DoDefine): When reporting a wrong
6591 accessibility level, we use MethodCore to compare instead of
6592 Method (this was a regression in some refactoring effort).
6594 So now we correctly report cs0056 again.
6596 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6597 testing the target_type (which was known to be object_type) and
6598 not the source type (which is anonymous_method).
6600 Fixed reporting of error cs1660.
6602 * expression.cs (UserCast.Source): Expose the underlying cast.
6604 * statement.cs (Switch.SwitchGoverningType): Sort the list of
6605 allowed types to find a match to int32 first (most common).
6607 In addition, it ignores any ImplicitUserConversions that did an
6608 internal implicit conversion (as the switch statement allows only
6609 one integral conversion to exist).
6611 * class.cs (PartialContainer.Create): rename `name' to
6612 `member_name' for clarity. Then replace the string calls with a
6613 call to MemberName.GetPartialName, as now using
6614 MemberName.ToString is an error (this is due to the side effects
6615 it had, that were fixed in the past).
6617 This will restore the error reporting on a number of partial class
6618 errors that were missusing this (and getting an exception as a
6619 results, which is now just a plain textual warning, because
6620 yyparse debug output would crash otherwise).
6622 2004-11-26 Raja R Harinath <rharinath@novell.com>
6624 * Makefile (PROGRAM_INSTALL_DIR): Remove.
6626 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6628 * rootcontext.cs (LookupType): Make sure to cache lookups that
6629 don't give us a negative result. This saves about 5% of corlib
6632 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6634 * report.cs (AbstractMessage.Print): messages are sent to stderr
6636 * class.cs (TypeContainer.GetClassBases): It is an error to have a
6637 non-interface in the list of interfaces (at this point, either
6638 parent was properly set, or a base class is being listed in the
6639 interfaces section).
6641 This flags error 1722, and resolves the crash from bug 69259.
6643 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6645 * statement.cs (Using.EmitExpressionFinally): make this work right
6646 for valuetypes. Fixes 69926.
6648 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6650 * const.cs (Const.ChangeType): Cope with the "0 literal can be
6651 converted to an enum" here, before we try to change the underlying
6652 type. This code exists, but it is a different code path than the
6653 one used while encoding constants.
6655 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6656 old bug: when converting from the null literal to a pointer,
6657 return an EmptyCast, not the NullLiteral.
6659 This fixes #69921, the recent null_type changes probably made this
6662 (ImplicitReferenceConversionExists): In addition, resynchronized
6663 the code here, so it matches the same code in
6664 ImplicitReferenceConversionExists for the `from any class-type S
6665 to any interface-type T'.
6668 2004-11-25 Marek Safar <marek.safar@seznam.cz>
6670 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6672 2004-11-24 Miguel de Icaza <miguel@ximian.com>
6674 * cs-parser.jay: Use verbosity accordingly.
6676 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6678 * expression.cs (Unary.ResolveOperator): Do not report warning;
6679 AddressOf reads from variable.
6681 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6683 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6687 * attribute.cs (Attributable): Removed CheckTargets.
6688 (Attributes.Emit): Explicit attribute targets are tested here.
6690 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6691 not enabled for interfaces.
6693 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6694 (GetAssemblyName): Ouch next bug there.
6696 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6698 * expression.cs: Error 275 added.
6700 2004-11-23 Marek Safar <marek.safar@seznam.cz>
6702 Fix bug #69177 (Implemented decimal constant support)
6704 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6705 (BinaryFold): Add DecimalConstant.
6707 * const.cs (Define): Decimal constant
6709 (ChangeType): Add decimal type handling.
6710 (LookupConstantValue): Don't set value for decimal type but
6711 emit DecimalConstantAttribute. Needed for constant optimization.
6713 * constant.cs (ToDecimal): New method.
6714 (ConvertToDecimal): New method.
6715 (IntConstant): Implemented ConvertToDecimal.
6716 (DecimalConstant.Emit): Emit optimized version for decimals in
6719 * expression.cs (ResolveOperator): Changed order of constant
6720 reduction to work correctly with native types which have
6721 overloaded operators.
6722 (ResolveMemberAccess): Extract constant value from attribute
6725 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6727 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6728 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6729 (ChangeType): Decimal is special.
6730 (TypeToCoreType): Add decimal type.
6732 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6734 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6737 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6739 * class.cs (EventField.ApplyAttributeBuilder): Fix error
6742 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6744 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6746 * pending.cs (PendingImplementation): Grab only interfaces.
6748 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6750 * statement.cs (ForeachHelperMethods): Add location member and
6751 error 202 detection.
6753 2004-11-19 Raja R Harinath <rharinath@novell.com>
6755 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
6756 automatically handled by executable.make.
6757 (PROGRAM): Make profile-specific.
6759 2004-11-18 Marek Safar <marek.safar@seznam.cz>
6761 * expression.cs (DoResolveBase): Fixed wrong warning for out
6764 2004-11-18 Martin Baulig <martin@ximian.com>
6766 Merged latest changes into gmcs. Please keep this comment in
6767 here, it makes it easier for me to see what changed in MCS since
6768 the last time I merged.
6770 2004-11-17 Raja R Harinath <rharinath@novell.com>
6772 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6773 (TypeHandle.GetMemberCache): New.
6774 (TypeHandle.TypeHandle): Update.
6775 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6776 (TypeManager.LookupParentInterfacesCache):
6777 Rename from LookupInterfaceCache. Optimize slightly.
6778 (TypeManager.MemberLookup_FindMembers): Update.
6779 * decl.cs (MemberCache.MemberCache): Set Container to null in the
6781 (AddCacheContents): Rename from AddHashtable.
6782 * class.cs (TypeContainer.parent_container): Remove.
6783 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6784 (TypeContainer.DoDefineMembers): Don't initialize it.
6785 Update to name changes.
6787 2004-11-17 Miguel de Icaza <miguel@ximian.com>
6789 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6790 that factors the code to check access modifiers on override.
6792 (PropertyBase): Use the code here.
6794 Patch from Lluis S'anchez, fixes bug #69361.
6796 2004-11-15 Miguel de Icaza <miguel@ximian.com>
6798 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6799 routine that is used to report the use of a captured variable
6800 whose address has been taken.
6802 There are two checks: one when variables are being captured and
6803 the other check is when the address of a variable is taken.
6805 (because an anonymous methods might be resolved before *or* after
6806 the address has been taken) and
6808 * expression.cs (Conditional.DoResolve): Remove the special
6809 casing that Martin added to trueExpr and falseExpr being both
6810 NullLiteral. We get the right behavior now just by introducing
6811 the null_type into the compiler.
6813 * convert.cs (ExplicitConversion): Change the code to use
6814 null_type instead of testing `expr is NullLiteral'.
6815 (ImplicitConversionStandard): use null_type too.
6816 (ImplicitReferenceConversionExists): use null_type too.
6817 (ImplicitReferenceConversion): use null_type too.
6819 * literal.cs: The type of `NullLiteral' is now null_type instead
6821 (Resolve): Set the type here.
6823 * typemanager.cs: Introduce null_type.
6825 2004-11-17 Martin Baulig <martin@ximian.com>
6827 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6828 direction, like FindMembers() does. Fixes #69546, testcase is in
6831 2004-11-16 Martin Baulig <martin@ximian.com>
6833 This is based on a patch from Marek Safar, see bug #69082.
6834 Fixes bugs #63705 and #67130.
6836 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6837 method; create a MemberCache for an interface type and cache the
6840 * decl.cs (IMemberContainer.ParentContainer): Removed.
6841 (IMemberContainer.ParentCache): New property.
6842 (MemberCache.SetupCacheForInterface): Removed.
6843 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6844 to create a cache for an interface's "parent".
6846 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6849 2004-11-16 Martin Baulig <martin@ximian.com>
6851 Merged back from gmcs; these changes already went into gmcs a
6852 couple of weeks ago.
6855 (TypeManager.AddUserType): Removed the `ifaces' argument.
6856 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
6858 (TypeManager.AddUserInterface): Removed.
6859 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
6861 (TypeManager.GetInterfaces): Likewise.
6862 (TypeManager.GetExplicitInterfaces): Likewise.
6864 * ecore.cs (TypeExpr.GetInterfaces): Removed.
6866 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
6867 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
6869 2004-11-14 Ben Maurer <bmaurer@ximian.com>
6871 * statement.cs: Avoid adding bools to a hashtable.
6873 2004-11-07 Miguel de Icaza <miguel@ximian.com>
6875 * expression.cs (Invocation.OverloadResolve): Flag error if we are
6876 calling an unsafe method from a safe location.
6878 2004-11-06 Marek Safar <marek.safar@seznam.cz>
6881 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6883 2004-11-06 Miguel de Icaza <miguel@ximian.com>
6885 * namespace.cs (VerifyUsing): use GetPartialName instead of
6888 2004-11-05 Miguel de Icaza <miguel@ximian.com>
6890 * statement.cs (Return.Resolve): Fix regression in typo: if
6891 `in_exc', we have to request a NeedReturnLabel, this was a typo
6892 introduced in the anonymous method check-in. Fixes #69131.
6894 * Indexers were using the ShortName when defining themselves,
6895 causing a regression in the compiler bootstrap when applying the
6896 patch from 2004-11-02 (first part), now they use their full name
6897 and the bug is gone.
6899 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
6901 * driver.cs: Strip the path from the names of embedded resources. Fixes
6904 2004-11-04 Raja R Harinath <rharinath@novell.com>
6906 Fix error message regression: cs0104-2.cs.
6907 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6908 (AliasEntry.Resolve): Update.
6909 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
6911 (RootContext.LookupType): Update.
6913 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
6915 * cs-parser.jay: Add support for handling accessor modifiers
6916 * class: Add support port accessor modifiers and error checking,
6917 define PropertyMethod.Define as virtual (not abstract anymore)
6918 * ecore.cs: Add checking for proeprties access with access modifiers
6919 * iterators.cs: Modify Accessor constructor call based in the modified
6921 2004-11-02 Ben Maurer <bmaurer@ximian.com>
6923 * expression.cs (StringConcat): Handle being called twice,
6924 as when we have a concat in a field init with more than two
6927 2004-11-02 Miguel de Icaza <miguel@ximian.com>
6929 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6930 special case explicit implementations, we should always produce
6931 the .property or .event declaration.
6933 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6934 since it will not return correct data if people use this
6935 unresolved in the presence of using statements (see test-313).
6937 * class.cs (MethodData.Define): If we are an explicit interface
6938 implementation, set the method name to the full name of the
6939 interface plus the name of the method.
6941 Notice that using the method.MethodName.GetFullName() does not
6942 work, as it will only contain the name as declared on the source
6943 file (it can be a shorthand in the presence of using statements)
6944 and not the fully qualifed type name, for example:
6948 class D : ICloneable {
6949 object ICloneable.Clone () {
6953 Would produce a method called `ICloneable.Clone' instead of
6954 `System.ICloneable.Clone'.
6956 * namespace.cs (Alias.Resolve): Use GetPartialName.
6958 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6960 * cs-parser.jay: Add error 1055 report.
6962 2004-11-01 Miguel de Icaza <miguel@ximian.com>
6964 * assign.cs (Assign.DoResolve): Only do the transform of
6965 assignment into a New if the types are compatible, if not, fall
6966 through and let the implicit code deal with the errors and with
6967 the necessary conversions.
6969 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6971 * cs-parser.jay: Add error 1031 report.
6973 * cs-tokenizer.cs: Add location for error 1038.
6975 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6977 * cs-parser.jay: Add error 1016 report.
6979 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6981 * cs-parser.jay: Add errors 1575,1611 report.
6983 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6985 * cs-parser.jay: Add error 1001 report.
6987 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6990 * attribute.cs (GetMarshal): Add method argument for
6991 caller identification.
6993 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6994 agument for GetMarshal and RuntimeMissingSupport.
6996 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6998 * attribute.cs (ExtractSecurityPermissionSet): Removed
6999 TypeManager.code_access_permission_type.
7001 * typemanager.cs: Removed TypeManager.code_access_permission_type.
7003 2004-10-27 Miguel de Icaza <miguel@ximian.com>
7005 * expression.cs (LocalVariableReference.DoResolveLValue): Check
7006 for obsolete use of a variable here. Fixes regression on errors
7007 cs0619-25 and cs0619-26.
7009 2004-10-27 Marek Safar <marek.safar@seznam.cz>
7011 Fix #62358, implemented security attribute encoding.
7013 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7014 Tests permitted SecurityAction for assembly or other types.
7015 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7016 data from SecurityPermissionAttribute to PermisionSet class.
7018 * class.cs (ApplyAttributeBuilder): Added special handling
7019 for System.Security.Permissions.SecurityAttribute based types.
7021 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7022 special handling for System.Security.Permissions.SecurityAttribute
7025 * enum.cs (ApplyAttributeBuilder): Added special handling
7026 for System.Security.Permissions.SecurityAttribute based types.
7028 * parameter.cs (ApplyAttributeBuilder): Added special handling
7029 for System.Security.Permissions.SecurityAttribute based types.
7031 * rootcontext.cs: Next 2 core types.
7033 * typemanager.cs (TypeManager.security_permission_attr_type):
7034 Built in type for the SecurityPermission Attribute.
7035 (code_access_permission_type): Build in type.
7037 2004-10-17 Miguel de Icaza <miguel@ximian.com>
7039 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7040 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7041 all of this information into
7042 EmitContext.EmitCapturedVariableInstance.
7044 * codegen.cs (EmitCapturedVariableInstance): move here the
7045 funcionality of emitting an ldarg.0 in the presence of a
7046 remapping. This centralizes the instance emit code.
7048 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7049 then emit a load of this: it means that we have reached the
7050 topmost ScopeInfo: the one that contains the pointer to the
7051 instance of the class hosting the anonymous method.
7053 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7054 captures to the topmost CaptureContext.
7056 2004-10-12 Miguel de Icaza <miguel@ximian.com>
7058 * expression.cs (LocalVariableReference): Move the knowledge about
7059 the iterators into codegen's EmitCapturedVariableInstance.
7061 2004-10-11 Miguel de Icaza <miguel@ximian.com>
7063 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7064 all code paths return a value from an anonymous method (it is the
7065 same as the 161 error, but for anonymous methods).
7067 2004-10-08 Miguel de Icaza <miguel@ximian.com>
7069 The introduction of anonymous methods in the compiler changed
7070 various ways of doing things in the compiler. The most
7071 significant one is the hard split between the resolution phase
7072 and the emission phases of the compiler.
7074 For instance, routines that referenced local variables no
7075 longer can safely create temporary variables during the
7076 resolution phase: they must do so from the emission phase,
7077 since the variable might have been "captured", hence access to
7078 it can not be done with the local-variable operations from the runtime.
7082 (Block.Flags): New flag `IsTopLevel' to indicate that this block
7083 is a toplevel block.
7085 (ToplevelBlock): A new kind of Block, these are the blocks that
7086 are created by the parser for all toplevel method bodies. These
7087 include methods, accessors and anonymous methods.
7089 These contain some extra information not found in regular blocks:
7090 A pointer to an optional CaptureContext (for tracking captured
7091 local variables and parameters). A pointer to the parent
7094 (Return.Resolve): Catch missmatches when returning a value from an
7095 anonymous method (error 1662).
7096 Invoke NeedReturnLabel from the Resolve phase instead of the emit
7099 (Break.Resolve): ditto.
7101 (SwitchLabel): instead of defining the labels during the
7102 resolution phase, we now turned the public ILLabel and ILLabelCode
7103 labels into methods called GetILLabelCode() and GetILLabel() that
7104 only define the label during the Emit phase.
7106 (GotoCase): Track the SwitchLabel instead of the computed label
7107 (its contained therein). Emit the code by using
7108 SwitchLabel.GetILLabelCode ().
7110 (LocalInfo.Flags.Captured): A new flag has been introduce to track
7111 whether the Local has been captured or not.
7113 (LocalInfo.IsCaptured): New property, used to tell whether the
7114 local has been captured.
7116 * anonymous.cs: Vastly updated to contain the anonymous method
7119 The main classes here are: CaptureContext which tracks any
7120 captured information for a toplevel block and ScopeInfo used to
7121 track the activation frames for various local variables.
7123 Each toplevel block has an optional capture context associated
7124 with it. When a method contains an anonymous method both the
7125 toplevel method and the anonymous method will create a capture
7126 context. When variables or parameters are captured, they are
7127 recorded on the CaptureContext that owns them, for example:
7131 MyDelegate d = delegate {
7136 Here `a' will be recorded as captured on the toplevel
7137 CapturedContext, the inner captured context will not have anything
7138 (it will only have data if local variables or parameters from it
7139 are captured in a nested anonymous method.
7141 The ScopeInfo is used to track the activation frames for local
7142 variables, for example:
7144 for (int i = 0; i < 10; i++)
7145 for (int j = 0; j < 10; j++){
7146 MyDelegate d = delegate {
7151 At runtime this captures a single captured variable `i', but it
7152 captures 10 different versions of the variable `j'. The variable
7153 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7154 recorded on a child.
7156 The toplevel ScopeInfo will also track information like the `this'
7157 pointer if instance variables were referenced (this is necessary
7158 as the anonymous method lives inside a nested class in the host
7159 type of the method).
7161 (AnonymousMethod): Expanded to track the Toplevel, implement
7162 `AnonymousMethod.Compatible' to tell whether an anonymous method
7163 can be converted to a target delegate type.
7165 The routine now also produces the anonymous method content
7167 (AnonymousDelegate): A helper class that derives from
7168 DelegateCreation, this is used to generate the code necessary to
7169 produce the delegate for the anonymous method that was created.
7171 * assign.cs: API adjustments for new changes in
7172 Convert.ImplicitStandardConversionExists.
7174 * class.cs: Adjustments to cope with the fact that now toplevel
7175 blocks are of type `ToplevelBlock'.
7177 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7178 insteda of standard blocks.
7180 Flag errors if params arguments are passed to anonymous methods.
7182 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7183 `CurrentAnonymousMethod' which points to the current Anonymous
7184 Method. The variable points to the AnonymousMethod class that
7185 holds the code being compiled. It is set in the new EmitContext
7186 created for the anonymous method.
7188 (EmitContext.Phase): Introduce a variable and an enumeration to
7189 assist in enforcing some rules about when and where we are allowed
7190 to invoke certain methods (EmitContext.NeedsReturnLabel is the
7191 only one that enfonces this right now).
7193 (EmitContext.HaveCaptureInfo): new helper method that returns
7194 whether we have a CapturedContext initialized.
7196 (EmitContext.CaptureVariable): New method used to register that a
7197 LocalInfo must be flagged for capturing.
7199 (EmitContext.CapturedParameter): New method used to register that a
7200 parameters must be flagged for capturing.
7202 (EmitContext.CapturedField): New method used to register that a
7203 field must be flagged for capturing.
7205 (EmitContext.HaveCapturedVariables,
7206 EmitContext.HaveCapturedFields): Return whether there are captured
7207 variables or fields.
7209 (EmitContext.EmitMethodHostInstance): This is used to emit the
7210 instance for the anonymous method. The instance might be null
7211 (static methods), this (for anonymous methods that capture nothing
7212 and happen to live side-by-side with the current method body) or a
7213 more complicated expression if the method has a CaptureContext.
7215 (EmitContext.EmitTopBlock): Routine that drives the emission of
7216 code: it will first resolve the top block, then emit any metadata
7217 and then emit the code. The split is done so that we can extract
7218 any anonymous methods and flag any captured variables/parameters.
7220 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7221 during this phase, the ILGenerator should not be used as labels
7222 and local variables declared here might not be accessible to any
7223 code that is part of an anonymous method.
7225 Exceptions to this include the temporary variables that are
7226 created by some statements internally for holding temporary
7229 (EmitContext.EmitMeta): New routine, in charge of emitting all the
7232 (EmitContext.TemporaryReturn): This method is typically called
7233 from the Emit phase, and its the only place where we allow the
7234 ReturnLabel to be defined other than the EmitMeta. The reason is
7235 that otherwise we would have to duplicate a lot of logic in the
7236 Resolve phases of various methods that today is on the Emit
7239 (EmitContext.NeedReturnLabel): This no longer creates the label,
7240 as the ILGenerator is not valid during the resolve phase.
7242 (EmitContext.EmitThis): Extended the knowledge in this class to
7243 work in anonymous methods in addition to iterators.
7245 (EmitContext.EmitCapturedVariableInstance): This emits whatever
7246 code is necessary on the stack to access the instance to a local
7247 variable (the variable will be accessed as a field).
7249 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7250 EmitContext.EmitAddressOfParameter): Routines to support
7251 parameters (not completed at this point).
7253 Removals: Removed RemapLocal and RemapLocalLValue. We probably
7254 will also remove the parameters.
7256 * convert.cs (Convert): Define a `ConstantEC' which points to a
7257 null. This is just to prefity some code that uses
7258 ImplicitStandardConversion code and do not have an EmitContext
7261 The idea is to flag explicitly that at that point in time, it is
7262 known that the conversion will not trigger the delegate checking
7263 code in implicit conversions (which requires a valid
7266 Everywhere: pass new EmitContext parameter since
7267 ImplicitStandardConversionExists now requires it to check for
7268 anonymous method conversions.
7270 (Convert.ImplicitStandardConversionExists): If the type of an
7271 expression is the anonymous_method_type, and the type is a
7272 delegate, we invoke the AnonymousMethod.Compatible method to check
7273 whether an implicit conversion is possible.
7275 (Convert.ImplicitConversionStandard): Only do implicit method
7276 group conversions if the language level is not ISO_1.
7278 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7279 MethodInfo for the Invoke method. used by Delegate and
7282 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7283 method conversions if the target type is a delegate.
7285 Removed extra debugging nops.
7287 (LocalVariableReference): Turn the `local_info' into a public
7290 Add `prepared' field, the same hack used for FieldExprs to cope
7291 with composed assignments, as Local variables do not necessarily
7292 operate purely on the stack as they used to: they can be captured
7295 Add `temp' for a temporary result, like fields.
7297 Refactor DoResolve and DoResolveLValue into DoResolveBase.
7299 It now copes with Local variables that are captured and emits the
7300 proper instance variable to load it from a field in the captured
7303 (ParameterReference.DoResolveBase): During the resolve phase,
7304 capture parameters if we are in an anonymous method.
7306 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7307 anonymous method, use the EmitContext helper routines to emit the
7308 parameter reference.
7310 * iterators.cs: Set RemapToProxy to true/false during the
7313 * parameters.cs (GetParameterByName): New helper method.
7315 * typemanager.cs (anonymous_method_type) a new type that
7316 represents an anonyous method. This is always an internal type,
7317 used as a fencepost to test against the anonymous-methodness of an
7320 2004-10-20 Marek Safar <marek.safar@seznam.cz>
7322 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7324 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7326 2004-10-18 Martin Baulig <martin@ximian.com>
7328 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7329 `Type' directly, but call ResolveType() on it.
7330 (Catch.Resolve): Likewise.
7331 (Foreach.Resolve): Likewise.
7333 2004-10-18 Martin Baulig <martin@ximian.com>
7335 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7336 `Type' directly, but call ResolveType() on it.
7337 (Probe.DoResolve): Likewise.
7338 (ArrayCreation.LookupType): Likewise.
7339 (TypeOf.DoResolve): Likewise.
7340 (SizeOf.DoResolve): Likewise.
7342 2004-10-18 Martin Baulig <martin@ximian.com>
7344 * expression.cs (Invocation.BetterFunction): Put back
7345 TypeManager.TypeToCoreType().
7347 2004-10-18 Raja R Harinath <rharinath@novell.com>
7349 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7352 2004-10-18 Martin Baulig <martin@ximian.com>
7354 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
7355 `Type' directly, but call ResolveType() on it.
7357 2004-10-18 Martin Baulig <martin@ximian.com>
7359 * class.cs (FieldMember.Define): Don't access the TypeExpr's
7360 `Type' directly, but call ResolveType() on it.
7361 (MemberBase.DoDefine): Likewise.
7363 * expression.cs (New.DoResolve): Don't access the TypeExpr's
7364 `Type' directly, but call ResolveType() on it.
7365 (ComposedCast.DoResolveAsTypeStep): Likewise.
7367 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7368 `Type' directly, but call ResolveType() on it.
7370 2004-10-17 John Luke <john.luke@gmail.com>
7372 * class.cs (Operator.GetSignatureForError): use CSharpName
7374 * parameter.cs (Parameter.GetSignatureForError): Returns
7375 correct name even if was not defined.
7377 2004-10-13 Raja R Harinath <rharinath@novell.com>
7380 * class.cs (TypeContainer.EmitContext): New property.
7381 (DefineNestedTypes): Create an emitcontext for each part.
7382 (MethodCore.DoDefineParameters): Use container's emitcontext.
7383 Pass type array to InternalParameters.
7384 (MemberBase.DoDefine): Use container's emitcontext.
7385 (FieldMember.Define): Likewise.
7386 (Event.Define): Likewise.
7387 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7388 Pass type array to InternalParameters.
7389 (SetIndexerMethod.GetParameterInfo): Likewise.
7390 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7391 * delegate.cs (Define): Pass emitcontext to
7392 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7393 array to InternalParameters.
7394 * expression.cs (ParameterReference.DoResolveBase): Pass
7395 emitcontext to GetParameterInfo.
7396 (ComposedCast.DoResolveAsTypeStep): Remove check on
7397 ec.ResolvingTypeTree.
7398 * parameter.cs (Parameter.Resolve): Change argument to
7399 EmitContext. Use ResolveAsTypeTerminal.
7400 (Parameter.GetSignature): Change argument to EmitContext.
7401 (Parameters.ComputeSignature): Likewise.
7402 (Parameters.ComputeParameterTypes): Likewise.
7403 (Parameters.GetParameterInfo): Likewise.
7404 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7405 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7406 * support.cs (InternalParameters..ctor): Remove variant that takes
7408 * typemanager.cs (system_intptr_expr): New.
7409 (InitExpressionTypes): Initialize it.
7411 2004-10-12 Chris Toshok <toshok@ximian.com>
7413 * cs-parser.jay: fix location for try_statement and catch_clause.
7415 2004-10-11 Martin Baulig <martin@ximian.com>
7417 * report.cs: Don't make --fatal abort on warnings, we have
7418 -warnaserror for that.
7420 2004-10-07 Raja R Harinath <rharinath@novell.com>
7422 More DeclSpace.ResolveType avoidance.
7423 * decl.cs (MemberCore.InUnsafe): New property.
7424 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
7425 with newly created EmitContext.
7426 (FieldMember.Define): Likewise.
7427 * delegate.cs (Delegate.Define): Likewise.
7428 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7429 only if normal name-lookup fails.
7430 (TypeExpr.DoResolve): Enable error-checking.
7431 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7432 (SizeOf.DoResolve): Likewise.
7433 (ComposedCast.DoResolveAsTypeStep): Likewise.
7434 (StackAlloc.DoResolve): Likewise.
7435 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7436 (Block.Unsafe): New property.
7437 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7438 (Unsafe): Set 'unsafe' flag of contained block.
7439 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7440 (Fixed.Resolve): Likewise.
7441 (Catch.Resolve): Likewise.
7442 (Using.ResolveLocalVariableDecls): Likewise.
7443 (Foreach.Resolve): Likewise.
7445 2004-10-05 John Luke <john.luke@gmail.com>
7447 * cs-parser.jay: add location to error CS0175
7449 2004-10-04 Miguel de Icaza <miguel@ximian.com>
7451 * ecore.cs (Expression.Constantity): Add support for turning null
7454 * const.cs (Const.Define): Allow constants to be reference types
7455 as long as the value is Null.
7457 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
7459 * namespace.cs (NamespaceEntry.Using): No matter which warning
7460 level is set, check if this namespace name has already been added.
7462 2004-10-03 Ben Maurer <bmaurer@ximian.com>
7464 * expression.cs: reftype [!=]= null should always use br[true,false].
7467 2004-10-03 Marek Safar <marek.safar@seznam.cz>
7470 * attribute.cs: Enum conversion moved to
7471 GetAttributeArgumentExpression to be applied to the all
7474 2004-10-01 Raja R Harinath <rharinath@novell.com>
7476 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7477 * class.c (TypeContainer.DefineType): Flag error if
7478 base types aren't accessible due to access permissions.
7479 * decl.cs (DeclSpace.ResolveType): Move logic to
7480 Expression.ResolveAsTypeTerminal.
7481 (DeclSpace.ResolveTypeExpr): Thin layer over
7482 Expression.ResolveAsTypeTerminal.
7483 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7484 Refactor code into NestedAccess. Use it.
7485 (DeclSpace.NestedAccess): New.
7486 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7487 argument to silence errors. Check access permissions.
7488 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7489 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7490 (Cast.DoResolve): Likewise.
7491 (New.DoResolve): Likewise.
7492 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7493 (TypeOf.DoResolve): Likewise.
7495 * expression.cs (Invocation.BetterConversion): Return the Type of
7496 the better conversion. Implement section 14.4.2.3 more faithfully.
7497 (Invocation.BetterFunction): Make boolean. Make correspondence to
7498 section 14.4.2.2 explicit.
7499 (Invocation.OverloadResolve): Update.
7500 (Invocation): Remove is_base field.
7501 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
7502 (Invocation.Emit): Likewise.
7504 2004-09-27 Raja R Harinath <rharinath@novell.com>
7506 * README: Update to changes.
7508 2004-09-24 Marek Safar <marek.safar@seznam.cz>
7510 * cs-parser.jay: Reverted 642 warning fix.
7512 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7515 * decl.cs (FindMemberWithSameName): Indexer can have more than
7518 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7520 * expression.cs (LocalVariableReference.DoResolveLValue):
7521 Do not report warning 219 for out values.
7522 (EmptyExpression.Null): New member to avoid extra allocations.
7524 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7526 * cs-parser.jay: Fix wrong warning 642 report.
7528 * cs-tokenizer.cs (CheckNextToken): New helper;
7529 Inspect next character if is same as expected.
7531 2004-09-23 Martin Baulig <martin@ximian.com>
7533 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7534 (Convert.ImplicitReferenceConversionExists): Likewise.
7536 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7538 * class.cs (Operator.Define): Add error 448 and 559 report.
7540 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7542 * class.cs (MemberBase.IsTypePermitted): New protected
7543 method for checking error CS0610.
7545 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7547 * class.cs (TypeContainer.HasExplicitLayout): New property
7548 Returns whether container has StructLayout attribute set Explicit.
7549 (FieldMember): New abstract class for consts and fields.
7550 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7551 (Field): Reuse FieldMember.
7553 * const.cs (Const): Reuse FieldMember.
7555 * rootcontext.cs: EmitConstants call moved to class.
7557 2004-09-22 Martin Baulig <martin@ximian.com>
7559 Thanks to Peter Sestoft for this bug report.
7561 * expression.cs (Conditional): If both the `trueExpr' and the
7562 `falseExpr' is a NullLiteral, return a NullLiteral.
7564 2004-09-22 Martin Baulig <martin@ximian.com>
7566 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7567 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7568 for the "get_Current" call.
7570 2004-09-22 Martin Baulig <martin@ximian.com>
7572 Marek and me just fixed one of our oldest bugs: #28562 :-)
7574 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7576 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7577 we're an EnumConstant, just return that.
7578 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7579 an EnumConstant. In this case, we need to use GetValueAsEnumType()
7580 to get the value which'll actually be written into the attribute.
7581 However, we have to use GetValue() to access the attribute's value
7584 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7586 * constant.cs (Constant.IsNegative): New abstract property
7589 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7590 (StackAlloc.DoResolve): Reused IsNegative.
7592 2004-09-21 Martin Baulig <martin@ximian.com>
7594 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
7595 if we're used in an iterator, we may be called from different
7598 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
7599 we actually have an exception block.
7601 2004-09-20 John Luke <jluke@cfl.rr.com>
7603 * class.cs, cs-parser.jay: Improve the error report for 1520:
7604 report the actual line where the error happens, not where the
7607 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
7608 Pass location information that was available elsewhere.
7610 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
7612 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
7613 runtime to delay sign assemblies.
7615 2004-09-19 Miguel de Icaza <miguel@ximian.com>
7617 * cs-parser.jay: Do not report the stack trace, this is barely
7620 2004-08-22 John Luke <john.luke@gmail.com>
7622 * driver.cs : check that a resource id is not already used
7623 before adding it, report CS1508 if it is, bug #63637
7625 2004-09-19 Miguel de Icaza <miguel@ximian.com>
7627 * ecore.cs: Removed dead code.
7629 2004-09-18 Marek Safar <marek.safar@seznam.cz>
7631 * class.cs: Do not report warning CS0067 on the interfaces.
7633 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7635 * cs-parser.jay: Add error 504 report.
7637 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7639 * rootcontext.cs: WarningLevel is 4 by default now.
7641 * statement.cs (Fixed.Resolve): Do not null
7644 2004-09-16 Marek Safar <marek.safar@seznam.cz>
7647 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
7648 deep search when property is not virtual.
7649 (PropertyExpr.ResolveAccessors): Make one call for both
7652 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7655 * statement.cs: Error 152 report constains also location.
7657 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7660 * const.cs: Explicitly set constant as static.
7662 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7665 * cs-parser.jay: Add error 1017 report.
7667 2004-09-15 Marek Safar <marek.safar@seznam.cz>
7669 Fixed bug #59980, #64224
7670 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
7672 * typemanager.cs (IsSpecialMethod): Simplified
7674 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7676 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
7677 condition with better params.
7679 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7682 * attribute.cs (Resolve): Property has to have both
7685 2004-09-14 Martin Baulig <martin@ximian.com>
7687 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7689 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7692 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7693 called and is obsolete then this member suppress message
7694 when call is inside next [Obsolete] method or type.
7696 * expression.cs: Use TestObsoleteMethodUsage member.
7698 2004-09-14 Martin Baulig <martin@ximian.com>
7700 * cs-parser.jay: Sync a bit with the GMCS version.
7702 2004-09-14 Martin Baulig <martin@ximian.com>
7704 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
7705 (CSharpParser.yacc_verbose_flag): New public field.
7707 * genericparser.cs: Removed.
7709 2004-09-14 Raja R Harinath <rharinath@novell.com>
7711 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
7713 2004-09-13 Marek Safar <marek.safar@seznam.cz>
7715 * class.cs (MethodCore.CheckBase): Fix bug #65757.
7717 2004-09-10 Martin Baulig <martin@ximian.com>
7719 Backported my MemberName changes from GMCS into MCS.
7721 - we are now using a special `MemberName' class instead of using
7722 strings; in GMCS, the `MemberName' also contains the type
7725 - changed the grammar rules a bit:
7726 * the old `member_name' is now a `namespace_or_type_name':
7727 The rule is that we use `namespace_or_type_name' everywhere
7728 where we expect either a "member name" (GetEnumerator) or a
7729 "member name" with an explicit interface name
7730 (IEnumerable.GetEnumerator).
7731 In GMCS, the explicit interface name may include type arguments
7732 (IEnumerable<T>.GetEnumerator).
7733 * we use `member_name' instead of just `IDENTIFIER' for
7735 The rule is that we use `member_name' wherever a member may
7736 have type parameters in GMCS.
7738 * decl.cs (MemberName): New public class.
7739 (MemberCore.MemberName): New public readonly field.
7740 (MemberCore.ctor): Take a `MemberName' argument, not a string.
7741 (DeclSpace): Likewise.
7743 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
7744 * enum.cs (Enum.ctor): Likewise.
7746 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
7748 (AliasEntry.ctor): Take a MemberName, not an Expression.
7749 (AliasEntry.UsingAlias): Likewise.
7751 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
7752 (IMethodData.MemberName): Changed type from string to MemberName.
7753 (MemberBase.ExplicitInterfaceName): Likewise.
7754 (AbstractPropertyEventMethod.SetupName): Make this private.
7755 (AbstractPropertyEventMethod.ctor): Added `string prefix'
7756 argument; compute the member name here.
7757 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
7758 on the `member.MemberName' and the `prefix'.
7760 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
7762 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
7763 thus, we get a `MemberName' instead of a `string'. These
7764 declarations may have type parameters in GMCS.
7765 (interface_method_declaration, delegate_declaration): Likewise.
7766 (class_declaration, interface_declaration): Likewise.
7767 (method_header): Use `namespace_or_type_name' instead of
7768 `member_name'. We may be an explicit interface implementation.
7769 (property_declaration, event_declaration): Likewise.
7770 (member_name): This is now just an `IDENTIFIER', not a
7771 `namespace_or_type_name'.
7772 (type_name, interface_type): Removed.
7773 (namespace_or_type_name): Return a MemberName, not an Expression.
7774 (primary_expression): Use `member_name' instead of `IDENTIFIER';
7775 call GetTypeExpression() on the MemberName to get an expression.
7776 (IndexerDeclaration.interface_type): Changed type from string to
7778 (MakeName): Operate on MemberName's instead of string's.
7780 2004-09-13 Raja R Harinath <rharinath@novell.com>
7783 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
7784 (NamespaceEntry.Lookup): Add new argument to flag if we want the
7785 lookup to avoid symbols introduced by 'using'.
7786 * rootcontext.cs (NamespaceLookup): Update.
7788 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7790 * class.cs (TypeContainer.DoDefineMembers): Do not call
7791 DefineDefaultConstructor for static classes.
7793 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7795 * attribute.cs (Attribute.Resolve): Add error 653 report.
7797 * class.cs (Class.ApplyAttributeBuilder): Add error 641
7799 (Method.ApplyAttributeBuilder): Add error 685 report.
7800 (Operator.Define): Add error 564 report.
7802 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7804 * expression.cs (Invocation.DoResolve): Add error
7807 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7810 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7812 * class.cs (ConstructorInitializer.Resolve):
7813 Wrong error number (515->516).
7815 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7817 * class.cs (Indexer.Define): Add error 631 report.
7819 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7821 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7823 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7825 * expression.cs (Probe.DoResolve): Add error CS0241 report.
7827 2004-09-10 Marek Safar <marek.safar@seznam.cz>
7829 * cs-parser.jay: Added error CS0241 report.
7831 2004-09-10 Raja R Harinath <rharinath@novell.com>
7833 * cs-parser.jay (fixed_statement): Introduce a scope for the
7834 declaration in the 'fixed' statement.
7836 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7838 * cs-parser.jay: Added CS0230 error report.
7840 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7842 * cs-parser.jay: Added errors CS0231 and CS0257 report.
7844 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7846 * expression.cs (Argument.Resolve): Added error CS0192 and
7849 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7851 C# 2.0 #pragma warning feature
7853 * cs-tokenizer.cs (PreProcessPragma): New method;
7854 Handles #pragma directive.
7856 * report.cs (WarningRegions): New class; Support
7857 class for #pragma warning directive. It tests whether
7858 warning is enabled for a given line.
7860 2004-09-08 Miguel de Icaza <miguel@ximian.com>
7862 * const.cs: Add more descriptive error report, tahnks to
7865 2004-09-08 Marek Safar <marek.safar@seznam.cz>
7867 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7869 2004-09-07 Miguel de Icaza <miguel@ximian.com>
7871 * expression.cs: Apply patch from Ben: Remove dead code from
7872 ArrayCreation, and remove the TurnintoConstant call in const.cs,
7873 as that code just threw an exception anwyays.
7875 * const.cs: Remove the call to the turnintoconstant, for details
7878 * literal.cs: The type of the null-literal is the null type; So
7879 we use a placeholder type (literal.cs:System.Null, defined here)
7882 * expression.cs (Conditional.DoResolve): Remove some old code that
7883 is no longer needed, conversions have been fixed.
7885 (ArrayCreationExpression.DoResolve): Return false if we fail to
7886 resolve the inner expression.
7888 2004-09-07 Raja R Harinath <rharinath@novell.com>
7891 * cs-parser.jay (delegate_declaration): Record a delegate
7892 declaration as a type declaration.
7893 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7895 2004-09-06 Miguel de Icaza <miguel@ximian.com>
7897 * parameter.cs: Do not crash if the type can not be resolved.
7899 * expression.cs: Report errors with unsafe pointers, fixes #64896
7901 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
7903 * expression.cs: Pointer arith always needs to do a conv.i
7904 if the operand is a long. fix 65320
7906 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7908 Fixed cs0619-37.cs, cs0619-38.cs
7910 * enum.cs (GetObsoleteAttribute): Removed.
7912 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7913 on Enum member is double staged. The first is tested member
7916 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7918 Fixed #56986, #63631, #65231
7920 * class.cs: (TypeContainer.AddToMemberContainer): New method,
7921 adds member to name container.
7922 (TypeContainer.AddToTypeContainer): New method, adds type to
7924 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7925 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7926 AddOperator): Simplified by reusing AddToMemberContainer.
7927 (TypeContainer.UserDefinedStaticConstructor): Changed to property
7929 (Method.CheckForDuplications): Fixed implementation to test all
7931 (MemberBase): Detection whether member is explicit interface
7932 implementation is now in constructor.
7933 (MemberBase.UpdateMemberName): Handles IndexerName.
7934 (Accessor): Changed to keep also location information.
7935 (AbstractPropertyEventMethod): Is derived from MemberCore.
7936 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7937 will be emited or not.
7938 (PropertyBase.AreAccessorsDuplicateImplementation):
7939 Tests whether accessors are not in collision with some method.
7940 (Operator): Is derived from MethodCore to simplify common
7943 * decl.cs (Flags.TestMethodDuplication): Test for duplication
7945 (DeclSpace.AddToContainer): Adds the member to defined_names
7946 table. It tests for duplications and enclosing name conflicts.
7948 * enum.cs (EnumMember): Clean up to reuse the base structures
7950 2004-09-03 Martin Baulig <martin@ximian.com>
7952 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7953 into TypeContainer, to make partial classes work again.
7955 2004-09-03 Martin Baulig <martin@ximian.com>
7957 * rootcontext.cs (RootContext.V2): Removed.
7959 2004-03-23 Martin Baulig <martin@ximian.com>
7961 * expression.cs (Invocation.OverloadResolve): Added `bool
7962 may_fail' argument and use it instead of the Location.IsNull() hack.
7964 2004-09-03 Martin Baulig <martin@ximian.com>
7966 Merged latest changes into gmcs. Please keep this comment in
7967 here, it makes it easier for me to see what changed in MCS since
7968 the last time I merged.
7970 2004-09-03 Raja R Harinath <rharinath@novell.com>
7973 * expression.cs (BetterConversion): Don't allow either conversion
7974 to be null. Remove redundant implicit conversion test when 'q ==
7975 null' -- when this function is invoked, we already know that the
7976 implicit conversion exists.
7977 (BetterFunction): Assume that 'best' is non-null. Remove
7978 redundant reimplementation of IsApplicable when 'best' is null.
7979 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7980 number of arguments.
7981 (IsAncestralType): Extract from OverloadResolve.
7982 (OverloadResolve): Make robust to the MethodGroupExpr being
7983 unsorted. Implement all the logic of Section 14.5.5.1, and
7984 support overloading of methods from multiple applicable types.
7985 Clean up logic somewhat. Don't pass null methods to BetterFunction.
7987 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7988 (RealError, Warning): Append type of report to related symbol.
7990 2004-09-03 Marek Safar <marek.safar@seznam.cz>
7992 * enum.cs: Fixed CLS-Compliance checks for enum members.
7993 Error tests cs3008-8.cs, cs3014-8.cs
7995 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7997 Fixed bug #62342, #63102
7998 * class.cs: ImplementIndexer uses member.IsExplicitImpl
7999 like ImplementMethod.
8001 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8003 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8006 2004-09-02 Martin Baulig <martin@ximian.com>
8008 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8009 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8012 2004-09-01 Marek Safar <marek.safar@seznam.cz>
8014 C# 2.0 Static classes implemented
8016 * class.cs (TypeContainer): instance_constructors,
8017 initialized_fields, initialized_static_fields,
8018 default_constructor, base_inteface_types are protected to be
8019 accessible from StaticClass.
8020 (TypeContainer.DefineDefaultConstructor): New virtual method
8021 for custom default constructor generating
8022 (StaticClass): New class to handle "Static classes" feature.
8024 * cs-parser.jay: Handle static keyword on class like instance
8027 * driver.cs: Added "/langversion" command line switch with two
8028 options (iso-1, default).
8030 2004-08-31 Marek Safar <marek.safar@seznam.cz>
8032 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8034 2004-08-31 Miguel de Icaza <miguel@ximian.com>
8036 * delegate.cs: Style.
8038 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
8040 * delegate.cs: Add seperate instance expr field for miguel.
8042 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8044 * PointerArithmetic (Resolve): make sure we are not doing
8045 pointer arith on void*. Also, make sure we are resolved
8046 by not setting eclass until resolve.
8048 All callers: Make sure that PointerArithmetic gets resolved.
8050 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8052 * ArrayCreation (LookupType): If the type does not resolve
8053 to an array, give an error.
8055 2004-08-27 Marek Safar <marek.safar@seznam.cz>
8057 * statement.cs (Try.Resolve): Fixed bug #64222
8059 2004-08-27 Martin Baulig <martin@ximian.com>
8062 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8065 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8067 * ecore.cs (Constantify): Get underlying type via
8068 System.Enum.GetUnderlyingType to avoid StackOverflow on the
8069 Windows in special cases.
8071 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8073 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8074 for obtaining also private methods.
8075 (GetRemoveMethod): Used GetRemoveMethod (true)
8076 for obtaining also private methods.
8078 2004-08-24 Martin Baulig <martin@ximian.com>
8080 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8081 MethodAttributes.HideBySig for operators.
8083 2004-08-23 Martin Baulig <martin@ximian.com>
8085 Back to the old error reporting system :-)
8087 * report.cs (Message): Removed.
8088 (Report.MessageData, ErrorData, WarningData): Removed.
8089 (Report.Error, Warning): Back to the old system.
8091 2004-08-23 Martin Baulig <martin@ximian.com>
8093 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8095 * class.cs (TypeContainer.ParentContainer): New public virtual
8096 method; replaces the explicit interface implementation.
8097 (ClassPart.ParentContainer): Override.
8099 2004-08-23 Martin Baulig <martin@ximian.com>
8101 * statement.cs (Switch): Added support for constant switches; see
8102 #59428 or test-285.cs.
8104 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8107 * statement.cs (GetEnumeratorFilter): Removed useless
8108 logic because C# specs is strict. GetEnumerator must be
8111 2004-08-22 Martin Baulig <martin@ximian.com>
8113 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8114 a switch and may break, reset the barrier. Fixes #59867.
8116 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8118 CLS-Compliance speed up (~5% for corlib)
8120 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8121 New method. Tests container for CLS-Compliant names
8123 * class.cs (TypeContainer.VerifyClsName): New method.
8124 Checks whether container name is CLS Compliant.
8125 (Constructor): Implements IMethodData.
8127 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8128 low-case table for CLS Compliance test.
8129 (MemberCache.VerifyClsParameterConflict): New method.
8130 Checks method parameters for CS3006 error.
8132 * enum.cs (EnumMember): Is derived from MemberCore.
8133 (Enum.VerifyClsName): Optimized for better performance.
8135 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8137 * report.cs: Renamed Error_T to Error and changed all
8140 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8142 * class.cs (TypeContainer.IndexerArrayList): New inner class
8143 container for indexers.
8144 (TypeContainer.DefaultIndexerName): New constant for default
8145 indexer name. Replaced all "Item" with this constant.
8146 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8148 * typemanager.cs (TypeManager.default_member_ctor): Cache here
8149 DefaultMemberAttribute constructor.
8151 2004-08-05 Martin Baulig <martin@ximian.com>
8153 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8156 2004-08-05 Marek Safar <marek.safar@seznam.cz>
8158 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8159 multi platforms problem.
8161 * compiler.csproj: Included shared files.
8163 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8165 Fix bug 60333, 55971 in the more general way
8166 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8167 Added arg_type argument for constant conversion.
8168 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8170 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8173 * class.cs (TypeContainer ): New inner classes MethodArrayList,
8174 OperatorArrayList, MethodCoreArrayList for typecontainer
8175 containers. Changed class member types to these new types.
8176 (MethodArrayList.DefineMembers): Added test for CS0659.
8178 2004-08-04 Miguel de Icaza <miguel@ximian.com>
8180 * cfold.cs: Synchronize the folding with the code in expression.cs
8181 Binary.DoNumericPromotions for uint operands.
8183 * attribute.cs: Revert patch from Raja, it introduced a regression
8184 while building Blam-1.2.1 (hard to isolate a test case).
8186 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8190 (TypeContainer.Define): Renamed to DefineContainerMembers because of
8192 (MethodCore.parent_method): New member. The method we're overriding
8193 if this is an override method.
8194 (MethodCore.CheckBase): Moved from Method class and made common.
8195 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8197 (MethodCore.CheckForDuplications): New abstract method. For custom
8198 member duplication search in a container
8199 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8200 method and its return type.
8201 (Event.conflict_symbol): New member. Symbol with same name in the
8205 (MemberCache.FindMemberWithSameName): New method. The method
8206 is looking for conflict with inherited symbols.
8208 2004-08-04 Martin Baulig <martin@ximian.com>
8210 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8212 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8214 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8216 * report.cs (Message): New enum for better error, warning reference in
8218 (MessageData): New inner abstract class. It generally handles printing of
8219 error and warning messages.
8220 Removed unused Error, Warning, Message methods.
8222 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8224 Fix for cs0592-8.cs test
8226 (Attributable.ValidAttributeTargets): Made public.
8227 (Attribute.ExplicitTarget): New member for explicit target value.
8228 (Attribute.CheckTargets): Now we translate explicit attribute
8229 target to Target here.
8231 2004-08-03 Ben Maurer <bmaurer@ximian.com>
8233 * ecore.cs (MethodGroupExpr): new IsBase property.
8235 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8237 * delegate.cs (DelegateCreation): store a MethodGroupExpr
8238 rather than an instance expr.
8240 (DelegateCreation.Emit): Use the method group rather than
8241 the instance expression. Also, if you have base.Foo as the
8242 method for a delegate, make sure to emit ldftn, not ldftnvirt.
8244 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
8246 (NewDelegate.DoResolve): Only check for the existance of Invoke
8247 if the method is going to be needed. Use MethodGroupExpr.
8249 (NewDelegate.Emit): Remove, DelegateCreation implements this.
8251 * expression.cs: For pointer arith., make sure to use
8252 the size of the type, not the size of the pointer to
8255 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8258 * class.cs (Class): Added error CS0502 test.
8260 2004-08-03 John Luke <jluke@cfl.rr.com>
8261 Raja R Harinath <rharinath@novell.com>
8264 * attribute.cs (Attribute.complained_before): New flag.
8265 (Attribute.ResolveType, Attribute.Resolve),
8266 (Attribute.DefinePInvokeMethod): Set it.
8267 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8269 2004-08-03 Martin Baulig <martin@ximian.com>
8271 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8272 use a user-defined operator; we still need to do numeric
8273 promotions in case one argument is a builtin type and the other
8274 one has an implicit conversion to that type. Fixes #62322.
8276 2004-08-02 Martin Baulig <martin@ximian.com>
8278 * statement.cs (LocalInfo.Flags): Added `IsThis'.
8279 (LocalInfo.IsThis): New public property.
8280 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8282 2004-08-01 Martin Baulig <martin@ximian.com>
8284 * class.cs (TypeContainer.GetClassBases): Don't set the default
8285 here since we may get called from GetPartialBases().
8286 (TypeContainer.DefineType): If GetClassBases() didn't return a
8287 parent, use the default one.
8289 2004-07-30 Duncan Mak <duncan@ximian.com>
8291 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
8293 2004-07-30 Martin Baulig <martin@ximian.com>
8295 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8297 * class.cs (SourceMethod): New public class, derive from the
8298 symbol writer's ISourceMethod.
8299 (Method): Use the new symbol writer API.
8301 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8302 as argument and use the new symbol writer.
8305 (SourceFile): Implement the symbol writer's ISourceFile.
8306 (Location.SymbolDocument): Removed.
8307 (Location.SourceFile): New public property.
8309 * symbolwriter.cs: Use the new symbol writer API.
8311 2004-07-30 Raja R Harinath <rharinath@novell.com>
8313 * Makefile (install-local): Remove. Functionality moved to
8316 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
8318 * Makefile: Install mcs.exe.config file together with mcs.exe.
8319 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8320 correct runtime version.
8322 2004-07-25 Martin Baulig <martin@ximian.com>
8325 (TypeContainer.RegisterOrder): Removed, this was unused.
8326 (TypeContainer, interface_order): Removed.
8327 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8328 TypeContainer as argument since we can also be called with a
8329 `PartialContainer' for a partial class/struct/interface.
8330 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8331 of checking whether we're an `Interface' - we could be a
8333 (PartialContainer.Register): Override; call
8334 AddClass()/AddStruct()/AddInterface() on our parent.
8336 * cs-parser.jay (interface_member_declaration): Add things to the
8337 `current_container', not the `current_class'.
8339 * rootcontext.cs (RegisterOrder): The overloaded version which
8340 takes an `Interface' was unused, removed.
8342 * typemanager.cs (TypeManager.LookupInterface): Return a
8343 `TypeContainer', not an `Interface'.
8344 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8345 contain a `PartialContainer' for an interface, so check it's
8346 `Kind' to figure out what it is.
8348 2004-07-25 Martin Baulig <martin@ximian.com>
8350 * class.cs (Class.DefaultTypeAttributes): New public constant.
8351 (Struct.DefaultTypeAttributes): Likewise.
8352 (Interface.DefaultTypeAttributes): Likewise.
8353 (PartialContainer.TypeAttr): Override this and add the
8354 DefaultTypeAttributes.
8356 2004-07-25 Martin Baulig <martin@ximian.com>
8358 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8359 we can just use the `Parent' field instead.
8361 2004-07-25 Martin Baulig <martin@ximian.com>
8363 * class.cs (TypeContainer.Emit): Renamed to EmitType().
8365 2004-07-25 Martin Baulig <martin@ximian.com>
8367 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8368 our parts before defining any methods.
8369 (TypeContainer.VerifyImplements): Make this virtual.
8370 (ClassPart.VerifyImplements): Override and call VerifyImplements()
8371 on our PartialContainer.
8373 2004-07-25 Martin Baulig <martin@ximian.com>
8375 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8377 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8378 argument, we can just use the `Parent' field instead.
8381 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
8382 (MemberBase.DoDefine): Likewise.
8384 2004-07-24 Martin Baulig <martin@ximian.com>
8386 * decl.cs (MemberCore.Parent): New public field.
8387 (DeclSpace.Parent): Moved to MemberCore.
8389 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8390 (MemberBase.ctor): Added TypeContainer argument, pass it to our
8392 (FieldBase, Field, Operator): Likewise.
8393 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8394 (EventField, Event): Likewise.
8396 2004-07-23 Martin Baulig <martin@ximian.com>
8398 * class.cs (PartialContainer): New public class.
8399 (ClassPart): New public class.
8400 (TypeContainer): Added support for partial classes.
8401 (TypeContainer.GetClassBases): Splitted some of the functionality
8402 out into GetNormalBases() and GetPartialBases().
8404 * cs-tokenizer.cs (Token.PARTIAL): New token.
8405 (Tokenizer.consume_identifier): Added some hacks to recognize
8406 `partial', but only if it's immediately followed by `class',
8407 `struct' or `interface'.
8409 * cs-parser.jay: Added support for partial clases.
8411 2004-07-23 Martin Baulig <martin@ximian.com>
8413 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8414 a `DeclSpace' and also made it readonly.
8415 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8416 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8417 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8419 * cs-parser.jay: Pass the `current_class', not the
8420 `current_container' (at the moment, this is still the same thing)
8421 to a new Method, Property, Event, Indexer or Constructor.
8423 2004-07-23 Martin Baulig <martin@ximian.com>
8425 * cs-parser.jay (CSharpParser): Added a new `current_class' field
8426 and removed the `current_interface' one.
8427 (struct_declaration, class_declaration, interface_declaration):
8428 Set `current_class' to the newly created class/struct/interface;
8429 set their `Bases' and call Register() before parsing their body.
8431 2004-07-23 Martin Baulig <martin@ximian.com>
8433 * class.cs (Kind): New public enum.
8434 (TypeContainer): Made this class abstract.
8435 (TypeContainer.Kind): New public readonly field.
8436 (TypeContainer.CheckDef): New public method; moved here from
8438 (TypeContainer.Register): New public abstract method.
8439 (TypeContainer.GetPendingImplementations): New public abstract
8441 (TypeContainer.GetClassBases): Removed the `is_class' and
8442 `is_iface' parameters.
8443 (TypeContainer.DefineNestedTypes): Formerly known as
8445 (ClassOrStruct): Made this class abstract.
8447 * tree.cs (RootTypes): New public type.
8449 2004-07-20 Martin Baulig <martin@ximian.com>
8451 * tree.cs (Tree.RecordNamespace): Removed.
8452 (Tree.Namespaces): Removed.
8454 * rootcontext.cs (RootContext.IsNamespace): Removed.
8456 * cs-parser.jay (namespace_declaration): Just create a new
8457 NamespaceEntry here.
8459 2004-07-20 Martin Baulig <martin@ximian.com>
8461 * statement.cs (ExceptionStatement): New abstract class. This is
8462 now used as a base class for everyone who's using `finally'.
8463 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
8464 our local variables before using them.
8466 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
8467 virtual method. This is used by Yield.Resolve() to "steal" an
8468 outer block's `finally' clauses.
8469 (FlowBranchingException): The .ctor now takes an ExceptionStatement
8472 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
8473 version which takes an ExceptionStatement. This version must be
8474 used to create exception branchings.
8477 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
8478 (Iterator.EmitMoveNext): Added exception support; protect the
8479 block with a `fault' clause, properly handle 'finally' clauses.
8480 (Iterator.EmitDispose): Run all the `finally' clauses here.
8482 2004-07-20 Martin Baulig <martin@ximian.com>
8484 * iterator.cs: This is the first of a set of changes in the
8485 iterator code. Match the spec more closely: if we're an
8486 IEnumerable, then GetEnumerator() must be called. The first time
8487 GetEnumerator() is called, it returns the current instance; all
8488 subsequent invocations (if any) must create a copy.
8490 2004-07-19 Miguel de Icaza <miguel@ximian.com>
8492 * expression.cs: Resolve the constant expression before returning
8495 2004-07-19 Martin Baulig <martin@ximian.com>
8497 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
8498 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
8499 the return type of the new EmitContext.
8501 2004-07-18 Martin Baulig <martin@ximian.com>
8503 * class.cs (Property.Define): Fix iterators.
8505 * iterators.cs (Iterator.Define): Moved the
8506 `container.AddInterator (this)' call here from the .ctor; only do
8507 it if we resolved successfully.
8509 2004-07-17 Miguel de Icaza <miguel@ximian.com>
8511 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
8512 `true' for preprocessing directives that we parse. The return
8513 value indicates whether we should return to regular tokenizing or
8514 not, not whether it was parsed successfully.
8516 In the past if we were in: #if false ... #line #endif, we would
8517 resume parsing after `#line'. See bug 61604.
8519 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
8520 building: IsEnumType should return true only for enums, not for
8521 enums or System.Enum itself. This fixes #61593.
8523 Likely what happened is that corlib was wrong: mcs depended on
8524 this bug in some places. The bug got fixed, we had to add the
8525 hack, which caused bug 61593.
8527 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
8528 that was a workaround for the older conditions.
8530 2004-07-16 Ben Maurer <bmaurer@ximian.com>
8532 * assign.cs: IAssignMethod has a new interface, as documented
8533 inline. All assignment code now uses this new api.
8535 * ecore.cs, expression.cs: All classes which implement
8536 IAssignMethod now use the new interface.
8538 * expression.cs (Invocation): add a hack to EmitCall so that
8539 IndexerAccess can be the target of a compound assignment without
8540 evaluating its arguments twice.
8542 * statement.cs: Handle changes in Invocation api.
8544 2004-07-16 Martin Baulig <martin@ximian.com>
8546 * iterators.cs: Rewrote this. We're now using one single Proxy
8547 class for both the IEnumerable and the IEnumerator interface and
8548 `Iterator' derives from Class so we can use the high-level API.
8550 * class.cs (TypeContainer.AddIterator): New method.
8551 (TypeContainer.DoDefineType): New protected virtual method, which
8552 is called from DefineType().
8553 (TypeContainer.DoDefineMembers): Call DefineType() and
8554 DefineMembers() on all our iterators.
8555 (TypeContainer.Emit): Call Emit() on all our iterators.
8556 (TypeContainer.CloseType): Call CloseType() on all our iterators.
8558 * codegen.cs (EmitContext.CurrentIterator): New public field.
8560 2004-07-15 Martin Baulig <martin@ximian.com>
8563 (TypeManager.not_supported_exception_type): New type.
8565 2004-07-14 Martin Baulig <martin@ximian.com>
8567 * iterators.cs: Use real error numbers.
8569 2004-07-14 Martin Baulig <martin@ximian.com>
8571 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8572 requires this to be a System.Collection.IEnumerable and not a
8573 class implementing that interface.
8574 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
8576 2004-07-13 Marek Safar <marek.safar@seznam.cz>
8578 * class.cs: Fixed previous fix, it broke some error tests.
8580 2004-07-12 Martin Baulig <martin@ximian.com>
8582 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8585 2004-07-09 Miguel de Icaza <miguel@ximian.com>
8587 * assign.cs (LocalTemporary): Add new argument: is_address,If
8588 `is_address' is true, then the value that we store is the address
8589 to the real value, and not the value itself.
8591 * ecore.cs (PropertyExpr): use the new local temporary
8592 stuff to allow us to handle X.Y += z (where X is a struct)
8594 2004-07-08 Martin Baulig <martin@ximian.com>
8596 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8597 not always return, just like we're doing in Using.Resolve().
8599 2004-07-07 Miguel de Icaza <miguel@ximian.com>
8601 * cs-parser.jay (fixed_statement): flag this as Pinned.
8603 2004-07-06 Miguel de Icaza <miguel@ximian.com>
8605 * typemanager.cs (TypeManager): Removed MakePinned method, this
8606 mechanism is replaced with the .NET 2.x compatible mechanism of
8607 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8609 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
8610 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8611 `IsFixed' property which has a different meaning.
8613 2004-07-02 Raja R Harinath <rharinath@novell.com>
8615 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8616 visible from inside a nested class, not just the names of the
8617 immediately enclosing class.
8620 2004-06-24 Raja R Harinath <rharinath@novell.com>
8622 * expression.cs (BetterConversion): Remove buggy special-case
8623 handling of "implicit constant expression conversions". At this
8624 point, we already know that the conversion is possible -- we're
8625 only checking to see which is better.
8627 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8629 * cs-parser.jay: Added error CS0210 test.
8631 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8633 * cs-parser.jay: Added error CS0134 test.
8635 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8638 * cs-parser.jay: Added error CS0145 test.
8640 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8642 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8644 2004-06-23 Ben Maurer <bmaurer@ximian.com>
8646 * expression.cs (StackAlloc.Resolve): The argument may not
8647 be a constant; deal with this case.
8649 2004-06-23 Marek Safar <marek.safar@seznam.cz>
8651 * attribute.cs (IndexerName_GetIndexerName): Renamed to
8652 GetIndexerAttributeValue.
8653 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8655 * class.cs (Indexer.Define): Added error tests for CS0415,
8658 2004-06-23 Miguel de Icaza <miguel@ximian.com>
8660 * attribute.cs (Attribute.Resolve): Keep field code in sync with
8663 2004-06-23 Martin Baulig <martin@ximian.com>
8665 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8666 neither return nor throw, reset the barrier as well. Fixes #60457.
8668 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
8670 * class.cs : EventAttributes is now set to None by default.
8671 This fixes bug #60459.
8673 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8676 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8677 Don't throw exception but return null (it's sufficient now).
8679 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8681 * typemanager.cs (GetArgumentTypes): Faster implementation.
8683 2004-06-18 Martin Baulig <martin@ximian.com>
8685 * attribute.cs (Attribute.Resolve): Check whether we're an
8686 EmptyCast which a Constant child. Fixes #60333.
8688 2004-06-17 Ben Maurer <bmaurer@ximian.com>
8690 * statement.cs (EmitCollectionForeach): Account for the fact that
8691 not all valuetypes are in areas which we can take the address of.
8692 For these variables, we store to a temporary variable. Also, make
8693 sure that we dont emit a `callvirt' on a valuetype method.
8695 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8697 * expression.cs (StackAlloc.DoReSolve): Added test for
8698 negative parameter (CS0247).
8700 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8703 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8705 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8708 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8711 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8713 Fix bug #58254 & cs1555.cs, cs1556.cs
8714 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8716 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8718 * cs-parser.jay: Added error CS1669 test for indexers.
8720 2004-06-11 Martin Baulig <martin@ximian.com>
8722 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8723 call this twice: for params and varargs methods.
8725 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8728 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8730 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8732 * attribute.cs (Attribute.GetValidTargets): Made public.
8735 (AbstractPropertyEventMethod): New class for better code sharing.
8736 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8738 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8740 2004-06-11 Raja R Harinath <rharinath@novell.com>
8743 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
8744 that the call to Resolve is part of a MemberAccess.
8745 (Expression.Resolve): Use it for SimpleName resolution.
8746 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
8747 Add 'intermediate' boolean argument.
8748 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
8749 error message when the SimpleName can be resolved ambiguously
8750 between an expression and a type.
8751 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
8753 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
8754 call on the left-side.
8756 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8759 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
8761 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8763 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
8765 2004-06-11 Martin Baulig <martin@ximian.com>
8767 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
8768 varargs methods if applicable.
8770 2004-06-11 Martin Baulig <martin@ximian.com>
8772 * expression.cs (Invocation.EmitCall): Don't use
8773 `method.CallingConvention == CallingConventions.VarArgs' since the
8774 method could also have `CallingConventions.HasThis'.
8776 2004-06-11 Marek Safar <marek.safar@seznam.cz>
8778 * class.cs (Event.GetSignatureForError): Implemented.
8779 Fixed crash in error test cs3010.cs
8781 2004-06-10 Miguel de Icaza <miguel@ximian.com>
8783 * cs-tokenizer.cs: Change the way we track __arglist to be
8784 consistent with the other keywords.
8786 2004-06-09 Miguel de Icaza <miguel@ximian.com>
8788 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
8791 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
8793 * codegen.cs: Check that all referenced assemblies have a strongname
8794 before strongnaming the compiled assembly. If not report error CS1577.
8795 Fix bug #56563. Patch by Jackson Harper.
8796 * typemanager.cs: Added a method to return all referenced assemblies.
8797 Fix bug #56563. Patch by Jackson Harper.
8799 2004-06-08 Marek Safar <marek.safar@seznam.cz>
8802 (Method.ApplyAttributeBuilder): Moved and added conditional
8803 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
8806 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
8808 2004-06-08 Marek Safar <marek.safar@seznam.cz>
8811 * class.cs: (EventField.attribute_targets): Changed default target.
8813 2004-06-08 Martin Baulig <martin@ximian.com>
8815 * expression.cs (Invocation.EmitCall): Enable varargs methods.
8817 2004-06-08 Martin Baulig <martin@ximian.com>
8819 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
8821 2004-06-07 Martin Baulig <martin@ximian.com>
8823 Added support for varargs methods.
8825 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
8828 * cs-parser.jay: Added support for `__arglist'.
8830 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
8832 * expression.cs (Argument.AType): Added `ArgList'.
8833 (Invocation): Added support for varargs methods.
8834 (ArglistAccess): New public class.
8835 (Arglist): New public class.
8837 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
8839 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
8840 a method's top-level block if the method has varargs.
8842 * support.cs (ReflectionParameters, InternalParameters): Added
8843 support for varargs methods.
8845 2004-06-07 Miguel de Icaza <miguel@ximian.com>
8847 * class.cs: Provide location in indexer error report.
8849 * driver.cs: Use standard names.
8851 * namespace.cs: Catch the use of using after a namespace has been
8852 declared also on using aliases.
8854 2004-06-03 Raja R Harinath <rharinath@novell.com>
8857 * typemanager.cs (closure_private_ok, closure_invocation_type)
8858 (closure_qualifier_type, closure_invocation_assembly)
8859 (FilterWithClosure): Move to ...
8860 (Closure): New internal nested class.
8861 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
8862 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
8863 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
8864 (MemberLookup, MemberLookupFailed): Use it.
8865 * expression.cs (New.DoResolve): Treat the lookup for the
8866 constructor as being qualified by the 'new'ed type.
8867 (Indexers.GetIndexersForTypeOrInterface): Update.
8869 2004-06-03 Marek Safar <marek.safar@seznam.cz>
8872 (GetConditionalAttributeValue): New method. Returns
8873 condition of ConditionalAttribute.
8874 (SearchMulti): New method. Returns all attributes of type 't'.
8875 Use it when attribute is AllowMultiple = true.
8876 (IsConditionalMethodExcluded): New method.
8879 (Method.IsExcluded): Implemented. Returns true if method has conditional
8880 attribute and the conditions is not defined (method is excluded).
8881 (IMethodData): Extended interface for ConditionalAttribute support.
8882 (PropertyMethod.IsExcluded): Implemented.
8885 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
8888 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
8891 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
8893 * expression.cs (ArrayCreationExpression): Make this just an
8894 `expression'. It can't be a statement, so the code here was
8897 2004-06-02 Marek Safar <marek.safar@seznam.cz>
8900 * typemanager.cs (GetFullNameSignature): New method for
8903 2004-06-02 Marek Safar <marek.safar@seznam.cz>
8906 * class.cs (MemberBase.GetSignatureForError): New virtual method.
8907 Use this method when MethodBuilder is null.
8908 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
8909 Added test for error CS0626 (MONO reports error for this situation).
8910 (IMethodData.GetSignatureForError): Extended interface.
8912 2004-06-01 Marek Safar <marek.safar@seznam.cz>
8915 (AttributeTester.GetObsoleteAttribute): Returns instance of
8916 ObsoleteAttribute when type is obsolete.
8919 (TypeContainer.VerifyObsoleteAttribute): Override.
8920 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8921 (MethodCode.VerifyObsoleteAttribute): Override.
8922 (MemberBase.VerifyObsoleteAttribute): Override.
8925 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8926 and report proper error.
8929 Delegate.VerifyObsoleteAttribute): Override.
8932 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8933 and report proper error.
8934 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8937 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8941 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8942 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8943 Added test for ObsoleteAttribute.
8946 (Catch): Derived from Statement.
8948 2004-06-01 Marek Safar <marek.safar@seznam.cz>
8950 Fixed bug #59071 & cs0160.cs
8952 * statement.cs (Try.Resolve): Check here whether order of catch
8953 clauses matches their dependencies.
8955 2004-05-31 Miguel de Icaza <miguel@ximian.com>
8957 * Reverted patch to namespace.cs (Use lookuptypedirect). This
8958 caused a regression: #59343. Referencing nested classes from an
8959 assembly stopped working.
8961 2004-05-31 Martin Baulig <martin@ximian.com>
8963 MCS is now frozen for beta 2.
8965 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8967 * convert.cs: add a trivial cache for overload operator resolution.
8969 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8971 * decl.cs: If possible, use lookuptypedirect here. We can only do
8972 this if there is no `.' after the namespace. Avoids using
8973 LookupType, which does lots of slow processing.
8974 (FindNestedType) New method, does what it says :-).
8975 * namespace.cs: use LookupTypeDirect.
8976 * rootcontext.cs: use membercache, if possible.
8977 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8979 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8982 According to the spec,
8984 In a member access of the form E.I, if E is a single identifier,
8985 and if the meaning of E as a simple-name (§7.5.2) is a constant,
8986 field, property, localvariable, or parameter with the same type as
8987 the meaning of E as a type-name (§3.8), then both possible
8988 meanings of E are permitted.
8990 We did not check that E as a simple-name had the same type as E as
8993 This trivial check gives us 5-7% on bootstrap time.
8995 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8997 * expression.cs (Invocation.OverloadResolve): Avoid the
8998 use of hashtables and boxing here by allocating on demand.
9000 2004-05-30 Martin Baulig <martin@ximian.com>
9002 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9003 we're doing a silent lookup. Don't try to lookup nested types in
9004 TypeManager.object_type (thanks to Ben Maurer).
9006 2004-05-30 Martin Baulig <martin@ximian.com>
9008 Committing a patch from Ben Maurer.
9010 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9012 2004-05-29 Martin Baulig <martin@ximian.com>
9014 * class.cs (IMethodData.ShouldIgnore): New method.
9016 * typemanager.cs (TypeManager.MethodFlags): Don't take a
9017 `Location' argument, we don't need it anywhere. Use
9018 `IMethodData.ShouldIgnore ()' instead of
9019 `MethodData.GetMethodFlags ()'.
9020 (TypeManager.AddMethod): Removed.
9021 (TypeManager.AddMethod2): Renamed to AddMethod.
9023 2004-05-29 Martin Baulig <martin@ximian.com>
9025 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9027 * convert.cs (Convert.ImplicitReferenceConversion): If we're
9028 converting from a class type S to an interface type and we already
9029 have an object on the stack, don't box it again. Fixes #52578.
9031 2004-05-29 Martin Baulig <martin@ximian.com>
9033 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9034 Added support for `params' parameters. Fixes #59267.
9036 2004-05-29 Martin Baulig <martin@ximian.com>
9038 * literal.cs (NullPointer): Provide a private .ctor which sets
9039 `type' to TypeManager.object_type. Fixes #59048.
9041 2004-05-29 Martin Baulig <martin@ximian.com>
9043 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9044 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
9046 * ecore.cs (EventExpr.instance_expr): Make the field private.
9048 2004-05-26 Marek Safar <marek.safar@seznam.cz>
9050 Fixed bug #50080 & cs0214-2.cs
9051 * expression.cs (Cast.DoResolve): Check unsafe context here.
9053 * statement.cs (Resolve.DoResolve): Likewise.
9055 2004-05-26 Martin Baulig <martin@ximian.com>
9057 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9059 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9060 (RootContext.LookupType): Pass down the `silent' flag.
9062 2004-05-25 Martin Baulig <martin@ximian.com>
9065 (MethodGroupExpr.IdenticalTypeName): New public property.
9066 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9067 expression actually refers to a type.
9069 2004-05-25 Martin Baulig <martin@ximian.com>
9071 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9072 for #56176 and made it actually work.
9074 2004-05-25 Martin Baulig <martin@ximian.com>
9076 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9077 (FieldExpr, PropertyExpr): Override and implement
9078 CacheTemporaries. Fixes #52279.
9080 2004-05-25 Miguel de Icaza <miguel@ximian.com>
9082 * location.cs: In the new compiler listing a file twice is a
9083 warning, not an error.
9085 2004-05-24 Martin Baulig <martin@ximian.com>
9087 * enum.cs (Enum.DefineType): For the `BaseType' to be a
9088 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
9090 2004-05-24 Martin Baulig <martin@ximian.com>
9092 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9093 walking the `using' list. Fixes #53921.
9095 2004-05-24 Martin Baulig <martin@ximian.com>
9097 * const.cs (Const.LookupConstantValue): Added support for
9098 EmptyCast's; fixes #55251.
9100 2004-05-24 Martin Baulig <martin@ximian.com>
9102 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9103 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9104 which does the CS0135 check. The reason is that we first need to
9105 check whether the variable actually exists.
9107 2004-05-24 Martin Baulig <martin@ximian.com>
9109 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9110 than RootContext.LookupType() to find the explicit interface
9113 2004-05-24 Raja R Harinath <rharinath@novell.com>
9115 * Makefile: Simplify. Use executable.make.
9116 * mcs.exe.sources: New file. List of sources of mcs.exe.
9118 2004-05-24 Anders Carlsson <andersca@gnome.org>
9122 Use the invariant culture when doing String.Compare for CLS case
9125 2004-05-23 Martin Baulig <martin@ximian.com>
9127 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9128 don't have any dots. Fixes #52622, added cs0246-8.cs.
9130 * namespace.cs (NamespaceEntry.Lookup): Likewise.
9132 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9134 * class.cs (MemberBase.Define): Reuse MemberType member for
9135 resolved type. Other methods can use it too.
9137 2004-05-23 Martin Baulig <martin@ximian.com>
9139 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9140 the variable also exists in the current block (otherwise, we need
9141 to report a CS0103). Fixes #58670.
9143 2004-05-23 Martin Baulig <martin@ximian.com>
9145 * flowanalysis.cs (Reachability.Reachable): Compute this
9146 on-the-fly rather than storing it as a field.
9148 2004-05-23 Martin Baulig <martin@ximian.com>
9150 * flowanalysis.cs (Reachability.And): Manually compute the
9151 resulting `barrier' from the reachability.
9153 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9156 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9157 instance of ObsoleteAttribute when symbol is obsolete.
9160 (IMethodData): Extended interface for ObsoleteAttribute support.
9162 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9164 * attribute.cs: Fix bug #55970
9166 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9170 (GetObsoleteAttribute): New method. Creates the instance of
9172 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9173 ObsoleteAttribute when member is obsolete.
9174 (AttributeTester.Report_ObsoleteMessage): Common method for
9175 Obsolete error/warning reporting.
9178 (TypeContainer.base_classs_type): New member for storing parent type.
9181 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9182 for this MemberCore.
9184 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9186 * attribute.cs, const.cs: Fix bug #58590
9188 2004-05-21 Martin Baulig <martin@ximian.com>
9190 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9191 out parameters if the end of the method is unreachable. Fixes
9194 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9196 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9197 Hari was right, why extra method.
9199 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9201 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9203 2004-05-20 Martin Baulig <martin@ximian.com>
9205 Merged this back from gmcs to keep the differences to a minumum.
9207 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
9208 instead of a Declspace.
9209 (Attribute.ResolveType): Likewise.
9210 (Attributes.Search): Likewise.
9211 (Attributes.Contains): Likewise.
9212 (Attributes.GetClsCompliantAttribute): Likewise.
9214 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
9216 (MethodData.ApplyAttributes): Take an EmitContext instead of a
9219 2004-05-19 Marek Safar <marek.safar@seznam.cz>
9221 Fix bug #58688 (MCS does not report error when the same attribute
9224 * attribute.cs (Attribute.Emit): Distinction between null and default.
9226 2004-05-19 Raja R Harinath <rharinath@novell.com>
9228 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9229 of a top-level attribute without an attribute target.
9230 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
9232 (Attribute.Conditional_GetConditionName),
9233 (Attribute.Obsolete_GetObsoleteMessage): Update.
9234 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
9235 part of ScanForIndexerName.
9236 (Attribute.CanIgnoreInvalidAttribute): New function.
9237 (Attribute.ScanForIndexerName): Move to ...
9238 (Attributes.ScanForIndexerName): ... here.
9239 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9240 (Attributes.Search): New internal variant that can choose not to
9241 complain if types aren't resolved. The original signature now
9243 (Attributes.GetClsCompliantAttribute): Use internal variant, with
9244 complaints suppressed.
9245 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9246 only if it not useful.
9247 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9248 top-level for attributes that are shared between the assembly
9249 and a top-level class.
9250 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9251 * class.cs: Update to reflect changes.
9252 (DefineIndexers): Fuse loops.
9253 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
9254 a couple more variants of attribute names.
9256 2004-05-18 Marek Safar <marek.safar@seznam.cz>
9258 Fix bug #52585 (Implemented explicit attribute declaration)
9261 (Attributable.ValidAttributeTargets): New abstract method. It gets
9262 list of valid attribute targets for explicit target declaration.
9263 (Attribute.Target): It holds target itself.
9264 (AttributeSection): Removed.
9265 (Attribute.CheckTargets): New method. It checks whether attribute
9266 target is valid for the current element.
9269 (EventProperty): New class. For events that are declared like
9270 property (with add and remove accessors).
9271 (EventField): New class. For events that are declared like field.
9274 * cs-parser.jay: Implemented explicit attribute target declaration.
9276 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
9277 Override ValidAttributeTargets.
9280 (ReturnParameter): Class for applying custom attributes on
9282 (ParameterAtribute): New class. Class for applying custom
9283 attributes on the parameter type.
9285 2004-05-17 Miguel de Icaza <miguel@ximian.com>
9287 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9290 (Method): Allow UNSAFE here.
9292 * modifiers.cs: Support unsafe reporting.
9294 2004-05-17 Marek Safar <marek.safar@seznam.cz>
9296 * decl.cs: Fix bug #58478.
9298 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9300 * statement.cs: When checking for unreachable code on an EmptyStatement,
9301 set the location. Fixes bug #58488.
9303 2004-05-13 Miguel de Icaza <miguel@ximian.com>
9305 * driver.cs: Add -pkg handling.
9307 From Gonzalo: UseShelLExecute=false
9309 2004-05-12 Marek Safar <marek.safar@seznam.cz>
9312 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9314 (Attribute.IsClsCompliaceRequired): Moved to base for better
9316 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9317 when attribute is AttributeUsageAttribute.
9318 (Attribute.GetValidTargets): Simplified.
9319 (Attribute.GetAttributeUsage): New method returns AttributeUsage
9320 attribute for this type.
9321 (Attribute.ApplyAttributes): Method renamed to Emit and make
9323 (GlobalAttributeSection): New class for special handling of global
9324 attributes (assembly, module).
9325 (AttributeSection.Emit): New method.
9327 * class.cs: Implemented Attributable abstract methods.
9328 (MethodCore.LabelParameters): Moved to Parameter class.
9329 (Accessor): Is back simple class.
9330 (PropertyMethod): Implemented Attributable abstract class.
9331 (DelegateMethod): Implemented Attributable abstract class.
9332 (Event): New constructor for disctintion between normal Event
9333 and Event with accessors.
9335 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9337 * codegen.cs, const.cs, decl.cs, delegate.cs:
9338 (CommonAssemblyModulClass): Implemented Attributable abstract class
9341 * enum.cs: Implement IAttributeSupport interface.
9342 (EnumMember): New class for emum members. Implemented Attributable
9346 (ParameterBase): Is abstract.
9347 (ReturnParameter): New class for easier [return:] attribute handling.
9349 * typemanager.cs: Removed builder_to_attr.
9351 2004-05-11 Raja R Harinath <rharinath@novell.com>
9354 * attribute.cs (Attribute.GetPositionalValue): New function.
9355 * class.cs (TypeContainer.VerifyMembers): New function.
9356 (TypeContainer.Emit): Use it.
9357 (ClassOrStruct): New base class for Class and Struct.
9358 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
9359 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9361 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9362 then each non-static field should have a FieldOffset attribute.
9363 Otherwise, none of the fields should have a FieldOffset attribute.
9364 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
9365 and FieldOffset attributes.
9366 * typemanager.cs (TypeManager.struct_layout_attribute_type)
9367 (TypeManager.field_offset_attribute_type): New core types.
9368 (TypeManager.InitCoreTypes): Initialize them.
9370 2004-05-11 Michal Moskal <malekith@pld-linux.org>
9372 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9373 Return correct type.
9376 2004-05-09 Miguel de Icaza <miguel@ximian.com>
9378 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9379 be implicitly converted to ulong.
9381 * expression.cs: The logic for allowing operator &, | and ^ worked
9382 was wrong, it worked before because we did not report an error in
9383 an else branch. Fixes 57895.
9385 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9386 allow volatile fields to be reference types.
9388 2004-05-07 Miguel de Icaza <miguel@ximian.com>
9390 * driver.cs: Add support for /debug-
9392 2004-05-07 Raja R Harinath <rharinath@novell.com>
9394 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
9395 Add a 'complain' parameter to silence errors.
9396 (Attribute.Resolve): Update to changes. Put in sanity check to catch
9397 silently overlooked type-resolutions.
9398 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9400 (Attributes.Search): New function.
9401 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9402 (Attributes.GetAttributeFullName): Remove hack.
9403 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
9404 Update to reflect changes.
9405 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9406 Use Attributes.Search instead of nested loops.
9408 2004-05-07 Marek Safar <marek.safar@seznam.cz>
9411 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9412 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9413 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9415 * report.cs: (Report.Warning): Renamed to Warning_T because of
9416 parameter collision.
9418 2004-05-05 Raja R Harinath <rharinath@novell.com>
9420 * expression.cs (MemberAccess.ResolveMemberAccess):
9421 Exit with non-zero status after Report.Error.
9422 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9424 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9426 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9428 * support.cs: Don't hang when the file is empty.
9430 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9432 * support.cs: In SeekableStreamReader, compute the preamble size of the
9433 underlying stream. Position changes should take into account that initial
9436 2004-05-03 Todd Berman <tberman@sevenl.net>
9438 * driver.cs: remove unused GetSysVersion function.
9440 2004-05-03 Todd Berman <tberman@sevenl.net>
9442 * driver.cs: Remove the hack from saturday, as well as the hack
9443 from jackson (LoadAssemblyFromGac), also adds the CWD to the
9444 link_paths to get that bit proper.
9446 2004-05-01 Todd Berman <tberman@sevenl.net>
9448 * driver.cs: Try a LoadFrom before a Load, this checks the current
9449 path. This is currently a bug in mono that is be fixed, however, this
9450 provides a workaround for now. This will be removed when the bug
9453 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
9455 * CryptoConvert.cs: Updated to latest version. Fix issue with
9456 incomplete key pairs (#57941).
9458 2004-05-01 Todd Berman <tberman@sevenl.net>
9460 * driver.cs: Remove '.' from path_chars, now System.* loads properly
9463 2004-04-30 Jackson Harper <jackson@ximian.com>
9465 * codegen.cs: Open keys readonly.
9467 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9469 * typemanager.cs: don't report cyclic struct layout when a struct
9470 contains 2 or more fields of the same type. Failed for Pango.AttrShape
9471 which has 2 Pango.Rectangle fields.
9473 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
9475 * expression.cs: Handle IntPtr comparisons with IL code
9476 rather than a method call.
9478 2004-04-29 Martin Baulig <martin@ximian.com>
9480 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
9481 the list of PropertyInfo's in class hierarchy and find the
9482 accessor. Fixes #56013.
9484 2004-04-29 Martin Baulig <martin@ximian.com>
9486 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9488 2004-04-29 Martin Baulig <martin@ximian.com>
9490 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9492 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9494 2004-04-29 Martin Baulig <martin@ximian.com>
9496 * class.cs (ConstructorInitializer.Resolve): Check whether the
9497 parent .ctor is accessible. Fixes #52146.
9499 2004-04-29 Martin Baulig <martin@ximian.com>
9501 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9503 * statement.cs (Using.EmitLocalVariableDecls): Use
9504 TypeManager.idisposable_type, not typeof (IDisposable).
9505 (Foreach.EmitCollectionForeach): Added support for valuetypes.
9507 2004-04-29 Martin Baulig <martin@ximian.com>
9509 * class.cs (Event.Define): Don't emit the field and don't set
9510 RTSpecialName and SpecialName for events on interfaces. Fixes
9513 2004-04-29 Raja R Harinath <rharinath@novell.com>
9515 Refactor Attribute.ApplyAttributes.
9516 * attribute.cs (Attributable): New base class for objects that can
9517 have Attributes applied on them.
9518 (Attribute): Make AttributeUsage fields public.
9519 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9520 (Attribute.IsInternalCall): New property.
9521 (Attribute.UsageAttr): Convert to a public read-only property.
9522 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9523 (Attribute.ResolveType, Attribute.Resolve)
9524 (Attribute.ScanForIndexerName): Update to reflect changes.
9525 (Attribute.CheckAttributeTarget): Re-format.
9526 (Attribute.ApplyAttributes): Refactor, to various
9527 Attributable.ApplyAttributeBuilder methods.
9528 * decl.cs (MemberCore): Make Attributable.
9529 * class.cs (Accessor): Make Attributable.
9530 (MethodData.ApplyAttributes): Use proper attribute types, not
9532 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9533 (TypeContainer.ApplyAttributeBuilder)
9534 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9535 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
9536 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9537 (Operator.ApplyAttributeBuilder): New factored-out methods.
9538 * const.cs (Const.ApplyAttributeBuilder): Likewise.
9539 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9540 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9541 * parameter.cs (ParameterBase): New Attributable base class
9542 that can also represent Return types.
9543 (Parameter): Update to the changes.
9545 2004-04-29 Jackson Harper <jackson@ximian.com>
9547 * driver.cs: Prefer the corlib system version when looking for
9548 assemblies in the GAC. This is still a hack, but its a better hack
9551 2004-04-29 Marek Safar <marek.safar@seznam.cz>
9553 * decl.cs, enum.cs: Improved error 3005 reporting.
9555 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9556 (related_symbols): New private member for list of symbols
9557 related to reported error/warning.
9559 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9561 2004-04-29 Martin Baulig <martin@ximian.com>
9563 * ecore.cs (Expression.Constantify): If we're an enum and
9564 TypeManager.TypeToCoreType() doesn't give us another type, use
9565 t.UnderlyingSystemType. Fixes #56178.
9567 2004-04-29 Martin Baulig <martin@ximian.com>
9569 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9570 interfaces and for each interface, only add members directly
9571 declared in that interface. Fixes #53255.
9573 2004-04-28 Martin Baulig <martin@ximian.com>
9575 * expression.cs (ConditionalLogicalOperator): Use a temporary
9576 variable for `left' to avoid that we evaluate it more than once;
9579 2004-04-28 Martin Baulig <martin@ximian.com>
9581 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9584 2004-04-28 Martin Baulig <martin@ximian.com>
9586 * statement.cs (LocalInfo.Resolve): Check whether the type is not
9589 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9590 whether the type is not void (CS1547).
9592 2004-04-28 Martin Baulig <martin@ximian.com>
9594 * expression.cs (Unary.DoResolveLValue): Override this and report
9595 CS0131 for anything but Operator.Indirection.
9597 2004-04-28 Martin Baulig <martin@ximian.com>
9599 Committing a patch from Ben Maurer; see bug #50820.
9601 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9604 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9607 2004-04-28 Martin Baulig <martin@ximian.com>
9609 Committing a patch from Ben Maurer; see bug #50820.
9611 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9614 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9617 2004-04-28 Martin Baulig <martin@ximian.com>
9619 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9620 (Block.AddLabel): Call DoLookupLabel() to only search in the
9623 2004-04-28 Martin Baulig <martin@ximian.com>
9625 * cfold.cs (ConstantFold.BinaryFold): Added special support for
9626 comparing StringConstants and NullLiterals in Equality and Inequality.
9628 2004-04-28 Jackson Harper <jackson@ximian.com>
9630 * driver.cs: Attempt to load referenced assemblies from the
9631 GAC. This is the quick and dirty version of this method that
9632 doesnt take into account versions and just takes the first
9633 canidate found. Will be good enough for now as we will not have more
9634 then one version installed into the GAC until I update this method.
9636 2004-04-28 Martin Baulig <martin@ximian.com>
9638 * typemanager.cs (TypeManager.CheckStructCycles): New public
9639 static method to check for cycles in the struct layout.
9641 * rootcontext.cs (RootContext.PopulateTypes): Call
9642 TypeManager.CheckStructCycles() for each TypeContainer.
9643 [Note: We only need to visit each type once.]
9645 2004-04-28 Martin Baulig <martin@ximian.com>
9647 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9649 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9650 success and added `out object value'. Use a `bool resolved' field
9651 to check whether we've already been called rather than
9652 `ConstantValue != null' since this breaks for NullLiterals.
9654 2004-04-28 Raja R Harinath <rharinath@novell.com>
9656 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9657 setting of this flag, since the 'set' method may be non-public.
9659 2004-04-28 Raja R Harinath <rharinath@novell.com>
9661 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9662 check on current_vector.Block.
9664 2004-04-27 Martin Baulig <martin@ximian.com>
9666 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9667 a field initializer. Fixes #56459.
9669 2004-04-27 Martin Baulig <martin@ximian.com>
9671 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9672 we're not attempting to use an indexer. Fixes #52154.
9674 2004-04-27 Martin Baulig <martin@ximian.com>
9676 * statement.cs (Return): Don't create a return label if we don't
9677 need it; reverts my change from January 20th. Thanks to Ben
9680 2004-04-27 Martin Baulig <martin@ximian.com>
9682 According to the spec, `goto' can only leave a nested scope, but
9685 * statement.cs (Block.LookupLabel): Only lookup in the current
9686 block, don't recurse into parent or child blocks.
9687 (Block.AddLabel): Check in parent and child blocks, report
9688 CS0140/CS0158 if we find a duplicate.
9689 (Block): Removed this indexer for label lookups.
9690 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9691 this already does the error reporting for us.
9694 (FlowBranching.UsageVector.Block): New public variable; may be null.
9695 (FlowBranching.CreateSibling): Added `Block' argument.
9696 (FlowBranching.LookupLabel): New public virtual method. Lookup a
9697 label for the target of a `goto' and check whether we're not
9698 leaving a `finally'.
9700 2004-04-27 Martin Baulig <martin@ximian.com>
9702 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9703 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9706 2004-04-27 Martin Baulig <martin@ximian.com>
9708 * statement.cs (Block.AddLabel): Also check for implicit blocks
9709 and added a CS0158 check.
9711 2004-04-27 Martin Baulig <martin@ximian.com>
9713 * flowanalysis.cs (FlowBranchingLoop): New class.
9714 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9715 UsageVector's instead of an ArrayList.
9716 (FlowBranching.Label): Likewise.
9717 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9718 (FlowBranching.AddBreakVector): New method.
9720 2004-04-27 Miguel de Icaza <miguel@ximian.com>
9722 * attribute.cs: Small regression fix: only convert the type if we
9723 the type is different, fixes System.Drawing build.
9725 2004-04-27 Martin Baulig <martin@ximian.com>
9727 * attribute.cs (Attribute.Resolve): If we have a constant value
9728 for a named field or property, implicity convert it to the correct
9731 2004-04-27 Raja R Harinath <rharinath@novell.com>
9733 * statement.cs (Block.Block): Implicit blocks share
9734 'child_variable_names' fields with parent blocks.
9735 (Block.AddChildVariableNames): Remove.
9736 (Block.AddVariable): Mark variable as "used by a child block" in
9737 every surrounding block.
9738 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9739 been used in a child block, complain about violation of "Invariant
9740 meaning in blocks" rule.
9741 * cs-parser.jay (declare_local_variables): Don't use
9742 AddChildVariableNames.
9743 (foreach_statement): Don't create an implicit block: 'foreach'
9746 2004-04-23 Miguel de Icaza <miguel@ximian.com>
9748 * convert.cs (ImplicitNumericConversion): 0 is also positive when
9749 converting from 0L to ulong. Fixes 57522.
9751 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9753 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9754 derived class hides via 'new' keyword field from base class (test-242.cs).
9755 TODO: Handle this in the more general way.
9757 * class.cs (CheckBase): Ditto.
9759 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9761 * decl.cs (caching_flags): New member for storing cached values
9763 (MemberCore.Flags): New enum where bit flags for caching_flags
9765 (MemberCore.cls_compliance): Moved to caching_flags.
9766 (DeclSpace.Created): Moved to caching_flags.
9768 * class.cs: Use caching_flags instead of DeclSpace.Created
9770 2004-04-21 Miguel de Icaza <miguel@ximian.com>
9772 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9773 if we are only a derived class, not a nested class.
9775 * typemanager.cs: Same as above, but do this at the MemberLookup
9776 level (used by field and methods, properties are handled in
9777 PropertyExpr). Allow for the qualified access if we are a nested
9780 2004-04-21 Marek Safar <marek.safar@seznam.cz>
9782 * class.cs: Refactoring.
9783 (IMethodData): New inteface; Holds links to parent members
9784 to avoid member duplication (reduced memory allocation).
9785 (Method): Implemented IMethodData interface.
9786 (PropertyBase): New inner classes for get/set methods.
9787 (PropertyBase.PropertyMethod): Implemented IMethodData interface
9788 (Event): New inner classes for add/remove methods.
9789 (Event.DelegateMethod): Implemented IMethodData interface.
9791 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9792 EmitContext (related to class.cs refactoring).
9794 2004-04-21 Raja R Harinath <rharinath@novell.com>
9796 * delegate.cs (Delegate.VerifyApplicability): If the number of
9797 arguments are the same as the number of parameters, first try to
9798 verify applicability ignoring any 'params' modifier on the last
9802 2004-04-16 Raja R Harinath <rharinath@novell.com>
9804 * class.cs (TypeContainer.AddIndexer): Use
9805 'ExplicitInterfaceName' to determine if interface name was
9806 explicitly specified. 'InterfaceType' is not initialized at this time.
9807 (TypeContainer.DefineIndexers): Remove use of temporary list. The
9808 Indexers array is already in the required order. Initialize
9809 'IndexerName' only if there are normal indexers.
9810 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9811 (TypeContainer.Emit): Emit DefaultMember attribute only if
9812 IndexerName is initialized.
9815 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
9817 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9820 2004-04-15 Raja R Harinath <rharinath@novell.com>
9822 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9826 * attribute.cs (Attribute.Resolve): Check for duplicate named
9830 2004-04-15 Miguel de Icaza <miguel@ximian.com>
9832 * iterators.cs (MarkYield): track whether we are in an exception,
9833 and generate code accordingly. Use a temporary value to store the
9834 result for our state.
9836 I had ignored a bit the interaction of try/catch with iterators
9837 since their behavior was not entirely obvious, but now it is
9838 possible to verify that our behavior is the same as MS .NET 2.0
9842 2004-04-14 Miguel de Icaza <miguel@ximian.com>
9844 * iterators.cs: Avoid creating temporaries if there is no work to
9847 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9848 Enumerations, use TypeManager.EnumToUnderlying and call
9851 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9854 (This.Emit): Use EmitContext.EmitThis to emit our
9857 (This.EmitAssign): Ditto.
9859 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9860 codepaths, we will move all the functionality into
9863 (FieldExpr.EmitAssign): Ditto.
9865 This fixes several hidden bugs that I uncovered while doing a code
9866 review of this today.
9868 * codegen.cs (EmitThis): reworked so the semantics are more clear
9869 and also support value types "this" instances.
9871 * iterators.cs: Changed so that for iterators in value types, we
9872 do not pass the value type as a parameter.
9874 Initialization of the enumerator helpers is now done in the caller
9875 instead of passing the parameters to the constructors and having
9876 the constructor set the fields.
9878 The fields have now `assembly' visibility instead of private.
9880 2004-04-11 Miguel de Icaza <miguel@ximian.com>
9882 * expression.cs (Argument.Resolve): Check if fields passed as ref
9883 or out are contained in a MarshalByRefObject.
9885 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9886 another compiler type.
9888 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
9890 * class.cs (Indexer.Define): use the new name checking method.
9891 Also, return false on an error.
9892 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9893 (is_identifier_[start/part]_character): make static.
9895 2004-04-10 Miguel de Icaza <miguel@ximian.com>
9897 * expression.cs (Binary.ResolveOperator): Do no append strings
9898 twice: since we can be invoked more than once (array evaluation)
9899 on the same concatenation, take care of this here. Based on a fix
9900 from Ben (bug #56454)
9902 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
9904 * codegen.cs: Fix another case where CS1548 must be reported (when
9905 delay-sign isn't specified and no private is available #56564). Fix
9906 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
9907 error when MCS is used on the MS runtime and we need to delay-sign
9908 (which seems unsupported by AssemblyBuilder - see #56621).
9910 2004-04-08 Marek Safar <marek.safar@seznam.cz>
9912 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9913 (TypeManager.ComputeNamespaces): Faster implementation for
9916 * compiler.csproj: Updated AssemblyName to mcs.
9918 2004-04-07 Miguel de Icaza <miguel@ximian.com>
9920 * rootcontext.cs: Add new types to the boot resolution.
9922 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9923 MulticastDelegate is not allowed.
9925 * typemanager.cs: Add new types to lookup: System.TypedReference
9928 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9929 check for TypedReference or ArgIterator, they are not allowed.
9931 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9932 makes us properly catch 1510 in some conditions (see bug 56016 for
9935 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
9937 * CryptoConvert.cs: update from corlib version
9940 2004-04-05 Miguel de Icaza <miguel@ximian.com>
9942 * class.cs (Indexer.Define): Check indexername declaration
9944 2004-04-05 Marek Safar <marek.safar@seznam.cz>
9946 * attribute.cs (IsClsCompliant): Fixed problem with handling
9947 all three states (compliant, not-compliant, undetected).
9949 2004-03-30 Marek Safar <marek.safar@seznam.cz>
9951 * attribute.cs (Attribute): Location is now public.
9952 (Resolve): Store resolved arguments (pos_values) in attribute class.
9953 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9954 (GetClsCompliantAttributeValue): New method that gets
9955 CLSCompliantAttribute value.
9956 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9957 if exists else null.
9958 (AttributeTester): New class for CLS-Compliant verification routines.
9960 * class.cs (Emit): Add CLS-Compliant verification.
9961 (Method.GetSignatureForError): Implemented.
9962 (Constructor.GetSignatureForError): Implemented
9963 (Constructor.HasCompliantArgs): Returns if constructor has
9964 CLS-Compliant arguments.
9965 (Constructor.Emit): Override.
9966 (Construcor.IsIdentifierClsCompliant): New method; For constructors
9967 is needed to test only parameters.
9968 (FieldBase.GetSignatureForError): Implemented.
9969 (TypeContainer): New member for storing base interfaces.
9970 (TypeContainer.FindMembers): Search in base interfaces too.
9972 * codegen.cs (GetClsComplianceAttribute): New method that gets
9973 assembly or module CLSCompliantAttribute value.
9974 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9976 (ModuleClass.Emit): Add error 3012 test.
9978 * const.cs (Emit): Override and call base for CLS-Compliant tests.
9980 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9981 state for all decl types.
9982 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9983 if CLS-Compliant tests are required.
9984 (IsClsCompliaceRequired): New method. Analyze whether code
9985 must be CLS-Compliant.
9986 (IsExposedFromAssembly): New method. Returns true when MemberCore
9987 is exposed from assembly.
9988 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9989 value or gets cached value.
9990 (HasClsCompliantAttribute): New method. Returns true if MemberCore
9991 is explicitly marked with CLSCompliantAttribute.
9992 (IsIdentifierClsCompliant): New abstract method. This method is
9993 used to testing error 3005.
9994 (IsIdentifierAndParamClsCompliant): New method. Common helper method
9995 for identifier and parameters CLS-Compliant testing.
9996 (VerifyClsCompliance): New method. The main virtual method for
9997 CLS-Compliant verifications.
9998 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9999 null. I don't know why is null (too many public members !).
10000 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10001 and get value of first CLSCompliantAttribute that found.
10003 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10004 (VerifyClsCompliance): Override and add extra tests.
10006 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10007 clscheck- disable CLS-Compliant verification event if assembly is has
10008 CLSCompliantAttribute(true).
10010 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10011 ApllyAttribute is now called in emit section as in the other cases.
10012 Possible future Emit integration.
10013 (IsIdentifierClsCompliant): New override.
10014 (VerifyClsCompliance): New override.
10015 (GetEnumeratorName): Returns full enum name.
10017 * parameter.cs (GetSignatureForError): Implemented.
10019 * report.cs (WarningData): New struct for Warning message information.
10020 (LocationOfPreviousError): New method.
10021 (Warning): New method. Reports warning based on the warning table.
10022 (Error_T): New method. Reports error based on the error table.
10024 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10025 verifications are done here.
10027 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10029 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10030 CLSCompliantAttribute.
10031 (all_imported_types): New member holds all imported types from other
10033 (LoadAllImportedTypes): New method fills static table with exported types
10034 from all referenced assemblies.
10035 (Modules): New property returns all assembly modules.
10037 2004-03-30 Miguel de Icaza <miguel@ximian.com>
10039 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10040 throwing a parser error.
10042 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10043 which removes the hardcoded get_/set_ prefixes for properties, as
10044 IL allows for the properties to be named something else.
10048 * expression.cs: Do not override operand before we know if it is
10049 non-null. Fix 56207
10051 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10053 * typemanager.cs: support for pinned variables.
10055 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10057 * decl.cs, typemanager.cs: Avoid using an arraylist
10058 as a buffer if there is only one result set.
10060 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10062 * expression.cs: Make sure you cant call a static method
10063 with an instance expression, bug #56174.
10065 2004-03-29 Miguel de Icaza <miguel@ximian.com>
10067 * class.cs (IsDuplicateImplementation): Improve error reporting to
10068 flag 663 (method only differs in parameter modifier).
10070 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10071 in preprocessor directives.
10073 * location.cs (LookupFile): Allow for the empty path.
10075 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
10076 better approach for some of that patch, but its failing with the
10077 CharSet enumeration. For now try/catch will do.
10079 * typemanager.cs: Do not crash if a struct does not have fields.
10082 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10084 * expression.cs: cs0213, cant fix a fixed expression.
10087 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10089 * cs-parser.jay: detect invalid embeded statements gracefully.
10092 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10094 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10097 the invocation type may not be a subclass of the tye of the item/
10098 The type of the item must be a subclass of the invocation item.
10103 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
10105 * attribute.cs: Added methods to get a string and a bool from an
10106 attribute. Required to information from AssemblyKeyFileAttribute,
10107 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10108 * codegen.cs: Modified AssemblyName creation to include support for
10109 strongnames. Catch additional exceptions to report them as CS1548.
10110 * compiler.csproj: Updated include CryptoConvert.cs.
10111 * compiler.csproj.user: Removed file - user specific configuration.
10112 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
10113 Mono.Security assembly. The original class is maintained and tested in
10114 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10115 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10116 like CSC 8.0 (C# v2) supports.
10117 * Makefile: Added CryptoConvert.cs to mcs sources.
10118 * rootcontext.cs: Added new options for strongnames.
10120 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
10122 * driver.cs: For --expect-error, report error code `2'
10123 if the program compiled with no errors, error code `1' if
10124 it compiled with an error other than the one expected.
10126 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
10128 * compiler.csproj: Updated for Visual Studio .NET 2003.
10129 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10130 * compiler.sln: Updated for Visual Studio .NET 2003.
10132 2004-03-24 Ravi Pratap M <ravi@ximian.com>
10134 * expression.cs: Fix bug #47234. We basically need to apply the
10135 rule that we prefer the conversion of null to a reference type
10136 when faced with a conversion to 'object' (csc behaviour).
10138 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10140 * statement.cs: Shorter form for foreach, eliminates
10141 a local variable. r=Martin.
10143 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10145 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10146 checks if we can use brtrue/brfalse to test for 0.
10147 * expression.cs: use the above in the test for using brtrue/brfalse.
10148 cleanup code a bit.
10150 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10152 * expression.cs: Rewrite string concat stuff. Benefits:
10154 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10155 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10156 rather than a concat chain.
10158 * typemanager.cs: Add lookups for more concat overloads.
10160 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10162 * expression.cs: Emit shorter il code for array init.
10179 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
10181 * statement.cs: Before, two switch blocks would be merged if the
10182 total size of the blocks (end_item - begin_item + 1) was less than
10183 two times the combined sizes of the blocks.
10185 Now, it will only merge if after the merge at least half of the
10190 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
10192 * class.cs : csc build fix for GetMethods(). See bug #52503.
10194 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
10196 * expression.cs: Make sure fp comparisons work with NaN.
10197 This fixes bug #54303. Mig approved this patch a long
10198 time ago, but we were not able to test b/c the runtime
10201 2004-03-19 Miguel de Icaza <miguel@ximian.com>
10203 * ecore.cs (TypExpr.GetHashCode): implement this overload.
10205 2004-03-19 Martin Baulig <martin@ximian.com>
10207 * class.cs (MemberCore.IsDuplicateImplementation): Report the
10208 error here and not in our caller.
10210 2004-03-19 Martin Baulig <martin@ximian.com>
10212 * interface.cs: Completely killed this file.
10213 (Interface): We're now a TypeContainer and live in class.cs.
10215 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10216 argument; we're now also called for interfaces.
10217 (TypeContainer.DefineMembers): Allow this method being called
10219 (TypeContainer.GetMethods): New public method; formerly known as
10220 Interface.GetMethod(). This is used by PendingImplementation.
10221 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10222 it's now private and non-static.
10223 (Interface): Moved this here; it's now implemented similar to
10225 (Method, Property, Event, Indexer): Added `bool is_interface'
10226 argument to their .ctor's.
10227 (MemberBase.IsInterface): New public field.
10229 * cs-parser.jay: Create normal Method, Property, Event, Indexer
10230 instances instead of InterfaceMethod, InterfaceProperty, etc.
10231 (opt_interface_base): Removed; we now use `opt_class_base' instead.
10232 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10234 2004-03-19 Martin Baulig <martin@ximian.com>
10236 * class.cs (MethodCore.IsDuplicateImplementation): New private
10237 method which does the CS0111 checking.
10238 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10239 Use IsDuplicateImplementation().
10241 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
10243 * decl.cs (FindMemberToOverride): New method to find the correct
10244 method or property to override in the base class.
10246 - Make Method/Property use the above method to find the
10247 version in the base class.
10248 - Remove the InheritableMemberSignatureCompare as it is now
10251 This patch makes large code bases much faster to compile, as it is
10252 O(n) rather than O(n^2) to do this validation.
10254 Also, it fixes bug 52458 which is that nested classes are not
10255 taken into account when finding the base class member.
10257 Reviewed/Approved by Martin.
10259 2004-03-17 Marek Safar <marek.safar@seznam.cz>
10261 * interface.cs: In all interface classes removed redundant
10262 member initialization.
10264 2004-03-16 Martin Baulig <martin@ximian.com>
10266 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10268 2004-03-15 Miguel de Icaza <miguel@ximian.com>
10270 * decl.cs (DefineTypeAndParents): New helper method to define a
10271 type's containers before the type itself is defined; This is a
10272 bug exposed by the recent changes to Windows.Forms when an
10273 implemented interface was defined inside a class that had not been
10276 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10278 (Check): Loop correctly to report errors modifiers
10279 (UNSAFE was not in the loop, since it was the same as TOP).
10281 * interface.cs: Every interface member now takes a ModFlags,
10282 instead of a "is_new" bool, which we set on the base MemberCore.
10284 Every place where we called "UnsafeOk" in the interface, now we
10285 call the proper member (InterfaceMethod.UnsafeOK) instead to get
10286 the unsafe settings from the member declaration instead of the
10287 container interface.
10289 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
10291 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10292 `set_indexer_name' to the pending bits (one per type).
10294 We fixed a bug today that was picking the wrong method to
10295 override, since for properties the existing InterfaceMethod code
10296 basically ignored the method name. Now we make sure that the
10297 method name is one of the valid indexer names.
10299 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
10301 * support.cs (SeekableStreamReader): Keep track of stream byte
10302 positions and don't mix them with character offsets to the buffer.
10304 Patch from Gustavo Giráldez
10306 2004-03-15 Marek Safar <marek.safar@seznam.cz>
10308 * interface.cs (InterfaceSetGetBase): Removed double member
10309 initialization, base class does it as well.
10311 2004-03-13 Martin Baulig <martin@ximian.com>
10313 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10314 when compiling corlib.
10316 2004-03-13 Miguel de Icaza <miguel@ximian.com>
10318 * convert.cs (ExplicitConversion): We were reporting an error on
10319 certain conversions (object_type source to a value type, when the
10320 expression was `null') before we had a chance to pass it through
10321 the user defined conversions.
10323 * driver.cs: Replace / and \ in resource specifications to dots.
10326 * class.cs: Add check for duplicate operators. Fixes 52477
10328 2004-03-11 Miguel de Icaza <miguel@ximian.com>
10330 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10331 that are in the middle of the statements, not only at the end.
10334 * class.cs (TypeContainer.AddField): No longer set the
10335 `HaveStaticConstructor' flag, now we call it
10336 `UserDefineStaticConstructor' to diferentiate the slightly
10337 semantic difference.
10339 The situation is that we were not adding BeforeFieldInit (from
10340 Modifiers.TypeAttr) to classes that could have it.
10341 BeforeFieldInit should be set to classes that have no static
10346 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10348 And most importantly Zoltan's comment:
10350 http://bugzilla.ximian.com/show_bug.cgi?id=44229
10352 "I think beforefieldinit means 'it's ok to initialize the type sometime
10353 before its static fields are used', i.e. initialization does not need
10354 to be triggered by the first access to the type. Setting this flag
10355 helps the JIT to compile better code, since it can run the static
10356 constructor at JIT time, and does not need to generate code to call it
10357 (possibly lots of times) at runtime. Unfortunately, mcs does not set
10358 this flag for lots of classes like String.
10360 csc sets this flag if the type does not have an explicit static
10361 constructor. The reasoning seems to be that if there are only static
10362 initalizers for a type, and no static constructor, then the programmer
10363 does not care when this initialization happens, so beforefieldinit
10366 This bug prevents the AOT compiler from being usable, since it
10367 generates so many calls to mono_runtime_class_init that the AOT code
10368 is much slower than the JITted code. The JITted code is faster,
10369 because it does not generate these calls if the vtable is type is
10370 already initialized, which is true in the majority of cases. But the
10371 AOT compiler can't do this."
10373 2004-03-10 Miguel de Icaza <miguel@ximian.com>
10375 * class.cs (MethodData.Emit): Refactor the code so symbolic
10376 information is generated for destructors; For some reasons we
10377 were taking a code path that did not generate symbolic information
10380 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
10382 * class.cs: Create a Constructor.CheckBase method that
10383 takes care of all validation type code. The method
10384 contains some code that was moved from Define.
10386 It also includes new code that checks for duplicate ctors.
10387 This fixes bug #55148.
10389 2004-03-09 Joshua Tauberer <tauberer@for.net>
10391 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
10392 a { ... }-style array creation invokes EmitStaticInitializers
10393 which is not good for reference-type arrays. String, decimal
10394 and now null constants (NullCast) are not counted toward
10395 static initializers.
10397 2004-03-05 Martin Baulig <martin@ximian.com>
10399 * location.cs (SourceFile.HasLineDirective): New public field;
10400 specifies whether the file contains or is referenced by a "#line"
10402 (Location.DefineSymbolDocuments): Ignore source files which
10403 either contain or are referenced by a "#line" directive.
10405 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
10407 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10408 direct access to our parent, so check the method inline there.
10410 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
10412 * expression.cs (Invocation.EmitCall): Miguel's last commit
10413 caused a regression. If you had:
10418 In Foo the implict this would be null.
10420 2004-02-27 Miguel de Icaza <miguel@ximian.com>
10422 * expression.cs (Invocation.EmitCall): If the method is not
10423 virtual, do not emit a CallVirt to it, use Call.
10425 * typemanager.cs (GetFullNameSignature): Improve the method to
10426 cope with ".ctor" and replace it with the type name.
10428 * class.cs (ConstructorInitializer.Resolve): Now the method takes
10429 as an argument the ConstructorBuilder where it is being defined,
10430 to catch the recursive constructor invocations.
10432 2004-02-26 Miguel de Icaza <miguel@ximian.com>
10434 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10435 routines to check if a type is an enumerable/enumerator allow
10436 classes that implement the IEnumerable or IEnumerator interfaces.
10438 * class.cs (Property, Operator): Implement IIteratorContainer, and
10439 implement SetYields.
10441 (Property.Define): Do the block swapping for get_methods in the
10442 context of iterators. We need to check if Properties also
10443 include indexers or not.
10445 (Operator): Assign the Block before invoking the
10446 OperatorMethod.Define, so we can trigger the Iterator code
10449 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
10450 Property and Operator classes are not created when we parse the
10451 declarator but until we have the block completed, so we use a
10452 singleton SimpleIteratorContainer.Simple to flag whether the
10453 SetYields has been invoked.
10455 We propagate this setting then to the Property or the Operator to
10456 allow the `yield' to function.
10458 2004-02-25 Marek Safar <marek.safar@seznam.cz>
10460 * codegen.cs: Implemented attribute support for modules.
10461 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10462 Assembly/Module functionality.
10464 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10465 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10466 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10468 2004-02-16 Marek Safar <marek.safar@seznam.cz>
10470 * interface.cs (FindMembers): The operation is performed on all base
10471 interfaces and not only on the first. It is required for future CLS Compliance patch.
10473 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
10475 * statement.cs, codegen.cs:
10476 This patch deals with patterns such as:
10478 public class List : IEnumerable {
10480 public MyEnumerator GetEnumerator () {
10481 return new MyEnumerator(this);
10484 IEnumerator IEnumerable.GetEnumerator () {
10488 public struct MyEnumerator : IEnumerator {
10493 Before, there were a few things we did wrong:
10494 1) we would emit callvirt on a struct, which is illegal
10495 2) we emited ldarg when we needed to emit ldarga
10496 3) we would mistakenly call the interface methods on an enumerator
10497 type that derived from IEnumerator and was in another assembly. For example:
10499 public class MyEnumerator : IEnumerator
10501 Would have the interface methods called, even if there were public impls of the
10502 method. In a struct, this lead to invalid IL code.
10504 2004-02-11 Marek Safar <marek.safar@seznam.cz>
10506 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10509 * delegate.cs (Define): Fixed crash when delegate type is undefined.
10511 2004-02-11 Miguel de Icaza <miguel@ximian.com>
10513 * cs-parser.jay: Fix small regression: we were not testing V2
10514 compiler features correctly.
10516 * interface.cs: If the emit context is null, then create one
10518 2004-02-09 Marek Safar <marek.safar@seznam.cz>
10520 * decl.cs (GetSignatureForError): New virtual method to get full name
10521 for error messages.
10523 * attribute.cs (IAttributeSupport): New interface for attribute setting.
10524 Now it is possible to rewrite ApplyAttributes method to be less if/else.
10526 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10527 Duplicated members and code in these classes has been removed.
10528 Better encapsulation in these classes.
10530 2004-02-07 Miguel de Icaza <miguel@ximian.com>
10532 * assign.cs (Assign.DoResolve): When dealing with compound
10533 assignments, there is a new rule in ECMA C# 2.4 (might have been
10534 there before, but it is documented here) that states that in:
10538 If b is of type int, and the `op' is a shift-operator, then the
10539 above is evaluated as:
10543 * expression.cs (Binary.ResolveOperator): Instead of testing for
10544 int/uint/long/ulong, try to implicitly convert to any of those
10545 types and use that in pointer arithmetic.
10547 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10548 method to print information for from the type, not from the
10549 null-method we were given.
10551 2004-02-01 Duncan Mak <duncan@ximian.com>
10553 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10554 parsing for cmd, fixes bug #53694.
10556 2004-02-04 Marek Safar <marek.safar@seznam.cz>
10558 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10559 in the member name duplication tests. Property and operator name duplication
10560 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10562 2004-02-03 Marek Safar <marek.safar@seznam.cz>
10564 * interface.cs (PopulateMethod): Fixed crash when interface method
10565 returns not existing type (error test cs0246-3.cs).
10567 2004-02-02 Ravi Pratap M <ravi@ximian.com>
10569 * cs-parser.jay (interface_accessors): Re-write actions to also
10570 store attributes attached to get and set methods. Fix spelling
10573 (inteface_property_declaration): Modify accordingly.
10575 (InterfaceAccessorInfo): New helper class to store information to pass
10576 around between rules that use interface_accessors.
10578 * interface.cs (Emit): Apply attributes on the get and set
10579 accessors of properties and indexers too.
10581 * attribute.cs (ApplyAttributes): Modify accordingly to use the
10582 right MethodBuilder when applying attributes to the get and set accessors.
10584 2004-01-31 Miguel de Icaza <miguel@ximian.com>
10586 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10588 2004-01-26 Miguel de Icaza <miguel@ximian.com>
10590 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10592 2004-01-25 Miguel de Icaza <miguel@ximian.com>
10594 * cs-parser.jay: Remove YIELD token, instead use the new grammar
10595 changes that treat `yield' specially when present before `break'
10596 or `return' tokens.
10598 * cs-tokenizer.cs: yield is no longer a keyword.
10600 2004-01-23 Marek Safar <marek.safar@seznam.cz>
10602 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10603 setting for default constructors.
10604 For default constructors are almost every time set wrong Modifier. The
10605 generated IL code has been alright. But inside mcs this values was
10606 wrong and this was reason why several of my CLS Compliance tests
10609 2004-01-22 Martin Baulig <martin@ximian.com>
10611 * cs-parser.jay (namespace_or_type_name): Return an Expression,
10612 not a QualifiedIdentifier. This is what `type_name_expression'
10613 was previously doing.
10614 (type_name_expression): Removed; the code is now in
10615 `namespace_or_type_name'.
10616 (qualified_identifier): Removed, use `namespace_or_type_name'
10618 (QualifiedIdentifier): Removed this class.
10620 2004-01-22 Martin Baulig <martin@ximian.com>
10622 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10623 not a string as alias name.
10625 2004-01-21 Miguel de Icaza <miguel@ximian.com>
10627 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10628 #52730 bug, and instead compute correctly the need to use a
10629 temporary variable when requesting an address based on the
10630 static/instace modified of the field and the constructor.
10632 2004-01-21 Martin Baulig <martin@ximian.com>
10634 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10635 class and namespace before looking up aliases. Fixes #52517.
10637 2004-01-21 Martin Baulig <martin@ximian.com>
10639 * flowanalysis.cs (UsageVector.Merge): Allow variables being
10640 assinged in a 'try'; fixes exception4.cs.
10642 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10643 * class.cs : Implemented parameter-less constructor for TypeContainer
10645 * decl.cs: Attributes are now stored here. New property OptAttributes
10647 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10649 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10651 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10653 * typemanager.cs (CSharpSignature): Now reports also inner class name.
10654 (CSharpSignature): New method for indexer and property signature.
10656 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10658 * pending.cs (IsVirtualFilter): Faster implementation.
10660 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10662 * typemanager.cs: Avoid inclusion of same assembly more than once.
10664 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10666 * cs-parser.jay: Fixed problem where the last assembly attribute
10667 has been applied also to following declaration (class, struct, etc.)
10669 2004-01-21 Marek Safar <marek.safar@seznam.cz>
10671 * class.cs: Added error CS0538, CS0539 reporting.
10672 Fixed crash on Microsoft runtime when field type is void.
10674 * cs-parser.jay: Added error CS0537 reporting.
10676 * pending.cs: Added error CS0535 reporting.
10677 Improved error report for errors CS0536, CS0534.
10679 2004-01-20 Miguel de Icaza <miguel@ximian.com>
10681 Merge a few bits from the Anonymous Method MCS tree.
10683 * statement.cs (ToplevelBlock): New class for toplevel methods,
10684 will hold anonymous methods, lifted variables.
10686 * cs-parser.jay: Create toplevel blocks for delegates and for
10687 regular blocks of code.
10689 2004-01-20 Martin Baulig <martin@ximian.com>
10691 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10692 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10693 and `NeedExplicitReturn'; added `IsLastStatement'.
10694 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10695 have a `ReturnLabel' or we're not unreachable.
10697 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10698 child's reachability; don't just override ours with it. Fixes
10699 #58058 (lluis's example).
10700 (FlowBranching): Added public InTryOrCatch(), InCatch(),
10701 InFinally(), InLoop(), InSwitch() and
10702 BreakCrossesTryCatchBoundary() methods.
10704 * statement.cs (Return): Do all error checking in Resolve().
10705 Unless we are the last statement in a top-level block, always
10706 create a return label and jump to it.
10707 (Break, Continue): Do all error checking in Resolve(); also make
10708 sure we aren't leaving a `finally'.
10709 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10710 statement in a top-level block.
10711 (Block.Flags): Added `IsDestructor'.
10712 (Block.IsDestructor): New public property.
10714 2004-01-20 Martin Baulig <martin@ximian.com>
10716 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10718 2004-01-20 Martin Baulig <martin@ximian.com>
10720 * statement.cs (Statement.ResolveUnreachable): New public method.
10721 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10722 (Block.Resolve): Resolve unreachable statements.
10724 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
10726 * expression.cs: We need to fix the case where we do
10727 not have a temp variable here.
10729 * assign.cs: Only expression compound assignments need
10730 temporary variables.
10732 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
10734 * flowanalysis.cs: Reduce memory allocation in a few ways:
10735 - A block with no variables should not allocate a bit
10737 - A method with no out parameters does not need any tracking
10738 for assignment of the parameters, so we need not allocate
10741 public readonly Type[] VariableTypes;
10742 public readonly string[] VariableNames;
10743 Are redundant. The data is already stored in the variable
10744 map, so we need not allocate another array for it.
10745 - We need to add alot of checks for if (params | locals) == null
10746 due to the first two changes.
10748 2004-01-18 Miguel de Icaza <miguel@ximian.com>
10750 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10751 implement IMemoryLocation, we store a copy on a local variable and
10752 take the address of it. Patch from Benjamin Jemlich
10754 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
10755 to use a special "type_name_expression" rule which reduces the
10756 number of "QualifiedIdentifier" classes created, and instead
10757 directly creates MemberAccess expressions.
10759 2004-01-17 Miguel de Icaza <miguel@ximian.com>
10761 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
10762 that fixes #52853. Null literal assignment to ValueType
10764 * class.cs (MethodData.Emit): Instead of checking the name of the
10765 method to determine if its a destructor, create a new derived
10766 class from Method called Destructor, and test for that.
10768 * cs-parser.jay: Create a Destructor object instead of a Method.
10770 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10774 2004-01-16 Miguel de Icaza <miguel@ximian.com>
10776 * expression.cs (Binary.ResolveOperator): Perform an implicit
10777 conversion from MethodGroups to their delegate types on the
10778 Addition operation.
10780 * delegate.cs: Introduce a new class DelegateCreation that is the
10781 base class for `NewDelegate' and `ImplicitDelegateCreation',
10782 factor some code in here.
10784 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
10785 conversion from MethodGroups to compatible delegate types.
10787 * ecore.cs (Expression.Resolve): Do not flag error 654
10788 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
10789 we allow conversions from MethodGroups to delegate types now.
10791 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
10792 assignments in v2 either.
10794 2004-01-10 Miguel de Icaza <miguel@ximian.com>
10796 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
10797 static read-only fields in ctors.
10799 Applied patch from Benjamin Jemlich
10801 * expression.cs (UnaryMutator): Avoid leaking local variables.
10803 2004-01-09 Miguel de Icaza <miguel@ximian.com>
10805 * cs-tokenizer.cs (IsCastToken): Allow the various native types
10806 here to return true, as they can be used like this:
10808 (XXX) int.MEMBER ()
10810 Fixed 49836 and all the other dups
10812 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
10814 * driver.cs: Implement /win32res and /win32icon.
10816 2004-01-08 Miguel de Icaza <miguel@ximian.com>
10818 * cs-parser.jay: Add a rule to improve error handling for the
10819 common mistake of placing modifiers after the type.
10821 2004-01-07 Miguel de Icaza <miguel@ximian.com>
10823 * cs-parser.jay (interface_event_declaration): Catch
10824 initialization of events on interfaces, and report cs0068
10826 * cs-parser.jay (interface_event_declaration): Catch
10827 initialization of events.
10829 * ecore.cs: Better report missing constructors.
10831 * expression.cs (Binary.ResolveOperator): My previous bug fix had
10832 the error reporting done in the wrong place. Fix.
10834 * expression.cs (Binary.ResolveOperator): Catch the
10835 operator + (E x, E y) error earlier, and later allow for implicit
10836 conversions in operator +/- (E e, U x) from U to the underlying
10839 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10840 52596, if the container class is abstract, the default constructor
10841 is protected otherwise its public (before, we were always public).
10843 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10846 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10847 Jemlich that fixes bug #52597, MCS was generating invalid code for
10848 idisposable structs. Thanks to Ben for following up with this
10851 2004-01-06 Miguel de Icaza <miguel@ximian.com>
10853 * driver.cs: Allow assemblies without code to be generated, fixes
10856 2004-01-07 Nick Drochak <ndrochak@gol.com>
10858 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10860 2004-01-05 Miguel de Icaza <miguel@ximian.com>
10862 * cs-parser.jay: Add rules to improve error reporting if fields or
10863 methods are declared at the namespace level (error 116)
10865 * Add rules to catch event add/remove
10867 2004-01-04 David Sheldon <dave-mono@earth.li>
10869 * expression.cs: Added matching ")" to error message for
10872 2004-01-03 Todd Berman <tberman@gentoo.org>
10874 * ecore.cs, attribute.cs:
10875 Applying fix from #52429.
10877 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10879 * ecore.cs, expression.cs, statement.cs:
10880 Total rewrite of how we handle branching. We
10881 now handle complex boolean expressions with fewer
10882 jumps. As well if (x == 0) no longer emits a ceq.
10884 if (x is Foo) is much faster now, because we generate
10887 Overall, we get a pretty big improvement on our benchmark
10888 tests. The code we generate is smaller and more readable.
10890 I did a full two-stage bootstrap. The patch was reviewed
10891 by Martin and Miguel.
10893 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10895 * cs-parser.jay: Make primary_expression not take a QI.
10896 we dont need this because the member_access rule covers
10897 us here. So we replace the rule with just IDENTIFIER.
10899 This has two good effects. First, we remove a s/r conflict.
10900 Second, we allocate many fewer QualifiedIdentifier objects.
10902 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10904 * attribute.cs: Handle MarshalAs attributes as pseudo, and
10905 set the correct information via SRE. This prevents
10906 hanging on the MS runtime. Fixes #29374.
10908 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10910 * convert.cs: correctly handle conversions to value types
10911 from Enum and ValueType as unboxing conversions.
10913 Fixes bug #52569. Patch by Benjamin Jemlich.
10915 2004-01-02 Ravi Pratap <ravi@ximian.com>
10917 * expression.cs (BetterConversion): Prefer int -> uint
10918 over int -> ulong (csc's behaviour). This fixed bug #52046.
10920 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
10922 * decl.cs (MemberCache.FindMembers): now returns a
10925 * typemanager.cs: In general, go with with ^^.
10926 (CopyNewMethods): take an IList.
10927 (RealMemberLookup): Only allocate an arraylist
10928 if we copy from two sets of methods.
10930 This change basically does two things:
10931 1) Fewer array lists allocated due to CopyNewMethods.
10932 2) the explicit cast in MemberList costed ALOT.
10934 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
10936 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10937 a hashtable to avoid needless string allocations when an identifier is
10938 used more than once (the common case).
10940 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10942 * pending.cs: MS's TypeBuilder.GetInterfaces ()
10943 is broken, it will not return anything. So, we
10944 have to use the information we have in mcs to
10947 * typemanager.cs: Add a cache for GetInterfaces,
10948 since this will now be used more often (due to ^^)
10950 (GetExplicitInterfaces) New method that gets the
10951 declared, not effective, interfaces on a type
10952 builder (eg, if you have interface IFoo, interface
10953 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10956 This patch makes MCS able to bootstrap itself on
10959 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10961 * expression.cs: Remove the Nop's that Miguel put
10964 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10966 * report.cs, codegen.cs: Give the real stack trace to
10967 the error when an exception is thrown.
10969 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10971 * decl.cs: only allocate hashtables for ifaces if
10974 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10976 * expression.cs: fix the error from cs0121-2.cs
10977 (a parent interface has two child interfaces that
10978 have a function with the same name and 0 params
10979 and the function is called through the parent).
10981 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
10983 * class.cs, rootcontext.cs, typmanager.cs: do not
10986 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
10988 * codegen.cs: remove stack for the ec flow branching.
10989 It is already a linked list, so no need.
10991 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
10993 * Makefile: Allow custom profiler here.
10995 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10997 * typemanager.cs (LookupType):
10998 - Use a static char [], because split takes
10999 a param array for args, so it was allocating
11001 - Do not store true in a hashtable, it boxes.
11003 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11005 * flowanalysis.cs: bytify common enums.
11007 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11009 * modifiers.cs: Add a new set of flags for the
11010 flags allowed on explicit interface impls.
11011 * cs-parser.jay: catch the use of modifiers in
11012 interfaces correctly.
11013 * class.cs: catch private void IFoo.Blah ().
11015 All related to bug #50572.
11017 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11019 * decl.cs: Rewrite the consistant accessability checking.
11020 Accessability is not linear, it must be implemented in
11021 a tableish way. Fixes #49704.
11023 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11025 * expression.cs: Handle negation in a checked context.
11026 We must use subtraction from zero. Fixes #38674.
11028 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11030 * class.cs: Ignore static void main in DLLs.
11031 * rootcontext.cs: Handle the target type here,
11032 since we are have to access it from class.cs
11033 * driver.cs: account for the above.
11035 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11037 * report.cs: Give line numbers and files if available.
11039 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
11041 * driver.cs: Implement /addmodule.
11043 * typemanager.cs: Change 'modules' field so it now contains Modules not
11046 2003-12-20 Martin Baulig <martin@ximian.com>
11048 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11049 (FieldBase.IsAssigned): Removed this field.
11050 (FieldBase.SetAssigned): New public method.
11051 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11053 2003-12-20 Martin Baulig <martin@ximian.com>
11055 * expression.cs (LocalVariableReference.DoResolve): Don't set
11056 `vi.Used' if we're called from DoResolveLValue().
11058 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11059 returns the usage vector it just merged into the current one -
11060 pass this one to UsageWarning().
11061 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11062 of the `EmitContext', don't call this recursively on our children.
11064 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
11066 * driver.cs: Implement /target:module.
11068 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
11070 * support.cs (CharArrayHashtable): New helper class.
11072 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
11073 char arrays, not strings, so we can avoid creating a string in
11074 consume_identifier if the identifier is a keyword.
11076 2003-12-16 Martin Baulig <martin@ximian.com>
11078 * statement.cs (LocalInfo.Assigned): Removed this property.
11079 (LocalInfo.Flags): Removed `Assigned'.
11080 (LocalInfo.IsAssigned): New public method; takes the EmitContext
11081 and uses flow analysis.
11082 (Block.UsageWarning): Made this method private.
11083 (Block.Resolve): Call UsageWarning() if appropriate.
11085 * expression.cs (LocalVariableReference.DoResolve): Always set
11086 LocalInfo.Used here.
11088 2003-12-13 Martin Baulig <martin@ximian.com>
11090 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11091 any value here; we're now using flow analysis to figure out
11092 whether a statement/block returns a value.
11094 2003-12-13 Martin Baulig <martin@ximian.com>
11096 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11098 (FlowBranching.MergeFinally): Don't call
11099 `branching.CheckOutParameters()' here, this is called in
11101 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11102 when adding the `finally' vector.
11104 2003-12-13 Martin Baulig <martin@ximian.com>
11107 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11108 actually work and also fix #48962.
11110 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
11112 * decl.cs: Do not check System.Object for nested types,
11113 since we know it does not have any. Big bang for buck:
11116 Run 1: 8.35 seconds
11117 Run 2: 8.32 seconds
11118 corlib: 17.99 seconds
11120 Run 1: 8.17 seconds
11121 Run 2: 8.17 seconds
11122 corlib: 17.39 seconds
11124 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
11126 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
11127 time we are returning 0 members, so we save alot here.
11129 2003-12-11 Martin Baulig <martin@ximian.com>
11131 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
11132 `MergeChild()', also just take the `FlowBranching' as argument;
11133 call Merge() on it and return the result.
11134 (FlowBranching.Merge): We don't need to do anything if we just
11137 2003-12-11 Martin Baulig <martin@ximian.com>
11139 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
11140 them in an `ArrayList' to reduce memory usage. Thanks to Ben
11141 Maurer for this idea.
11143 2003-12-11 Martin Baulig <martin@ximian.com>
11145 * flowanalysis.cs (MergeResult): This class is now gone; we now
11146 use the `UsageVector' for this. The reason for this is that if a
11147 branching just has one sibling, we don't need to "merge" them at
11148 all - that's the next step to do.
11149 (FlowBranching.Merge): We now return a `UsageVector' instead of a
11152 2003-12-11 Martin Baulig <martin@ximian.com>
11154 Reworked flow analyis and made it more precise and bug-free. The
11155 most important change is that we're now using a special `Reachability'
11156 class instead of having "magic" meanings of `FlowReturns'. I'll
11157 do some more cleanups and optimizations and also add some more
11158 documentation this week.
11160 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
11161 largely reworked this class.
11162 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
11163 the new `Reachability' class instead of having "magic" values here.
11164 (FlowBranching): We're now using an instance of `Reachability'
11165 instead of having separate `Returns', `Breaks' etc. fields.
11167 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
11168 based on flow analysis; ignore the return value of block.Emit ().
11170 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
11172 * driver.cs typemanager.cs: Find the mono extensions to corlib even
11173 if they are private.
11175 2003-12-09 Martin Baulig <martin@ximian.com>
11177 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
11178 call them directly on the UsageVector.
11180 2003-12-09 Martin Baulig <martin@ximian.com>
11182 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
11183 Changed return type from `FlowReturns' to `Reachability'.
11185 2003-12-09 Martin Baulig <martin@ximian.com>
11187 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
11188 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
11189 `Reachable' fields with a single `Reachability' one.
11191 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11193 * class.cs (FindMembers): Remove foreach's.
11198 Run 1: 8.74 seconds
11199 Run 2: 8.71 seconds
11202 Run 1: 8.64 seconds
11203 Run 2: 8.58 seconds
11206 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11211 This patch does a few things:
11212 1. EmptyStatement is now a singleton, so it is never reallocated.
11213 2. All blah is EmptyStatement constructs have been changed to
11214 blah == EmptyStatement.Value, which is much faster and valid
11215 now that EmptyStatement is a singleton.
11216 3. When resolving a block, rather than allocating a new array for
11217 the non-empty statements, empty statements are replaced with
11218 EmptyStatement.Value
11219 4. Some recursive functions have been made non-recursive.
11220 Mainly the performance impact is from (3), however (1) and (2) are needed for
11221 this to work. (4) does not make a big difference in normal situations, however
11222 it makes the profile look saner.
11227 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11228 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
11229 Total memory allocated: 56397 KB
11232 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
11233 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
11234 Total memory allocated: 55666 KB
11236 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11238 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
11239 than the hashtable in a hashtable version
11241 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
11242 we always end up concating a string. This results in a huge perf
11243 loss, because many strings have to be tracked by the GC. In this
11244 patch, we first use a hashtable that works with two keys, so that
11245 the strings do not need to be concat'ed.
11249 Run 1: 8.74 seconds
11250 Run 2: 8.71 seconds
11253 Run 1: 8.65 seconds
11254 Run 2: 8.56 seconds
11256 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
11258 * Makefile: Add a new target `do-time' that does a quick and simple
11259 profile, leaving easy to parse output.
11261 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
11263 * codegen.cs (Init): Create the dynamic assembly with
11264 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
11266 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
11268 * support.cs: Make the PtrHashtable use only one
11269 instance of its comparer.
11271 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
11273 * typemanager.cs: Fix lookup of GetNamespaces.
11275 2003-11-29 Miguel de Icaza <miguel@ximian.com>
11277 * expression.cs: Removed redundant line.
11279 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
11280 ArrayLists, use for loops with bounds.
11282 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
11285 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
11286 arraylists, use for loop with bounds.
11288 The above three changes give us a 0.071 second performance
11289 improvement out of 3.294 seconds down to 3.223. On my machine
11290 the above changes reduced the memory usage by 1,387 KB during
11291 compiler bootstrap.
11293 * cs-parser.jay (QualifiedIdentifier): New class used to represent
11294 QualifiedIdentifiers. Before we created a new string through
11295 concatenation, and mostly later on, the result would be
11296 manipulated by DecomposeQI through string manipulation.
11298 This reduced the compiler memory usage for bootstrapping from
11299 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
11300 compile times in 0.05 seconds.
11302 2003-11-28 Dick Porter <dick@ximian.com>
11304 * support.cs: Do string compares with the Invariant culture.
11312 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
11313 the comparison is done with the Invariant culture.
11315 2003-11-27 Miguel de Icaza <miguel@ximian.com>
11317 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
11318 GetEnumerator method.
11320 (ProbeCollectionType): Iterate starting at the most specific type
11321 upwards looking for a GetEnumerator
11323 * expression.cs: Shift count can be up to 31 for int/uint and 63
11326 2003-11-26 Miguel de Icaza <miguel@ximian.com>
11328 * statement.cs (Block.LookupLabel): Also look for the label on the
11329 children blocks. Use a hash table to keep track of visited
11332 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
11333 we actually did transform the other operand, otherwise fall back
11334 to the common codepath that casts to long.
11336 * cs-tokenizer.cs: Use the same code pattern as the int case.
11337 Maybe I should do the parsing myself, and avoid depending on the
11338 Parse routines to get this done.
11340 2003-11-25 Miguel de Icaza <miguel@ximian.com>
11342 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11343 which fixes bug 51347. This time test it.
11345 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
11346 attributes for example can not tell the difference between these.
11347 The difference was only a syntax feature of the language.
11349 * attribute.cs: Apply attributes to delegates.
11351 * delegate.cs: Call the apply attributes method.
11353 2003-11-24 Miguel de Icaza <miguel@ximian.com>
11355 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
11356 comparing 0 vs Byte.MinValue, not the value
11358 (ImplicitConversionRequired): When reporting a conversion error,
11359 use error 31 to print out the constant error instead of the
11362 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
11363 which fixes bug 51347.
11365 2003-11-22 Miguel de Icaza <miguel@ximian.com>
11367 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
11368 which fixes the -warnaserror command line option.
11370 2003-11-21 Miguel de Icaza <miguel@ximian.com>
11372 * cfold.cs (DoNumericPromotions): During constant folding of
11373 additions on UIntConstant, special case intconstants with
11374 IntConstants like we do on the expression binary operator.
11376 2003-11-12 Miguel de Icaza <miguel@ximian.com>
11378 * convert.cs (ImplicitReferenceConversion): We were missing a case
11379 (System.Enum are not value types or class types, so we need to
11380 classify them separatedly).
11382 * driver.cs: We do not support error 2007.
11384 2003-11-12 Jackson Harper <jackson@ximian.com>
11386 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
11387 system directory. Also use the full file name so users can
11388 libraries names mscorlib-o-tron.dll in a non system dir.
11390 2003-11-10 Martin Baulig <martin@ximian.com>
11392 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
11393 (TypeManager.InitCoreTypes): Initialize them here, but instead of
11394 calling `ResolveType()' on them, directly assign their `Type'.
11396 2003-11-08 Martin Baulig <martin@ximian.com>
11398 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
11399 return value and the `out parent' parameter.
11400 (TypeContainer.DefineType): Moved the CS0644 check into
11401 GetClassBases(). Don't pass the interface types to the
11402 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11403 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11405 * ecore.cs (TypeExpr.IsAttribute): New property.
11406 (TypeExpr.GetInterfaces): New method.
11408 * interface.cs (Interface.GetInterfaceTypeByName): Return a
11409 TypeExpr instead of a Type.
11410 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11411 (Interface.DefineType): Don't pass the interface types to the
11412 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11413 them later and then call `TypeBulider.AddInterfaceImplementation()'.
11415 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11416 instead of a `Type[]'.
11417 (TypeManager.RegisterBuilder): Likewise.
11418 (TypeManager.AddUserInterface): Likewise.
11419 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11420 `Type[]' and also return a `TypeExpr[]'.
11421 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11423 2003-11-08 Martin Baulig <martin@ximian.com>
11425 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11428 2003-11-08 Martin Baulig <martin@ximian.com>
11430 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11431 TypeManager.ResolveExpressionTypes().
11433 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11434 instead of an Expression.
11435 (TypeExpr): This is now an abstract base class for `TypeExpression'.
11436 (TypeExpression): New public class; formerly known as `TypeExpr'.
11438 * expression.cs (ComposedCast): Derive from TypeExpr.
11440 * typemanager.cs (TypeManager.system_*_expr): These are now
11441 TypExpr's instead of Expression's.
11442 (TypeManager.ResolveExpressionTypes): New public static function;
11443 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11446 2003-11-06 Miguel de Icaza <miguel@ximian.com>
11448 * expression.cs (New.DoResolve): Do not dereference value that
11449 might be a null return.
11451 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11452 sure that the constant value has the right type. Fixes an
11453 unreported bug, similar to 50425.
11455 * const.cs (Const.LookupConstantValue): Call
11456 ImplicitStandardConversionExists before doing a conversion to
11457 avoid havng the TypeManager.ChangeType do conversions.
11459 Reduced the number of casts used
11461 (Const.ChangeType): New routine to enable reuse of the constant
11462 type changing code from statement.
11464 * typemanager.cs (ChangeType): Move common initialization to
11465 static global variables.
11469 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11470 every value type to go through, even if it was void. Fix that.
11472 * cs-tokenizer.cs: Use is_identifier_start_character on the start
11473 character of the define, and the is_identifier_part_character for
11474 the rest of the string.
11476 2003-11-05 Miguel de Icaza <miguel@ximian.com>
11478 * expression.cs (UnaryMutator.EmitCode): When I updated
11479 LocalVariableReference.DoResolve, I overdid it, and dropped an
11480 optimization done on local variable references.
11482 2003-11-04 Miguel de Icaza <miguel@ximian.com>
11484 * ecore.cs: Convert the return from Ldlen into an int.
11486 2003-10-20 Miguel de Icaza <miguel@ximian.com>
11488 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11489 the accessibility, this is a special case for toplevel non-public
11490 classes (internal for instance).
11492 2003-10-20 Nick Drochak <ndrochak@gol.com>
11494 * ecore.cs: Fix typo and build. Needed another right paren.
11496 2003-10-19 Miguel de Icaza <miguel@ximian.com>
11498 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
11499 `internal' case regular and protected, but not allowing protected
11500 to be evaluated later. Bug 49840
11502 2003-10-15 Miguel de Icaza <miguel@ximian.com>
11504 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11505 to kb.Nlast, and not the kb.nFirst to isolate the switch
11508 Extract the underlying type, so enumerations of long/ulong are
11509 treated like long/ulong.
11511 2003-10-14 Miguel de Icaza <miguel@ximian.com>
11513 * expression.cs (New): Overload the meaning of RequestedType to
11514 track the possible creation of the NewDelegate type, since
11515 DoResolve is invoked more than once for new constructors on field
11518 See bugs: #48800 and #37014
11520 * cs-parser.jay (declare_local_constants): Take an arraylist
11521 instead of a single constant.
11523 (local_constant_declaration): It should take a
11524 constant_declarators, not a constant_declarator. Fixes 49487
11526 * convert.cs: Fix error report.
11528 2003-10-13 Jackson Harper <jackson@ximian.com>
11530 * typemanager.cs (TypeToCoreType): Add float and double this fixes
11533 2003-10-09 Martin Baulig <martin@ximian.com>
11535 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11537 (MethodCore.DoDefineParameters): Removed the TypeContainer
11538 argument; use the DeclSpace which was passed to the .ctor instead.
11539 (MethodCore.CheckParameter): Take a DeclSpace instead of a
11540 TypeContainer; we only need a DeclSpace here.
11542 2003-10-09 Martin Baulig <martin@ximian.com>
11544 * class.cs (MethodData): Added additional `DeclSpace ds' argument
11546 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11547 EmitContext's .ctor.
11549 2003-10-09 Martin Baulig <martin@ximian.com>
11551 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11552 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11553 AsAccessible(), moved them as well.
11555 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11557 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11559 * cs-parser.jay : Renamed yyName to yyNames related to jay.
11561 2003-10-07 Miguel de Icaza <miguel@ximian.com>
11563 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11564 generation for >=, as spotted by Paolo, bug 48679.
11565 Patch from David Waite.
11567 * cs-tokenizer.cs: Add handling for #pragma.
11569 * cs-parser.jay: Allow for both yield and yield return in the
11570 syntax. The anti-cobolization of C# fight will go on!
11572 * class.cs (TypeBuilder.DefineType): Catch error condition here
11573 (Parent.DefineType erroring out and returning null).
11575 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11576 coping with enumerations variables, we were mistakenly processing
11577 them as a regular value type instead of built-in types. Fixes the
11580 * typemanager.cs (IsBuiltinOrEnum): New method.
11582 2003-09-30 Miguel de Icaza <miguel@ximian.com>
11584 * cs-parser.jay: Upgrade: yield now needs the return clause.
11586 2003-09-19 Martin Baulig <martin@ximian.com>
11588 * decl.cs (MemberCache.SetupCacheForInterface): Take a
11589 `MemberCache parent' argument. Normally, an interface doesn't
11590 have a parent type except System.Object, but we use this in gmcs
11591 for generic type parameters.
11593 2003-09-18 Martin Baulig <martin@ximian.com>
11595 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11596 on `type.IsInterface'; don't check whether the type has a parent
11597 to determine whether it's an interface.
11599 2003-09-15 Martin Baulig <martin@ximian.com>
11601 * class.cs (TypeContainer.DefineType): Added an error flag to
11602 avoid reporting duplicate CS0146's ("class definition is
11605 * driver.cs (Driver.MainDriver): Abort if
11606 RootContext.ResolveTree() reported any errors.
11608 2003-09-07 Martin Baulig <martin@ximian.com>
11610 * report.cs (Error, Warning): Added overloaded versions which take
11611 a `params object[] args' and call String.Format().
11613 2003-09-07 Martin Baulig <martin@ximian.com>
11615 * decl.cs (DeclSpace..ctor): Don't call
11616 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11617 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
11618 (DeclSpace.RecordDecl): New method.
11620 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11622 2003-09-02 Ravi Pratap <ravi@ximian.com>
11624 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11625 value attributes to be applied to ParameterBuilders.
11627 * class.cs (MethodCore.LabelParameters): Make static and more
11628 generic so that it can be used from other places - like interface
11629 methods, for instance.
11631 * interface.cs (Interface.Emit): Call LabelParameters before
11632 emitting attributes on the InterfaceMethod.
11634 2003-08-26 Martin Baulig <martin@ximian.com>
11636 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11637 resolving aliases; fixes #47927.
11639 2003-08-26 Martin Baulig <martin@ximian.com>
11641 * statement.cs (Using.DoResolve): This is internally emitting a
11642 try/finally clause, so we need to set ec.NeedExplicitReturn if we
11643 do not always return. Fixes #47681.
11645 2003-08-26 Martin Baulig <martin@ximian.com>
11647 * decl.cs (MemberCore): Moved WarningNotHiding(),
11648 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11650 (AdditionResult): Make this nested in DeclSpace.
11651 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11652 argument; call NamespaceEntry.Define() unless we're nested in a
11655 * namespace.cs (Namespace.DefineName): New public function. This
11656 is called from DeclSpace's .ctor to add
11657 (Namespace.Lookup): Include DeclSpaces in the lookup.
11659 * class.cs (Operator): Derive from MemberBase, not MemberCore.
11661 * const.cs (Const): Derive from MemberBase, not MemberCore.
11663 2003-08-25 Martin Baulig <martin@ximian.com>
11665 * convert.cs (Convert.ExplicitReferenceConversion): When
11666 converting from an interface type to a class, unbox if the target
11667 type is a struct type. Fixes #47822.
11669 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11671 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11674 2003-08-22 Martin Baulig <martin@ximian.com>
11676 * class.cs (TypeManager.DefineType): When defining a nested type,
11677 call DefineType() on our parent; fixes #47801.
11679 2003-08-22 Martin Baulig <martin@ximian.com>
11681 * class.cs (MethodData.Define): While checking if a method is an
11682 interface implementation, improve the test a bit more to fix #47654.
11684 2003-08-22 Martin Baulig <martin@ximian.com>
11686 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11687 correctly; fixes #47722.
11689 2003-08-22 Martin Baulig <martin@ximian.com>
11691 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11692 LocalVariableReference, ensure it's not read-only. Fixes #47536.
11694 * statement.cs (Fixed.DoResolve): Make all variables read-only.
11696 2003-08-22 Martin Baulig <martin@ximian.com>
11698 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11699 can only be assigned in static constructors. Fixes #47161.
11701 2003-08-22 Martin Baulig <martin@ximian.com>
11703 Rewrote and improved the flow analysis code.
11705 * flowbranching.cs (FlowBranching): Make this class abstract.
11706 (FlowBranching.CreateBranching): New static function to create a
11707 new flow branching.
11708 (FlowBranchingBlock, FlowBranchingException): New classes.
11709 (FlowBranching.UsageVector.Type): New public readonly field.
11710 (FlowBranching.UsageVector.Breaks): Removed the setter.
11711 (FlowBranching.UsageVector.Returns): Removed the setter.
11712 (FlowBranching.UsageVector): Added Break(), Return(),
11713 NeverReachable() and Throw() methods to modify the reachability.
11714 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11715 done by FlowBranching.Merge().
11716 (FlowBranching.UsageVector.MergeChild): New method; merges the
11717 merge result into the current vector.
11718 (FlowBranching.Merge): New abstract method to merge a branching.
11720 2003-08-12 Martin Baulig <martin@ximian.com>
11722 * expression.cs (Indirection.CacheTemporaries): Create the
11723 LocalTemporary with the pointer type, not its element type.
11725 2003-08-10 Miguel de Icaza <miguel@ximian.com>
11727 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11728 token was a keyword or not.
11730 Add `error' options where an IDENTIFIER was expected; Provide
11731 CheckToken and CheckIdentifierToken convenience error reporting
11734 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11736 * decl.cs: Rename `NamespaceEntry Namespace' public field into
11737 NameSpaceEntry NameSpaceEntry.
11739 (LookupInterfaceOrClass): Avoid creating a full qualified name
11740 from namespace and name: avoid doing lookups when we know the
11741 namespace is non-existant. Use new Tree.LookupByNamespace which
11742 looks up DeclSpaces based on their namespace, name pair.
11744 * driver.cs: Provide a new `parser verbose' to display the
11745 exception thrown during parsing. This is turned off by default
11746 now, so the output of a failure from mcs is more graceful.
11748 * namespace.cs: Track all the namespaces defined in a hashtable
11751 (IsNamespace): New method
11753 2003-08-09 Miguel de Icaza <miguel@ximian.com>
11755 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
11756 we know that we need to concatenate (full typename can never be
11761 * statement.cs: Use a bitfield; Do not initialize to null things
11762 which are done by the constructor by default.
11764 * cs-parser.jay: bug fix, parameter was 4, not 3.
11766 * expression.cs: Just use the property;
11768 * statement.cs: No need for GetVariableInfo method.
11770 2003-08-08 Martin Baulig <martin@ximian.com>
11772 * flowanalysis.cs (FlowReturns): This is now nested in the
11773 `FlowBranching' class.
11774 (MyBitVector): Moved this here from statement.cs.
11775 (FlowBranching.SiblingType): New enum type.
11776 (FlowBranching.CreateSibling): Added `SiblingType' argument.
11778 2003-08-07 Martin Baulig <martin@ximian.com>
11780 * flowanalysis.cs (FlowBranchingType): This is now nested in the
11781 `FlowBranching' class and called `BranchingType'.
11783 2003-08-07 Martin Baulig <martin@ximian.com>
11785 * flowanalysis.cs: Moved all the control flow analysis code into
11788 2003-08-07 Martin Baulig <martin@ximian.com>
11790 * assign.cs (Assign.DoResolve): `target' must either be an
11791 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
11794 2003-08-07 Miguel de Icaza <miguel@ximian.com>
11796 * expression.cs (BinaryMethod): This kind of expression is created by the
11797 Binary class if it determines that the operator has to be handled
11800 (BinaryDelegate): This kind of expression is created if we are
11801 dealing with a + or - operator on delegates.
11803 (Binary): remove method, argumetns, and DelegateOperator: when
11804 dealing with methods,
11806 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11808 * statement.cs (Block): use bitfields for the three extra booleans
11809 we had in use. Remove unused topblock parameter.
11811 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11813 * assign.cs: Drop extra unneeded tests.
11815 2003-08-06 Miguel de Icaza <miguel@ximian.com>
11817 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11819 * statement.cs (Foreach): Use VariableStorage instead of
11822 * codegen.cs (VariableStorage): New class used by clients that
11823 require a variable stored: locals or fields for variables that
11824 need to live across yield.
11826 Maybe provide a convenience api for EmitThis+EmitLoad?
11828 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11831 2003-08-05 Miguel de Icaza <miguel@ximian.com>
11833 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11834 RemapParameterLValue): New methods that are used to turn a
11835 precomputed FieldInfo into an expression like this:
11839 The idea is to use this instead of making LocalVariableReference
11840 have more than one meaning.
11842 * cs-parser.jay: Add error production to BASE.
11844 * ecore.cs: Deal with TypeManager.GetField returning null, which
11845 is now a valid return value.
11847 (FieldExprNoAddress): New expression for Fields whose address can
11850 * expression.cs (LocalVariableReference): During the resolve
11851 phases, create new expressions if we are in a remapping context.
11852 Remove code that dealt with remapping here.
11854 (ParameterReference): same.
11856 (ProxyInstance): New expression, like the `This' expression, but
11857 it is born fully resolved. We know what we are doing, so remove
11858 the errors that are targeted to user-provided uses of `this'.
11860 * statement.cs (Foreach): our variable is now stored as an
11861 Expression; During resolution, follow the protocol, dont just
11862 assume it will return this.
11864 2003-08-06 Martin Baulig <martin@ximian.com>
11866 * support.cs (SeekableStreamReader.cs): New public class.
11868 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11869 SeekableStreamReader instead of the normal StreamReader.
11871 2003-08-04 Martin Baulig <martin@ximian.com>
11873 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11874 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11875 deambiguate casts and delegate invocations.
11876 (parenthesized_expression): Use the new tokens to ensure this is
11877 not a cast of method invocation.
11879 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11880 when reading a `)' and Deambiguate_CloseParens () was previously
11883 * expression.cs (ParenthesizedExpression): New class. This is
11884 just used for the CS0075 test.
11885 (Binary.DoResolve): Check for CS0075.
11887 2003-07-29 Ravi Pratap <ravi@ximian.com>
11889 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11890 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11891 reference comparison.
11893 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11894 examine the ReturnType for equality - this is necessary in the
11895 cases of implicit and explicit operators whose signature also
11896 includes the return type.
11898 2003-07-26 Miguel de Icaza <miguel@ximian.com>
11900 * namespace.cs: Cache the result of the namespace computation,
11901 instead of computing it every time.
11903 2003-07-24 Miguel de Icaza <miguel@ximian.com>
11905 * decl.cs: Use a global arraylist that we reuse over invocations
11906 to avoid excesive memory consumption. Reduces memory usage on an
11907 mcs compile by one meg (45 average).
11909 * typemanager.cs (LookupTypeReflection): In .NET pointers are
11910 private, work around that.
11912 2003-07-23 Miguel de Icaza <miguel@ximian.com>
11914 * literal.cs (IntLiteral): Define Zero and One static literals.
11916 * cs-parser.jay (integer_literal): use static literals to reduce
11917 memory usage for the most used literals (0, 1 and -1). 211kb
11918 reduced in memory usage.
11920 Replace all calls to `new ArrayList' with `new
11921 ArrayList(4)' which is a good average number for most allocations,
11922 and also requires only 16 bytes of memory for its buffer by
11925 This reduced MCS memory usage in seven megabytes for the RSS after
11928 2003-07-28 Ravi Pratap <ravi@ximian.com>
11930 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11931 handle params methods the correct way by forming only one
11932 applicable set with params and normal methods in them. Earlier we
11933 were looking at params methods only if we found no normal methods
11934 which was not the correct thing to do.
11936 (Invocation.BetterFunction): Take separate arguments indicating
11937 when candidate and the best method are params methods in their
11940 This fixes bugs #43367 and #46199.
11942 * attribute.cs: Documentation updates.
11944 (CheckAttribute): Rename to CheckAttributeTarget.
11945 (GetValidPlaces): Rename to GetValidTargets.
11947 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11948 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11952 2003-07-28 Martin Baulig <martin@ximian.com>
11954 * class.cs (TypeContainer.DefineMembers): Use the base type's full
11955 name when looking up the base class of a nested class. Fixes #46977.
11957 2003-07-26 Martin Baulig <martin@ximian.com>
11959 * expression.cs (Indexers.Indexer): New nested struct; contains
11960 getter, setter and the indexer's type.
11961 (Indexers.Properties): This is now an ArrayList of
11962 Indexers.Indexer's.
11963 (IndexerAccess.DoResolveLValue): Correctly set the type if the
11964 indexer doesn't have any getters.
11966 * assign.cs (Assign.DoResolve): Also do the implicit conversions
11967 for embedded property and indexer assignments.
11969 2003-07-26 Martin Baulig <martin@ximian.com>
11971 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
11972 preprocessor directive is not the first non-whitespace character
11975 2003-07-26 Martin Baulig <martin@ximian.com>
11977 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
11978 namespace parsing, follow the spec more closely.
11980 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
11981 NamespaceEntry.Lookup().
11983 2003-07-25 Martin Baulig <martin@ximian.com>
11985 * MethodCore.cs (OverridesSomething): New public field; it's set
11986 from TypeContainer.DefineMembers if this method overrides
11987 something (which doesn't need to be a method). Fix #39462.
11989 2003-07-25 Ravi Pratap <ravi@ximian.com>
11991 * typemanager.cs (GetMembers): Ensure that the list of members is
11992 reversed. This keeps things in sync.
11994 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
11995 find an AttributeUsage attribute.
11997 * expression.cs (Invocation.OverloadResolve): Perform the check
11998 which disallows Invoke to be directly called on a Delegate.
12000 (Error_InvokeOnDelegate): Report error cs1533.
12002 2003-07-25 Martin Baulig <martin@ximian.com>
12004 * expression.cs (Indexers.GetIndexersForType): Only look in the
12005 interface hierarchy if the requested type is already an
12006 interface. Fixes #46788 while keeping #46502 fixed.
12008 2003-07-25 Martin Baulig <martin@ximian.com>
12010 * class.cs (TypeContainer.DefineMembers): Check whether all
12011 readonly fields have been assigned and report warning CS0649 if
12014 * statement.cs (LocalInfo.IsFixed): Always return true if this is
12017 2003-07-24 Ravi Pratap <ravi@ximian.com>
12019 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
12020 returned from GetMethods to make things consistent with the
12021 assumptions MCS makes about ordering of methods.
12023 This should comprehensively fix bug #45127 and it does :-)
12025 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
12026 ordering is actually reverse.
12028 * Clean up some debug messages I left lying around.
12030 * interface.cs (Populate*): Get rid of code which emits attributes
12031 since the stage in which we emit attributes is the 'Emit' stage,
12032 not the define stage.
12034 (Emit): Move attribute emission for interface members here.
12036 2003-07-22 Ravi Pratap <ravi@ximian.com>
12038 * expression.cs (Invocation.OverloadResolve): Follow the spec more
12039 closely: we eliminate methods in base types when we have an
12040 applicable method in a top-level type.
12042 Please see section 14.5.5.1 for an exact description of what goes
12045 This fixes bug #45127 and a host of other related to corlib compilation.
12047 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
12048 array is the method corresponding to the top-level type (this is
12049 because of the changes made to icall.c) so we change this
12052 (MethodGroupExpr.Name): This too.
12054 * typemanager.cs (GetElementType): New method which does the right
12055 thing when compiling corlib.
12057 * everywhere: Make use of the above in the relevant places.
12059 2003-07-22 Martin Baulig <martin@ximian.com>
12061 * cs-parser.jay (invocation_expression): Moved
12062 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
12063 `cast_expression', but create a InvocationOrCast which later
12064 resolves to either an Invocation or a Cast.
12066 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
12067 method; call this before EmitStatement() to make sure that this
12068 expression can be used as a statement.
12070 * expression.cs (InvocationOrCast): New class; resolves to either
12071 an Invocation or a Cast.
12073 * statement.cs (StatementExpression): Call ResolveStatement() on
12074 the ExpressionStatement before emitting it.
12076 2003-07-21 Martin Baulig <martin@ximian.com>
12078 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
12079 `ref' and `out' attributes match; fixes #46220.
12080 (MemberAccess.ResolveMemberAccess): You can't reference a type
12081 through an expression; fixes #33180.
12082 (Indexers.GetIndexersForType): Don't return the indexers from
12083 interfaces the class implements; fixes #46502.
12085 2003-07-21 Martin Baulig <martin@ximian.com>
12087 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
12088 CS0661 checks; fixes bug #30442.
12090 2003-07-21 Martin Baulig <martin@ximian.com>
12092 * decl.cs (AdditionResult): Added `Error'.
12094 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
12096 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
12097 makes cs0031.cs actually work.
12099 2003-07-20 Martin Baulig <martin@ximian.com>
12101 * namespace.cs: Fixed that bug which caused a crash when compiling
12102 the debugger's GUI.
12104 2003-07-20 Miguel de Icaza <miguel@ximian.com>
12106 * typemanager.cs (LookupTypeReflection): Never expose types which
12107 are NotPublic, NestedPrivate, NestedAssembly, or
12108 NestedFamANDAssem. We used to return these, and later do a check
12109 that would report a meaningful error, but the problem is that we
12110 would not get the real match, if there was a name override.
12112 2003-07-18 Miguel de Icaza <miguel@ximian.com>
12114 * namespace.cs (Namespace, Name): Do not compute the namespace
12115 name dynamically, compute it in the constructor. This reduced
12116 memory usage by 1697 KB.
12118 * driver.cs: Use --pause to pause at the end.
12120 2003-07-17 Peter Williams <peter@newton.cx>
12122 * Makefile: Change the name of the test target so that it doesn't
12123 conflict with the recursive test target.
12125 2003-07-17 Miguel de Icaza <miguel@ximian.com>
12127 * expression.cs (LocalVariableReference.Emit, EmitAssign,
12128 AddressOf): Do not use EmitThis, that was wrong, use the actual
12131 2003-07-15 Miguel de Icaza <miguel@ximian.com>
12133 * class.cs (MethodData.Define): While checking if a method is an
12134 interface implementation, improve the test: If we are not public
12135 (use new test here: use the computed MethodAttributes directly,
12136 instead of the parsed modifier flags) check if the `implementing'
12137 method comes from an interface or not.
12139 * pending.cs (VerifyPendingMethods): Slightly better error
12142 * makefile: add test target that does the mcs bootstrap.
12144 2003-07-16 Ravi Pratap <ravi@ximian.com>
12146 * interface.cs (Define): Do nothing here since there are no
12147 members to populate etc. Move the attribute emission out of here
12148 since this was just totally the wrong place to put it. Attribute
12149 application happens during the 'Emit' phase, not in the 'Define'
12152 (Emit): Add this method and move the attribute emission here
12154 * rootcontext.cs (EmitCode): Call the Emit method on interface
12157 2003-07-14 Ravi Pratap M <ravi@ximian.com>
12159 * expression.cs (OverloadResolve): Report error only if Location
12160 is not 'Null' which means that there was a probe going on.
12162 2003-07-14 Martin Baulig <martin@ximian.com>
12164 * expression.cs (ConditionalLogicalOperator): New public class to
12165 implement user defined conditional logical operators.
12166 This is section 14.11.2 in the spec and bug #40505.
12168 2003-07-14 Martin Baulig <martin@ximian.com>
12170 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
12172 2003-07-14 Martin Baulig <martin@ximian.com>
12174 * codegen.cs (EmitContext.InFixedInitializer): New public field.
12176 * ecore.cs (IVariable.VerifyFixed): New interface method.
12178 * expression.cs (Unary.ResolveOperator): When resolving the `&'
12179 operator, check whether the variable is actually fixed. Fixes bug
12180 #36055. Set a variable definitely assigned when taking its
12181 address as required by the spec.
12183 * statement.cs (LocalInfo.IsFixed): New field.
12184 (LocalInfo.MakePinned): Set `IsFixed' to true.
12186 2003-07-14 Ravi Pratap M <ravi@ximian.com>
12188 * attribute.cs (Attribute.Resolve): While doing a Member lookup
12189 for .ctors, ensure that we only ask for members declared in the
12190 attribute type (BindingFlags.DeclaredOnly).
12194 * expression.cs (Error_WrongNumArguments): Report error 1501
12195 correctly the way CSC does.
12197 2003-07-13 Martin Baulig <martin@ximian.com>
12199 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
12200 lookup on the fully qualified name, to make things like "X.X" work
12201 where "X.X" is a fully qualified type name, but we also have a
12202 namespace "X" in the using list. Fixes #41975.
12204 2003-07-13 Martin Baulig <martin@ximian.com>
12206 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
12207 function. If we're a CompoundAssign, we need to create an embedded
12208 CompoundAssign, not an embedded Assign.
12209 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
12212 2003-07-13 Martin Baulig <martin@ximian.com>
12214 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
12215 work to fix bug #46088.
12217 2003-07-13 Ravi Pratap <ravi@ximian.com>
12219 * class.cs (Operator.Emit): Do not emit attributes here - it is
12220 taken care of by the Method class that we delegate too. This takes
12221 care of bug #45876.
12223 2003-07-10 Martin Baulig <martin@ximian.com>
12225 * expression.cs (TypeOfVoid): New class.
12226 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
12228 2003-07-10 Martin Baulig <martin@ximian.com>
12230 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
12233 2003-07-10 Martin Baulig <martin@ximian.com>
12235 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
12236 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
12238 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
12240 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
12242 2003-07-10 Martin Baulig <martin@ximian.com>
12244 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
12245 of decimal. Fixes #42850.
12247 NOTE: I also fixed the created byte blob, but this doesn't work on
12248 the MS runtime and csc never produces any byte blobs for decimal
12251 2003-07-10 Martin Baulig <martin@ximian.com>
12253 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
12254 structs; fixes #32068.
12255 (Block.AddChildVariableNames): Fixed #44302.
12257 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12259 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
12261 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12263 * attribute.cs: And this test is onger needed.
12265 2003-07-08 Martin Baulig <martin@ximian.com>
12267 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
12268 inaccessible types. Fixes #36313.
12270 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
12272 * namespace.cs (NamespaceEntry): Create implicit entries for all
12273 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
12274 implicit entries for N1.N2 and N1.
12276 2003-07-08 Martin Baulig <martin@ximian.com>
12278 Rewrote the handling of namespaces to fix a lot of the issues
12279 wrt. `using' aliases etc.
12281 * namespace.cs (Namespace): Splitted this class into a
12282 per-assembly `Namespace' and a per-file `NamespaceEntry'.
12284 * typemanager.cs (TypeManager.IsNamespace): Removed.
12285 (TypeManager.ComputeNamespaces): Only compute namespaces from
12286 loaded assemblies here, not the namespaces from the assembly we're
12287 currently compiling.
12289 2003-07-08 Martin Baulig <martin@ximian.com>
12291 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
12293 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12295 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
12298 I thought about the memory savings here, but LookupTypeReflection
12299 is used under already very constrained scenarios. Compiling
12300 corlib or mcs only exposes one hit, so it would not really reduce
12301 any memory consumption.
12303 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12305 * typemanager.cs: fixes bug #45889 by only adding public types from
12306 other assemblies to the list of known types.
12308 2003-07-07 Miguel de Icaza <miguel@ximian.com>
12310 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
12311 on the type we resolved.
12313 2003-07-05 Martin Baulig <martin@ximian.com>
12315 * pending.cs (PendingImplementation.ParentImplements): Don't
12316 create the proxy if the parent is abstract.
12318 * class.cs (TypeContainer.DefineIndexers): Process explicit
12319 interface implementations first. Fixes #37714.
12321 2003-07-04 Miguel de Icaza <miguel@ximian.com>
12323 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
12324 defined recursively; but since we modify the input parameters
12325 (left is set to `this' temporarily), we reset this value if the
12326 left_is_explicit is false, which gives the original semantics to
12329 * literal.cs (NullPointer): new class used to represent a null
12330 literal in a pointer context.
12332 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
12333 type is a pointer, use a NullPointer object instead of a
12334 NullLiteral. Closes 43687
12336 (ExplicitConversion): Convert pointer values using
12337 the conv opcode to the proper type.
12339 * ecore.cs (New): change ValueTypeVariable property into a method,
12340 that returns whether the valuetype is suitable for being used.
12342 * expression.cs (Binary.DoNumericPromotions): Only return if we
12343 the int constant was a valid uint, and we can return both left and
12344 right as uints. If not, we continue processing, to trigger the
12345 type conversion. This fixes 39018.
12347 * statement.cs (Block.EmitMeta): During constant resolution, set
12348 the CurrentBlock property on the emitcontext, so that we resolve
12349 constants propertly.
12351 2003-07-02 Martin Baulig <martin@ximian.com>
12353 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
12354 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
12356 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
12357 than emitting it here.
12359 * statement.cs: Fixed some more flow analysis bugs.
12361 2003-07-02 Martin Baulig <martin@ximian.com>
12363 * class.cs (MethodData.Define): When implementing interface
12364 methods, set Final unless we're Virtual.
12366 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
12367 check work for interface methods.
12369 2003-07-01 Martin Baulig <martin@ximian.com>
12371 * ecore.cs (EmitContext.This): Replaced this property with a
12372 GetThis() method which takes a Location argument. This ensures
12373 that we get the correct error location for a CS0188.
12375 2003-07-01 Miguel de Icaza <miguel@ximian.com>
12377 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
12378 ImplicitStandardConversion.
12380 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
12382 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
12384 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
12387 2003-06-30 Miguel de Icaza <miguel@ximian.com>
12389 * class.cs (Constructor.Define): Turn off initlocals for unsafe
12392 (MethodData.Define): Turn off initlocals for unsafe methods.
12394 2003-06-29 Miguel de Icaza <miguel@ximian.com>
12396 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
12397 complete; Fixes #37521.
12399 * delegate.cs: Use Modifiers.TypeAttr to compute the
12400 TypeAttributes, instead of rolling our own. This makes the flags
12401 correct for the delegates.
12403 2003-06-28 Miguel de Icaza <miguel@ximian.com>
12405 * class.cs (Constructor.Define): Set the private flag for static
12406 constructors as well.
12408 * cs-parser.jay (statement_expression): Set the return value to
12409 null, to avoid a crash when we catch an error.
12411 2003-06-24 Miguel de Icaza <miguel@ximian.com>
12413 * cs-parser.jay: Applied patch from Jackson that adds support for
12414 extern and unsafe modifiers to destructor declarations.
12416 * expression.cs: Report error 21 if the user is trying to index a
12419 * driver.cs: Add an error message, suggested by the bug report.
12421 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12422 if we do not have a ": this ()" constructor initializer. Fixes 45149
12424 2003-06-14 Miguel de Icaza <miguel@ximian.com>
12426 * namespace.cs: Add some information to reduce FAQs.
12428 2003-06-13 Miguel de Icaza <miguel@ximian.com>
12430 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12431 underlying enumeration types. Fixes #43915.
12433 * expression.cs: Treat ushort/short as legal values to be used in
12434 bitwise operations.
12436 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12438 * delegate.cs: transfer custom attributes for paramenters from
12439 the delegate declaration to Invoke and BeginInvoke.
12441 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12443 * attribute.cs: handle custom marshalers and emit marshal info
12446 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
12448 * makefile.gnu: Added anonymous.cs to the compiler sources.
12450 2003-05-28 Miguel de Icaza <miguel@ximian.com>
12452 * iterators.cs: Change the name of the proxy class to include two
12455 * cs-parser.jay: Update grammar to include anonymous methods.
12457 * anonymous.cs: new file.
12459 2003-05-27 Miguel de Icaza <miguel@ximian.com>
12461 * class.cs (Field.Define): Add missing test for pointers and
12464 2003-05-27 Ravi Pratap <ravi@ximian.com>
12466 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12467 we use the stobj opcode.
12469 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12470 since it wasn't the correct fix.
12472 It still is puzzling that we are required to use stobj for IntPtr
12473 which seems to be a ValueType.
12475 2003-05-26 Miguel de Icaza <miguel@ximian.com>
12477 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12478 during regular simple name resolution. Now, the trick is that
12479 instead of returning for processing the simplename, we do a
12480 TypeManager.LookupType (ie, a rooted lookup as opposed to a
12481 contextual lookup type). If a match is found, return that, if
12482 not, return for further composition.
12484 This fixes long-standing 30485.
12486 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12487 using the address to initialize an object, do an Stobj instead of
12488 using the regular Stelem.
12490 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12491 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12492 Because if we are a BaseIndexerAccess that value will be true.
12495 * statement.cs (GotoCase.Resolve): Return after reporting an
12496 error, do not attempt to continue.
12498 * expression.cs (PointerArithmetic.Emit): If our operand is a
12499 long, convert our constants to match the operand before
12500 multiplying. Convert to I type before adding. Fixes 43670.
12502 2003-05-14 Ravi Pratap <ravi@ximian.com>
12504 * enum.cs (ImplicitConversionExists) : Rename to
12505 ImplicitEnumConversionExists to remove ambiguity.
12507 * ecore.cs (NullCast): New type of cast expression class which
12508 basically is very similar to EmptyCast with the difference being
12509 it still is a constant since it is used only to cast a null to
12511 (eg. (string) null)
12513 * convert.cs (ImplicitReferenceConversion): When casting a null
12514 literal, we return a NullCast.
12516 * literal.cs (NullLiteralTyped): Remove - I don't see why this
12517 should be around anymore.
12519 The renaming (reported was slightly wrong). Corrections:
12521 ConvertImplicitStandard -> ImplicitConversionStandard
12522 ConvertExplicitStandard -> ExplicitConversionStandard
12524 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12525 before passing them in !
12527 * convert.cs (ImplicitConversionStandard): When comparing for
12528 equal expr and target types, ensure that expr is not a
12531 In general, we must not be checking (expr_type ==
12532 target_type) in the top level conversion methods
12533 (ImplicitConversion, ExplicitConversion etc). This checking is
12534 done in the methods that they delegate to.
12536 2003-05-20 Miguel de Icaza <miguel@ximian.com>
12538 * convert.cs: Move Error_CannotConvertType,
12539 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12540 ImplicitNumericConversion, ImplicitConversionExists,
12541 ImplicitUserConversionExists, StandardConversionExists,
12542 FindMostEncompassedType, FindMostSpecificSource,
12543 FindMostSpecificTarget, ImplicitUserConversion,
12544 ExplicitUserConversion, GetConversionOperators,
12545 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12546 TryImplicitIntConversion, Error_CannotConvertImplicit,
12547 ConvertImplicitRequired, ConvertNumericExplicit,
12548 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12549 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12552 Perform the following renames:
12554 StandardConversionExists -> ImplicitStandardConversionExists
12555 ConvertImplicit -> ImplicitConversion
12556 ConvertImplicitStandard -> ImplicitStandardConversion
12557 TryImplicitIntConversion -> ImplicitIntConversion
12558 ConvertImplicitRequired -> ImplicitConversionRequired
12559 ConvertNumericExplicit -> ExplicitNumericConversion
12560 ConvertReferenceExplicit -> ExplicitReferenceConversion
12561 ConvertExplicit -> ExplicitConversion
12562 ConvertExplicitStandard -> ExplicitStandardConversion
12564 2003-05-19 Martin Baulig <martin@ximian.com>
12566 * statement.cs (TypeInfo.StructInfo): Made this type protected.
12567 (TypeInfo): Added support for structs having structs as fields.
12569 * ecore.cs (FieldExpr): Implement IVariable.
12570 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12571 VariableInfo for the field.
12573 2003-05-18 Martin Baulig <martin@ximian.com>
12575 * expression.cs (This.DoResolve): Report a CS0027 if we're
12576 emitting a field initializer.
12578 2003-05-18 Martin Baulig <martin@ximian.com>
12580 * expression.cs (This.ResolveBase): New public function.
12581 (This.DoResolve): Check for CS0188.
12583 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12586 * ecore.cs (MethodGroupExpr.DoResolve): Set the
12587 `instance_expression' to null if we don't have any non-static
12590 2003-05-18 Martin Baulig <martin@ximian.com>
12592 Reworked the way how local variables and parameters are handled by
12593 the flow analysis code.
12595 * statement.cs (TypeInfo, VariableMap): New public classes.
12596 (VariableInfo): New public class. This is now responsible for
12597 checking whether a variable has been assigned. It is used for
12598 parameters and local variables.
12599 (Block.EmitMeta): Take the InternalParameters as argument; compute
12600 the layout of the flow vectors here.
12601 (Block.LocalMap, Block.ParameterMap): New public properties.
12602 (FlowBranching): The .ctor doesn't get the InternalParameters
12603 anymore since Block.EmitMeta() now computes the layout of the flow
12605 (MyStructInfo): This class is now known as `StructInfo' and nested
12606 in `TypeInfo'; we don't access this directly anymore.
12608 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12609 property and removed IsAssigned(), IsFieldAssigned(),
12610 SetAssigned() and SetFieldAssigned(); we now call them on the
12611 VariableInfo so we don't need to duplicate this code everywhere.
12613 * expression.cs (ParameterReference): Added `Block block' argument
12615 (LocalVariableReference, ParameterReference, This): The new
12616 VariableInfo class is now responsible for all the definite
12619 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12620 IsParameterAssigned, SetParameterAssigned): Removed.
12622 2003-05-18 Martin Baulig <martin@ximian.com>
12624 * typemanager.cs (InitCoreTypes): Try calling
12625 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12626 the 3-args-version. Corlib now also needs our `void_type'.
12627 (GetMethod): Added overloaded version which takes an optional
12628 `bool report_errors' to allow lookups of optional methods.
12630 2003-05-12 Martin Baulig <martin@ximian.com>
12632 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12633 only used for locals and not for parameters.
12635 2003-05-12 Miguel de Icaza <miguel@ximian.com>
12637 * support.cs (InternalParameters.ParameterType): Return the
12638 ExternalType of the parameter.
12640 * parameter.cs (Parameter.ExternalType): drop the two arguments,
12643 2003-05-11 Miguel de Icaza <miguel@ximian.com>
12645 * class.cs (MethodData.Define): Do not set the `newslot' on
12646 interface members, if they are also flagged as "override".
12648 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12649 better code for ++i and i++. This only works for static fields
12650 and local variables.
12652 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12653 want to pull the DeclSpace out of the builder_to_declspace instead
12654 of the TypeBuilder (like in TypeContainer.FindMembers).
12656 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12657 instead of LookupTypeContainer. Fixes the crash on .NET for
12658 looking up interface members.
12660 * const.cs: Create our own emit context during the Definition
12661 stage, so that constants are evaluated in the proper context, when
12662 a recursive definition happens.
12664 2003-05-11 Martin Baulig <martin@ximian.com>
12666 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
12667 new block for a switch section.
12668 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12669 the adding/lookup in the switch block. Fixes #39828.
12671 2003-05-09 Miguel de Icaza <miguel@ximian.com>
12673 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12674 functionality: I needed to convert the data after I had performed
12675 the add/sub operation into the operands type size.
12677 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12678 pass the type for the box operation, otherwise the resulting
12679 object would have been of type object.
12681 (BoxedCast): Add constructor to specify the type to box as.
12683 2003-05-07 Miguel de Icaza <miguel@ximian.com>
12685 * iterators.cs: I was reusing the `count' variable inadvertently,
12686 take steps to not allow this to happen.
12688 2003-05-06 Miguel de Icaza <miguel@ximian.com>
12690 * attribute.cs (Attribute.Resolve): Params attributes are encoded
12691 by creating an array at the point where the params starts and
12692 putting all those arguments there, then adjusting the size of the
12695 2003-05-05 Miguel de Icaza <miguel@ximian.com>
12697 * expression.cs (New.AddressOf): Implement interface
12698 IMemoryLocation. This is used when the `new' operator is used in
12699 the context of an invocation to a method on a value type.
12701 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12704 * namespace.cs: Also check the using aliases here.
12706 * driver.cs: Move the test for using validity after the types have
12707 been entered, so we do a single pass that also includes the using
12710 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12711 in the regular case. CreateSiblingForFinally is doing extra
12714 * attribute.cs (GetAttributeArgumentExpression): Store the result
12715 on an out value, and use the return value to indicate failure
12716 instead of using null (which is a valid return for Constant.GetValue).
12718 * statement.cs: Perform the analysis flow for the increment
12719 portion after the statement, because this will be the real flow of
12720 execution. Fixes #42385
12722 * codegen.cs (EmitContext.EmitArgument,
12723 EmitContext.EmitStoreArgument): New helper functions when the
12724 RemapToProxy flag is set.
12726 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12729 Add support for remapping parameters.
12731 * iterators.cs: Propagate parameter values; Store parameter
12732 values in the proxy classes.
12734 2003-05-04 Miguel de Icaza <miguel@ximian.com>
12736 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
12737 need a proxy reference; I do not know what I was thinking
12739 * cs-parser.jay (constructor_initializer): catch another error,
12740 and display nice message.
12742 (field_declaration): catch void field declaration
12743 to flag a better error.
12745 * class.cs (MemberBase.CheckBase): Report an error instead of a
12746 warning if a new protected member is declared in a struct.
12747 (Field.Define): catch the error of readonly/volatile.
12749 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12751 (FieldExpr.AddressOf): ditto. Catch error where the address of a
12752 volatile variable is taken
12754 2003-05-02 Miguel de Icaza <miguel@ximian.com>
12756 * statement.cs (Fixed.Resolve): Report an error if we are not in
12759 2003-05-01 Miguel de Icaza <miguel@ximian.com>
12761 * typemanager.cs: reuse the code that handles type clashes for
12762 delegates and enumerations.
12764 * class.cs (Report28): Always report.
12766 * expression.cs (EncodeAsAttribute): Allow nulls here.
12768 2003-04-28 Miguel de Icaza <miguel@ximian.com>
12770 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12771 the functionality for testing whether an expression is valid for
12772 an attribute here. Also handle the case of arrays of elements
12775 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12776 encoding a linear array into an array of objects that are suitable
12777 to be passed to an CustomAttributeBuilder.
12779 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12781 * ecore.cs: (FieldExpr): Handle field remapping here.
12783 * iteratators.cs: Pass the instance variable (if the method is an
12784 instance method) to the constructors, so we can access the field
12785 variables on the class.
12787 TODO: Test this with structs. I think the THIS variable on
12788 structs might have to be a pointer, and not a refenrece
12790 2003-04-27 Miguel de Icaza <miguel@ximian.com>
12792 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12793 local variables to fields in a proxy class.
12795 * iterators.cs (PopulateProxy): Rename our internal fields to
12797 Create a <THIS> field if we are an instance method, so we can
12798 reference our parent container variables.
12799 (MapVariable): Called back from the EmitContext code to enter a
12800 new variable to field mapping into the proxy class (we just create
12804 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12805 for using the remapped locals to fields.
12807 I placed the code here, because that gives the same semantics to
12808 local variables, and only changes the Emit code.
12810 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12811 statements inside iterators.
12812 (VariableInfo): Add a FieldBuilder for the cases when we are
12813 remapping local variables to fields in a proxy class
12815 * ecore.cs (SimpleNameResolve): Avoid testing two times for
12816 current_block != null.
12818 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12819 not cope with strings, as it has been moved to the
12820 TableSwitchEmit. Fixed bug in switch generation.
12822 * expression.cs (New.DoResolve): Provide more context for the user
12823 when reporting an error.
12825 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12828 * expression.cs (MemberAccess.DoResolve): When we get a type back,
12829 check the permissions for it. Note than in a type-resolution
12830 context the check was already present in DeclSpace.ResolveType,
12831 but was missing from the MemberAccess.
12833 (ArrayCreation.CheckIndices): warn if the user has
12834 more nested levels of expressions, but there are no more
12835 dimensions specified. Avoids crash on bug 41906.
12837 2003-04-26 Miguel de Icaza <miguel@ximian.com>
12839 * statement.cs (Block): replace Implicit bool, for a generic
12841 New flag: `Unchecked'. This is used during the EmitMeta phase
12842 (which is out-of-line with the regular Resolve/Emit process for a
12843 statement, as this is done ahead of time, but still gets a chance
12844 to call constant resolve).
12846 (Block.Flags): new enum for adding a new flag.
12848 (Block.EmitMeta): track the state of unchecked.
12850 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12851 to enable constant resolution to work there as well.
12853 2003-04-22 Miguel de Icaza <miguel@ximian.com>
12855 * typemanager.cs (ienumerable_type): Also look up
12856 System.Collections.IEnumerable.
12858 2003-04-21 Miguel de Icaza <miguel@ximian.com>
12860 TODO: Test more than one conditional per method.
12862 * class.cs (Indexer.Define): Report the location where the user is
12863 referencing the unsupported feature.
12865 (MethodData): Overload the use of `conditionals' to
12866 minimize the creation of needless ArrayLists. This saves roughly
12867 212kb on my machine.
12869 (Method): Implement the new IIteratorContainer interface.
12870 (Method.SetYields): Implement the method by setting the ModFlags
12871 to contain METHOD_YIELDS.
12873 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12874 which just got set to null.
12876 * iterators.cs: New file.
12878 (Yield, YieldBreak): New statements.
12880 * statement.cs (Return.Resolve): Flag an error if we are used in
12881 an iterator method.
12883 * codegen.cs (InIterator): New flag set if the code is being
12884 compiled in an iterator method.
12886 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
12887 internal modifier, and we just use it to avoid adding extra
12888 fields, as this is seldom used.
12890 * cs-parser.jay: Add yield_statement (yield and yield break).
12892 * driver.cs: New flag -v2 to turn on version 2 features.
12894 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12895 hashtable when v2 is enabled.
12897 2003-04-20 Miguel de Icaza <miguel@ximian.com>
12899 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12900 there is already a namespace defined with this name.
12902 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12903 people upgraded their corlibs.
12905 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12906 always use fully qualified types, no need to use the compiler
12909 (TypeManager.IsNamespace): Use binarysearch.
12911 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12912 AddDelegate): I did not quite use the new IsValid API properly: I
12913 have to pass the short-name and the fullname. I was passing only
12914 the basename instead of the fullname sometimes.
12916 (TypeContainer.DefineType): call NamespaceClash.
12918 * interface.cs (Interface.DefineType): use NamespaceClash before
12921 * delegate.cs (Delegate.DefineType): use NamespaceClash before
12924 * enum.cs: (Enum.DefineType): use NamespaceClash before
12927 * typemanager.cs (: 3-line patch that gives us some tasty 11%
12928 speed increase. First, use the negative_hits cache when we get a
12929 negative. Second, add the type with its full original name
12930 instead of the new . and + encoded name (reflection uses + to
12931 separate type from a nested type). Use LookupTypeReflection
12932 directly which bypasses the type->name hashtable (that we already
12933 know does not contain the type.
12935 * decl.cs (DeclSpace.ResolveTypeExpr): track the
12936 location/container type.
12938 * driver.cs: When passing utf8, use directly the UTF8Encoding.
12940 2003-04-19 Miguel de Icaza <miguel@ximian.com>
12942 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12944 * delegate.cs (NewDelegate.Resolve): Test whether an instance
12945 method is being referenced in the method group from a static
12946 context, and report error 120 if so.
12948 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12951 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12952 is created, we create the A namespace).
12954 * cs-parser.jay: A namespace also introduces a DeclarationFound.
12957 2003-04-18 Miguel de Icaza <miguel@ximian.com>
12959 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12960 invocation to ModuleBuilder.GetType with the same values will
12961 return a new type instance, so we need to cache its return
12964 * expression.cs (Binary.ResolveOperator): Only allow the compare
12965 operators on enums if they are of the same type.
12967 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12968 types of ValueType on their own case. Before we were giving them
12969 the same treatment as objects.
12971 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12972 fullname. Short name is used to compare against container name.
12973 Fullname is used to check against defined namespace names.
12975 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12976 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12978 (Method.CheckBase): Call parent.
12979 (MemberBase.CheckBase): Check for protected members on sealed
12981 (PropertyBase.CheckBase): Call parent.
12982 (Field.Define): Call parent.
12984 * report.cs: Negative error codes are now mapped to 8000 - code,
12985 so that the display is render more nicely.
12987 * typemanager.cs: Do not use try/catch, instead report a regular
12990 (GetPointerType, GetReferenceType): These methods provide
12991 mechanisms to obtain the T* and T& from a T. We had the code
12992 previously scattered around the code base, and it also used
12993 TypeManager.LookupType that would go through plenty of caches.
12994 This one goes directly to the type source.
12996 In some places we did the Type.GetType followed by
12997 ModuleBuilder.GetType, but not in others, so this unifies the
12998 processing as well.
13000 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
13001 statements now that we have namespace information.
13003 * typemanager.cs (IsNamespace): New method, returns whether the
13004 string presented is a namespace or not.
13006 (ComputeNamespaces): New public entry point, computes the list of
13007 available namespaces, using the GetNamespaces API call in Mono, or
13008 the slower version in MS.NET.
13010 Now before we start the semantic analysis phase, we have a
13011 complete list of namespaces including everything that the user has
13014 Deleted old code to cache namespaces in .nsc files.
13016 2003-04-17 Miguel de Icaza <miguel@ximian.com>
13018 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
13019 class/struct location definition Location for the implicit
13020 constructor location.
13022 (Operator.Define): Use the location of the operator for the
13023 implicit Method definition.
13025 (Constructor.Emit): use the constructor location for the implicit
13026 base initializer constructor.
13028 * ecore.cs: Remove ITypeExpression. This interface is now gone,
13029 and the Expression class now contains two new methods:
13031 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
13032 isolate type lookup from the rest of the resolution process.
13034 Since we use Expressions to hold type definitions due to the way
13035 we parse the input we have historically overloaded Resolve to
13036 perform the Type lookups if a special flag is passed. Now this is
13037 eliminated and two methods take their place.
13039 The differences in the two methods between xStep and xTerminal is
13040 that xStep is involved in our current lookup system that uses
13041 SimpleNames to compose a name, while xTerminal is used just to
13042 catch the case where the simplename lookup failed.
13044 2003-04-16 Miguel de Icaza <miguel@ximian.com>
13046 * expression.cs (ResolveMemberAccess): Remove redundant code.
13047 TypeExpr expressions are always born fully resolved.
13049 * interface.cs (PopulateMethod): Do not lookup the types twice.
13050 We were doing it once during SemanticAnalysis and once during
13053 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
13054 in local variable type definitions, were being returned as a
13055 SimpleName (we decomposed everything into a string), that is
13056 because primary_expression was being used instead of a type in the
13057 grammar (reduce/reduce conflicts).
13059 The part that was wrong is that we converted the expression into a
13060 string (an oversimplification in one hand, compounded with primary
13061 expressions doing string concatenation).
13067 Would return "A.B.C[]" as a SimpleName. This stopped things like
13068 using clauses from working on this particular context. And a type
13069 was being matched directly against "A.B.C[]".
13071 We now use the correct approach, and allow for ComposedCast to be
13072 part of the unary expression. So the "A.B.C []" become a composed
13073 cast of "A.B.C" (as a nested group of MemberAccess with a
13074 SimpleName at the end) plus the rank composition "[]".
13078 2003-04-10 Miguel de Icaza <miguel@ximian.com>
13080 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
13081 for the access level checking.
13083 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
13084 `TypeContainer container', because I kept getting confused when I
13085 was debugging this code.
13087 * expression.cs (Indexers): Instead of tracking getters/setters,
13088 we now track them in parallel. We create one arraylist less, but
13089 most importantly it is possible now for the LValue code to find a
13090 matching get for a set.
13092 (IndexerAccess.DoResolveLValue): Update the code.
13093 GetIndexersForType has been modified already to extract all the
13094 indexers from a type. The code assumed it did not.
13096 Also make the code set the correct return type for the indexer.
13097 This was fixed a long time ago for properties, but was missing for
13098 indexers. It used to be void_type.
13100 (Binary.Emit): Test first for doubles instead of
13101 floats, as they are more common.
13103 (Binary.EmitBranchable): Use the .un version of the branch opcodes
13104 when dealing with floats and the <=, >= operators. This fixes bug
13107 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
13108 to load the array value by emitting a load on the foreach variable
13109 type. This was incorrect.
13111 We now emit the code to load an element using the the array
13112 variable type, and then we emit the conversion operator.
13116 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
13118 * attribute.cs: Avoid allocation of ArrayLists in the common case.
13120 2003-04-09 Miguel de Icaza <miguel@ximian.com>
13122 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
13123 test for protection before we test for signatures.
13125 (MethodSignature.ToString): implement.
13127 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
13128 to the case where we reduced into a LongConstant.
13130 * decl.cs (CheckAccessLevel): If the type is an array, we can not
13131 depend on whether the information is acurrate, because the
13132 Microsoft runtime will always claim that the array type is public,
13133 regardless of the real state.
13135 If the type is a pointer, another problem happens: the type is
13136 reported as non-public in Microsoft.
13138 In both cases we have to call CheckAccessLevel recursively with
13139 the underlying type as the argument to be tested.
13141 2003-04-08 Miguel de Icaza <miguel@ximian.com>
13143 * assign.cs (Assign.Emit): If we are dealing with a compound
13144 assignment expression, we should use the code path that stores the
13145 intermediate result in a temporary value. This fixes #40903.
13147 *expression.cs (Indirection.ToString): Provide ToString method for
13150 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
13152 * class.cs: Null out fields holding references to Block objects so
13153 they can be garbage collected.
13155 * expression.cs (OverloadResolve): Remove unused local.
13157 2003-04-07 Martin Baulig <martin@ximian.com>
13159 * codegen.cs (EmitContext.CurrentFile): New public field.
13160 (EmitContext.Mark): Use the CurrentFile to check whether the
13161 location is in the correct file.
13162 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
13164 2003-04-07 Martin Baulig <martin@ximian.com>
13166 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
13168 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
13169 location. [FIXME: The location argument which gets passed to this
13170 method is sometimes wrong!]
13172 2003-04-07 Nick Drochak <ndrochak@gol.com>
13174 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
13176 2003-04-07 Miguel de Icaza <miguel@ximian.com>
13178 * expression.cs (Indirection.EmitAssign): We were using the
13179 temporary, but returning immediately instead of continuing the
13182 2003-04-06 Martin Baulig <martin@ximian.com>
13184 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
13185 if it's a nested child, but also deriving from the outer class.
13188 * typemanager.cs (IsNestedChildOf): Make this work if it's a
13189 nested child, but also deriving from the outer class. See
13191 (FilterWithClosure): We may access private members of the outer
13192 class if we're a nested child and deriving from the outer class.
13193 (RealMemberLookup): Only set `closure_private_ok' if the
13194 `original_bf' contained BindingFlags.NonPublic.
13196 2003-04-05 Martin Baulig <martin@ximian.com>
13198 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
13200 2003-04-02 Miguel de Icaza <miguel@ximian.com>
13202 * class.cs (Event.Define): Do not allow abstract events to have
13205 2003-04-01 Miguel de Icaza <miguel@ximian.com>
13207 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
13208 block in event declarations.
13210 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
13211 value type, get its address.
13213 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
13214 leaving a class on the stack instead of a boolean value (int
13215 0/1). Change the code so we compare against null, and then the
13216 result against zero.
13218 * class.cs (TypeContainer.GetClassBases): We were checking for the
13219 parent class being sealed too late.
13221 * expression.cs (Binary.Emit): For <= and >= when dealing with
13222 floating point values, use cgt.un and clt.un instead of cgt and
13225 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
13227 * statement.cs: Apply the same optimization as MS: skip the
13228 GetEnumerator returning an IEnumerator, and use the one returning a
13229 CharEnumerator instead. This allows us to avoid the try-finally block
13232 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
13234 * cs-parser.jay: Attributes cannot be applied to
13235 namespaces. Fixes #40473
13237 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13240 (Add*): check if the name is valid using the full name for constants,
13241 fields, properties and events.
13243 2003-03-28 Miguel de Icaza <miguel@ximian.com>
13245 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
13246 char constants to be part of the enumeration.
13248 * expression.cs (Conditional.DoResolve): Add support for operator
13249 true. Implements the missing functionality from 14.12
13251 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
13252 operator true/false as required by the spec.
13254 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
13255 implicit conversion to boolean.
13257 * statement.cs (Statement.ResolveBoolean): A boolean expression is
13258 also one where the type implements `operator true'.
13260 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
13261 get an expression that will invoke operator true based on an
13264 (GetConversionOperators): Removed the hack that called op_True
13267 (Expression.ResolveBoolean): Move this from Statement.
13269 2003-03-17 Miguel de Icaza <miguel@ximian.com>
13271 * ecore.cs (FieldExpr): do not allow initialization of initonly
13272 fields on derived classes
13274 2003-03-13 Martin Baulig <martin@ximian.com>
13276 * statement.cs (Block.Emit): Call ig.BeginScope() and
13277 ig.EndScope() when compiling with debugging info; call
13278 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
13280 2003-03-08 Miguel de Icaza <miguel@ximian.com>
13282 * expression.cs (Indexers): Do not construct immediately, allow
13283 for new members to be appended as we go. Fixes 38143
13285 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13287 * expression.cs: save/restore context when resolving an unchecked
13290 2003-03-05 Miguel de Icaza <miguel@ximian.com>
13292 * cfold.cs: Catch division by zero in modulus operator during
13295 2003-03-03 Miguel de Icaza <miguel@ximian.com>
13297 * interface.cs (Interface.DefineMembers): Avoid defining members
13300 2003-02-27 Miguel de Icaza <miguel@ximian.com>
13302 * driver.cs: handle the +/- options for -noconfig
13304 * statement.cs (Unckeched.Resolve): Also track the state of
13305 unchecked in the Resolve phase.
13307 2003-02-27 Martin Baulig <martin@ximian.com>
13309 * ecore.cs (Expression.MemberLookup): Don't create a
13310 MethodGroupExpr for something which is not a method. Fixes #38291.
13312 2003-02-25 Miguel de Icaza <miguel@ximian.com>
13314 * class.cs (MemberBase.CheckParameters): Also check that the type
13315 is unmanaged if it is a pointer.
13317 * expression.cs (SizeOf.Resolve): Add location information.
13319 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
13320 a managed type is declared.
13322 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
13323 parameter modifiers as well. Fixes bug 38606
13325 * class.cs: Very sad. Am backing out the speed up changes
13326 introduced by the ArrayList -> Array in the TypeContainer, as they
13327 were not actually that much faster, and introduced a bug (no error
13328 reports on duplicated methods).
13330 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
13331 source first, this will guarantee that we have a valid expression
13332 before calling in lower levels functions that will require a
13333 resolved object. Then use this original_source in the
13334 target.ResolveLValue instead of the original source that was
13337 Another change. Use target.Resolve instead of LValueResolve.
13338 Although we are resolving for LValues, we will let the Assign code
13339 take care of that (it will be called again from Resolve). This
13340 basically allows code like this:
13342 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
13343 class Y { void A (X x) { x [0] += o; }
13345 The problem was that the indexer was trying to resolve for
13346 set_Item (idx, object o) and never finding one. The real set_Item
13347 was set_Item (idx, X). By delaying the process we get the right
13352 2003-02-23 Martin Baulig <martin@ximian.com>
13354 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
13355 while calling DoEmit ().
13357 * codegen.cs (EmitContext.Mark): Don't mark locations in other
13358 source files; if you use the #line directive inside a method, the
13359 compiler stops emitting line numbers for the debugger until it
13360 reaches the end of the method or another #line directive which
13361 restores the original file.
13363 2003-02-23 Martin Baulig <martin@ximian.com>
13365 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
13367 2003-02-23 Martin Baulig <martin@ximian.com>
13369 * statement.cs (Block.AddChildVariableNames): We need to call this
13370 recursively, not just for our immediate children.
13372 2003-02-23 Martin Baulig <martin@ximian.com>
13374 * class.cs (Event.Define): Always make the field private, like csc does.
13376 * typemanager.cs (TypeManager.RealMemberLookup): Make events
13377 actually work, fixes bug #37521.
13379 2003-02-23 Miguel de Icaza <miguel@ximian.com>
13381 * delegate.cs: When creating the various temporary "Parameters"
13382 classes, make sure that we call the ComputeAndDefineParameterTypes
13383 on those new parameters (just like we do with the formal ones), to
13384 allow them to be resolved in the context of the DeclSpace.
13386 This fixes the bug that Dick observed in Bugzilla #38530.
13388 2003-02-22 Miguel de Icaza <miguel@ximian.com>
13390 * expression.cs (ResolveMemberAccess): When resolving a constant,
13391 do not attempt to pull a constant if the value was not able to
13392 generate a valid constant.
13394 * const.cs (LookupConstantValue): Do not report more errors than required.
13396 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13398 * expression.cs: fixes bug #38328.
13400 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13402 * class.cs: Changed all the various members that can be part of a
13403 class from being an ArrayList to be an Array of the right type.
13404 During the DefineType type_list, interface_list, delegate_list and
13405 enum_list are turned into types, interfaces, delegates and enums
13408 And during the member population, indexer_list, event_list,
13409 constant_list, field_list, instance_constructor_list, method_list,
13410 operator_list and property_list are turned into their real arrays.
13412 Although we could probably perform this operation earlier, for
13413 good error reporting we need to keep the lists and remove the
13414 lists for longer than required.
13416 This optimization was triggered by Paolo profiling the compiler
13417 speed on the output of `gen-sample-program.pl' perl script.
13419 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13420 not crash in methods like MemberLookupFailed that use this field.
13422 This problem arises when the compiler fails to resolve a type
13423 during interface type definition for example.
13425 2003-02-18 Miguel de Icaza <miguel@ximian.com>
13427 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13428 inherit from System.Object, so we have to stop at null, not only
13429 when reaching System.Object.
13431 2003-02-17 Miguel de Icaza <miguel@ximian.com>
13433 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13434 DeclaredOnly because the parent indexer might have had a different
13435 name, but did not loop until the top of the hierarchy was reached.
13437 The problem this one fixes is 35492: when a class implemented an
13438 indexer from an interface, we were getting the interface method
13439 (which was abstract) and we were flagging an error (can not invoke
13442 This also keeps bug 33089 functioning, and test-148 functioning.
13444 * typemanager.cs (IsSpecialMethod): The correct way of figuring
13445 out if a method is special is to see if it is declared in a
13446 property or event, or whether it is one of the predefined operator
13447 names. This should fix correctly #36804.
13449 2003-02-15 Miguel de Icaza <miguel@ximian.com>
13451 The goal here is to remove the dependency on EmptyCast.Peel ().
13452 Killing it completely.
13454 The problem is that currently in a number of places where
13455 constants are expected, we have to "probe" for an EmptyCast, and
13456 Peel, which is not the correct thing to do, as this will be
13457 repetitive and will likely lead to errors.
13459 The idea is to remove any EmptyCasts that are used in casts that
13460 can be reduced to constants, so we only have to cope with
13463 This bug hunt was triggered by Bug 37363 and the desire to remove
13464 the duplicate pattern where we were "peeling" emptycasts to check
13465 whether they were constants. Now constants will always be
13468 * ecore.cs: Use an enumconstant here instead of wrapping with
13471 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13472 throwing me off. By handling this we can get rid of a few hacks.
13474 * statement.cs (Switch): Removed Peel() code.
13476 2003-02-14 Miguel de Icaza <miguel@ximian.com>
13478 * class.cs: Location information for error 508
13480 * expression.cs (New.DoResolve): Add a guard against double
13481 resolution of an expression.
13483 The New DoResolve might be called twice when initializing field
13484 expressions (see EmitFieldInitializers, the call to
13485 GetInitializerExpression will perform a resolve on the expression,
13486 and later the assign will trigger another resolution
13488 This leads to bugs (#37014)
13490 * delegate.cs: The signature for EndInvoke should contain any ref
13491 or out parameters as well. We were not doing this in the past.
13493 * class.cs (Field.Define): Do not overwrite the type definition
13494 inside the `volatile' group. Turns out that volatile enumerations
13495 were changing the type here to perform a validity test, which
13498 2003-02-12 Miguel de Icaza <miguel@ximian.com>
13500 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13501 and structs, we do not want to load the instance variable
13503 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13504 enum_type has to be handled like an object reference (implicit
13505 conversions exists from this to object), but the regular IsClass
13506 and IsValueType tests will never return true for this one.
13508 Also we use TypeManager.IsValueType instead of type.IsValueType,
13509 just for consistency with the rest of the code (this is only
13510 needed if we ever use the construct exposed by test-180.cs inside
13511 corlib, which we dont today).
13513 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
13515 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13518 2003-02-09 Martin Baulig <martin@ximian.com>
13520 * namespace.cs (Namespace..ctor): Added SourceFile argument.
13521 (Namespace.DefineNamespaces): New static public method; this is
13522 called when we're compiling with debugging to add all namespaces
13523 to the symbol file.
13525 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13526 pass it to the Namespace's .ctor.
13528 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13529 and MethodBase arguments; pass the namespace ID to the symwriter;
13530 pass the MethodBase instead of the token to the symwriter.
13531 (SymbolWriter.DefineNamespace): New method to add a namespace to
13534 2003-02-09 Martin Baulig <martin@ximian.com>
13536 * symbolwriter.cs: New file. This is a wrapper around
13537 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
13538 methods here in near future.
13540 2003-02-09 Martin Baulig <martin@ximian.com>
13542 * codegen.cs (EmitContext.Mark): Just pass the arguments to
13543 ILGenerator.MarkSequencePoint() which are actually used by the
13546 2003-02-09 Martin Baulig <martin@ximian.com>
13548 * location.cs (SourceFile): New public sealed class. This
13549 contains the name and an index which is used in the location's token.
13550 (Location): Reserve an appropriate number of bits in the token for
13551 the source file instead of walking over that list, this gives us a
13552 really huge performance improvement when compiling with debugging.
13554 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13555 `SourceFile' argument instead of a string.
13556 (Driver.ProcessFile): Add all the files via Location.AddFile(),
13557 but don't parse/tokenize here, we need to generate the list of all
13558 source files before we do that.
13559 (Driver.ProcessFiles): New static function. Parses/tokenizes all
13562 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13563 instead of a string.
13565 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13568 2003-02-09 Martin Baulig <martin@ximian.com>
13570 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13571 filename on `#line default'.
13573 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13575 * statement.cs: don't clear the pinned var when the fixed statement
13576 returns from the method (fixes bug#37752).
13578 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13580 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
13583 2003-02-07 Martin Baulig <martin@ximian.com>
13585 * driver.cs: Removed the `--debug-args' command line argument.
13587 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13588 automatically by the AsssemblyBuilder.
13589 (CodeGen.InitializeSymbolWriter): We don't need to call any
13590 initialization function on the symbol writer anymore. This method
13591 doesn't take any arguments.
13593 2003-02-03 Miguel de Icaza <miguel@ximian.com>
13595 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13596 from referenced assemblies as well.
13598 2003-02-02 Martin Baulig <martin@ximian.com>
13600 * class.cs (MethodData.Emit): Generate debugging info for external methods.
13602 2003-02-02 Martin Baulig <martin@ximian.com>
13604 * class.cs (Constructor.Emit): Open the symbol writer before
13605 emitting the constructor initializer.
13606 (ConstructorInitializer.Emit): Call ec.Mark() to allow
13607 single-stepping through constructor initializers.
13609 2003-01-30 Miguel de Icaza <miguel@ximian.com>
13611 * class.cs: Handle error 549: do not allow virtual methods in
13614 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13616 * decl.cs: Check access levels when resolving types
13618 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13620 * statement.cs: Add parameters and locals set in catch blocks that might
13621 return to set vector
13623 2003-01-29 Miguel de Icaza <miguel@ximian.com>
13625 * class.cs (Operator): Set the SpecialName flags for operators.
13627 * expression.cs (Invocation.DoResolve): Only block calls to
13628 accessors and operators on SpecialName methods.
13630 (Cast.TryReduce): Handle conversions from char constants.
13633 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13635 * statement.cs: small memory and time optimization in FlowBranching.
13637 2003-01-28 Pedro Mart <yoros@wanadoo.es>
13639 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13640 problem that the last fix but in the other sid (Set).
13642 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13643 access when there is no indexer in the hierarchy.
13645 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13647 * class.cs: Combine some if statements.
13649 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13651 * driver.cs: fixed bug #37187.
13653 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
13655 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13656 any indexer, it's needed to build a list with all the indexers in the
13657 hierarchy (AllGetters), else we have problems. Fixes #35653.
13659 2003-01-23 Miguel de Icaza <miguel@ximian.com>
13661 * class.cs (MethodData.Define): It is wrong for an interface
13662 implementation to be static in both cases: explicit and implicit.
13663 We were only handling this in one case.
13665 Improve the if situation there to not have negations.
13667 * class.cs (Field.Define): Turns out that we do not need to check
13668 the unsafe bit on field definition, only on usage. Remove the test.
13670 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13672 * driver.cs: use assembly.Location instead of Codebase (the latest
13673 patch made mcs fail when using MS assemblies).
13675 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
13677 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13678 get the path to *corlib.dll.
13680 2003-01-21 Nick Drochak <ndrochak@gol.com>
13684 * typemanager.cs: Remove compiler warnings
13686 2003-01-20 Duncan Mak <duncan@ximian.com>
13688 * AssemblyInfo.cs: Bump the version number to 0.19.
13690 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13692 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13694 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
13696 * class.cs (Constructor::Emit): Emit debugging info for constructors.
13698 2003-01-17 Miguel de Icaza <miguel@ximian.com>
13700 * cs-parser.jay: Small fix: we were not comparing the constructor
13701 name correctly. Thanks to Zoltan for the initial pointer.
13703 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13705 * cs-tokenizer.cs: Set file name when specified with #line
13707 2003-01-15 Miguel de Icaza <miguel@ximian.com>
13709 * cs-parser.jay: Only perform the constructor checks here if we
13710 are named like the class; This will help provider a better
13711 error. The constructor path is taken when a type definition is
13712 not found, but most likely the user forgot to add the type, so
13713 report that rather than the constructor error.
13715 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13717 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13720 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13722 * cs-parser.jay: Add cleanup call.
13724 2003-01-13 Duncan Mak <duncan@ximian.com>
13726 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13727 consistent with other methods.
13729 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13731 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13733 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13735 * attribute.cs: only set GuidAttr to true when we have a
13738 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13742 * typemanager.cs: fixes to allow mcs compile corlib with the new
13743 Type.IsSubclassOf fix.
13745 2003-01-08 Miguel de Icaza <miguel@ximian.com>
13747 * expression.cs (LocalVariableReference.DoResolve): Classify a
13748 constant as a value, not as a variable. Also, set the type for
13751 * cs-parser.jay (fixed_statement): take a type instead of a
13752 pointer_type, so we can produce a better error message later.
13754 * statement.cs (Fixed.Resolve): Flag types that are not pointers
13757 (For.DoEmit): Make inifinite loops have a
13758 non-conditional branch back.
13760 (Fixed.DoEmit): First populate the pinned variables, then emit the
13761 statement, then clear the variables. Before I was emitting the
13762 code once for each fixed piece.
13765 2003-01-08 Martin Baulig <martin@ximian.com>
13767 * statement.cs (FlowBranching.MergeChild): A break in a
13768 SWITCH_SECTION does not leave a loop. Fixes #36155.
13770 2003-01-08 Martin Baulig <martin@ximian.com>
13772 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13773 lives in the same number space than `param_map'. Fixes #36154.
13775 2003-01-07 Miguel de Icaza <miguel@ximian.com>
13777 * cs-parser.jay (constructor_declaration): Set the
13778 Constructor.ModFlags before probing for it. This makes the
13779 compiler report 514, 515 and 132 (the code was there, but got
13782 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13783 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13784 (GotoCase.Resolve): Set `Returns' to ALWAYS.
13786 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13788 * enum.cs: create the enum static fields using the enum type.
13790 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13792 * class.cs: don't try to create the ParamBuilder for the return
13793 type if it's not needed (and handle it breaking for the ms runtime
13796 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13798 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13800 2002-12-29 Miguel de Icaza <miguel@ximian.com>
13802 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13803 the command. This showed up while compiling the JANET source
13804 code, which used \r as its only newline separator.
13806 2002-12-28 Miguel de Icaza <miguel@ximian.com>
13808 * class.cs (Method.Define): If we are an operator (because it
13809 reuses our code), then set the SpecialName and HideBySig. #36128
13811 2002-12-22 Miguel de Icaza <miguel@ximian.com>
13813 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13814 exception, report error 120 `object reference required'.
13816 * driver.cs: Add --pause option, used during to measure the size
13817 of the process as it goes with --timestamp.
13819 * expression.cs (Invocation.DoResolve): Do not allow methods with
13820 SpecialName to be invoked.
13822 2002-12-21 Miguel de Icaza <miguel@ximian.com>
13824 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13825 number before adding it.
13827 2002-12-21 Ravi Pratap <ravi@ximian.com>
13829 * ecore.cs (StandardImplicitConversion): When in an unsafe
13830 context, we allow conversion between void * to any other pointer
13831 type. This fixes bug #35973.
13833 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13835 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13836 is not thrown when extensionless outputs are used
13838 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13840 * rootcontext.cs: fixed compilation of corlib.
13842 2002-12-19 Miguel de Icaza <miguel@ximian.com>
13844 * attribute.cs (Attributes.Contains): Add new method.
13846 * class.cs (MethodCore.LabelParameters): if the parameter is an
13847 `out' parameter, check that no attribute `[In]' has been passed.
13849 * enum.cs: Handle the `value__' name in an enumeration.
13851 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
13853 * decl.cs: Added special case to allow overrides on "protected
13856 2002-12-18 Ravi Pratap <ravi@ximian.com>
13858 * attribute.cs (Attributes.AddAttributeSection): Rename to this
13859 since it makes much more sense.
13861 (Attributes.ctor): Don't require a Location parameter.
13863 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13865 * attribute.cs (ApplyAttributes): Remove extra Location parameters
13866 since we already have that information per attribute.
13868 * everywhere : make appropriate changes.
13870 * class.cs (LabelParameters): Write the code which actually
13871 applies attributes to the return type. We can't do this on the MS
13872 .NET runtime so we flag a warning in the case an exception is
13875 2002-12-18 Miguel de Icaza <miguel@ximian.com>
13877 * const.cs: Handle implicit null conversions here too.
13879 2002-12-17 Ravi Pratap <ravi@ximian.com>
13881 * class.cs (MethodCore.LabelParameters): Remove the extra
13882 Type [] parameter since it is completely unnecessary. Instead
13883 pass in the method's attributes so that we can extract
13884 the "return" attribute.
13886 2002-12-17 Miguel de Icaza <miguel@ximian.com>
13888 * cs-parser.jay (parse): Use Report.Error to flag errors instead
13889 of ignoring it and letting the compile continue.
13891 * typemanager.cs (ChangeType): use an extra argument to return an
13892 error condition instead of throwing an exception.
13894 2002-12-15 Miguel de Icaza <miguel@ximian.com>
13896 * expression.cs (Unary.TryReduce): mimic the code for the regular
13897 code path. Perform an implicit cast in the cases where we can
13898 implicitly convert to one of the integral types, and then reduce
13899 based on that constant. This fixes bug #35483.
13901 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13903 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13905 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13907 * namespace.cs: fixed bug #35489.
13909 2002-12-12 Miguel de Icaza <miguel@ximian.com>
13911 * class.cs: Remove some dead code.
13913 * cs-parser.jay: Estimate the number of methods needed
13914 (RootContext.MethodCount);
13916 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13917 numbers instead of StringBuilders.
13919 * support.cs (PtrHashtable): Add constructor with initial size;
13920 We can now reduce reallocations of the method table.
13922 2002-12-10 Ravi Pratap <ravi@ximian.com>
13924 * attribute.cs (ApplyAttributes): Keep track of the emitted
13925 attributes on a per-target basis. This fixes bug #35413.
13927 2002-12-10 Miguel de Icaza <miguel@ximian.com>
13929 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13930 default to the Windows 1252 encoding.
13932 (UnixParseOption): Support version, thanks to Alp for the missing
13935 * AssemblyInfo.cs: Add nice assembly information.
13937 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13940 * cs-parser.jay: Allow a trailing comma before the close bracked
13941 in the attribute_section production.
13943 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13944 address of the instance was being taken, I will take this out,
13945 because we take the address of the object immediately here.
13947 2002-12-09 Ravi Pratap <ravi@ximian.com>
13949 * typemanager.cs (AreMultipleAllowed): Take care of the most
13950 obvious case where attribute type is not in the current assembly -
13953 2002-12-08 Miguel de Icaza <miguel@ximian.com>
13955 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13956 definitions, instead of doing that afterwards.
13958 Also we use a nice little hack, depending on the constructor, we
13959 know if we are a "composed" name or a simple name. Hence, we
13960 avoid the IndexOf test, and we avoid
13962 * codegen.cs: Add code to assist in a bug reporter to track down
13963 the source of a compiler crash.
13965 2002-12-07 Ravi Pratap <ravi@ximian.com>
13967 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13968 types have been emitted for a given element and flag an error
13969 if something which does not have AllowMultiple set is used more
13972 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13973 attribute types and their corresponding AllowMultiple properties
13975 (AreMultipleAllowed): Check the property for a given type.
13977 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13978 property in the case we have a TypeContainer.
13980 (Attributes.AddAttribute): Detect duplicates and just skip on
13981 adding them. This trivial fix catches a pretty gross error in our
13982 attribute emission - global attributes were being emitted twice!
13984 Bugzilla bug #33187 is now fixed.
13986 2002-12-06 Miguel de Icaza <miguel@ximian.com>
13988 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13989 instead of pp_and).
13991 * expression.cs (Binary.ResolveOperator): I can only use the
13992 Concat (string, string, string) and Concat (string, string,
13993 string, string) if the child is actually a concatenation of
13996 2002-12-04 Miguel de Icaza <miguel@ximian.com>
13998 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13999 context where we need a 2-character lookahead.
14001 * pending.cs (PendingImplementation): Rework so we can keep track
14002 of interface types all the time, and flag those which were
14003 implemented by parents as optional.
14005 2002-12-03 Miguel de Icaza <miguel@ximian.com>
14007 * expression.cs (Binary.ResolveOperator): Use
14008 String.Concat(string,string,string) or
14009 String.Concat(string,string,string,string) when possible.
14011 * typemanager: More helper methods.
14014 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
14016 * pending.cs: remove the bogus return from GetMissingInterfaces()
14017 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
14019 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14021 * namespace.cs: avoid duplicated 'using xxx' being added to
14022 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
14023 when we get more than one 'using' statement for the same namespace.
14024 Report a CS0105 warning for it.
14026 2002-11-30 Miguel de Icaza <miguel@ximian.com>
14028 * cs-tokenizer.cs (consume_identifier): use read directly, instead
14029 of calling getChar/putback, uses internal knowledge of it.
14031 (xtoken): Reorder tokenizer so most common patterns are checked
14032 first. This reduces the compilation time in another 5% (from 8.11s
14033 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
14035 The parsing time is 22% of the compilation in mcs, and from that
14036 64% is spent on the tokenization process.
14038 I tried using a binary search for keywords, but this is slower
14039 than the hashtable. Another option would be to do a couple of
14042 * Not use a StringBuilder, instead use an array of chars,
14043 with a set value. Notice that this way we could catch
14044 the 645 error without having to do it *afterwards*.
14046 * We could write a hand-parser to avoid the hashtable
14047 compares altogether.
14049 The identifier consumption process takes 37% of the tokenization
14050 time. Another 15% is spent on is_number. 56% of the time spent
14051 on is_number is spent on Int64.Parse:
14053 * We could probably choose based on the string length to
14054 use Int32.Parse or Int64.Parse and avoid all the 64-bit
14057 Another 3% is spend on wrapping `xtoken' in the `token' function.
14059 Handle 0xa0 as whitespace (#34752)
14061 2002-11-26 Miguel de Icaza <miguel@ximian.com>
14063 * typemanager.cs (IsCLRType): New routine to tell whether a type
14064 is one of the builtin types.
14066 Maybe it needs to use TypeCodes to be faster. Maybe we could use
14067 typecode in more places instead of doing pointer comparissions.
14068 We could leverage some knowledge about the way the typecodes are
14071 New code to cache namespaces in assemblies, it is currently not
14072 invoked, to be used soon.
14074 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
14076 * expression.cs (Binary.ResolveOperator): specially handle
14077 strings, and do not perform user-defined operator overloading for
14080 2002-11-24 Miguel de Icaza <miguel@ximian.com>
14082 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
14083 internalcall as it is a pretty simple operation; Avoid whenever
14084 possible to call Char.IsLetter.
14086 (consume_identifier): Cut by half the number of
14087 hashtable calls by merging the is_keyword and GetKeyword behavior.
14089 Do not short-circuit, because if we do, we
14090 report errors (ie, #if false && true would produce an invalid
14094 2002-11-24 Martin Baulig <martin@ximian.com>
14096 * expression.cs (Cast.TryReduce): If we're in checked syntax,
14097 check constant ranges and report a CS0221. Fixes #33186.
14099 2002-11-24 Martin Baulig <martin@ximian.com>
14101 * cs-parser.jay: Make this work for uninitialized variable
14102 declarations in the `for' initializer. Fixes #32416.
14104 2002-11-24 Martin Baulig <martin@ximian.com>
14106 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
14107 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
14109 2002-11-24 Martin Baulig <martin@ximian.com>
14111 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
14112 argument; if true, we also check for user-defined conversions.
14113 This is only needed if both arguments are of a user-defined type.
14114 Fixes #30443, added test-175.cs.
14115 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
14117 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
14119 2002-11-24 Martin Baulig <martin@ximian.com>
14121 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
14122 function to get the store opcode.
14123 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
14124 only emit the Ldelema if the store opcode is Stobj. You must run
14125 both test-34 and test-167 to test this. Fixes #34529.
14127 2002-11-23 Martin Baulig <martin@ximian.com>
14129 * ecore.cs (Expression.MemberLookup): Added additional
14130 `qualifier_type' argument which is used when we're being called
14131 from MemberAccess.DoResolve() and null if we're called from a
14133 (Expression.MemberLookupFailed): New method to report errors; this
14134 does the CS1540 check and reports the correct error message.
14136 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
14137 argument for the CS1540 check and redone the way how we're dealing
14138 with private members. See the comment in the source code for details.
14139 (FilterWithClosure): Reverted this back to revision 1.197; renamed
14140 `closure_start_type' to `closure_qualifier_type' and check whether
14141 it's not null. It was not this filter being broken, it was just
14142 being called with the wrong arguments.
14144 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
14145 and pass it the correct `qualifier_type'; this also does the error
14148 2002-11-22 Miguel de Icaza <miguel@ximian.com>
14150 * expression.cs (Invocation.EmitParams): If the we are dealing
14151 with a non-built-in value type, load its address as well.
14153 (ArrayCreation): Use a a pretty constant instead
14154 of the hardcoded value 2. Use 6 instead of 2 for the number of
14155 static initializers.
14157 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
14158 because they are not really value types, just glorified integers.
14160 * driver.cs: Do not append .exe, the CSC compiler does not do it.
14162 * ecore.cs: Remove redundant code for enumerations, make them use
14163 the same code path as everything else, fixes the casting issue
14164 with enumerations in Windows.Forms.
14166 * attribute.cs: Do only cast to string if it is a string, the
14167 validation happens later.
14169 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
14170 people upgrade their corlibs.
14172 * ecore.cs: Oops, enumerations were not following the entire code path
14174 2002-11-21 Miguel de Icaza <miguel@ximian.com>
14176 * typemanager.cs (FilterWithClosure): Commented out the test for
14177 1540 in typemanager.cs, as it has problems when accessing
14178 protected methods from a parent class (see test-174.cs).
14180 * attribute.cs (Attribute.ValidateGuid): new method.
14181 (Attribute.Resolve): Use above.
14183 2002-11-19 Miguel de Icaza <miguel@ximian.com>
14185 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
14187 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
14188 handling for enumerations, as we only needed the TypeContainer
14189 functionality to begin with (this is required for the fix below to
14190 work for enums that reference constants in a container class for
14193 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
14195 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
14196 a valid TypeBuilder to perform lookups on.o
14198 * class.cs (InheritableMemberSignatureCompare): Use true in the
14199 call to GetGetMethod and GetSetMethod, because we are comparing
14200 the signature, and we need to get the methods *even* if they are
14203 (PropertyBase.CheckBase): ditto.
14205 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
14206 GotoCase.Resolve): Use Peel on EmpytCasts.
14208 * ecore.cs (EmptyCast): drop child, add Peel method.
14210 2002-11-17 Martin Baulig <martin@ximian.com>
14212 * ecore.cs (EmptyCast.Child): New public property.
14214 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
14215 label resolved to an EmptyCast. Fixes #34162.
14216 (GotoCase.Resolve): Likewise.
14217 (Block.EmitMeta): Likewise.
14219 2002-11-17 Martin Baulig <martin@ximian.com>
14221 * expression.cs (Invocation.BetterConversion): Prefer int over
14222 uint; short over ushort; long over ulong for integer literals.
14223 Use ImplicitConversionExists instead of StandardConversionExists
14224 since we also need to check for user-defined implicit conversions.
14225 Fixes #34165. Added test-173.cs.
14227 2002-11-16 Martin Baulig <martin@ximian.com>
14229 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
14230 with the `true' and `false' literals. Fixes #33151.
14232 2002-11-16 Martin Baulig <martin@ximian.com>
14234 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
14235 October 22nd; don't do the cs1540 check for static members.
14237 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
14238 now using our own filter here and doing the cs1540 check again.
14240 2002-11-16 Martin Baulig <martin@ximian.com>
14242 * support.cs (InternalParameters): Don't crash if we don't have
14243 any fixed parameters. Fixes #33532.
14245 2002-11-16 Martin Baulig <martin@ximian.com>
14247 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
14248 when looking up static methods to make this work on Windows.
14251 2002-11-16 Martin Baulig <martin@ximian.com>
14253 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
14254 a setter rather than using PropertyInfo.CanWrite.
14256 2002-11-15 Nick Drochak <ndrochak@gol.com>
14258 * class.cs: Allow acces to block member by subclasses. Fixes build
14261 2002-11-14 Martin Baulig <martin@ximian.com>
14263 * class.cs (Constructor.Emit): Added the extern/block check.
14266 2002-11-14 Martin Baulig <martin@ximian.com>
14268 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
14269 iteration while looking for indexers, this is needed because the
14270 indexer may have a different name in our base classes. Fixed the
14271 error reporting (no indexers at all, not get accessor, no
14272 overloaded match). Fixes bug #33089.
14273 (IndexerAccess.DoResolveLValue): Likewise.
14275 2002-11-14 Martin Baulig <martin@ximian.com>
14277 * class.cs (PropertyBase.CheckBase): Make this work for multiple
14278 indexers. Fixes the first part of bug #33089.
14279 (MethodSignature.InheritableMemberSignatureCompare): Added support
14282 2002-11-13 Ravi Pratap <ravi@ximian.com>
14284 * attribute.cs (Attribute.Resolve): Catch the
14285 NullReferenceException and report it since it isn't supposed to
14288 2002-11-12 Miguel de Icaza <miguel@ximian.com>
14290 * expression.cs (Binary.EmitBranchable): Also handle the cases for
14291 LogicalOr and LogicalAnd that can benefit from recursively
14292 handling EmitBranchable. The code now should be nice for Paolo.
14294 2002-11-08 Miguel de Icaza <miguel@ximian.com>
14296 * typemanager.cs (LookupType): Added a negative-hit hashtable for
14297 the Type lookups, as we perform quite a number of lookups on
14298 non-Types. This can be removed once we can deterministically tell
14299 whether we have a type or a namespace in advance.
14301 But this might require special hacks from our corlib.
14305 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
14306 and double which avoids a conversion from an integer to a double.
14308 * expression.cs: tiny optimization, avoid calling IsConstant,
14309 because it effectively performs the lookup twice.
14311 2002-11-06 Miguel de Icaza <miguel@ximian.com>
14313 But a bogus return here to keep the semantics of the old code
14314 until the Mono runtime is fixed.
14316 * pending.cs (GetMissingInterfaces): New method used to remove all
14317 the interfaces that are already implemented by our parent
14318 classes from the list of pending methods.
14320 * interface.cs: Add checks for calls after ResolveTypeExpr.
14322 2002-11-05 Miguel de Icaza <miguel@ximian.com>
14324 * class.cs (Class.Emit): Report warning 67: event not used if the
14325 warning level is beyond 3.
14327 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
14328 being a NullLiteral.
14330 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
14333 * class.cs (TypeContainer.GetClassBases): Cover a missing code
14334 path that might fail if a type can not be resolved.
14336 * expression.cs (Binary.Emit): Emit unsigned versions of the
14339 * driver.cs: use error 5.
14341 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
14343 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
14345 2002-11-01 Miguel de Icaza <miguel@ximian.com>
14347 * cs-parser.jay (switch_section): A beautiful patch from Martin
14348 Baulig that fixed 33094.
14350 2002-10-31 Miguel de Icaza <miguel@ximian.com>
14352 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
14353 Check whether the base is abstract and report an error if so.
14355 * expression.cs (IndexerAccess.DoResolveLValue,
14356 IndexerAccess.DoResolve): ditto.
14358 (Invocation.DoResolve): ditto.
14360 (Invocation.FullMethodDesc): Improve the report string.
14362 * statement.cs (Block): Eliminate IsVariableDefined as it is
14363 basically just a wrapper for GetVariableInfo.
14365 * ecore.cs (SimpleName): Use new
14367 * support.cs (ReflectionParamter.ParameterType): We unwrap the
14368 type, as we return the actual parameter ref/unref state on a
14371 2002-10-30 Miguel de Icaza <miguel@ximian.com>
14373 * support.cs: Return proper flags REF/OUT fixing the previous
14376 * expression.cs: Reverted last patch, that was wrong. Is_ref is
14377 not used to mean `ref' but `ref or out' in ParameterReference
14379 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
14380 full type signature instead of calling TypeManger.CSharpName
14383 * support.cs (InternalParameters.ParameterDesc): Do not compare
14384 directly to the modflags, because REF/OUT will actually be bitsets
14387 * delegate.cs (VerifyMethod): Check also the modifiers.
14389 * cs-tokenizer.cs: Fix bug where floating point values with an
14390 exponent where a sign was missing was ignored.
14392 * driver.cs: Allow multiple assemblies to be specified in a single
14395 2002-10-28 Miguel de Icaza <miguel@ximian.com>
14397 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
14398 because identifiers after a parenthesis would end up in this kind
14399 of production, and we needed to desamiguate it for having casts
14402 (UserDefinedType *) xxx
14404 2002-10-24 Miguel de Icaza <miguel@ximian.com>
14406 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14407 we should set on the Bindingflags.NonPublic, but not turn on
14408 private_ok. private_ok controls whether a Private member is
14409 returned (this is chekced on the filter routine), while the
14410 BindingFlags.NonPublic just controls whether private/protected
14411 will be allowed. This fixes the problem part of the problem of
14412 private properties being allowed to be used in derived classes.
14414 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14415 so we can call the children DoResolveLValue method (this will
14416 properly signal errors on lvalue assignments to base properties)
14418 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14419 getter are null, and we have a property info, we know that this
14420 happened because the lookup failed, so we report an error 122 for
14421 protection level violation.
14423 We also silently return if setter and getter are null in the
14424 resolve functions, this condition only happens if we have flagged
14425 the error before. This is the other half of the problem.
14427 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14428 not have accessibility information, that is why we were returning
14429 true in the filter function in typemanager.cs.
14431 To properly report 122 (property is inaccessible because of its
14432 protection level) correctly, we report this error in ResolveAccess
14433 by failing if both the setter and the getter are lacking (ie, the
14436 DoResolve and DoLResolve have been modified to check for both
14437 setter/getter being null and returning silently, the reason being
14438 that I did not want to put the knowledge about this error in upper
14441 int old = Report.Errors;
14442 x = new PropertyExpr (...);
14443 if (old != Report.Errors)
14448 So the property expr is returned, but it is invalid, so the error
14449 will be flagged during the resolve process.
14451 * class.cs: Remove InheritablePropertySignatureCompare from the
14452 class, as we no longer depend on the property signature to compute
14453 whether it is possible to implement a method or not.
14455 The reason is that calling PropertyInfo.GetGetMethod will return
14456 null (in .NET, in Mono it works, and we should change this), in
14457 cases where the Get Method does not exist in that particular
14462 class X { public virtual int A { get { return 1; } } }
14464 class Z : Y { public override int A { get { return 2; } } }
14466 Would fail in Z because the parent (Y) would not have the property
14467 defined. So we avoid this completely now (because the alternative
14468 fix was ugly and slow), and we now depend exclusively on the
14471 (PropertyBase.CheckBase): Use a method-base mechanism to find our
14472 reference method, instead of using the property.
14474 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14475 routines are gone now.
14477 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14478 names, they were incorrectly named.
14480 * cs-tokenizer.cs: Return are more gentle token on failure.
14482 * pending.cs (PendingImplementation.InterfaceMethod): This routine
14483 had an out-of-sync index variable, which caused it to remove from
14484 the list of pending methods the wrong method sometimes.
14486 2002-10-22 Miguel de Icaza <miguel@ximian.com>
14488 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14489 CanWrite, because those refer to this particular instance of the
14490 property, and do not take into account the fact that we can
14491 override single members of a property.
14493 Constructor requires an EmitContext. The resolution process does
14494 not happen here, but we need to compute the accessors before,
14495 because the resolution does not always happen for properties.
14497 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14498 subclass, before we did not update this flag, but we did update
14501 (GetAccessors): Drop this routine, as it did not work in the
14502 presence of partially overwritten set/get methods.
14504 Notice that this broke the cs1540 detection, but that will require
14507 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14511 * driver.cs: issue a warning instead of an error if we don't support
14512 debugging for the platform. Also ignore a couple of errors that may
14513 arise when trying to write the symbols. Undo my previous patch.
14515 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14517 * driver.cs: ignore /debug switch except for Unix platforms.
14519 2002-10-23 Nick Drochak <ndrochak@gol.com>
14521 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14523 2002-10-21 Miguel de Icaza <miguel@ximian.com>
14525 * driver.cs: Do not make mcs-debug conditional, so we do not break
14526 builds that use it.
14528 * statement.cs (UsageVector.MergeChildren): I would like Martin to
14529 review this patch. But basically after all the children variables
14530 have been merged, the value of "Breaks" was not being set to
14531 new_breaks for Switch blocks. I think that it should be set after
14532 it has executed. Currently I set this to the value of new_breaks,
14533 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14534 conservative, but I do not understand this code very well.
14536 I did not break anything in the build, so that is good ;-)
14538 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14540 2002-10-20 Mark Crichton <crichton@gimp.org>
14542 * cfold.cs: Fixed compile blocker. Really fixed it this time.
14544 2002-10-20 Nick Drochak <ndrochak@gol.com>
14546 * cfold.cs: Fixed compile blocker.
14548 2002-10-20 Miguel de Icaza <miguel@ximian.com>
14550 * driver.cs: I was chekcing the key, not the file.
14552 2002-10-19 Ravi Pratap <ravi@ximian.com>
14554 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14555 message that we were generating - we just need to silently return
14558 2002-10-19 Miguel de Icaza <miguel@ximian.com>
14560 * class.cs (Event.Define): Change my previous commit, as this
14561 breaks the debugger. This is a temporary hack, as it seems like
14562 the compiler is generating events incorrectly to begin with.
14564 * expression.cs (Binary.ResolveOperator): Added support for
14565 "U operator - (E x, E y)"
14567 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14570 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14571 init-only variables, but this path did not take into account that
14572 there might be also instance readonly variables. Correct this
14575 This fixes bug 32253
14577 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14580 * driver.cs: Change the extension for modules to `netmodule'
14582 * cs-parser.jay: Improved slightly the location tracking for
14583 the debugger symbols.
14585 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14586 modifiers that were specified instead of the hardcoded value
14587 (FamAndAssem). This was basically ignoring the static modifier,
14588 and others. Fixes 32429.
14590 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14591 fixed a bug in the process (32476)
14593 * expression.cs (ArrayAccess.EmitAssign): Patch from
14594 hwang_rob@yahoo.ca that fixes bug 31834.3
14596 2002-10-18 Miguel de Icaza <miguel@ximian.com>
14598 * driver.cs: Make the module extension .netmodule.
14600 2002-10-16 Miguel de Icaza <miguel@ximian.com>
14602 * driver.cs: Report an error if the resource file is not found
14603 instead of crashing.
14605 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14606 false, like Emit does.
14608 2002-10-16 Nick Drochak <ndrochak@gol.com>
14610 * typemanager.cs: Remove unused private member. Also reported mcs
14611 bug to report this as a warning like csc.
14613 2002-10-15 Martin Baulig <martin@gnome.org>
14615 * statement.cs (Statement.Emit): Made this a virtual method; emits
14616 the line number info and calls DoEmit().
14617 (Statement.DoEmit): New protected abstract method, formerly knows
14618 as Statement.Emit().
14620 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14622 2002-10-11 Miguel de Icaza <miguel@ximian.com>
14624 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14625 have fixed a remaining problem: not every AddXXXX was adding a
14626 fully qualified name.
14628 Now everyone registers a fully qualified name in the DeclSpace as
14629 being defined instead of the partial name.
14631 Downsides: we are slower than we need to be due to the excess
14632 copies and the names being registered this way.
14634 The reason for this is that we currently depend (on the corlib
14635 bootstrap for instance) that types are fully qualified, because
14636 we dump all the types in the namespace, and we should really have
14637 types inserted into the proper namespace, so we can only store the
14638 basenames in the defined_names array.
14640 2002-10-10 Martin Baulig <martin@gnome.org>
14642 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14643 from bug #31834, see the bug report for a testcase which is
14646 2002-10-10 Martin Baulig <martin@gnome.org>
14648 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14649 flow analysis code for this.
14651 * statement.cs (Do, While, For): Tell the flow analysis code about
14653 (FlowBranching.UsageVector): Added support for infinite loops.
14654 (Block.Resolve): Moved the dead code elimination here and use flow
14657 2002-10-09 Miguel de Icaza <miguel@ximian.com>
14659 * class.cs (Field.Define): Catch cycles on struct type
14662 * typemanager.cs (IsUnmanagedtype): Do not recursively check
14663 fields if the fields are static. We only need to check instance
14666 * expression.cs (As.DoResolve): Test for reference type.
14668 * statement.cs (Using.ResolveExpression): Use
14669 ConvertImplicitRequired, not ConvertImplicit which reports an
14671 (Using.ResolveLocalVariableDecls): ditto.
14673 * expression.cs (Binary.ResolveOperator): Report errors in a few
14674 places where we had to.
14676 * typemanager.cs (IsUnmanagedtype): Finish implementation.
14678 2002-10-08 Miguel de Icaza <miguel@ximian.com>
14680 * expression.cs: Use StoreFromPtr instead of extracting the type
14681 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
14683 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14684 an enumeration value to a System.Enum, but System.Enum is not a
14685 value type, but an class type, so we need to box.
14687 (Expression.ConvertExplicit): One codepath could return
14688 errors but not flag them. Fix this. Fixes #31853
14690 * parameter.cs (Resolve): Do not allow void as a parameter type.
14692 2002-10-06 Martin Baulig <martin@gnome.org>
14694 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14695 if it's a class type and not a struct. Fixes #31815.
14697 2002-10-06 Martin Baulig <martin@gnome.org>
14699 * statement.cs: Reworked the flow analysis code a bit to make it
14700 usable for dead code elimination.
14702 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14704 * cs-parser.jay: allow empty source files. Fixes bug #31781.
14706 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14708 * expression.cs (ComposedCast.DoResolveType): A quick workaround
14709 to fix the test 165, will investigate deeper.
14711 2002-10-04 Martin Baulig <martin@gnome.org>
14713 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14714 finally blocks actually work.
14715 (Try.Resolve): We don't need to create a sibling for `finally' if
14716 there is no finally block.
14718 2002-10-04 Martin Baulig <martin@gnome.org>
14720 * class.cs (Constructor.Define): The default accessibility for a
14721 non-default constructor is private, not public.
14723 2002-10-04 Miguel de Icaza <miguel@ximian.com>
14725 * class.cs (Constructor): Make AllowedModifiers public, add
14728 * cs-parser.jay: Perform the modifiers test here, as the
14729 constructor for the Constructor class usually receives a zero
14730 because of the way we create it (first we create, later we
14731 customize, and we were never checking the modifiers).
14733 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14734 is a version of LookupTypeReflection that includes the type-name
14735 cache. This can be used as a fast path for functions that know
14736 the fully qualified name and are only calling into *.GetType() to
14737 obtain a composed type.
14739 This is also used by TypeManager.LookupType during its type
14742 (LookupType): We now also track the real type name, as sometimes
14743 we can get a quey for the real type name from things like
14744 ComposedCast. This fixes bug 31422.
14746 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14747 complete type fullname, it does not have to go through the type
14748 resolution system to obtain the composed version of the type (for
14749 obtaining arrays or pointers).
14751 (Conditional.Emit): Use the EmitBoolExpression to
14752 generate nicer code, as requested by Paolo.
14754 (ArrayCreation.CheckIndices): Use the patch from
14755 hwang_rob@yahoo.ca to validate the array initializers.
14757 2002-10-03 Miguel de Icaza <miguel@ximian.com>
14759 * class.cs (ConstructorInitializer.Emit): simplify code by using
14760 Invocation.EmitCall, and at the same time, fix the bugs in calling
14761 parent constructors that took variable arguments.
14763 * ecore.cs (Expression.ConvertNumericExplicit,
14764 Expression.ImplicitNumericConversion): Remove the code that
14765 manually wrapped decimal (InternalTypeConstructor call is now gone
14768 * expression.cs (Cast.TryReduce): Also handle decimal types when
14769 trying to perform a constant fold on the type.
14771 * typemanager.cs (IsUnmanagedtype): Partially implemented.
14773 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14774 that only turned off an error report, and did nothing else.
14776 2002-10-02 Miguel de Icaza <miguel@ximian.com>
14778 * driver.cs: Handle and ignore /fullpaths
14780 2002-10-01 Miguel de Icaza <miguel@ximian.com>
14782 * expression.cs (Binary.ResolveOperator): Catch the case where
14783 DoNumericPromotions returns true,
14785 (Binary.DoNumericPromotions): Simplify the code, and the tests.
14787 2002-09-27 Miguel de Icaza <miguel@ximian.com>
14789 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14792 2002-09-26 Miguel de Icaza <miguel@ximian.com>
14794 * ecore.cs (ConvertNumericExplicit): It is not enough that the
14795 conversion exists, but it is also required that the conversion be
14796 performed. This manifested in "(Type64Enum) 2".
14798 * class.cs (TypeManager.AddMethod): The fix is not to change
14799 AddEnum, because that one was using a fully qualified name (every
14800 DeclSpace derivative does), but to change the AddMethod routine
14801 that was using an un-namespaced name. This now correctly reports
14802 the duplicated name.
14804 Revert patch until I can properly fix it. The issue
14805 is that we have a shared Type space across all namespaces
14806 currently, which is wrong.
14808 Options include making the Namespace a DeclSpace, and merge
14809 current_namespace/current_container in the parser.
14811 2002-09-25 Miguel de Icaza <miguel@ximian.com>
14813 * cs-parser.jay: Improve error reporting when we get a different
14814 kind of expression in local_variable_type and
14815 local_variable_pointer_type.
14817 Propagate this to avoid missleading errors being reported.
14819 * ecore.cs (ImplicitReferenceConversion): treat
14820 TypeManager.value_type as a target just like object_type. As
14825 Is valid, and needs to result in the int 1 being boxed before it
14826 is assigned to the value type v.
14828 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14829 to validate the enumeration name.
14831 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14832 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
14833 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14835 * ecore.cs (TryImplicitIntConversion): When doing an
14836 implicit-enumeration-conversion, check if the type is 64-bits and
14837 perform a conversion before passing to EnumConstant.
14839 2002-09-23 Miguel de Icaza <miguel@ximian.com>
14841 * decl.cs (Error_AmbiguousTypeReference); New routine used to
14842 report ambiguous type references. Unlike the MS version, we
14843 report what the ambiguity is. Innovation at work ;-)
14845 (DeclSpace.FindType): Require a location argument to
14846 display when we display an ambiguous error.
14848 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14850 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14852 * expression.cs (EmitDynamicInitializers): Apply patch from
14853 hwang_rob@yahoo.ca that fixes the order in which we emit our
14856 2002-09-21 Martin Baulig <martin@gnome.org>
14858 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14859 delegate takes no arguments.
14861 2002-09-20 Miguel de Icaza <miguel@ximian.com>
14863 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14866 * expression.cs: Extract the underlying type.
14868 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14870 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14872 2002-09-19 Miguel de Icaza <miguel@ximian.com>
14874 * class.cs (TypeContainer.DefineType): We can not use the nice
14875 PackingSize with the size set to 1 DefineType method, because it
14876 will not allow us to define the interfaces that the struct
14879 This completes the fixing of bug 27287
14881 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14882 means also structs. This fixes part of the problem.
14883 (Expresion.ImplicitReferenceConversionExists): ditto.
14885 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14886 error if there were no errors reported during the type lookup
14887 process, to avoid duplicates or redundant errors. Without this
14888 you would get an ambiguous errors plus a type not found. We have
14889 beaten the user enough with the first error.
14891 (DeclSparce.FindType): Emit a warning if we have an ambiguous
14894 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14895 during the resolution process, stop the lookup, this avoids
14896 repeated error reports (same error twice).
14898 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14900 * typemanager.cs (LookupType): Redo the type lookup code to match
14901 the needs of System.Reflection.
14903 The issue is that System.Reflection requires references to nested
14904 types to begin with a "+" sign instead of a dot. So toplevel
14905 types look like: "NameSpace.TopLevelClass", and nested ones look
14906 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14909 2002-09-19 Martin Baulig <martin@gnome.org>
14911 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14912 says that a method always returns or always throws an exception,
14913 don't report the CS0161.
14915 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14916 set `Returns = new_returns'.
14918 2002-09-19 Martin Baulig <martin@gnome.org>
14920 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14921 to an enum constant, check for a CS0176.
14923 2002-09-18 Miguel de Icaza <miguel@ximian.com>
14925 * class.cs (TypeContainer.CheckPairedOperators): Now we check
14926 for operators that must be in pairs and report errors.
14928 * ecore.cs (SimpleName.DoResolveType): During the initial type
14929 resolution process, when we define types recursively, we must
14930 check first for types in our current scope before we perform
14931 lookups in the enclosing scopes.
14933 * expression.cs (MakeByteBlob): Handle Decimal blobs.
14935 (Invocation.VerifyArgumentsCompat): Call
14936 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14937 I thought we were supposed to always call this, but there are a
14938 few places in the code where we dont do it.
14940 2002-09-17 Miguel de Icaza <miguel@ximian.com>
14942 * driver.cs: Add support in -linkres and -resource to specify the
14943 name of the identifier.
14945 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14947 * ecore.cs (StandardConversionExists): Sync with the conversion
14948 code: allow anything-* to void* conversions.
14950 (FindMostSpecificSource): Use an Expression argument
14951 instead of a Type, because we might be handed over a Literal which
14952 gets a few more implicit conversions that plain types do not. So
14953 this information was being lost.
14955 Also, we drop the temporary type-holder expression when not
14958 2002-09-17 Martin Baulig <martin@gnome.org>
14960 * class.cs (PropertyBase.CheckBase): Don't check the base class if
14961 this is an explicit interface implementation.
14963 2002-09-17 Martin Baulig <martin@gnome.org>
14965 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14966 different `IndexerName' attributes.
14968 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14969 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14970 virtual CommonResolve().
14972 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14974 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14975 and convert that to the UnderlyingType.
14977 * statement.cs (Foreach.Resolve): Indexers are just like variables
14978 or PropertyAccesses.
14980 * cs-tokenizer.cs (consume_string): Track line numbers and columns
14981 inside quoted strings, we were not doing this before.
14983 2002-09-16 Martin Baulig <martin@gnome.org>
14985 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14986 resolve it. This is needed for the definite assignment check of the
14987 instance expression, fixes bug #29846.
14988 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14990 2002-09-16 Nick Drochak <ndrochak@gol.com>
14992 * parameter.cs: Fix compile error. Cannot reference static member
14993 from an instance object. Is this an mcs bug?
14995 2002-09-14 Martin Baulig <martin@gnome.org>
14997 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14998 multiple times. Fixes bug #30295, added test-166.cs.
15000 2002-09-14 Martin Baulig <martin@gnome.org>
15002 * statement.cs (Block.Emit): Don't emit unreachable code.
15003 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
15004 `break' statements.
15005 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
15007 2002-09-14 Martin Baulig <martin@gnome.org>
15009 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
15012 2002-09-14 Martin Baulig <martin@gnome.org>
15014 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
15015 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
15016 be false on the ms runtime.
15018 2002-09-13 Martin Baulig <martin@gnome.org>
15020 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
15021 the CS0038 error message.
15023 2002-09-12 Miguel de Icaza <miguel@ximian.com>
15025 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
15026 constant inside, return it.
15028 2002-09-12 Martin Baulig <martin@gnome.org>
15030 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
15031 implicit conversion can be done between enum types.
15033 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
15034 check whether an implicit conversion to the current enum's UnderlyingType
15035 exists and report an error if not.
15037 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
15038 without debugging support.
15040 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
15041 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
15043 2002-09-12 Martin Baulig <martin@gnome.org>
15045 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
15047 * ecore.cs (IMemberExpr.DeclaringType): New property.
15048 (SimpleName.SimpleNameResolve): Check whether we're accessing a
15049 nonstatic member of an outer type (CS0038).
15051 2002-09-11 Miguel de Icaza <miguel@ximian.com>
15053 * driver.cs: Activate the using-error detector at warning level
15054 4 (at least for MS-compatible APIs).
15056 * namespace.cs (VerifyUsing): Small buglett fix.
15058 * pending.cs (PendingImplementation): pass the container pointer.
15060 * interface.cs (GetMethods): Allow for recursive definition. Long
15061 term, I would like to move every type to support recursive
15062 definitions, not the current ordering mechanism that we have right
15065 The situation is this: Attributes are handled before interfaces,
15066 so we can apply attributes to interfaces. But some attributes
15067 implement interfaces, we will now handle the simple cases
15068 (recursive definitions will just get an error).
15070 * parameter.cs: Only invalidate types at the end if we fail to
15073 2002-09-09 Martin Baulig <martin@gnome.org>
15075 * ecore.cs (PropertyExpr.Emit): Also check for
15076 TypeManager.system_int_array_get_length so this'll also work when
15077 compiling corlib. Fixes #30003.
15079 2002-09-09 Martin Baulig <martin@gnome.org>
15081 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
15082 and throw an exception if we can't get the type's size. Fixed #30040,
15085 2002-09-09 Martin Baulig <martin@gnome.org>
15087 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
15089 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
15090 context. Fixes bug #30027.
15092 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
15093 virtual functions. Fixes bug #30043, added test-164.cs.
15095 2002-09-08 Ravi Pratap <ravi@ximian.com>
15097 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
15099 2002-09-08 Nick Drochak <ndrochak@gol.com>
15101 * driver.cs: Use an object to get the windows codepage since it's not a
15104 2002-09-08 Miguel de Icaza <miguel@ximian.com>
15106 * statement.cs (For.Emit): for infinite loops (test == null)
15107 return whether there is a break inside, not always "true".
15109 * namespace.cs (UsingEntry): New struct to hold the name of the
15110 using definition, the location where it is defined, and whether it
15111 has been used in a successful type lookup.
15113 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
15118 2002-09-06 Ravi Pratap <ravi@ximian.com>
15120 * attribute.cs : Fix incorrect code which relied on catching
15121 a NullReferenceException to detect a null being passed in
15122 where an object was expected.
15124 2002-09-06 Miguel de Icaza <miguel@ximian.com>
15126 * statement.cs (Try): flag the catch variable as assigned
15128 * expression.cs (Cast): Simplified by using ResolveType instead of
15129 manually resolving.
15131 * statement.cs (Catch): Fix bug by using ResolveType.
15133 2002-09-06 Ravi Pratap <ravi@ximian.com>
15135 * expression.cs (BetterConversion): Special case for when we have
15136 a NullLiteral as the argument and we have to choose between string
15137 and object types - we choose string the way csc does.
15139 * attribute.cs (Attribute.Resolve): Catch the
15140 NullReferenceException and report error #182 since the Mono
15141 runtime no more has the bug and having this exception raised means
15142 we tried to select a constructor which takes an object and is
15145 2002-09-05 Ravi Pratap <ravi@ximian.com>
15147 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
15148 message (1502, 1503) when we can't locate a method after overload
15149 resolution. This is much more informative and closes the bug
15152 * interface.cs (PopulateMethod): Return if there are no argument
15153 types. Fixes a NullReferenceException bug.
15155 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
15156 expressions too. Previously we were checking only in one place for
15157 positional arguments leaving out named arguments.
15159 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
15160 type to the enum type is not allowed. Remove code corresponding to
15163 (ConvertNumericExplicit): Allow explicit conversions from
15164 the underlying type to enum type. This precisely follows the spec
15165 and closes a bug filed by Gonzalo.
15167 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15170 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
15172 2002-09-03 Miguel de Icaza <miguel@ximian.com>
15174 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
15175 it was important that we stored the right value after the
15176 reduction in `converted'.
15178 2002-09-04 Martin Baulig <martin@gnome.org>
15180 * location.cs (Location.SymbolDocument): Use full pathnames for the
15183 2002-08-30 Miguel de Icaza <miguel@ximian.com>
15185 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
15186 of the expression resolve mechanism, because that will catch the
15187 SimpleName error failures.
15189 (Conditional): If we can not resolve the
15190 expression, return, do not crash.
15192 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15195 (location): display token name instead of its number.
15197 2002-08-28 Martin Baulig <martin@gnome.org>
15199 * expression.cs (Binary.ResolveOperator): Don't silently return
15200 but return an error if an operator cannot be applied between two
15203 2002-08-28 Martin Baulig <martin@gnome.org>
15205 * class.cs (Constructor.Define): Set the permission attributes
15206 correctly instead of making all constructors public.
15208 2002-08-28 Martin Baulig <martin@gnome.org>
15210 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
15211 for private members before reporting a CS0103; if we find anything,
15214 2002-08-28 Martin Baulig <martin@gnome.org>
15216 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
15217 to check whether `closure_start_type == closure_invocation_type',
15218 we also need to check whether `m.DeclaringType == closure_invocation_type'
15219 before bypassing the permission checks. We might be accessing
15220 protected/private members from the base class.
15221 (TypeManager.RealMemberLookup): Only set private_ok if private
15222 members were requested via BindingFlags.NonPublic.
15224 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
15226 * expression.cs (MemberAccess.ResolveMemberAccess): Set
15227 MethodGroupExpr.IsExplicitImpl if appropriate.
15228 (Invocation.DoResolve): Don't report the CS0120 for explicit
15229 interface implementations.
15231 2002-08-27 Martin Baulig <martin@gnome.org>
15233 * expression.cs (Invocation.DoResolve): If this is a static
15234 method and we don't have an InstanceExpression, we must report
15237 2002-08-25 Martin Baulig <martin@gnome.org>
15239 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
15240 `==' between a valuetype and an object.
15242 2002-08-25 Miguel de Icaza <miguel@ximian.com>
15244 * ecore.cs (TypeExpr): Provide a ToString method.
15246 2002-08-24 Martin Baulig <martin@gnome.org>
15248 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
15249 now called proggie.dbg and it's a binary file.
15251 2002-08-23 Martin Baulig <martin@gnome.org>
15253 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
15255 2002-08-23 Martin Baulig <martin@gnome.org>
15257 * struct.cs (MyStructInfo.ctor): Make this work with empty
15258 structs; it's not allowed to use foreach() on null.
15260 2002-08-23 Martin Baulig <martin@gnome.org>
15262 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
15263 writer the full pathname of the generated assembly.
15265 2002-08-23 Martin Baulig <martin@gnome.org>
15267 * statements.cs (FlowBranching.UsageVector.MergeChildren):
15268 A `finally' block never returns or breaks; improved handling of
15271 2002-08-23 Martin Baulig <martin@gnome.org>
15273 * statement.cs (Throw.Resolve): Allow `throw null'.
15275 2002-08-23 Martin Baulig <martin@gnome.org>
15277 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
15278 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
15279 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
15280 MemberLookup would return a wrong event if this is an explicit
15281 interface implementation and the class has an event with the same
15284 2002-08-23 Martin Baulig <martin@gnome.org>
15286 * statement.cs (Block.AddChildVariableNames): New public method.
15287 (Block.AddChildVariableName): Likewise.
15288 (Block.IsVariableNameUsedInChildBlock): Likewise.
15289 (Block.AddVariable): Check whether a variable name has already
15290 been used in a child block.
15292 * cs-parser.jay (declare_local_variables): Mark all variable names
15293 from the current block as being used in a child block in the
15296 2002-08-23 Martin Baulig <martin@gnome.org>
15298 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
15299 find the symbol writer.
15301 * driver.cs: csc also allows the arguments to /define being
15302 separated by commas, not only by semicolons.
15304 2002-08-23 Martin Baulig <martin@gnome.org>
15306 * interface.cs (Interface.GetMembers): Added static check for events.
15308 2002-08-15 Martin Baulig <martin@gnome.org>
15310 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
15311 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
15313 * ecore.cs (Expression.MemberLookup): Added documentation and explained
15314 why the MethodData.EmitDestructor() change was necessary.
15316 2002-08-20 Martin Baulig <martin@gnome.org>
15318 * class.cs (TypeContainer.FindMembers): Added static check for events.
15320 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
15322 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
15323 use Type.GetEvents(), not Type.FindMembers().
15325 2002-08-20 Martin Baulig <martin@gnome.org>
15327 * decl.cs (MemberCache): Added a special method cache which will
15328 be used for method-only searched. This ensures that a method
15329 search will return a MethodInfo with the correct ReflectedType for
15332 2002-08-20 Martin Baulig <martin@gnome.org>
15334 * decl.cs (DeclSpace.FindMembers): Made this public.
15336 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15338 * delegate.cs: fixed build on windows.
15339 [FIXME: Filed as bug #29150: MCS must report these errors.]
15341 2002-08-19 Ravi Pratap <ravi@ximian.com>
15343 * ecore.cs (StandardConversionExists): Return a false
15344 if we are trying to convert the void type to anything else
15345 since that is not allowed.
15347 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
15348 we flag error 70 in the event an event is trying to be accessed
15349 directly from outside the declaring type.
15351 2002-08-20 Martin Baulig <martin@gnome.org>
15353 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
15354 MemberCache from typemanager.cs to decl.cs.
15356 2002-08-19 Martin Baulig <martin@gnome.org>
15358 * class.cs (TypeContainer): Implement IMemberContainer.
15359 (TypeContainer.DefineMembers): Create the MemberCache.
15360 (TypeContainer.FindMembers): Do better BindingFlags checking; only
15361 return public members if BindingFlags.Public was given, check
15362 whether members are static.
15364 2002-08-16 Martin Baulig <martin@gnome.org>
15366 * decl.cs (DeclSpace.Define): Splitted this in Define and
15367 DefineMembers. DefineMembers is called first and initializes the
15370 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
15371 DefineMembers() on all our DeclSpaces.
15373 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
15374 but call DefineMembers() on all nested interfaces. We call their
15375 Define() in our new Define() function.
15377 * interface.cs (Interface): Implement IMemberContainer.
15378 (Interface.Define): Moved all code except the attribute stuf to
15380 (Interface.DefineMembers): Initialize the member cache.
15382 * typemanager.cs (IMemberFinder): Removed this interface, we don't
15383 need this anymore since we can use MemberCache.FindMembers directly.
15385 2002-08-19 Martin Baulig <martin@gnome.org>
15387 * typemanager.cs (MemberCache): When creating the cache for an
15388 interface type, add all inherited members.
15389 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
15390 to `out bool used_cache' and documented it.
15391 (TypeManager.MemberLookup): If we already used the cache in the first
15392 iteration, we don't need to do the interfaces check.
15394 2002-08-19 Martin Baulig <martin@gnome.org>
15396 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
15397 here from IMemberFinder and don't implement this interface anymore.
15398 (DeclSpace.MemberCache): Moved here from IMemberFinder.
15400 * typemanager.cs (IMemberFinder): This interface is now only used by
15401 classes which actually support the member cache.
15402 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15403 since we only put DeclSpaces into this Hashtable.
15404 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15405 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15407 2002-08-16 Martin Baulig <martin@gnome.org>
15409 * typemanager.cs (ICachingMemberFinder): Removed.
15410 (IMemberFinder.MemberCache): New property.
15411 (TypeManager.FindMembers): Merged this with RealFindMembers().
15412 This function will never be called from TypeManager.MemberLookup()
15413 so we can't use the cache here, just the IMemberFinder.
15414 (TypeManager.MemberLookup_FindMembers): Check whether the
15415 IMemberFinder has a MemberCache and call the cache's FindMembers
15417 (MemberCache): Rewrote larger parts of this yet another time and
15418 cleaned it up a bit.
15420 2002-08-15 Miguel de Icaza <miguel@ximian.com>
15422 * driver.cs (LoadArgs): Support quoting.
15424 (Usage): Show the CSC-like command line arguments.
15426 Improved a few error messages.
15428 2002-08-15 Martin Baulig <martin@gnome.org>
15430 * typemanager.cs (IMemberContainer.Type): New property.
15431 (IMemberContainer.IsInterface): New property.
15433 The following changes are conditional to BROKEN_RUNTIME, which is
15434 defined at the top of the file.
15436 * typemanager.cs (MemberCache.MemberCache): Don't add the base
15437 class'es members, but add all members from TypeHandle.ObjectType
15438 if we're an interface.
15439 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15440 is the current type.
15441 (MemberCache.CacheEntry.Container): Removed this field.
15442 (TypeHandle.GetMembers): Include inherited members.
15444 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15446 * typemanager.cs: fixed compilation and added a comment on a field that
15449 2002-08-15 Martin Baulig <martin@gnome.org>
15451 * class.cs (ConstructorInitializer.Resolve): In the
15452 Expression.MemberLookup call, use the queried_type as
15455 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15456 declared' attribute, it's always true.
15457 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15458 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15459 temporary wrapper for FindMembers which tells MemberLookup whether
15460 members from the base classes are included in the return value.
15461 This will go away soon.
15462 (TypeManager.MemberLookup): Use this temporary hack here; once the
15463 new MemberCache is completed, we don't need to do the DeclaredOnly
15464 looping here anymore since the MemberCache will take care of this.
15465 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15466 (MemberCache): When creating the MemberCache for a class, get
15467 members from the current class and all its base classes.
15468 (MemberCache.CacheEntry.Container): New field. This is a
15469 temporary hack until the Mono runtime is fixed to distinguish
15470 between ReflectedType and DeclaringType. It allows us to use MCS
15471 with both the MS runtime and the unfixed Mono runtime without
15472 problems and without accecting performance.
15473 (MemberCache.SearchMembers): The DeclaredOnly looping from
15474 TypeManager.MemberLookup is now done here.
15476 2002-08-14 Martin Baulig <martin@gnome.org>
15478 * statement.cs (MyStructInfo.MyStructInfo): Don't call
15479 Type.GetFields on dynamic types but get the fields from the
15480 corresponding TypeContainer.
15481 (MyStructInfo.GetStructInfo): Added check for enum types.
15483 * typemanager.cs (MemberList.IsSynchronized): Implemented.
15484 (MemberList.SyncRoot): Implemented.
15485 (TypeManager.FilterWithClosure): No need to check permissions if
15486 closure_start_type == closure_invocation_type, don't crash if
15487 closure_invocation_type is null.
15489 2002-08-13 Martin Baulig <martin@gnome.org>
15491 Rewrote TypeContainer.FindMembers to use a member cache. This
15492 gives us a speed increase of about 35% for the self-hosting MCS
15493 build and of about 15-20% for the class libs (both on GNU/Linux).
15495 * report.cs (Timer): New class to get enhanced profiling. This
15496 whole class is "TIMER" conditional since it remarkably slows down
15499 * class.cs (MemberList): New class. This is an IList wrapper
15500 which we're now using instead of passing MemberInfo[]'s around to
15501 avoid copying this array unnecessarily.
15502 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15503 (ICachingMemberFinder, IMemberContainer): New interface.
15504 (TypeManager.FilterWithClosure): If `criteria' is null, the name
15505 has already been checked, otherwise use it for the name comparision.
15506 (TypeManager.FindMembers): Renamed to RealMemberFinder and
15507 provided wrapper which tries to use ICachingMemberFinder.FindMembers
15508 if possible. Returns a MemberList, not a MemberInfo [].
15509 (TypeHandle): New class, implements IMemberContainer. We create
15510 one instance of this class per type, it contains a MemberCache
15511 which is used to do the member lookups.
15512 (MemberCache): New class. Each instance of this class contains
15513 all members of a type and a name-based hash table.
15514 (MemberCache.FindMembers): This is our new member lookup
15515 function. First, it looks up all members of the requested name in
15516 the hash table. Then, it walks this list and sorts out all
15517 applicable members and returns them.
15519 2002-08-13 Martin Baulig <martin@gnome.org>
15521 In addition to a nice code cleanup, this gives us a performance
15522 increase of about 1.4% on GNU/Linux - not much, but it's already
15523 half a second for the self-hosting MCS compilation.
15525 * typemanager.cs (IMemberFinder): New interface. It is used by
15526 TypeManager.FindMembers to call FindMembers on a TypeContainer,
15527 Enum, Delegate or Interface.
15528 (TypeManager.finder_to_member_finder): New PtrHashtable.
15529 (TypeManager.finder_to_container): Removed.
15530 (TypeManager.finder_to_delegate): Removed.
15531 (TypeManager.finder_to_interface): Removed.
15532 (TypeManager.finder_to_enum): Removed.
15534 * interface.cs (Interface): Implement IMemberFinder.
15536 * delegate.cs (Delegate): Implement IMemberFinder.
15538 * enum.cs (Enum): Implement IMemberFinder.
15540 * class.cs (TypeContainer): Implement IMemberFinder.
15542 2002-08-12 Martin Baulig <martin@gnome.org>
15544 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15546 2002-08-12 Martin Baulig <martin@gnome.org>
15548 * ecore.cs (ITypeExpression): New interface for expressions which
15550 (TypeExpression): Renamed to TypeLookupExpression.
15551 (Expression.DoResolve): If we're doing a types-only lookup, the
15552 expression must implement the ITypeExpression interface and we
15553 call DoResolveType() on it.
15554 (SimpleName): Implement the new ITypeExpression interface.
15555 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15556 hack, the situation that we're only looking up types can't happen
15557 anymore when this method is called. Moved the type lookup code to
15558 DoResolveType() and call it.
15559 (SimpleName.DoResolveType): This ITypeExpression interface method
15560 is now doing the types-only lookup.
15561 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15562 (ResolveFlags): Added MaskExprClass.
15564 * expression.cs (MemberAccess): Implement the ITypeExpression
15566 (MemberAccess.DoResolve): Added support for a types-only lookup
15567 when we're called via ITypeExpression.DoResolveType().
15568 (ComposedCast): Implement the ITypeExpression interface.
15570 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
15571 Expression.Resolve() with ResolveFlags.Type instead.
15573 2002-08-12 Martin Baulig <martin@gnome.org>
15575 * interface.cs (Interface.Define): Apply attributes.
15577 * attribute.cs (Attribute.ApplyAttributes): Added support for
15578 interface attributes.
15580 2002-08-11 Martin Baulig <martin@gnome.org>
15582 * statement.cs (Block.Emit): Only check the "this" variable if we
15583 do not always throw an exception.
15585 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15586 whether the property has a set accessor.
15588 2002-08-11 Martin Baulig <martin@gnome.org>
15590 Added control flow analysis support for structs.
15592 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15593 with control flow analysis turned off.
15594 (IVariable): New interface.
15595 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15596 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15597 (FieldExpr.DoResolve): Resolve the instance expression with flow
15598 analysis turned off and do the definite assignment check after the
15599 resolving when we know what the expression will resolve to.
15601 * expression.cs (LocalVariableReference, ParameterReference):
15602 Implement the new IVariable interface, only call the flow analysis
15603 code if ec.DoFlowAnalysis is true.
15604 (This): Added constructor which takes a Block argument. Implement
15605 the new IVariable interface.
15606 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15607 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15608 This does the definite assignment checks for struct members.
15610 * class.cs (Constructor.Emit): If this is a non-static `struct'
15611 constructor which doesn't have any initializer, call
15612 Block.AddThisVariable() to tell the flow analysis code that all
15613 struct elements must be initialized before control returns from
15616 * statement.cs (MyStructInfo): New public class.
15617 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15618 argument to this indexer. If non-zero, check an individual struct
15619 member, not the whole struct.
15620 (FlowBranching.CheckOutParameters): Check struct members.
15621 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15622 overloaded versions of these methods which take an additional
15623 `int field_idx' argument to check struct members.
15624 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15625 overloaded versions of these methods which take an additional
15626 `string field_name' argument to check struct member.s
15627 (VariableInfo): Implement the IVariable interface.
15628 (VariableInfo.StructInfo): New public property. Returns the
15629 MyStructInfo instance of the variable if it's a struct or null.
15630 (Block.AddThisVariable): New public method. This is called from
15631 Constructor.Emit() for non-static `struct' constructor which do
15632 not have any initializer. It creates a special variable for the
15633 "this" instance variable which will be checked by the flow
15634 analysis code to ensure that all of the struct's fields are
15635 initialized before control returns from the constructor.
15636 (UsageVector): Added support for struct members. If a
15637 variable/parameter is a struct with N members, we reserve a slot
15638 in the usage vector for each member. A struct is considered fully
15639 initialized if either the struct itself (slot 0) or all its
15640 members are initialized.
15642 2002-08-08 Martin Baulig <martin@gnome.org>
15644 * driver.cs (Driver.MainDriver): Only report an error CS5001
15645 if there were no compilation errors.
15647 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15648 `UnsafeContext' property to determine whether the parent is in
15649 unsafe context rather than checking the parent's ModFlags:
15650 classes nested in an unsafe class are unsafe as well.
15652 2002-08-08 Martin Baulig <martin@gnome.org>
15654 * statement.cs (UsageVector.MergeChildren): Distinguish between
15655 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15656 we return. Added test17() and test18() to test-154.cs.
15658 2002-08-08 Martin Baulig <martin@gnome.org>
15660 * typemanager.cs (TypeManager.FilterWithClosure): If we have
15661 Family access, make sure the invoking type isn't a subclass of the
15662 queried type (that'd be a CS1540).
15664 * ecore.cs (Expression.MemberLookup): Added overloaded version of
15665 this method which takes an additional `Type invocation_type'.
15667 * expression.cs (BaseAccess.DoResolve): Use the base type as
15668 invocation and query type.
15669 (MemberAccess.DoResolve): If the lookup failed and we're about to
15670 report a CS0122, try a lookup with the ec.ContainerType - if this
15671 succeeds, we must report a CS1540.
15673 2002-08-08 Martin Baulig <martin@gnome.org>
15675 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15676 (MethodGroupExpr): Implement the IMemberExpr interface.
15678 * expression (MemberAccess.ResolveMemberAccess): No need to have
15679 any special code for MethodGroupExprs anymore, they're now
15682 2002-08-08 Martin Baulig <martin@gnome.org>
15684 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15685 Family, FamANDAssem and FamORAssem permissions.
15686 (TypeManager.IsSubclassOrNestedChildOf): New public method.
15688 2002-08-08 Martin Baulig <martin@gnome.org>
15690 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15691 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15694 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15696 * driver.cs: implemented /resource option to embed managed resources.
15698 2002-08-07 Martin Baulig <martin@gnome.org>
15700 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15701 (FieldBase.HasFieldInitializer): New public property.
15702 (FieldBase.GetInitializerExpression): New public method. Resolves and
15703 returns the field initializer and makes sure it is only resolved once.
15704 (TypeContainer.EmitFieldInitializers): Call
15705 FieldBase.GetInitializerExpression to get the initializer, this ensures
15706 that it isn't resolved multiple times.
15708 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
15709 the resolving process (SimpleName/MemberLookup) that we're currently
15710 emitting a field initializer (which must not access any instance members,
15711 this is an error CS0236).
15713 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15714 argument, if the `IsFieldInitializer' flag is set, we must report and
15715 error CS0236 and not an error CS0120.
15717 2002-08-07 Martin Baulig <martin@gnome.org>
15719 * ecore.cs (IMemberExpr): New public interface.
15720 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15721 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15722 if the expression is an IMemberExpr.
15724 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15725 to be null, implicitly default to `this' if we're non-static in
15726 this case. Simplified the code a lot by using the new IMemberExpr
15727 interface. Also fixed bug #28176 here.
15729 2002-08-06 Martin Baulig <martin@gnome.org>
15731 * cs-parser.jay (SimpleLookup): Removed. We need to create
15732 ParameterReferences during semantic analysis so that we can do a
15733 type-only search when resolving Cast, TypeOf and SizeOf.
15734 (block): Pass the `current_local_parameters' to the Block's
15737 * class.cs (ConstructorInitializer): Added `Parameters parameters'
15738 argument to the constructor.
15739 (ConstructorInitializer.Resolve): Create a temporary implicit
15740 block with the parameters.
15742 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15743 references here if we aren't doing a type-only search.
15745 * statement.cs (Block): Added constructor which takes a
15746 `Parameters parameters' argument.
15747 (Block.Parameters): New public property.
15749 * support.cs (InternalParameters.Parameters): Renamed `parameters'
15750 to `Parameters' and made it public readonly.
15752 2002-08-06 Martin Baulig <martin@gnome.org>
15754 * ecore.cs (Expression.Warning): Made this public as well.
15756 * report.cs (Report.Debug): Print the contents of collections.
15758 2002-08-06 Martin Baulig <martin@gnome.org>
15760 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
15761 used to tell Resolve() which kinds of expressions it may return.
15762 (Expression.Resolve): Added overloaded version of this method which
15763 takes a `ResolveFlags flags' argument. This can be used to tell
15764 Resolve() which kinds of expressions it may return. Reports a
15766 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15767 ResolveFlags.SimpleName.
15768 (Expression.Error118): Added overloaded version of this method which
15769 takes a `ResolveFlags flags' argument. It uses the flags to determine
15770 which kinds of expressions are allowed.
15772 * expression.cs (Argument.ResolveMethodGroup): New public method.
15773 Resolves an argument, but allows a MethodGroup to be returned.
15774 This is used when invoking a delegate.
15776 * TODO: Updated a bit.
15778 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15780 Fixed compilation with csc.
15782 * ecore.cs: Expression.Error made public. Is this correct? Should
15783 Warning be made public too?
15785 * expression.cs: use ea.Location instead of ea.loc.
15786 [FIXME: Filed as bug #28607: MCS must report these errors.]
15788 2002-08-06 Martin Baulig <martin@gnome.org>
15790 * ecore.cs (Expression.loc): Moved the location here instead of
15791 duplicating it in all derived classes.
15792 (Expression.Location): New public property.
15793 (Expression.Error, Expression.Warning): Made them non-static and
15794 removed the location argument.
15795 (Expression.Warning): Added overloaded version which takes an
15796 `int level' argument.
15797 (Expression.Error118): Make this non-static and removed the
15798 expression and location arguments.
15799 (TypeExpr): Added location argument to the constructor.
15801 * expression.cs (StaticCallExpr): Added location argument to
15803 (Indirection, PointerArithmetic): Likewise.
15804 (CheckedExpr, UnCheckedExpr): Likewise.
15805 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15806 (StringPtr): Likewise.
15809 2002-08-05 Martin Baulig <martin@gnome.org>
15811 * expression.cs (BaseAccess.DoResolve): Actually report errors.
15813 * assign.cs (Assign.DoResolve): Check whether the source
15814 expression is a value or variable.
15816 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15817 while resolving the corresponding blocks.
15819 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15820 an error, don't silently return null.
15822 * statement.cs (Block.AddVariable): Do the error reporting here
15823 and distinguish between CS0128 and CS0136.
15824 (Block.DoResolve): Report all unused labels (warning CS0164).
15825 (LabeledStatement): Pass the location to the constructor.
15826 (LabeledStatement.HasBeenReferenced): New property.
15827 (LabeledStatement.Resolve): Set it to true here.
15829 * statement.cs (Return.Emit): Return success even after reporting
15830 a type mismatch error (CS0126 or CS0127), this is what csc does and
15831 it avoids confusing the users with any consecutive errors.
15833 2002-08-05 Martin Baulig <martin@gnome.org>
15835 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15837 * const.cs (Const.LookupConstantValue): Catch circular definitions.
15839 * expression.cs (MemberAccess.DoResolve): Silently return if an
15840 error has already been reported.
15842 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15843 error has already been reported.
15845 2002-08-05 Martin Baulig <martin@gnome.org>
15847 * statement.cs (UsageVector): Only initialize the `parameters'
15848 vector if we actually have any "out" parameters.
15850 2002-08-05 Martin Baulig <martin@gnome.org>
15852 * expression.cs (Binary.ResolveOperator): When combining delegates,
15853 they must have the same type.
15855 2002-08-05 Martin Baulig <martin@gnome.org>
15857 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15858 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15859 work with the ms runtime and we also don't need it: if we're a
15860 PropertyBuilder and not in the `indexer_arguments' hash, then we
15861 are a property and not an indexer.
15863 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15864 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15865 since the latter one doesn't work with the ms runtime.
15867 2002-08-03 Martin Baulig <martin@gnome.org>
15869 Fixed bugs #27998 and #22735.
15871 * class.cs (Method.IsOperator): New public field.
15872 (Method.CheckBase): Report CS0111 if there's already a method
15873 with the same parameters in the current class. Report CS0508 when
15874 attempting to change the return type of an inherited method.
15875 (MethodData.Emit): Report CS0179 if a method doesn't have a body
15876 and it's not marked abstract or extern.
15877 (PropertyBase): New abstract base class for Property and Indexer.
15878 (PropertyBase.CheckBase): Moved here from Property and made it work
15880 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15881 the same so we can reuse it there.
15882 (Property, Indexer): Derive from PropertyBase.
15883 (MethodSignature.inheritable_property_signature_filter): New delegate
15884 to find properties and indexers.
15886 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15887 argument and improved error reporting.
15889 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15890 EmptyReadOnlyParameters and made it a property.
15892 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15893 version of this method which takes a `PropertyInfo indexer'.
15894 (TypeManager.RegisterIndexer): New method.
15896 * class.cs: Added myself as author of this file :-)
15898 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15900 * class.cs: fixed compilation on windoze.
15902 2002-08-03 Martin Baulig <martin@gnome.org>
15904 * interface.cs (Interface.GetInterfaceBases): Check whether all
15905 base interfaces are at least as accessible than the current one.
15907 * class.cs (TypeContainer.GetClassBases): Check whether base types
15908 are at least as accessible than the current type.
15909 (TypeContainer.AsAccessible): Implemented and made non-static.
15910 (MemberBase.CheckParameters): Report errors if the accessibility
15913 * delegate.cs (Delegate.Delegate): The default visibility is
15914 internal for top-level types and private for nested types.
15915 (Delegate.Define): Report errors if the accessibility checks fail.
15917 * enum.cs (Enum.Enum): The default visibility is internal for
15918 top-level types and private for nested types.
15919 (Enum.DefineType): Compute the correct visibility.
15921 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15922 function which takes a `bool is_toplevel' instead of a TypeContainer.
15924 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15927 2002-08-02 Martin Baulig <martin@gnome.org>
15929 * expression.cs (LocalVariableReferenc): Added constructor which
15930 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15931 (LocalVariableReference.IsReadOnly): New property.
15932 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15933 variable is readonly, use our own readonly flag to do this; you can
15934 use the new constructor to get a writable reference to a read-only
15937 * cs-parser.jay (foreach_statement, using_statement): Get a writable
15938 reference to the local variable.
15940 2002-08-01 Miguel de Icaza <miguel@ximian.com>
15942 * rootcontext.cs (ResolveCore): Also include System.Exception
15944 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15945 we reach an EmptyStatement.
15947 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15950 * expression.cs (Binary.ResolveOperator): Check error result in
15953 use brtrue/brfalse directly and avoid compares to null.
15955 2002-08-02 Martin Baulig <martin@gnome.org>
15957 * class.cs (TypeContainer.Define): Define all nested interfaces here.
15958 Fixes bug #28407, added test-155.cs.
15960 2002-08-01 Martin Baulig <martin@gnome.org>
15962 * class.cs (Event.EmitDefaultMethod): Make this work with static
15963 events. Fixes #28311, added verify-3.cs.
15965 2002-08-01 Martin Baulig <martin@gnome.org>
15967 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15968 `is_disposable' fields.
15969 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15970 `hm.is_disposable' if we're using the collection pattern.
15971 (Foreach.EmitCollectionForeach): Use the correct type for the
15972 enumerator's local variable, only emit the try/finally block if
15973 necessary (fixes #27713).
15975 2002-08-01 Martin Baulig <martin@gnome.org>
15977 * ecore.cs (Expression.report118): Renamed to Error118 and made
15980 * statement.cs (Throw.Resolve): Check whether the expression is of
15981 the correct type (CS0118) and whether the type derives from
15982 System.Exception (CS0155).
15983 (Catch.Resolve): New method. Do the type lookup here and check
15984 whether it derives from System.Exception (CS0155).
15985 (Catch.CatchType, Catch.IsGeneral): New public properties.
15987 * typemanager.cs (TypeManager.exception_type): Added.
15989 2002-07-31 Miguel de Icaza <miguel@ximian.com>
15991 * driver.cs: Updated About function.
15993 2002-07-31 Martin Baulig <martin@gnome.org>
15995 Implemented Control Flow Analysis.
15997 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15998 (EmitContext.CurrentBranching): Added.
15999 (EmitContext.StartFlowBranching): Added.
16000 (EmitContext.EndFlowBranching): Added.
16001 (EmitContext.KillFlowBranching): Added.
16002 (EmitContext.IsVariableAssigned): Added.
16003 (EmitContext.SetVariableAssigned): Added.
16004 (EmitContext.IsParameterAssigned): Added.
16005 (EmitContext.SetParameterAssigned): Added.
16006 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
16007 Added control flow analysis stuff here.
16009 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
16010 resolve the expression as lvalue.
16011 (LocalVariableReference.DoResolve): Check whether the variable has
16012 already been assigned.
16013 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
16014 the parameter as assigned here.
16015 (ParameterReference.DoResolve): Check whether the parameter has already
16017 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
16018 expression as lvalue.
16020 * statement.cs (FlowBranching): New class for the flow analysis code.
16021 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
16022 (LabeledStatement.IsDefined): New public property.
16023 (LabeledStatement.AddUsageVector): New public method to tell flow
16024 analyis that the label may be reached via a forward jump.
16025 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
16027 (VariableInfo.Number): New public field. This is used by flow analysis
16028 to number all locals of a block.
16029 (Block.CountVariables): New public property. This is the number of
16030 local variables in this block (including the locals from all parent
16032 (Block.EmitMeta): Number all the variables.
16034 * statement.cs: Added flow analysis support to all classes.
16036 2002-07-31 Martin Baulig <martin@gnome.org>
16038 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
16039 To get debugging messages, compile mcs with /define:MCS_DEBUG and
16040 then use this argument.
16042 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
16044 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
16045 use this to specify /define options.
16047 2002-07-29 Martin Baulig <martin@gnome.org>
16049 * statement.cs (Fixed): Moved all code that does variable lookups
16050 and resolvings from Emit to Resolve.
16052 * statement.cs (For): Moved all code that does variable lookups
16053 and resolvings from Emit to Resolve.
16055 * statement.cs (Using): Moved all code that does variable lookups
16056 and resolvings from Emit to Resolve.
16058 2002-07-29 Martin Baulig <martin@gnome.org>
16060 * attribute.cs (Attribute.Resolve): Explicitly catch a
16061 System.NullReferenceException when creating the
16062 CustromAttributeBuilder and report a different warning message.
16064 2002-07-29 Martin Baulig <martin@gnome.org>
16066 * support.cs (ParameterData.ParameterName): Added method to
16067 get the name of a parameter.
16069 * typemanager.cs (TypeManager.IsValueType): New public method.
16071 2002-07-29 Martin Baulig <martin@gnome.org>
16073 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
16074 is a flag which specifies that it's either ref or out.
16075 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
16076 the out parameter to `out Parameter.Modifier mod', also set the
16077 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
16079 * support.cs (InternalParameters.ParameterModifier): Distinguish
16080 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16081 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16083 * expression.cs (Argument.GetParameterModifier): Distinguish
16084 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
16085 Parameter.Modifier.ISBYREF flag if it's either ref or out.
16087 2002-07-29 Martin Baulig <martin@gnome.org>
16089 * expression.cs (ParameterReference.ParameterReference): Added
16090 `Location loc' argument to the constructor.
16092 * cs-parser.jay: Pass location to ParameterReference.
16094 2002-07-28 Miguel de Icaza <miguel@ximian.com>
16096 * statement.cs (Try): Initialize the location.
16098 * cs-parser.jay: pass location to Try.
16100 * expression.cs (Unary.Reduce): Change the prototype to return
16101 whether a constant fold could be performed or not. The result is
16102 returned in an out parameters. In the case of Indirection and
16103 AddressOf, we want to perform the full tests.
16105 2002-07-26 Miguel de Icaza <miguel@ximian.com>
16107 * statement.cs (Statement.Emit): Flag dead code.
16109 2002-07-27 Andrew Birkett <andy@nobugs.org>
16111 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
16113 2002-07-27 Martin Baulig <martin@gnome.org>
16115 * class.cs (MethodData.Define): Put back call to
16116 TypeManager.AddMethod(), accidentally commented this out.
16118 * report.cs (Debug): New public method to print debugging information,
16119 this is `[Conditional ("DEBUG")]'.
16121 2002-07-26 Martin Baulig <martin@gnome.org>
16123 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
16124 (switch_statement): Push the current_block to the switch_stack and
16125 pop it again when we're done with the switch.
16126 (switch_section): The new block is a child of the current_block.
16127 Fixes bug #24007, added test-152.cs.
16129 2002-07-27 Martin Baulig <martin@gnome.org>
16131 * expression.cs (Invocation.EmitArguments): When calling a varargs
16132 function with only its fixed arguments, we need to pass an empty
16135 2002-07-27 Martin Baulig <martin@gnome.org>
16137 Mono 0.13 has been released.
16139 2002-07-25 Miguel de Icaza <miguel@ximian.com>
16141 * driver.cs: Rename --resource to --linkres, because that is what
16142 we do currently, we dont support --resource yet.
16144 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
16146 2002-07-25 Martin Baulig <martin@gnome.org>
16148 * class.cs (MethodData): New public class. This is a `method builder'
16149 class for a method or one accessor of a Property/Indexer/Event.
16150 (MethodData.GetMethodFlags): Moved here from MemberBase.
16151 (MethodData.ApplyAttributes): Likewise.
16152 (MethodData.ApplyObsoleteAttribute): Likewise.
16153 (MethodData.ApplyConditionalAttribute): Likewise.
16154 (MethodData.ApplyDllImportAttribute): Likewise.
16155 (MethodData.CheckAbstractAndExternal): Likewise.
16156 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
16157 (MethodData.Emit): Formerly known as Method.Emit().
16158 (MemberBase): Moved everything which was specific to a single
16159 accessor/method to MethodData.
16160 (Method): Create a new MethodData and call Define() and Emit() on it.
16161 (Property, Indexer, Event): Create a new MethodData objects for each
16162 accessor and call Define() and Emit() on them.
16164 2002-07-25 Martin Baulig <martin@gnome.org>
16166 Made MethodCore derive from MemberBase to reuse the code from there.
16167 MemberBase now also checks for attributes.
16169 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
16170 (MemberBase.GetMethodFlags): Moved here from class Method and marked
16172 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
16173 `CallingConventions cc' and `Attributes opt_attrs' arguments.
16174 (MemberBase.ApplyAttributes): New virtual method; applies the
16175 attributes to a method or accessor.
16176 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
16177 (MemberBase.ApplyConditionalAttribute): Likewise.
16178 (MemberBase.ApplyDllImportAttribute): Likewise.
16179 (MemberBase.CheckAbstractAndExternal): Likewise.
16180 (MethodCore.ParameterTypes): This is now a property instead of a
16181 method, it's initialized from DoDefineParameters().
16182 (MethodCore.ParameterInfo): Removed the set accessor.
16183 (MethodCore.DoDefineParameters): New protected virtual method to
16184 initialize ParameterTypes and ParameterInfo.
16185 (Method.GetReturnType): We can now simply return the MemberType.
16186 (Method.GetMethodFlags): Override the MemberBase version and add
16187 the conditional flags.
16188 (Method.CheckBase): Moved some code from Define() here, call
16189 DoDefineParameters() here.
16190 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
16191 here to avoid some larger code duplication.
16192 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
16193 ensure that abstract and external accessors don't declare a body.
16195 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
16196 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
16197 lookup in the attribute's parent classes, so we need to abort as soon
16198 as we found the first match.
16199 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
16200 the attribute has no arguments.
16202 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
16205 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16207 * cs-parser.jay: reverted previous patch.
16209 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16211 * cs-parser.jay: fixed bug #22119.
16213 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16215 * attribute.cs: fixed compilation. The error was:
16216 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
16217 be assigned to before control leaves the current method."
16218 [FIXME: Filed as bug #28186: MCS must report this error.]
16220 2002-07-25 Martin Baulig <martin@gnome.org>
16222 * attribute.cs (Attribute.Conditional_GetConditionName): New static
16223 method to pull the condition name ouf of a Conditional attribute.
16224 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
16225 the obsolete message and error flag out of an Obsolete attribute.
16227 * class.cs (Method.GetMethodFlags): New public method to get the
16228 TypeManager.MethodFlags for this method.
16229 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
16231 (Method.Define): Get and apply the Obsolete and Conditional attributes;
16232 if we're overriding a virtual function, set the new private variable
16233 `parent_method'; call the new TypeManager.AddMethod().
16235 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
16236 the MethodBuilder and the Method in a PtrHashtable.
16237 (TypeManager.builder_to_method): Added for this purpose.
16238 (TypeManager.MethodFlags): Added IsObsoleteError.
16239 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
16240 Obsolete and Conditional arguments in MethodBuilders. If we discover
16241 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
16242 the message from the attribute.
16244 2002-07-24 Martin Baulig <martin@gnome.org>
16246 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
16247 preprocessor directives, ensure that the argument to #define/#undef is
16248 exactly one identifier and that it's actually an identifier.
16250 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
16253 2002-07-24 Martin Baulig <martin@gnome.org>
16255 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
16256 initialize it to TypeManager.object_type in the constructor.
16257 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
16258 of the `hm.get_current' method if we're using the collection pattern.
16259 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
16260 for the explicit conversion to make it work when we're using the collection
16261 pattern and the `Current' property has a different return type than `object'.
16264 2002-07-24 Martin Baulig <martin@gnome.org>
16266 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
16267 does not match, but don't report any errors. This method is called in
16268 order for all methods in a MethodGroupExpr until a matching method is
16269 found, so we don't want to bail out if the first method doesn't match.
16270 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
16271 matches, report the 123. Fixes #28070.
16273 2002-07-24 Martin Baulig <martin@gnome.org>
16275 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
16276 TypeManager.TypeToCoreType() to the top of the method so the
16277 following equality checks will work. Fixes #28107.
16279 2002-07-24 Martin Baulig <martin@gnome.org>
16281 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
16282 operand is of type uint, and the other operand is of type sbyte,
16283 short or int, the operands are converted to type long." -
16284 Actually do what this comment already told us. Fixes bug #28106,
16287 2002-07-24 Martin Baulig <martin@gnome.org>
16289 * class.cs (MethodBase): New abstract class. This is now a base
16290 class for Property, Indexer and Event to avoid some code duplication
16291 in their Define() and DefineMethods() methods.
16292 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
16293 generic methods for Define() and DefineMethods().
16294 (FieldBase): Derive from MemberBase, not MemberCore.
16295 (Property): Derive from MemberBase, not MemberCore.
16296 (Property.DefineMethod): Moved all the code from this method to the
16297 new MethodBase.DefineAccessor(), just call it with appropriate
16299 (Property.Define): Call the new Property.DoDefine(), this does some
16300 sanity checks and we don't need to duplicate the code everywhere.
16301 (Event): Derive from MemberBase, not MemberCore.
16302 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
16303 accessors, this will also make them work with interface events.
16304 (Indexer): Derive from MemberBase, not MemberCore.
16305 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
16306 (Indexer.Define): Use the new MethodBase functions.
16308 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
16309 argument to the constructor.
16310 (Interface.FindMembers): Added support for interface events.
16311 (Interface.PopluateEvent): Implemented.
16313 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
16315 2002-07-22 Miguel de Icaza <miguel@ximian.com>
16317 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
16318 but this is required to check for a method name being the same as
16319 the containing class.
16323 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16325 * interface.cs: initialize variable.
16327 2002-07-23 Martin Baulig <martin@gnome.org>
16329 Implemented the IndexerName attribute in interfaces.
16331 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
16332 name if this is an explicit interface implementation.
16333 (Indexer.InterfaceIndexerName): New public variable. If we're
16334 implementing an interface indexer, this is the IndexerName in that
16335 interface. Otherwise, it's the IndexerName.
16336 (Indexer.DefineMethod): If we're implementing interface indexer,
16337 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
16338 and Pending.ImplementIndexer methods.
16339 (Indexer.Define): Also define the PropertyBuilder if we're
16340 implementing an interface indexer and this is neither an explicit
16341 interface implementation nor do the IndexerName match the one in
16344 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
16345 If a method is defined here, then we always need to create a proxy
16346 for it. This is used when implementing interface indexers.
16347 (Pending.IsInterfaceIndexer): New public method.
16348 (Pending.ImplementIndexer): New public method.
16349 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
16350 This is used when implementing interface indexers to define a proxy
16352 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
16353 define a proxy if necessary.
16355 * interface.cs (Interface.IndexerName): New public variable.
16356 (Interface.PopulateIndexer): Set the IndexerName.
16357 (Interface.DefineIndexers): New private method. Populate all the
16358 indexers and make sure their IndexerNames match.
16360 * typemanager.cs (IndexerPropertyName): Added support for interface
16363 2002-07-22 Martin Baulig <martin@gnome.org>
16365 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
16366 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
16367 ret if HasReturnLabel.
16368 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
16371 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
16372 and set the ec.LoopBeginTryCatchLevel.
16373 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
16374 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
16375 the current ec.TryCatchLevel, the branch goes out of an exception
16376 block. In this case, we need to use Leave and not Br.
16378 2002-07-22 Martin Baulig <martin@gnome.org>
16380 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
16381 block unless the block does not always return or it is contained in
16382 another try { ... } catch { ... } block. Fixes bug #26506.
16383 Added verify-1.cs to the test suite.
16385 2002-07-22 Martin Baulig <martin@gnome.org>
16387 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
16388 then we do not always return. Fixes bug #24985.
16390 2002-07-22 Martin Baulig <martin@gnome.org>
16392 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
16393 lookup on a per-class level; ie. walk up the class hierarchy until we
16394 found at least one applicable method, then choose the best among them.
16395 Fixes bug #24463 and test-29.cs.
16397 2002-07-22 Martin Baulig <martin@gnome.org>
16399 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16400 return types of the methods. The return type is not part of the
16401 signature and we must not check it to make the `new' modifier work.
16402 Fixes bug #27999, also added test-147.cs.
16403 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16405 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16406 on the method's return type.
16408 2002-07-21 Martin Baulig <martin@gnome.org>
16410 * assign.cs: Make this work if the rightmost source is a constant and
16411 we need to do an implicit type conversion. Also adding a few more tests
16412 to test-38.cs which should have caught this.
16414 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16415 target in the makefile for this. The makefile.gnu is primarily intended
16416 for end-users who don't want to debug the compiler.
16418 2002-07-21 Martin Baulig <martin@gnome.org>
16420 * assign.cs: Improved the Assign class so it can now handle embedded
16421 assignments (X = Y = Z = something). As a side-effect this'll now also
16422 consume less local variables. test-38.cs now passes with MCS, added
16423 a few new test cases to that test.
16425 2002-07-20 Martin Baulig <martin@gnome.org>
16427 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16428 instructions. Fixes bug #27977, also added test-146.cs.
16430 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16432 * cs-tokenizer.cs: fixed getHex ().
16434 2002-07-19 Martin Baulig <martin@gnome.org>
16436 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16437 not Type.GetType() to lookup the array type. This is needed when
16438 we're constructing an array of a user-defined type.
16439 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16440 single-dimensional arrays, but also for single-dimensial arrays of
16443 2002-07-19 Martin Baulig <martin@gnome.org>
16445 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16446 this function is called, it's not allowed to share LocalBuilders
16447 among ILGenerators.
16449 2002-07-19 Martin Baulig <martin@gnome.org>
16451 * expression.cs (Argument.Resolve): Report an error 118 when trying
16452 to pass a type as argument.
16454 2002-07-18 Martin Baulig <martin@gnome.org>
16456 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16457 Conv_R_Un for the signed `long' type.
16459 2002-07-15 Miguel de Icaza <miguel@ximian.com>
16461 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16462 `expr' for the temporary result, as that will fail if we do
16463 multiple resolves on the same expression.
16465 2002-07-05 Miguel de Icaza <miguel@ximian.com>
16467 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16468 ec.TypeContainer for looking up aliases.
16470 * class.cs (TypeContainer): Remove LookupAlias from here.
16472 * decl.cs (DeclSpace); Move here.
16474 2002-07-01 Miguel de Icaza <miguel@ximian.com>
16476 * class.cs (FindMembers): Only call filter if the constructor
16477 bulider is not null.
16479 Also handle delegates in `NestedTypes' now. Now we will perform
16480 type lookups using the standard resolution process. This also
16483 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16484 This uses Expressions (the limited kind that can be parsed by the
16485 tree) instead of strings.
16487 * expression.cs (ComposedCast.ToString): Implement, used to flag
16488 errors since now we have to render expressions.
16490 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
16493 * ecore.cs (SimpleName.ToString): ditto.
16495 * cs-parser.jay: Instead of using strings to assemble types, use
16496 Expressions to assemble the type (using SimpleName, ComposedCast,
16497 MemberAccess). This should fix the type lookups in declarations,
16498 because we were using a different code path for this.
16500 * statement.cs (Block.Resolve): Continue processing statements
16501 even when there is an error.
16503 2002-07-17 Miguel de Icaza <miguel@ximian.com>
16505 * class.cs (Event.Define): Also remove the `remove' method from
16506 the list of pending items.
16508 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16509 generate more compact code.
16511 2002-07-17 Martin Baulig <martin@gnome.org>
16513 * const.cs (Const.LookupConstantValue): Add support for constant
16514 `unchecked' and `checked' expressions.
16515 Also adding test case test-140.cs for this.
16517 2002-07-17 Martin Baulig <martin@gnome.org>
16519 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16520 check whether mi.ReturnType implements the IEnumerator interface; the
16521 `==' and the IsAssignableFrom() will fail in this situation.
16523 2002-07-16 Ravi Pratap <ravi@ximian.com>
16525 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
16528 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16530 * expression.cs: fixed bug #27811.
16532 2002-07-14 Miguel de Icaza <miguel@ximian.com>
16534 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16535 Molaro: when we are a ref, the value already contains a pointer
16536 value, do not take the address of it.
16538 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16539 * removed mb-parser.jay and mb-tokenizer.cs
16541 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16543 * expression.cs: check against the building corlib void type.
16545 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16547 * ecore.cs: fix for valuetype static readonly fields: when
16548 initializing them, we need their address, not the address of a copy.
16550 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16552 * typemanager.cs: register also enum_type in corlib.
16554 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16556 * class.cs: allow calling this (but not base) initializers in structs.
16558 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16560 * ecore.cs: make sure we compare against the building base types
16563 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16565 * typemanager.cs: fix TypeToCoreType() to handle void and object
16566 (corlib gets no more typerefs after this change).
16568 2002-07-12 Miguel de Icaza <miguel@ximian.com>
16570 * expression.cs (ArrayCreation.EmitArrayArguments): use
16571 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16573 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16574 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
16575 array indexes, the runtime actually forbids them.
16577 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16578 for array arguments here.
16580 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16581 instead of the default for ValueTypes.
16583 (New.DoEmit): Use IsValueType instead of
16584 IsSubclassOf (value_type)
16585 (New.DoResolve): ditto.
16586 (Invocation.EmitCall): ditto.
16588 * assign.cs (Assign): ditto.
16590 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16591 Statements *are* currently doing part of their resolution during
16594 Expressions do always resolve during resolve, but statements are
16595 only required to propagate resolution to their children.
16597 2002-07-11 Miguel de Icaza <miguel@ximian.com>
16599 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16601 (LoadAssembly): Do not add the dll if it is already specified
16603 (MainDriver): Add the System directory to the link path at the end,
16604 after all the other -L arguments.
16606 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16607 wrong opcode for loading bytes and bools (ldelem.i1 instead of
16608 ldelem.u1) and using the opposite for sbytes.
16610 This fixes Digger, and we can finally run it.
16612 * driver.cs (UnixParseOption): Move the option parsing here.
16613 (CSCParseOption): Implement CSC-like parsing of options.
16615 We now support both modes of operation, the old Unix way, and the
16616 new CSC-like way. This should help those who wanted to make cross
16617 platform makefiles.
16619 The only thing broken is that /r:, /reference: and /lib: are not
16620 implemented, because I want to make those have the same semantics
16621 as the CSC compiler has, and kill once and for all the confussion
16622 around this. Will be doing this tomorrow.
16624 * statement.cs (Unsafe.Resolve): The state is checked during
16625 resolve, not emit, so we have to set the flags for IsUnsfe here.
16627 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16629 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16630 not catch the Error_ObjectRefRequired in SimpleName (as it is
16631 possible to have a class/instance variable name that later gets
16632 deambiguated), we have to check this here.
16634 2002-07-10 Ravi Pratap <ravi@ximian.com>
16636 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16637 make static and put into Expression.
16639 (Event.Define): Register the private field of the event with the
16640 TypeManager so that GetFieldFromEvent can get at it.
16642 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16643 keep track of the private field associated with an event which
16646 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16649 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16651 2002-07-10 Miguel de Icaza <miguel@ximian.com>
16653 * expression.cs (Binary.EmitBranchable): this routine emits the
16654 Binary expression in a branchable context. This basically means:
16655 we need to branch somewhere, not just get the value on the stack.
16657 This works together with Statement.EmitBoolExpression.
16659 * statement.cs (Statement.EmitBoolExpression): Use
16662 2002-07-09 Miguel de Icaza <miguel@ximian.com>
16664 * statement.cs (For): Reduce the number of jumps in loops.
16666 (For): Implement loop inversion for the For statement.
16668 (Break): We can be breaking out of a Try/Catch controlled section
16669 (foreach might have an implicit try/catch clause), so we need to
16670 use Leave instead of Br.
16672 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16673 now). If the instace expression supports IMemoryLocation, we use
16674 the AddressOf method from the IMemoryLocation to extract the
16675 address instead of emitting the instance.
16677 This showed up with `This', as we were emitting the instance
16678 always (Emit) instead of the Address of This. Particularly
16679 interesting when This is a value type, as we dont want the Emit
16680 effect (which was to load the object).
16682 2002-07-08 Miguel de Icaza <miguel@ximian.com>
16684 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16686 * statement.cs (Checked): Set the CheckedState during the resolve
16687 process too, as the ConvCast operations track the checked state on
16688 the resolve process, and not emit.
16690 * cs-parser.jay (namespace_member_declaration): Flag that we have
16691 found a declaration when we do. This is used to flag error 1529
16693 * driver.cs: Report ok when we display the help only.
16695 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
16697 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16699 2002-07-04 Miguel de Icaza <miguel@ximian.com>
16701 * cs-tokenizer.cs (define): We also have to track locally the
16702 defines. AllDefines is just used for the Conditional Attribute,
16703 but we also need the local defines for the current source code.
16705 2002-07-03 Miguel de Icaza <miguel@ximian.com>
16707 * statement.cs (While, For, Do): These loops can exit through a
16708 Break statement, use this information to tell whether the
16709 statement is the last piece of code.
16711 (Break): Flag that we break.
16713 * codegen.cs (EmitContexts): New `Breaks' state variable.
16715 2002-07-03 Martin Baulig <martin@gnome.org>
16717 * class.cs (TypeContainer.MethodModifiersValid): Allow override
16718 modifiers in method declarations in structs. Otherwise, you won't
16719 be able to override things like Object.Equals().
16721 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16723 * class.cs (Method, Property, Indexer): Do not allow the public
16724 modifier to be used in explicit interface implementations.
16726 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16727 override modifiers in method declarations in structs
16729 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
16731 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16732 integer or real overflow, report an error
16734 2002-07-02 Martin Baulig <martin@gnome.org>
16736 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16737 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16738 to tell the runtime about our newly created System.Object and
16739 System.ValueType types.
16741 2002-07-02 Miguel de Icaza <miguel@ximian.com>
16743 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16744 struct instead of Ldarg/Starg.
16746 2002-07-02 Martin Baulig <martin@gnome.org>
16748 * expression.cs (Indirection.Indirection): Call
16749 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16751 2002-07-02 Martin Baulig <martin@gnome.org>
16753 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16754 ValueType, call TypeManager.TypeToCoreType() on it.
16755 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16756 the OpCodes.Newarr argument.
16758 2002-07-02 Martin Baulig <martin@gnome.org>
16760 * expression.cs (Invocation.EmitCall): When compiling corlib,
16761 replace all calls to the system's System.Array type to calls to
16762 the newly created one.
16764 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16765 System.Array methods.
16766 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16767 from the system's System.Array type which must be replaced.
16769 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16771 * typemanager.cs: load unverifiable_code_ctor so we can build
16772 corlib using the correct type. Avoid using GetTypeCode() with
16774 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16775 TypeManager.object_type to allow building corlib.
16777 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16779 * ecore.cs: handle System.Enum separately in LoadFromPtr().
16781 2002-07-01 Martin Baulig <martin@gnome.org>
16783 * class.cs: Make the last change actually work, we need to check
16784 whether `ifaces != null' to avoid a crash.
16786 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16788 * class.cs: when we build structs without fields that implement
16789 interfaces, we need to add the interfaces separately, since there is
16790 no API to both set the size and add the interfaces at type creation
16793 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16795 * expression.cs: the dimension arguments to the array constructors
16796 need to be converted if they are a long.
16798 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16800 * class.cs: don't emit ldarg.0 if there is no parent constructor
16801 (fixes showstopper for corlib).
16803 2002-06-29 Martin Baulig <martin@gnome.org>
16805 MCS now compiles corlib on GNU/Linux :-)
16807 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16808 ie. check for MethodImplOptions.InternalCall.
16810 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16811 and TypeManager.attribute_type are null, so we must explicitly check
16812 whether parent is not null to find out whether it's an attribute type.
16813 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16814 and SetBuilder, not only if the property is neither abstract nor external.
16815 This is necessary to set the MethodImplOptions on the accessor methods.
16816 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16817 SetBuilder, see Property.Emit().
16819 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16820 populate "System.Object", "System.ValueType" and "System.Attribute" since
16821 they've already been populated from BootCorlib_PopulateCoreTypes().
16823 2002-06-29 Martin Baulig <martin@gnome.org>
16825 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16826 is the NullLiteral, we also need to make sure that target_type is not
16829 2002-06-29 Martin Baulig <martin@gnome.org>
16831 * rootcontext.cs (RootContext.ResolveCore): We must initialize
16832 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16833 before calling BootstrapCorlib_ResolveDelegate ().
16835 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16837 * statement.cs: fixed build-breaker. All tests passed ok.
16839 2002-06-27 Martin Baulig <martin@gnome.org>
16841 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16842 for System.Decimal when compiling corlib.
16844 2002-06-27 Martin Baulig <martin@gnome.org>
16846 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16847 switch blocks which contain nothing but a default clause.
16849 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
16851 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16853 2002-06-27 Martin Baulig <martin@gnome.org>
16855 * ecore.cs (PropertyExpr.PropertyExpr): Call
16856 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16858 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16859 is already a TypeBuilder.
16861 2002-06-27 Martin Baulig <martin@gnome.org>
16863 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16864 `target_type == TypeManager.array_type', not IsAssignableFrom() in
16865 the "from an array-type to System.Array" case. This makes it work
16866 when compiling corlib.
16868 2002-06-27 Martin Baulig <martin@gnome.org>
16870 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16871 non-static PropertyExpr, set its InstanceExpression. This makes
16872 the `ICollection.Count' property work in System/Array.cs.
16874 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
16876 * driver.cs: Made error handling more consistent. Errors now
16877 tracked by Report class, so many methods which used to return int
16878 now return void. Main() now prints success/failure and
16879 errors/warnings message.
16881 Renamed '--probe' compiler argument to '--expect-error'. Removed
16882 the magic number return values (123 and 124). Now, if the
16883 expected error occurs, the compiler exits with success (exit value
16884 0). If the compilation completes without seeing that particular
16885 error, the compiler exits with failure (exit value 1). The
16886 makefile in mcs/errors has been changed to handle the new behaviour.
16888 * report.cs: Made 'expected error' number a property and renamed
16889 it from 'Probe' to 'ExpectedError'.
16891 * genericparser.cs: Removed error handling support, since it is
16892 now all done by Report class.
16894 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16895 class, so parse() no longer returns an int.
16897 * namespace.cs: Use Report.Error instead of GenericParser.error
16899 2002-06-22 Miguel de Icaza <miguel@ximian.com>
16901 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16902 TypeContainer.AddOperator): At the front of the list put the
16903 explicit implementations, so they get resolved/defined first.
16905 2002-06-21 Miguel de Icaza <miguel@ximian.com>
16907 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16908 interface type is implemented by this TypeContainer. Used during
16909 explicit interface implementation.
16911 (Property.Define, Indexer.Define, Method.Define): Validate that
16912 the given interface in the explicit implementation is one of the
16913 base classes for the containing type.
16915 Also if we are explicitly implementing an interface, but there is
16916 no match in the pending implementation table, report an error.
16918 (Property.Define): Only define the property if we are
16919 not explicitly implementing a property from an interface. Use the
16920 correct name also for those properties (the same CSC uses,
16921 although that is really not needed).
16923 (Property.Emit): Do not emit attributes for explicitly implemented
16924 properties, as there is no TypeBuilder.
16926 (Indexer.Emit): ditto.
16928 Hiding then means that we do not really *implement* a pending
16929 implementation, which makes code fail.
16931 2002-06-22 Martin Baulig <martin@gnome.org>
16933 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16934 the return value of Object.GetType(). [FIXME: we need to do this whenever
16935 we get a type back from the reflection library].
16937 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16939 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16941 2002-06-20 Miguel de Icaza <miguel@ximian.com>
16943 * attribute.cs: Return null if we can not look up the type.
16945 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16946 the interface types found.
16948 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16949 interface types found.
16951 * typemanager.cs (GetInterfaces): Make this routine returns alll
16952 the interfaces and work around the lame differences between
16953 System.Type and System.Reflection.Emit.TypeBuilder in the results
16954 result for GetInterfaces.
16956 (ExpandInterfaces): Given an array of interface types, expand and
16957 eliminate repeated ocurrences of an interface. This expands in
16958 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16961 2002-06-21 Martin Baulig <martin@gnome.org>
16963 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16966 2002-06-21 Martin Baulig <martin@gnome.org>
16968 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
16969 and called with one of the core types, return the corresponding typebuilder for
16972 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16975 2002-06-21 Martin Baulig <martin@gnome.org>
16977 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16978 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16979 (Expression.ConvertReferenceExplicit): Likewise.
16981 * expression.cs (ElementAccess.DoResolve): Likewise.
16982 (ElementAccess.DoResolveLValue): Likewise.
16984 2002-06-10 Martin Baulig <martin@gnome.org>
16986 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16987 add the "value" parameter to the parameter list.
16989 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16992 2002-06-19 Miguel de Icaza <miguel@ximian.com>
16994 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16995 the argument to an int, uint, long or ulong, per the spec. Also
16996 catch negative constants in array creation.
16998 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
17000 * class.cs: do not allow the same interface to appear twice in
17001 the definition list.
17003 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
17005 * ecore.cs: don't use ldlen with System.Array.
17007 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
17009 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
17011 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
17013 * modifiers.cs: produce correct field attributes for protected
17014 internal. Easy fix so miguel can work on ther harder stuff:-)
17016 2002-06-18 Miguel de Icaza <miguel@ximian.com>
17018 * pending.cs: New file. Move the code from class.cs here.
17019 Support clearning the pending flag for all methods (when not doing
17020 explicit interface implementation).
17022 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
17024 * rootcontext.cs: added a couple more types needed to bootstrap.
17026 2002-06-17 Miguel de Icaza <miguel@ximian.com>
17028 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
17029 constructor in the type, instead of any constructor in the type
17030 hierarchy. Thanks to Paolo for finding this bug (it showed up as
17031 a bug in the Mono runtime when applying the params attribute).
17033 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17034 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
17036 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
17038 * expression.cs (Unary.ResolveOperator): Use TypeManager
17039 to resolve the type.
17041 2002-06-13 Ravi Pratap <ravi@ximian.com>
17043 * cs-parser.jay (enum_member_declaration): Pass in the attributes
17046 * enum.cs (AddEnumMember): Add support to store the attributes associated
17047 with each member too.
17049 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
17050 field builders too - this takes care of the enum member case.
17052 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
17054 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
17055 address-of operator on both value types and pointers.
17057 2002-06-10 Martin Baulig <martin@gnome.org>
17059 * interface.cs (Interface.PopulateIndexer): Add the indexer's
17060 PropertyBuilder to the `property_builders' list.
17062 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
17063 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
17064 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
17065 find any indexers which are inherited from an interface.
17067 2002-06-09 Martin Baulig <martin@gnome.org>
17069 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
17070 the same type as the constant if necessary. There's also a test-130.cs
17073 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
17075 * typemanager.cs (TypeManager.ChangeType): Previously known as
17076 Enum.ChangeEnumType().
17078 2002-06-09 Martin Baulig <martin@gnome.org>
17080 * expression.cs (Cast.TryReduce): Added support for consts.
17082 2002-06-08 Ravi Pratap <ravi@ximian.com>
17084 * class.cs (Accessor): Hold attributes information so we can pass
17087 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
17088 Modify to pass in attributes attached to the methods.
17090 (add_accessor_declaration, remove_accessor_declaration): Ditto.
17092 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
17093 to handle the Accessor kind :-)
17095 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
17097 2002-06-08 Martin Baulig <martin@gnome.org>
17099 * expression.cs (Unary.TryReduceNegative): Added support for
17102 2002-06-08 Martin Baulig <martin@gnome.org>
17104 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
17105 name can't be found in the `defined_names' - the caller will do a
17106 MemberLookup in this case and thus find methods in System.Enum
17107 such as Enum.IsDefined().
17109 2002-06-08 Martin Baulig <martin@gnome.org>
17111 * enum.cs (Enum.ChangeEnumType): This is a custom version of
17112 Convert.ChangeType() which works with TypeBuilder created types.
17113 (Enum.LookupEnumValue, Enum.Define): Use it here.
17115 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
17116 `TypeBuilder.BaseType != null' check.
17117 (TypeContainer.FindMembers): Only lookup parent members if we
17118 actually have a parent.
17119 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
17120 (ConstructorInitializer.Resolve): Likewise.
17122 * interface.cs (Interface.FindMembers): Added
17123 `TypeBuilder.BaseType != null' check.
17125 * rootcontext.cs (RootContext.ResolveCore): Added
17126 "System.Runtime.CompilerServices.IndexerNameAttribute" to
17127 classes_second_stage.
17129 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
17130 debug_type and trace_type when compiling with --nostdlib.
17132 2002-06-07 Martin Baulig <martin@gnome.org>
17134 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
17135 (AddField): Set it to true when adding a non-static field.
17136 (DefineType): Use `have_nonstatic_fields' to find out whether we
17137 have non-static fields, not `Fields != null'.
17139 2002-06-02 Miguel de Icaza <miguel@ximian.com>
17141 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
17142 dereferencing a null on the static-field code path)
17144 2002-05-30 Martin Baulig <martin@gnome.org>
17146 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
17147 to take command line arguments. Use reflection to call the new
17148 custom `Initialize' function on the symbol writer and pass it the
17149 command line arguments.
17151 * driver.cs (--debug-args): New command line argument to pass command
17152 line arguments to the symbol writer.
17154 2002-05-28 Miguel de Icaza <miguel@ximian.com>
17156 * assign.cs (DoResolve): Forgot to do the implicit conversion to
17157 the target type for indexers and properties. Thanks to Joe for
17160 2002-05-27 Miguel de Icaza <miguel@ximian.com>
17162 * typemanager.cs (MethodFlags): returns the method flags
17163 (Obsolete/ShouldIgnore) that control warning emission and whether
17164 the invocation should be made, or ignored.
17166 * expression.cs (Invocation.Emit): Remove previous hack, we should
17167 not do this on matching a base type, we should do this based on an attribute
17169 Only emit calls to System.Diagnostics.Debug and
17170 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
17171 on the command line.
17173 * rootcontext.cs: Global settings for tracing and debugging.
17175 * cs-tokenizer.cs (define): New utility function to track
17176 defines. Set the global settings for TRACE and DEBUG if found.
17178 2002-05-25 Ravi Pratap <ravi@ximian.com>
17180 * interface.cs (Populate*): Pass in the TypeContainer as well as
17181 the DeclSpace as parameters so that we can create EmitContexts and
17182 then use that to apply attributes etc.
17184 (PopulateMethod, PopulateEvent, PopulateProperty)
17185 (PopulateIndexer): Apply attributes everywhere.
17187 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
17190 (ApplyAttributes): Update accordingly.
17192 We now apply interface attributes for all members too.
17194 2002-05-26 Miguel de Icaza <miguel@ximian.com>
17196 * class.cs (Indexer.Define); Correctly check if we are explicit
17197 implementation (instead of checking the Name for a ".", we
17198 directly look up if the InterfaceType was specified).
17200 Delay the creation of the PropertyBuilder.
17202 Only create the PropertyBuilder if we are not an explicit
17203 interface implementation. This means that explicit interface
17204 implementation members do not participate in regular function
17205 lookups, and hence fixes another major ambiguity problem in
17206 overload resolution (that was the visible effect).
17208 (DefineMethod): Return whether we are doing an interface
17211 * typemanager.cs: Temporary hack until we get attributes in
17212 interfaces (Ravi is working on that) and we get IndexerName
17213 support in interfaces.
17215 * interface.cs: Register the indexers as properties.
17217 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
17218 warning, I have verified that this is a bug in the .NET runtime
17219 (JavaScript suffers of the same problem).
17221 * typemanager.cs (MemberLookup): When looking up members for
17222 interfaces, the parent of an interface is the implicit
17223 System.Object (so we succeed in searches of Object methods in an
17224 interface method invocation. Example: IEnumerable x; x.ToString
17227 2002-05-25 Miguel de Icaza <miguel@ximian.com>
17229 * class.cs (Event): Events should also register if they do
17230 implement the methods that an interface requires.
17232 * typemanager.cs (MemberLookup); use the new GetInterfaces
17235 (GetInterfaces): The code used to lookup interfaces for a type is
17236 used in more than one place, factor it here.
17238 * driver.cs: Track the errors at the bottom of the file, we kept
17241 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
17242 instance if the method we are calling is static!
17244 2002-05-24 Miguel de Icaza <miguel@ximian.com>
17246 * attribute.cs (ApplyAttributes): Make this function filter out
17247 the IndexerName attribute (as that attribute in reality is never
17248 applied) and return the string constant for the IndexerName
17251 * class.cs (TypeContainer.Emit): Validate that all the indexers
17252 have the same IndexerName attribute, and if so, set the
17253 DefaultName attribute on the class.
17255 * typemanager.cs: The return value might contain other stuff (not
17256 only methods). For instance, consider a method with an "Item"
17257 property and an Item method.
17259 * class.cs: If there is a problem with the parameter types,
17262 2002-05-24 Ravi Pratap <ravi@ximian.com>
17264 * ecore.cs (ImplicitConversionExists): Wrapper function which also
17265 looks at user defined conversion after making a call to
17266 StandardConversionExists - we need this for overload resolution.
17268 * expression.cs : Update accordingly the various method calls.
17270 This fixes 2 bugs filed against implicit user defined conversions
17272 2002-05-22 Miguel de Icaza <miguel@ximian.com>
17274 * statement.cs: Track the result of the assignment.
17276 2002-05-21 Miguel de Icaza <miguel@ximian.com>
17278 * expression.cs (MemberAccess): Improved error reporting for
17279 inaccessible members.
17281 2002-05-22 Martin Baulig <martin@gnome.org>
17283 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
17284 itself with debugging support.
17286 2002-05-22 Martin Baulig <martin@gnome.org>
17288 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
17289 Removed, this isn't needed anymore.
17291 2002-05-20 Martin Baulig <martin@gnome.org>
17293 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
17294 be underlying type for an enum.
17296 2002-05-20 Miguel de Icaza <miguel@ximian.com>
17298 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
17299 that splits out the loading of just the core types.
17301 * rootcontext.cs (ResolveCore): Split the struct resolution in
17302 two, so we can load the enumeration underlying types before any
17305 * expression.cs (Is): Bandaid until we fix properly Switch (see
17306 bug #24985 for details).
17308 * typemanager.cs (ImplementsInterface): The hashtable will contain
17309 a null if there are no interfaces implemented.
17311 2002-05-18 Miguel de Icaza <miguel@ximian.com>
17313 * cs-parser.jay (indexer_declarator): It is fine to have array
17316 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17318 * typemanager.cs: (RegisterBuilder): New function used to register
17319 TypeBuilders that implement interfaces. Since
17320 TypeBuilder.GetInterfaces (as usual) does not work with lame
17322 (AddUserType): register interfaces.
17324 (ImplementsInterface): Use the builder_to_ifaces hash if we are
17325 dealing with TypeBuilder. Also, arrays are showing up as
17326 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
17327 methods can not be invoked on them!
17329 * ecore.cs (ExplicitReferenceConversionExists): Made public.
17330 (ImplicitReferenceConversionExists): Split out from
17331 StandardConversionExists.
17333 * expression.cs (As): We were only implementing one of the three
17334 cases for the as operator. We now implement them all.
17335 (Is): Implement the various other cases for Is as well.
17337 * typemanager.cs (CACHE): New define used to control if we want or
17338 not the FindMembers cache. Seems to have a negative impact on
17339 performance currently
17341 (MemberLookup): Nested types have full acess to
17342 enclosing type members
17344 Remove code that coped with instance/static returns for events, we
17345 now catch this in RealFindMembers.
17347 (RealFindMembers): only perform static lookup if the instance
17348 lookup did not return a type or an event.
17350 2002-05-17 Miguel de Icaza <miguel@ximian.com>
17352 * assign.cs (CompoundAssign): We pass more semantic information
17353 now to Compound Assignments than we did before: now we have all
17354 the information at hand, and now we resolve the target *before* we
17355 do the expression expansion, which allows the "CacheValue" method
17356 to have the effect we intended (before, a [x] += 1 would generate
17357 two differen ArrayAccess expressions from the ElementAccess,
17358 during the resolution process).
17360 (CompoundAssign.DoResolve): Resolve target and original_source here.
17362 2002-05-16 Miguel de Icaza <miguel@ximian.com>
17364 * expression.cs (ArrayAccess): dropped debugging information.
17366 * typemanager.cs: Small bug fix: I was always returning i_members,
17367 instead of one of i_members or s_members (depending on which had
17370 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
17371 method is invoked before any code generation takes place, and it
17372 is a mechanism to inform that the expression will be invoked more
17373 than once, and that the method should use temporary values to
17374 avoid having side effects
17376 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
17378 * ecore.cs (Expression.CacheTemporaries): Provide empty default
17381 * expression.cs (Indirection, ArrayAccess): Add support for
17382 CacheTemporaries in these two bad boys.
17384 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
17385 ldobj or ldind_ref.
17386 (StoreFromPtr): Handle stobj as well.
17388 * expression.cs (UnaryMutator): Share more code.
17390 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
17391 down: I was not tracking the Filter function as well, which
17392 was affecting the results of the cache.
17394 2002-05-15 Miguel de Icaza <miguel@ximian.com>
17396 * attribute.cs: Remove the hack to handle the CharSet property on
17399 2002-05-14 Miguel de Icaza <miguel@ximian.com>
17401 * attribute.cs (DoResolve): More uglyness, we now only try to
17402 resolve the attribute partially, to extract the CharSet
17403 information (only if we are a StructLayout attribute). Otherwise
17405 (GetExtraTypeInfo): Add some code to conditionally kill in the
17406 future this. I am more and more convinced that the .NET
17407 framework has special code to handle the attribute setting on
17410 * expression.cs (IsParamsMethodApplicable): Revert my previous
17411 foreach change here, it was wrong.
17413 2002-05-13 Miguel de Icaza <miguel@ximian.com>
17415 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17416 (pp_expr): do not abort on unknown input, just return.
17417 (eval): abort if there are pending chars.
17419 * attribute.cs (Attribute.Resolve): Positional parameters are
17420 optional. Deal with that case.
17422 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17423 the Ansi/Unicode/Auto information for the type.
17425 (TypeContainer.DefineType): instantiate the EmitContext here, as
17426 we will be using it during the type definition (to resolve
17427 attributes) and during the emit phase.
17429 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17430 to pull type information out of the attributes
17432 (Attribute.Resolve): track the constructor builder, and allow for
17433 multiple invocations (structs and classes will use this).
17435 * ecore.cs (MemberLookupFinal): new version with all the
17436 parameters customizable.
17438 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17439 constructors. Return if the result value is null (as the error
17440 would have been flagged already by MemberLookupFinal)
17442 Do not allow instances of abstract classes or interfaces to be
17445 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17446 We have to compare the assembly property here when dealing with
17447 FamANDAssem and Assembly access modifiers, because we might be
17448 creating an assembly from *modules* (that means that we are not
17449 getting TypeBuilders for types defined in other modules that are
17450 part of this assembly).
17452 (Method.Emit): If the method is marked abstract and has a body,
17455 (TypeContainer.DefineMembers): If both the defined member and the
17456 parent name match are methods, then do not emit any warnings: let
17457 the Method.Define routine take care of flagging warnings. But if
17458 there is a mismatch (method overrides something else, or method is
17459 overriwritten by something, then emit warning).
17461 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17462 set to null, this means `do not check for the return type on the
17465 (Method.Define): set the return type for the method signature to
17466 null, so that we get methods with the same name and parameters and
17467 different return types. This is used to flag warning 114 (you are
17468 hiding a method, and you probably want to use the new/override
17471 * typemanager.cs (MemberLookup): Implemented proper access
17472 control, closing a long standing set of bug reports. The problem
17473 was that the Framework only has two bits: Public and NonPublic,
17474 and NonPublic includes private and protected methods, but we need
17475 to enforce the FamANDAssem, FamOrAssem and Family.
17477 2002-05-11 Miguel de Icaza <miguel@ximian.com>
17479 * statement.cs (GotoCase): Return true: Ammounts to giving up
17480 knowledge on whether we return or not, and letting the other case
17481 be responsible for it.
17483 2002-05-10 Miguel de Icaza <miguel@ximian.com>
17485 * driver.cs: Do not load directories for each file processed, only
17486 do it if there is a pattern.
17488 * ecore.cs: Report readonly assigns here as well, as we might have
17489 been resolved only by MemberAccess.
17491 (SimpleName.SimpleNameResolve): Also be useful for LValue
17492 resolution. We need this to propagate assign to local readonly variables
17494 * typemanager.cs: Use a ptrhashtable for the criteria, because we
17495 do not want to reuse potential criteria memory.
17497 * class.cs (MyEventBuilder): Set reflected_type;
17499 * ecore.cs (Constantify): Added support for constifying bools.
17501 (RootContext.LookupType): Added a cache for values looked up in
17502 the declaration space.
17504 * typemanager.cs (FindMembers): Now is a front-end to
17505 RealFindMembers, and provides a two-level hashtable-based cache to
17508 15% performance improvement: from 22.5 to 19.2 seconds.
17510 * expression.cs (IsParamsMethodApplicable): use foreach.
17511 (Invocation.DoResolve): ditto.
17512 (New.DoResolve): ditto.
17513 (ArrayCreation.DoResolve): ditto.
17515 * ecore.cs (FindMostEncompassingType): use foreach.
17517 * delegate.cs (NewDelegate.DoResolve): Use foreach
17519 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17520 (RemoveMethods): use foreach.
17522 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17523 nested foreach statements instead of for, and also break out of
17524 the inner loop once a match is found.
17526 (Invocation.OverloadResolve): Use foreach, simplify the code.
17528 2002-05-08 Miguel de Icaza <miguel@ximian.com>
17530 * cfold.cs (BinaryFold): During an enumeration evaluation context,
17531 we actually unwrap the expression to allow for extra information
17534 * expression.cs: Use Shr_Un on unsigned operations.
17536 2002-05-08 Ravi Pratap <ravi@ximian.com>
17538 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
17539 applicable operators was not being considered correctly. This closes
17540 the bug Miguel reported.
17542 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17544 * attribute.cs: check that the type derives from System.Attribute
17545 and report the correct error in that case (moved the duplicate code to
17546 its own method, too).
17548 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17550 * attribute.cs: lookup attribute type name as the spec says: first the
17551 bare attribute name and then name + "Attribute" (nant compiles with
17552 mcs after this fix).
17554 2002-05-07 Miguel de Icaza <miguel@ximian.com>
17556 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
17557 Because of the way we parse things, we should try to see if a
17558 UIntConstant can fit in an integer.
17560 2002-05-07 Ravi Pratap <ravi@ximian.com>
17562 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17563 when we are in an explicit context.
17565 (ConvertReferenceExplicit): When converting from Iface type S to Class
17566 T make sure the rules are implemented as an OR.
17568 * parameter.cs (ParameterType): Make it a property for now although the
17569 purpose really isn't anything immediate.
17571 * expression.cs (Is*Applicable): Do better checking on the parameter type
17572 of a ref/out parameter. The ones from the system assemblies are already
17573 marked with the correct type so we don't need to do any correction.
17575 * ecore.cs (StandardConversionExists): Conversion from Interface types to
17576 the object type is standard too so include that.
17578 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17580 * ecore.cs (StandardConversionExists): Augment with missing code:
17581 deal with IntConstant, LongConstants and Enumerations.
17583 * assign.cs: Report the error, instead of failing silently
17585 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17586 typecontainer that they are declared, because the
17587 typecontainer/namespace will have the list of using clauses that
17588 need to be applied.
17590 Assembly Attributes were escaping the normal registration
17593 (EmitCode): Apply attributes within an EmitContext that represents
17594 the container they were declared on.
17596 * cs-parser.jay: Track bases for structs. How did I get this wrong?
17598 2002-05-06 Ravi Pratap <ravi@ximian.com>
17600 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17601 Revamp completely - make much cleaner as we now operate only
17604 (FindMostSpecificSource, FindMostSpecificTarget): New methods
17605 to implement the logic detailed in the spec more correctly.
17607 (UserDefinedConversion): Update accordingly.
17609 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17611 * statement.cs: Return flow analysis information up.
17613 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17616 (token): Do not consume an extra character before calling
17619 2002-05-06 Piers Haken <piersh@friskit.com>
17621 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17623 2002-05-06 Miguel de Icaza <miguel@ximian.com>
17625 * class.cs (Constructor.Emit): Set the IsStatic flag in the
17626 EmitContext during the instance constructor initializer
17627 resolution, to stop access to instance variables.
17629 This is mandated by the spec, last paragraph of the `constructor
17630 initializers' section.
17632 2002-05-05 Miguel de Icaza <miguel@ximian.com>
17634 * cs-parser.jay, class.cs (Accessor): new class used to represent
17635 an accessor (get or set). In the past we used `null' to represent
17636 a missing accessor. But this is ambiguous because there was no
17637 way to tell in abstract indexers/properties if one of them was
17640 Now there is a way of addressing that.
17642 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17643 instead of FindMembers.
17645 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17646 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17648 * attribute.cs: Treat indexers and properties as the same in terms
17649 of applying attributes
17651 * ecore.cs (FindMostEncompassedType): Use statically initialized
17652 EmptyExpressions()s like we do elsewhere to avoid creating useless
17653 objects (and we take this out of the tight loop).
17655 (GetConversionOperators): Move the code to extract the actual
17656 operators to a separate routine to clean things up.
17658 2002-05-04 Miguel de Icaza <miguel@ximian.com>
17660 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17661 events are always registered FieldBuilders.
17663 * class.cs (FieldBase): New class shared by Fields
17665 * delegate.cs: If we are a toplevel delegate, use our full name.
17666 If we are a nested delegate, then only use our tail name.
17668 2002-05-02 Ravi Pratap <ravi@ximian.com>
17670 * expression.cs (IsApplicable): Ensure that we add the "&" to
17671 ref/out types before comparing it with the type of the argument.
17673 (IsParamsMethodApplicable): Ditto.
17675 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
17678 * delegate.cs : Handle the case when we have more than one applicable
17679 method. Flag an error only when we finish checking all.
17681 2002-05-02 Miguel de Icaza <miguel@ximian.com>
17683 * expression.cs: Add support for boolean static initializers.
17685 2002-05-01 Miguel de Icaza <miguel@ximian.com>
17687 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17689 * parameter.cs (ComputeParameterTypes,
17690 ComputeAndDefineParameterTypes): Better error handling: now we
17691 clear the `types' cache if we fail during any of the type lookups.
17692 We also return the status code correctly to our caller
17694 * delegate.cs: If we fail to define a delegate, abort the extra
17697 * expression.cs (Binary.ResolveOperator): for
17698 operator==(object,object) and operator !=(object, object) we also
17699 have to verify that there is an implicit conversion from one to
17702 (ArrayAccess.DoResolve): Array Access can operate on
17705 2002-04-30 Miguel de Icaza <miguel@ximian.com>
17707 * assign.cs (CompoundAssign): A new class used as a "flag" that
17708 the assignment actually is happening as part of a compound
17709 assignment operator.
17711 During compound assignment, a few new rules exist to enable things
17718 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17719 to the type of x) if y is implicitly convertible to the type of x,
17720 and the operator is a builtin operator and the return type of the
17721 operator is explicitly convertible to the type of x.
17723 * rootcontext.cs: Reset warning level to 2. 4 catches various
17724 "interesting" features in mcs, we must clean this up at some
17725 point, but currently am trying to kill other bugs ;-)
17727 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17728 in container classes as well.
17730 * expression.cs (Binary.ResolveOperator): Handle string case
17731 before anything else (as operator overloading does emit an error
17732 before doing anything else).
17734 This code could go away when we move to a table driven model, but
17735 i could not come up with a good plan last night.
17737 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
17739 * typemanager.cs (CSharpName): reimplementation using regex.
17740 * class.cs: added null check for fields in Emit
17741 * rootcontext.cs: set warninglevel to 4
17743 2002-04-29 Miguel de Icaza <miguel@ximian.com>
17745 * typemanager.cs (CSharpName): reimplemented with Lupus
17748 2002-04-28 Miguel de Icaza <miguel@ximian.com>
17750 * statement.cs (If): correclty implement Resolve, because we were
17751 not catching sem errors in there. The same process is needed
17753 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17756 (Statement.Warning_DeadCodeFound): Factorize code.
17757 (While): Report dead code here too.
17759 (Statement): Added Resolve virtual method to allow
17760 for resolution split from the emit code.
17762 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17764 * statement.cs (EmitBoolExpression): No longer try to resolve the
17766 (MakeBoolean): New utility function that resolve, implicitly
17767 converts to boolean and tags the expression.
17770 (If, Do): Implement dead code elimination.
17771 (While): Implement loop inversion
17773 (Do, While, For, If): Resolve the expression prior to calling our
17776 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
17779 - added method Report28 (warning: program has more than one entry point)
17780 - added method IsEntryPoint, implements paragraph 10.1 of the spec
17781 - modified method Method.Define, the part at the end of the method
17783 * rootcontext.cs: added static public Location EntryPointLocation;
17785 * ../errors/cs0028.cs : Add test case for the above warning.
17788 - modified method CSharpName to allow arrays of primitive type to
17789 be printed nicely (e.g. instead of System.Int32[][] it now prints
17791 - added method CSharpSignature: returns the signature of a method
17792 in string format to be used in reporting errors, warnings, etc.
17794 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17797 2002-04-26 Ravi Pratap <ravi@ximian.com>
17799 * delegate.cs (Define): Fix extremely silly bug where I was
17800 setting the type of the 'object' parameter of the BeginInvoke
17801 method to System.IAsyncResult instead of System.Object ;-)
17803 2002-04-26 Miguel de Icaza <miguel@ximian.com>
17805 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17808 (Constructor.Emit): return if we fail to initialize the
17809 constructor. Another door closed!
17811 * expression.cs (New.DoResolve): Improve error message (from -6 to
17812 1501). Use DeclaredOnly lookup to find the exact constructor.
17814 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17815 loop. This is useful.
17817 * cs-parser.jay: Adjust the default parameters so that destructors
17818 have the proper signature.
17820 2002-04-26 Martin Baulig <martin@gnome.org>
17822 * driver.cs (LoadAssembly): If `assembly' contains any characters
17823 which are only valid in path names and not in assembly names
17824 (currently slash, backslash and point), use Assembly.LoadFrom ()
17825 instead of Assembly.Load () on the `assembly' (before iteration
17826 over the link_paths).
17828 2002-04-26 Martin Baulig <martin@gnome.org>
17830 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17832 2002-04-25 Miguel de Icaza <miguel@ximian.com>
17834 * class.cs (Property): use the new typemanager.MemberLookup
17836 (TypeContainer.MemberLookup): Implement using the
17837 TypeManager.MemberLookup now.
17839 * typemanager.cs: Make MemberLookup a function of the TypeManager,
17840 and return MemberInfos, so that these can be used without an
17841 EmitContext (what we had before).
17843 2002-04-24 Miguel de Icaza <miguel@ximian.com>
17845 * expression.cs: Fix the case where the argument to params if the
17846 type of the params. I omitted handling this before. Fixed
17848 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17850 * driver.cs: Call BootCorlib_PopulateCoreType
17852 * class.cs (Property.CheckBase): Check for properties only, not
17855 * interface.cs: Temporary hack: try/catch around the
17856 CustomAttributeBuilder, because I am getting an exception that I
17859 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17860 types whose definitions are required to be there (attributes are
17861 defined before standard types).
17863 Compute definitions as we boot the various types, as they are used
17864 immediately (value_type class will need object_type, but if we do
17865 not initialize object_type, we will pass a null, which will let
17866 the runtime pick the System.Object from the existing corlib, which
17867 is not what we want).
17869 2002-04-22 Patrik Torstensson <totte@labs2.com>
17871 * cs-tokenizer.cs: fixed a number of trim() issues.
17873 2002-04-22 Ravi Pratap <ravi@ximian.com>
17875 * expression.cs (Argument.Type): Ensure that we return the correct
17876 type when we have out or ref parameters [in which case we
17879 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17881 * class.cs (Property, Indexer): Allow extern modifier in there.
17883 * typemanager.cs (InitBaseTypes): Initializes object_type and
17884 value_type, since those will be used early on during the bootstrap
17885 process to compile corlib.
17887 (InitCoreTypes): Move code from here to InitBaseTypes.
17889 2002-04-21 Miguel de Icaza <miguel@ximian.com>
17891 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17892 single-dimension arrays as using the ldlen opcode.
17894 Daniel Lewis discovered this optimization.
17896 * typemanager.cs: Add signature for System.Array::get_Length
17898 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17900 * statement.cs: report the error when the foreach does not apply to an
17901 array nor a collection.
17903 2002-04-19 Miguel de Icaza <miguel@ximian.com>
17905 * expression.cs: Add implicit conversions to the operator ~.
17907 * constant.cs (DecimalConstant.Emit): Emit decimal value.
17909 * typemanager.cs: Locate the decimal constructor.
17911 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17913 * attribute.cs: use the new property of TypeOf.
17914 * expression.cs: added 'get' property around typearg.
17916 These changes fix a build breaker reported by NickD. Is this the
17917 correct way to fix? If not, please, revert my changes and make it
17920 2002-04-17 Miguel de Icaza <miguel@ximian.com>
17922 * attribute.cs: Add support for typeof in attribute invocations.
17923 I am not sure that this is right though.
17925 2002-04-14 Duncan Mak <duncan@ximian.com>
17927 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17928 Binary.Operator.Division case.
17930 2002-04-13 Ravi Pratap <ravi@ximian.com>
17932 * class.cs (DefineType): Ensure that we do a proper check on
17933 attribute types and also register it with the TypeManager.
17935 (TypeContainer.Targets): The default for attribute types is
17936 AttributeTargets.All.
17938 * attribute.cs (ApplyAttributes): Registering the attribute type
17939 is done elsewhere, not when we discover we have a Usage attribute.
17941 2002-04-12 Ravi Pratap <ravi@ximian.com>
17943 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17944 and get rid of is_delegate parameter.
17946 * everywhere : update.
17948 2002-04-12 Ravi Pratap <ravi@ximian.com>
17950 * cs-parser.jay (compilation_unit): Revamp completely to use
17951 some new ideas that I got from Rhys' grammar to solve the problems
17952 with assembly level attributes.
17954 (outer_declaration): New grammar production.
17956 (attribute_sections): Add.
17958 (opt_attributes): Base on attribute_sections
17960 (namespace_declaration): Allow opt_attributes to tackle the case
17961 when we have assembly level attributes - we are clever in this
17964 * attribute.cs (ApplyAttributes): Do not worry about assembly
17965 attributes in the non-global context.
17967 * rootcontext.cs (AddGlobalAttributes): Go back to using this
17968 instead of SetGlobalAttributes.
17970 * class.cs, rootcontext.cs : Ensure we define and generate
17971 attribute types before anything else.
17973 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17974 and flag the new error -20 for the case when the attribute type
17975 does not have valid targets specified. csc does not catch this.
17977 * ../errors/errors.txt : update for error # -20
17979 2002-04-11 Ravi Pratap <ravi@ximian.com>
17981 * support.cs (InternalParameters.ParameterModifier): Do some null
17982 checking and return sane values.
17984 * class.cs (Method.Define): If we are a PInvoke method, ensure
17985 that we are static and extern. Report error # 601
17987 * ../errors/cs0601.cs : Add test case for the above error.
17989 2002-04-07 Ravi Pratap <ravi@ximian.com>
17991 * rootcontext.cs (attribute_types): We need to keep type of
17992 all attribute types separately and emit code for them first.
17994 (RegisterAttribute) : Implement.
17996 * class.cs (DefineType): Check if the current Type is a custom
17997 attribute type and register it accordingly.
17999 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
18000 adding the first attribute twice and rename to
18002 (SetGlobalAttributes): this.
18004 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
18007 * attribute.cs (ApplyAttributes): Take an additional argument telling us
18008 if we are processing global arguments. Hmm, I am unsure of this.
18010 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18012 * expression.cs: added static array of strings to avoid calling
18013 Enum.ToString () for Operator in Binary. Significant recover of
18016 2002-04-10 Miguel de Icaza <miguel@ximian.com>
18018 * class.cs (FindMembers): Allow the Builders of the various
18019 members to be null. If they are skip them. This only happens
18020 during the PInvoke declaration.
18022 2002-04-09 Miguel de Icaza <miguel@ximian.com>
18024 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
18025 failure, so we do not keep going afterwards.
18027 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
18028 wanted to pass `false' as the `is_delegate' argument. If this is
18029 the case, why not use delegate_type == null to mean `is_delegate =
18030 false' and anything else as is_delegate = true.
18032 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
18034 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
18035 code for the section, not the beginning of the tests.
18037 2002-04-08 Miguel de Icaza <miguel@ximian.com>
18039 * cfold.cs: Handle operator + (Enum x, Underlying x)
18041 * expression.cs (Binary): same. Warn about errors where we have
18042 Enum/Enum in operator + as well.
18044 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
18047 - added support for switch(bool)
18048 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
18049 - add TableSwitchEmit() to handle table-based switch statements
18051 2002-04-05 Ravi Pratap <ravi@ximian.com>
18053 * expression.cs (Invocation.OverloadResolve): Factor out code which
18054 does parameter compatibility checking with arguments so that we can
18055 re-use the code even from Delegate.VerifyApplicability
18057 (VerifyArgumentsCompat): Move above code here.
18059 * delegate.cs (VerifyApplicability): Get rid of duplicate code
18060 and instead make a call to the above method.
18062 2002-03-31 Ravi Pratap <ravi@ximian.com>
18064 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
18065 We use it to keep track of classes which are attribute types.
18067 2002-04-02 Miguel de Icaza <miguel@ximian.com>
18069 * delegate.cs (Delegate.Define): Correctly define the types in the
18070 presence of fixed and array parameters.
18072 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
18075 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
18076 include NonPublic after the first iteration.
18078 * class.cs (Indexer.CheckBase): Only check if both parents are
18081 * cs-parser.jay (accessor_body): If empty, set to null.
18083 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
18084 same code path here to resolve constants names that we did have in
18085 MemberAccess.DoResolve. There is too much code duplicated here.
18087 2002-04-01 Miguel de Icaza <miguel@ximian.com>
18089 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
18091 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
18094 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
18095 tokens, numbers and strings.
18097 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
18100 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
18101 asyncronous parameters and the regular parameters.
18103 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
18104 specify the target directory.
18106 * expression.cs: (This.DoResolve): Simplify
18107 (As.Emit): Optimize, do not generate IsInst if the expression is
18108 always of the given type.
18110 (Is.DoResolve): Bug fix, we were reporting both always/never for
18113 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
18114 creating too many unnecessary arrays.
18116 2002-03-31 Miguel de Icaza <miguel@ximian.com>
18118 * class.cs (EmitFieldInitializer): Use Assign expression to assign
18119 fields instead of rolling our own initializer. Takes care of all
18120 implicit conversions, and drops unnecessary static checks/argument.
18122 2002-03-31 Dick Porter <dick@ximian.com>
18124 * driver.cs: use the GetDirectories() return values properly, and
18125 use "/" as path separator.
18127 2002-03-30 Miguel de Icaza <miguel@ximian.com>
18129 * expression.cs (Unary): Optimize - - expr into expr.
18130 (Binary): Optimize a + (-b) into a -b.
18132 * codegen.cs (CodeGen): Made all methods static.
18134 2002-03-29 Miguel de Icaza <miguel@ximian.com>
18138 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
18139 TypeBuilder property.
18141 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
18144 * tree.cs: Removed the various RecordXXXX, and replaced with a
18145 single RecordDecl. Removed all the accessor methods, and just
18146 left a single access point Type
18148 * enum.cs: Rename DefineEnum to DefineType.
18150 * decl.cs: New abstract method `DefineType' used to unify the
18151 Defines for Enumerations, Interfaces, TypeContainers and
18154 (FindType): Moved LookupInterfaceOrClass here. Moved the
18155 LookupBaseClasses method that used to live in class.cs and
18156 interface.cs here, and renamed to FindType.
18158 * delegate.cs: Implement DefineType. Take advantage of the
18159 refactored pattern for locating the parent builder without taking
18160 the parent_builder argument (which we know does not work if we are
18161 nested, and triggering a toplevel definition).
18163 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18165 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
18166 accessibility of a member has changed during override and report
18169 * class.cs (Method.Define, Property.Define): Only complain on
18170 overrides if the method is private, any other accessibility is
18171 fine (and since we just checked the permission is the same, we are
18174 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
18175 and elif are processed always. The other pre-processing
18176 directives are only processed if we are "taking" the path
18178 2002-03-29 Martin Baulig <martin@gnome.org>
18180 * class.cs (Method.Emit): Only emit symbolic debugging info if the
18181 current location is not Null.
18183 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
18184 a separate method so we can profile it.
18186 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
18187 `span.Seconds' are just seconds, but no minutes or hours.
18188 (MainDriver): Profile the CodeGen.SaveSymbols calls.
18190 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18192 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
18193 Remove the gratuitous set of Final:
18195 // If an interface implementation, then we can set Final.
18196 if (((flags & MethodAttributes.Abstract) == 0) &&
18197 implementing.DeclaringType.IsInterface)
18198 flags |= MethodAttributes.Final;
18200 I do not know what I was smoking when I used that.
18203 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
18204 step into fixing the name resolution issues for delegates and
18205 unifying the toplevel name resolution.
18207 2002-03-28 Martin Baulig <martin@gnome.org>
18209 * class.cs (Method.Emit): If we have a symbol writer, call its
18210 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
18211 tell it about the current method.
18213 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
18214 writer that we're going to emit the first byte of IL code for a new
18215 statement (a new source line).
18216 (EmitContext.EmitTopBlock): If we have a symbol writer, call
18217 EmitContext.Mark() before emitting any code.
18219 * location.cs (SymbolDocument): Return null when we're Null.
18221 * statement.cs (Statement): Moved the `Location loc' variable here.
18222 (Statement.EmitBoolExpression): If we have a symbol writer, call
18223 ec.Mark() before emitting any code to tell it that we're at the
18224 beginning of a new statement.
18225 (StatementExpression): Added `Location' argument to the constructor.
18226 (Block): Added public readonly variable `StartLocation' and public
18227 variable `EndLocation'. The latter is to be set using SetEndLocation().
18228 (Block): Added constructor which takes a start and end location.
18229 (Block.SetEndLocation): New method. This sets the end location.
18230 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
18231 local variables we create.
18232 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
18233 each statement and do also mark the begin and end of the block.
18235 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
18236 tell it the current lexer.Location, use Location.Null for the end of the
18238 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
18239 current block, set its end location using SetEndLocation().
18240 (statement_expression): StatementExpression constructor now takes the
18241 lexer.Location as additional argument.
18242 (for_statement, declare_local_variables): Likewise.
18243 (declare_local_variables): When creating a new implicit block, use the
18244 new Block constructor and pass it the lexer.Location.
18246 2002-03-28 Miguel de Icaza <miguel@ximian.com>
18248 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
18249 members also on the parent interfaces recursively.
18251 2002-03-27 Miguel de Icaza <miguel@ximian.com>
18253 * report.cs: Use new formats, since Gonzalo finished the missing
18256 * expression.cs (Binary.ResolveOperator): added missing operator|
18257 operator& and operator^ for bool/bool.
18259 * cs-parser.jay: CheckDef now takes a Location argument that is
18260 used to report errors more precisly (instead of reporting the end
18261 of a definition, we try to track something which is a lot closer
18262 to the source of the problem).
18264 * cs-tokenizer.cs: Track global token use, so we can properly flag
18265 the use of #define/#undef after the first token has been seen.
18267 Also, rename the reportXXXX to Error_DescriptiveName
18269 * decl.cs (DeclSpace.IsTopLevel): Move property here from
18270 TypeContainer, so that Enum and Interface can use this too.
18272 * class.cs (TypeContainer.LookupInterfaceOrClass,
18273 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
18274 `builder' argument. Typically this was used to pass the parent
18275 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
18278 The problem is that a nested class could trigger the definition of
18279 a toplevel class, and the builder would be obviously wrong in that
18282 So we drop this argument, and we compute dynamically the
18283 TypeBuilder/ModuleBuilder (the correct information was available
18284 to us anyways from DeclSpace.Parent)
18286 * interface.cs (Interface.DefineInterface): Drop builder
18287 parameter cleanup like class.cs
18289 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
18292 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
18295 (Try.Emit): Propagate the returns value from the statement.
18297 (Return.Emit): Even if we are leavning
18299 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
18301 * modifiers.cs: Fix the computation of MethodAttributes flags.
18303 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
18305 * driver.cs: allow compilation of files that start with '/'.
18306 Add a default case when checking the argument of --target.
18308 2002-03-25 Miguel de Icaza <miguel@ximian.com>
18310 * interface.cs: Implement the same search algorithm for types in
18311 the interface code.
18313 * delegate.cs: Do not allow multiple definition.
18315 * Recovered ChangeLog that got accidentally amputated
18317 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
18319 * rootcontext.cs: Load manually enum to allow core classes to
18320 contain enumerations.
18322 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
18323 Update to new static methods in TypeManager.
18325 * typemanager.cs (GetMethod, GetConstructor): Use our
18326 implementation of FindMembers to find the members, since during
18327 corlib compilation, the types are TypeBuilders and GetMethod and
18328 GetConstructor do not work.
18330 Make all methods in TypeManager static.
18332 (InitCodeHelpers): Split the functionality from
18333 the InitCodeTypes function.
18335 * driver.cs: Call InitCodeHelpers after we have populated the
18338 * cs-parser.jay (delegate_declaration): we did not used to compute
18339 the delegate name correctly for void delegates.
18341 2002-03-24 Miguel de Icaza <miguel@ximian.com>
18343 * rootcontext.cs (RootContext): Init the interface_resolve_order
18344 and type_container_resolve_order always.
18346 (ResolveCore, BootstrapCorlib_ResolveClass,
18347 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
18348 compiler when compiling with --nostdlib
18350 * class.cs (TypeContainer.DefineType): Check that our parent is
18351 not null. This test is most important when we are bootstraping
18354 * codegen.cs: Split out the symbol writing code.
18356 2002-03-25 Martin Baulig <martin@gnome.org>
18358 * driver.cs (-g): Made -g an alias for --debug.
18360 2002-03-24 Martin Baulig <martin@gnome.org>
18362 * codegen.cs (SymbolWriter): New public variable. Returns the
18363 current symbol writer.
18364 (CodeGen): Added `bool want_debugging_support' argument to the
18365 constructor. If true, tell the ModuleBuild that we want debugging
18366 support and ask it for the ISymbolWriter.
18367 (Save): If we have a symbol writer, call it's Close() method after
18368 saving the assembly.
18370 * driver.c (--debug): New command line argument to create a
18371 debugger information file.
18373 * location.cs (SymbolDocument): New public property. Returns an
18374 ISymbolDocumentWriter object for the current source file or null
18375 if we don't have a symbol writer.
18377 2002-03-21 Miguel de Icaza <miguel@ximian.com>
18379 * driver.cs (LoadAssembly): Correctly return when all the paths
18380 have been tried and not before.
18382 * statement.cs (Switch.Emit): return the actual coverage for this
18383 statement (returns/not-returns)
18385 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
18386 switch of the statement if we are the last switch section. That
18387 kills two problems: try/catch problems (we used to emit an empty
18388 nop at the end) and switch statements where all branches would
18391 2002-03-19 Miguel de Icaza <miguel@ximian.com>
18393 * driver.cs: Add default assemblies (the equivalent to the
18394 Microsoft CSC.RSP file)
18396 * cs-tokenizer.cs: When updating `cols and setting it to zero,
18397 also update tokens_seen and set it to false.
18399 * driver.cs: Implement --recurse for Mike.
18401 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18402 correctly splitting out the paths.
18404 2002-03-18 Miguel de Icaza <miguel@ximian.com>
18406 * interface.cs (Interface.PopulateProperty): Instead of using
18407 `parent' as the declaration space for the set parameters, use
18410 * support.cs (InternalParameters): InternalParameters constructor
18411 takes a DeclSpace instead of a TypeContainer.
18413 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18414 types are being initialized, load the address of it before calling
18417 (New): Provide a mechanism to disable the generation of local
18418 value type temporaries when the caller will be providing us with
18419 an address to store it.
18421 (ArrayCreation.EmitDynamicInitializers): Use it.
18423 2002-03-17 Miguel de Icaza <miguel@ximian.com>
18425 * expression.cs (Invocation.EmitArguments): Only probe for array
18426 property if there is more than one argument. Sorry about that.
18428 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18429 empty param arrays.
18431 * class.cs (Method.LabelParameters): Fix incorrect code path that
18432 prevented the `ParamArrayAttribute' from being applied to the
18435 2002-03-16 Miguel de Icaza <miguel@ximian.com>
18437 * support.cs (ReflectionParameters): Correctly compute whether the
18438 last argument is a params array. Fixes the problem with
18441 * typemanager.cs: Make the assemblies array always be non-null
18442 (empty, but non-null)
18444 * tree.cs (RecordDecl): New function that abstracts the recording
18445 of names. This reports error 101, and provides a pointer to the
18446 previous declaration. Fixes a crash in the compiler.
18448 * cs-parser.jay (constructor_declaration): Update to new grammar,
18449 and provide a constructor_body that can be empty.
18451 2002-03-15 Miguel de Icaza <miguel@ximian.com>
18453 * driver.cs: Add support for --resources.
18455 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18456 Make all types for the various array helper methods be integer.
18458 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18459 CheckState to ConvCast.
18461 (ConvCast): Now it takes a `checked' state argument, to avoid
18462 depending on the emit context for the conversion, and just using
18463 the resolve time setting.
18465 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18466 instead of Invocation.EmitArguments. We do not emit the original
18467 arguments, instead we emit those which have been converted to
18468 unsigned int expressions.
18470 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18472 * codegen.cs: ditto.
18474 * expression.cs (LocalVariableReference): Drop the use of the
18475 Store function that depended on the variable index.
18477 * statement.cs (VariableInfo): Drop the `Idx' property from this
18478 class, as this is not taking into account the indexes for
18479 temporaries tat we generate during the execution, getting the
18482 * class.cs: First emit class initializers, then call the parent
18485 * expression.cs (Binary): Fix opcode emision.
18486 (UnaryMutator.EmitCode): Support checked code generation
18488 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18489 matches for events for both the Static and Instance scans,
18490 pointing to the same element. Fix that.
18492 2002-03-14 Miguel de Icaza <miguel@ximian.com>
18494 * rootcontext.cs (ResolveTree): Always set the
18495 interface_resolve_order, because nested interfaces will be calling
18498 * class.cs (GetInterfaceOrClass): Track the same resolution
18499 process used by TypeManager.LookupType. This fixes the nested
18500 type lookups in class declarations (separate path from
18503 (TypeContainer.DefineType): Also define nested interfaces.
18504 (TypeContainer.RegisterOrder): New public function used to
18505 register the order in which child interfaces need to be closed.
18507 Nested interfaces need to be closed after their parents have been
18510 * interface.cs (InterfaceAttr): Put all the logic for computing
18511 the interface attribute here.
18513 (DefineInterface): Register our interface order with the
18514 RootContext or with the TypeContainer depending on the case.
18516 2002-03-12 Miguel de Icaza <miguel@ximian.com>
18518 * cs-parser.jay: rework foreach statement to work with the new
18519 changes to the policy on SimpleNames.
18521 * report.cs: support Stacktrace on warnings as well.
18523 * makefile: drop --unsafe and /unsafe from the compile.
18525 2002-03-13 Ravi Pratap <ravi@ximian.com>
18527 * ecore.cs (StandardConversionExists): Modify to take an Expression
18528 as the first parameter. Ensure we do null -> reference type conversion
18531 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18532 temporary Expression objects.
18534 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18536 * interface.cs: workaround bug in method overloading resolution
18537 (there is already a bugzilla bug for it).
18539 2002-03-12 Miguel de Icaza <miguel@ximian.com>
18541 We could also solve this problem by having a separate path for
18542 performing type lookups, instead of DoResolve, we could have a
18543 ResolveType entry point, and only participating pieces of the
18544 production (simplename, deref, array) would implement this.
18546 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18547 signal SimpleName to only resolve type names and not attempt to
18548 resolve anything else.
18550 * expression.cs (Cast): Set the flag.
18552 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18554 * class.cs: Only report 108 if there is no `new' modifier.
18556 * cs-parser.jay: rework foreach statement to work with the new
18557 changes to the policy on SimpleNames.
18559 * report.cs: support Stacktrace on warnings as well.
18561 * makefile: drop --unsafe and /unsafe from the compile.
18563 2002-03-11 Miguel de Icaza <miguel@ximian.com>
18565 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18566 lookups here, instead of doing that at parse time. This means
18567 that our grammar will not introduce `LocalVariableReferences' as
18568 expressions at this point. That solves the problem of code like
18572 static void Main ()
18576 This is only half the fix. The full fix requires parameters to
18577 also be handled in this way.
18579 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18580 makes the use more obvious of the DeclSpace. The
18581 ec.TypeContainer.TypeBuilder is now only used to pull the
18582 TypeBuilder for it.
18584 My theory is that I can get rid of the TypeBuilder completely from
18585 the EmitContext, and have typecasts where it is used (from
18586 DeclSpace to where it matters).
18588 The only pending problem is that the code that implements Aliases
18589 is on TypeContainer, and probably should go in DeclSpace.
18591 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18592 lookups here, instead of doing that at parse time. This means
18593 that our grammar will not introduce `LocalVariableReferences' as
18594 expressions at this point. That solves the problem of code like
18598 static void Main ()
18602 This is only half the fix. The full fix requires parameters to
18603 also be handled in this way.
18605 * class.cs (Property.DefineMethod): When implementing an interface
18606 method, set newslot, when implementing an abstract method, do not
18607 set the flag (before we tried never setting it, or always setting
18608 it, which is the difference).
18609 (Indexer.DefineMethod): same.
18610 (Method.DefineMethod): same.
18612 * ecore.cs: Only set the status used flag if we get back a Field.
18614 * attribute.cs: Temporary hack, so Paolo can keep working.
18616 2002-03-08 Ravi Pratap <ravi@ximian.com>
18618 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18619 the unmanaged type in the case we have a MarshalAs attribute.
18621 (Resolve): Handle the case when we are parsing the special MarshalAs
18622 attribute [we need to store the unmanaged type to use later]
18624 * typemanager.cs (marshal_as_attr_type): Built in type for the
18625 MarshalAs Attribute.
18627 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
18628 on parameters and accordingly set the marshalling info.
18630 2002-03-09 Miguel de Icaza <miguel@ximian.com>
18632 * class.cs: Optimizing slightly by removing redundant code after
18633 we switched to the `NoTypes' return value.
18634 (Property.DefineMethod): use NoTypes here too.
18636 This fixes the bug I introduced in my last batch of changes.
18638 2002-03-05 Ravi Pratap <ravi@ximian.com>
18640 * tree.cs (RecordEnum): Add. We now keep track of enums too.
18642 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18643 Enums since those are types too.
18645 * cs-parser.jay (enum_declaration): Record enums as we parse them.
18647 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
18648 thanks to a call during the lookup process.
18650 2002-03-07 Miguel de Icaza <miguel@ximian.com>
18652 * statement.cs (Foreach): Lots of work to accomodate a particular
18653 kind of foreach statement that I had not kept in mind. It is
18654 possible to have foreachs on classes that provide a GetEnumerator
18655 method that return objects that implement the "pattern" for using
18656 a foreach, there is no need to support GetEnumerator
18659 This is needed to compile nant.
18661 * decl.cs: Only report 114 if the member is not `Finalize' and if
18662 the warning level is at least 2.
18664 * class.cs: Moved the compare function from Method to
18667 (MethodSignature.InheritableMemberSignatureCompare): Add new
18668 filter function that is used to extract inheritable methods from a
18671 (Method.Define): Use the new `inheritable_method_signature_filter'
18674 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18677 2002-03-06 Miguel de Icaza <miguel@ximian.com>
18679 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18681 * cs-parser.jay: Add opt_semicolon to the interface declaration.
18683 * expression.cs: Pass location information to
18684 ConvertImplicitStandard.
18686 * class.cs: Added debugging code to track return values from
18689 2002-03-05 Miguel de Icaza <miguel@ximian.com>
18691 * expression.cs (Is.DoResolve): If either side of the `is' is an
18692 interface, do not flag the warning.
18694 * ecore.cs (ImplicitReferenceConversion): We need a separate test
18697 * report.cs: Allow for --fatal to be used with --probe.
18699 * typemanager.cs (NoTypes): Move the definition for the empty Type
18702 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18704 (TypeContainer.DefineProxy): New function used to proxy to parent
18705 implementations when implementing interfaces.
18706 (TypeContainer.ParentImplements): used to lookup if our parent
18707 implements a public function that is required by an interface.
18708 (TypeContainer.VerifyPendingMethods): Hook this up.
18710 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18711 `modules' and `assemblies' arraylists into arrays. We only grow
18712 these are the very early start up of the program, so this improves
18713 the speedof LookupType (nicely measured).
18715 * expression.cs (MakeByteBlob): Replaced unsafe code with
18716 BitConverter, as suggested by Paolo.
18718 * cfold.cs (ConstantFold.Binary): Special case: perform constant
18719 folding of string concatenation, but if either side is a string,
18720 and the other is not, then return null, and let the runtime use
18721 the concatenation on the string plus the object (using
18722 `Object.ToString').
18724 2002-03-04 Miguel de Icaza <miguel@ximian.com>
18726 Constant Folding has been implemented now.
18728 * expression.cs (Unary.Reduce): Do not throw an exception, catch
18729 the error instead on types that are not supported in one's
18732 * constant.cs (Constant and all children): New set of functions to
18733 perform implict and explicit conversions.
18735 * ecore.cs (EnumConstant): Implement the new functions to perform
18736 conversion by proxying to the child expression.
18738 * codegen.cs: (ConstantCheckState): Constant evaluation has its
18739 own separate setting that can not be turned off from the command
18740 line using --unchecked or --checked and is only controlled using
18741 the checked/unchecked statements and expressions. This setting is
18742 used by the constant folder to flag errors.
18744 * expression.cs (CheckedExpr, UncheckedExpr): Set the
18745 ConstantCheckState as well.
18747 During Resolve, they also have to flag the state, because the
18748 constant folder runs completely in the Resolve phase.
18750 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18753 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18755 * cfold.cs: New file, this file contains the constant folder.
18757 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18758 argument to track whether we are using the resulting address to
18759 load or store a value and provide better error messages.
18761 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18762 new AddressOf arguments.
18764 * statement.cs (Foreach.EmitCollectionForeach): Update
18766 * expression.cs (Argument.Emit): Call AddressOf with proper
18767 arguments to track usage.
18769 (New.DoEmit): Call AddressOf with new arguments.
18771 (Unary.Emit): Adjust AddressOf call.
18773 2002-03-01 Ravi Pratap <ravi@ximian.com>
18775 * cs-parser.jay (member_access): Change the case for pre-defined types
18776 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
18779 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18782 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18783 essentially like methods and apply attributes like MethodImplOptions to them too.
18785 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18788 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18789 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18792 * Update code everywhere accordingly.
18794 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18796 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18798 2002-02-28 Ravi Pratap <ravi@ximian.com>
18800 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18801 try performing lookups against those instead of jumping straight into using
18802 the 'using' clauses.
18804 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18806 (LookupType): Perform lookups in implicit parents too.
18808 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18809 sequence as RootContext.LookupType.
18811 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
18812 the various cases of namespace lookups into this method.
18814 2002-03-01 Miguel de Icaza <miguel@ximian.com>
18816 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18817 in positional arguments)
18819 * class.cs (Operator): Update the AllowedModifiers to contain
18822 * cs-parser.jay: Update operator declaration to allow for the
18823 operator body to be empty.
18825 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18828 2002-02-27 Miguel de Icaza <miguel@ximian.com>
18830 * class.cs (Method.Emit): Label parameters.
18832 * driver.cs: Return 1 or 0 as the program exit code.
18834 2002-02-26 Miguel de Icaza <miguel@ximian.com>
18836 * expression.cs: Special case the `null' object when trying to
18837 auto-compute the type, as anything can be explicitly converted to
18840 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18841 spotting this Paolo.
18843 (Expression.ImplicitNumericConversion): Perform comparissions of
18844 the type using the underlying type in the case of an enumeration
18845 rather than using the enumeration type for the compare.
18847 Cope with the underlying == type case, which is not possible to
18850 (Expression.ConvertNumericExplicit): Perform comparissions of
18851 the type using the underlying type in the case of an enumeration
18852 rather than using the enumeration type for the compare.
18854 * driver.cs: If the user does not supply an extension, assume .exe
18856 * cs-parser.jay (if_statement): Rewrote so that we can track the
18857 location for the if statement.
18859 * expression.cs (Binary.ConstantFold): Only concat strings when
18860 the operation is "+", not everything ;-)
18862 * statement.cs (Statement.EmitBoolExpression): Take a location
18864 (If, While, Do): Track location.
18866 * expression.cs (Binary.ResolveOperator): In the object + string
18867 case, I was missing a call to ConvertImplicit
18869 2002-02-25 Ravi Pratap <ravi@ximian.com>
18871 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18872 Location arguments. Ensure we use RootContext.LookupType to do our work
18873 and not try to do a direct Type.GetType and ModuleBuilder.GetType
18875 * interface.cs (PopulateMethod): Handle the type of the parameter being
18878 * expression.cs (Invocation.BetterFunction): Handle the case when we
18879 have a params method with no fixed arguments and a call is made with no
18882 2002-02-25 Miguel de Icaza <miguel@ximian.com>
18884 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18885 the verbatim-string-literal
18887 * support.cs (InternalParameters.ParameterModifier): handle null
18889 (InternalParameters.ParameterType): ditto.
18891 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18892 duplicating the name of the variable parameter.
18893 (GetParameterByName): Fix bug where we were not looking up array
18894 paramters if they were the only present (thanks Paolo!).
18895 (GetParameterInfo): We only have an empty set of types if both
18896 fixed and array are set to null.
18897 (GetParameterInfo-idx): Handle FixedParameter == null
18899 * cs-parser.jay: Handle the case where there is no catch
18900 statements (missing null test).
18902 2002-02-22 Miguel de Icaza <miguel@ximian.com>
18904 * driver.cs (MainDriver): Be conservative on our command line
18907 Catch DirectoryNotFoundException when calling GetFiles.
18909 (SplitPathAndPattern): Used to split the input specification into
18910 a path and a pattern that we can feed to Directory.GetFiles.
18912 2002-02-21 Miguel de Icaza <miguel@ximian.com>
18914 * statement.cs (Fixed): Implement the last case of the Fixed
18915 statement (string handling).
18917 * expression.cs (StringPtr): New class used to return a char * to
18918 a string; Used by the Fixed statement.
18920 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
18922 * expression.cs (Binary.ResolveOperator): Remove redundant
18923 MemberLookup pn parent type.
18924 Optimize union call, we do not need a union if the types are the same.
18925 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18928 Specialize the use of MemberLookup everywhere, instead of using
18929 the default settings.
18931 (StackAlloc): Implement stackalloc keyword.
18933 * cs-parser.jay: Add rule to parse stackalloc.
18935 * driver.cs: Handle /h, /help, /?
18937 * expression.cs (MakeByteBlob): Removed the hacks we had in place
18938 before we supported unsafe code.
18940 * makefile: add --unsafe to the self compilation of mcs.
18942 2002-02-20 Miguel de Icaza <miguel@ximian.com>
18944 * expression.cs (PointerArithmetic): New class that is used to
18945 perform pointer arithmetic.
18946 (Binary.Resolve): Handle pointer arithmetic
18947 Handle pointer comparission.
18948 (ArrayPtr): Utility expression class that is used to take the
18949 address of an array.
18951 (ElementAccess): Implement array access for pointers
18953 * statement.cs (Fixed): Implement fixed statement for arrays, we
18954 are missing one more case before we are done.
18956 * expression.cs (Indirection): Implement EmitAssign and set the
18957 ExprClass to Variable. This allows pointer dereferences to be
18958 treated as variables, and to have values assigned to them.
18960 * ecore.cs (Expression.StoreFromPtr): New utility function to
18961 store values dereferencing.
18963 2002-02-20 Ravi Pratap <ravi@ximian.com>
18965 * expression.cs (Binary.ResolveOperator): Ensure that we are
18966 not trying to operate on a void type - this fixes the reported
18969 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18970 the parent implementation is sealed.
18972 * ../errors/cs0239.cs : Add.
18974 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18976 * typemanager.cs (unverifiable_code_type): Corresponds to
18977 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18978 which have unsafe code in them.
18980 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
18983 2002-02-19 Miguel de Icaza <miguel@ximian.com>
18985 * cs-tokenizer.cs: Add support for @"litreal strings"
18987 Make tokenizer accept pre-processor directives
18988 on any column (remove the old C-like limitation).
18990 * rootcontext.cs (EmitCode): Emit any global attributes.
18991 (AddGlobalAttributes): Used to keep track of assembly attributes.
18993 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18995 * cs-parser.jay: Add support for global attributes.
18997 2002-02-17 Miguel de Icaza <miguel@ximian.com>
18999 * expression.cs (Indirection): New helper class. Unary will
19000 create Indirection classes to be able to implement the
19001 IMemoryLocation interface on it.
19003 2002-02-16 Miguel de Icaza <miguel@ximian.com>
19005 * cs-parser.jay (fixed_statement): reference the right statement.
19007 * statement.cs (Fixed.Emit): Finish implementing the fixed
19008 statement for the &x case.
19010 2002-02-14 Miguel de Icaza <miguel@ximian.com>
19012 * class.cs (Property.Define, Method.Define): Remove newslot when
19015 * modifiers.cs: My use of NewSlot when `Abstract' was set was
19016 wrong. NewSlot should only be used if the `new' keyword is present.
19018 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
19019 locating our system dir. Sorry about this.
19021 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19023 * driver.cs (GetSystemDir): Compute correctly the location of our
19024 system assemblies. I was using the compiler directory instead of
19025 the library directory.
19027 2002-02-13 Ravi Pratap <ravi@ximian.com>
19029 * expression.cs (BetterFunction): Put back in what Miguel commented out
19030 since it is the correct fix. The problem is elsewhere ;-)
19032 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
19033 parameters of the parms method are themselves compatible or not !
19035 (StandardConversionExists): Fix very dangerous bug where we were forgetting
19036 to check that a class implements an interface before saying that an implicit
19037 conversion was allowed. Use ImplementsInterface to do the checking.
19039 2002-02-13 Miguel de Icaza <miguel@ximian.com>
19041 * class.cs (Method.Define): Track whether we are an explicit
19042 implementation or not. And only call DefineMethodOverride if we
19043 are an explicit implementation.
19045 (Property.DefineMethod): Ditto.
19047 2002-02-11 Ravi Pratap <ravi@ximian.com>
19049 * expression.cs (BetterFunction): Catch hideous bug which was
19050 preventing us from detecting ambiguous calls due to implicit casts i.e
19053 2002-01-29 Miguel de Icaza <miguel@ximian.com>
19055 * support.cs (Pair): Remove un-needed method. I figured why I was
19056 getting the error in cs-parser.jay, the variable in a foreach loop
19057 is readonly, and the compiler does not really treat this as a variable.
19059 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
19060 instead of EQUALS in grammar.
19062 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
19064 * expression.cs (Unary.DoResolve): Check whether the argument is
19067 2002-01-28 Miguel de Icaza <miguel@ximian.com>
19069 * support.cs: Api for Pair to set a value. Despite the fact that
19070 the variables are public the MS C# compiler refuses to compile
19071 code that accesses the field if the variable is part of a foreach
19074 * statement.cs (Fixed): Begin implementation of the fixed
19077 (Block.AddVariable): Return the VariableInfo on success and null
19078 on failure instead of true/false.
19080 * cs-parser.jay (foreach): Catch errors on variables already
19081 defined (we were ignoring this value before) and properly unwind
19082 the block hierarchy
19084 (fixed_statement): grammar for the fixed statement.
19086 2002-01-25 Miguel de Icaza <miguel@ximian.com>
19088 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
19089 pointer types to be incretemented.
19091 (SizeOf): Implement.
19093 * cs-parser.jay (pointer_member_access): Implement
19094 expr->IDENTIFIER production.
19096 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
19097 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
19100 (Unary): Implement indirection.
19102 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
19103 use in non-unsafe context).
19105 (SimpleName.DoResolve): Check for pointers in field access on safe
19108 (Expression.LoadFromPtr): Factor the load-indirect code in this
19109 function. This was duplicated in UnboxCast and ParameterReference
19111 2002-01-24 Miguel de Icaza <miguel@ximian.com>
19113 * expression.cs (ComposedCast): report an error if a pointer cast
19114 is used in a safe region.
19116 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
19117 pointer type casts in unsafe context.
19119 * codegen.cs (EmitContext): Set up IsUnsafe.
19121 * cs-parser.jay (non_expression_type): Add productions for pointer
19124 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
19125 code. We should not use force into static mode if the method is
19126 not virtual. Fixes bug in MIS
19128 * statement.cs (Do.Emit, While.Emit, For.Emit,
19129 Statement.EmitBoolExpression): Add support to Do and While to
19130 propagate infinite loop as `I do return' semantics.
19132 Improve the For case to also test for boolean constants.
19134 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
19135 to the list of attributes we can add.
19137 Remove `EmitContext' argument.
19139 * class.cs (Method.Define): Apply parameter attributes.
19140 (Constructor.Define): Apply parameter attributes.
19141 (MethodCore.LabelParameters): Move here the core of labeling
19144 * support.cs (ReflectionParameters.ParameterModifier,
19145 InternalParameters.ParameterModifier): Use IsByRef on the type and
19146 only return the OUT bit for these parameters instead of in/out/ref
19149 This is because I miss-understood things. The ParameterInfo.IsIn
19150 and IsOut represent whether the parameter has the [In] and [Out]
19153 2002-01-22 Miguel de Icaza <miguel@ximian.com>
19155 * ecore.cs (FieldExpr.Emit): Release temporaries.
19157 * assign.cs (LocalTemporary.Release): new function.
19159 * codegen.cs (EmitContext.GetTemporaryStorage,
19160 EmitContext.FreeTemporaryStorage): Rework the way we deal with
19161 temporary storage. Now we can "put back" localbuilders when we
19164 2002-01-21 Miguel de Icaza <miguel@ximian.com>
19166 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
19167 need to make a copy of the variable to generate verifiable code.
19169 2002-01-19 Miguel de Icaza <miguel@ximian.com>
19171 * driver.cs: Compute dynamically the system directory.
19173 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
19174 Slower, but more generally useful. Used by the abstract
19175 registering implementation.
19177 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
19178 the rules for the special rule on Type/instances. First check if
19179 we have the same name, and if so, try that special static path
19180 rather than the instance path.
19182 2002-01-18 Miguel de Icaza <miguel@ximian.com>
19184 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
19187 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
19188 Enum, ValueType, Delegate or Array for non-corlib compiles.
19190 * cs-tokenizer.cs: Catch long identifiers (645)
19192 * typemanager.cs (IndexerPropetyName): Ravi never tested this
19195 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
19196 fix, we were returning too early, so we were not registering
19197 pending methods from abstract classes.
19199 Do not register pending methods if the class is abstract.
19201 * expression.cs (Conditional.DoResolve): Report circular implicit
19202 conversions when we neecd to compute it for conditional
19205 (Is.DoResolve): If the expression is always of the provided type,
19206 flag warning 183. If the expression can not ever be of the
19207 provided type flag warning 184.
19209 * class.cs: Catch 169 as well.
19211 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
19214 2002-01-18 Nick Drochak <ndrochak@gol.com>
19216 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
19218 2002-01-17 Miguel de Icaza <miguel@ximian.com>
19220 * interface.cs: (PopulateMethod): Check for pointers being defined
19221 only if the unsafe context is active.
19222 (PopulateProperty): ditto.
19223 (PopulateIndexer): ditto.
19225 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
19226 specified. If pointers are present, make sure that they are
19227 present in an unsafe context.
19228 (Constructor, Constructor.Define): ditto.
19229 (Field, Field.Define): ditto.
19230 (Property, Property.Define): ditto.
19231 (Event, Event.Define): ditto.
19233 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
19234 hashtable if there are classes or structs defined.
19236 * expression.cs (LocalVariableReference.DoResolve): Simplify this
19237 code, as the constant resolution moved.
19239 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
19240 the metadata, so we can flag error 133.
19242 * decl.cs (MemberCore.UnsafeOK): New function to test that a
19243 pointer is being declared in an unsafe context.
19245 2002-01-16 Miguel de Icaza <miguel@ximian.com>
19247 * modifiers.cs (Modifiers.Check): Require a Location argument.
19248 Report error 227 for Unsafe use.
19250 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
19252 * statement.cs (For.Emit): If the test is null, then report that
19253 we do `return', as we wont reach anything afterwards.
19255 (Switch.SwitchGoverningType): Track the expression that matched
19258 * driver.cs: Allow negative numbers as an error code to flag.
19260 * cs-parser.jay: Handle 1551.
19262 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
19264 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19266 * cs-parser.jay: Report 1518 (type declaration can only contain
19267 class, struct, interface, enum or delegate)
19269 (switch_label): Report 1523 (keywords `case' or `default' must
19272 (opt_switch_sections): Report 1522 (empty switch)
19274 * driver.cs: Report 1515 (response file specified multiple times)
19275 Report 1516 (Source file specified multiple times).
19277 * expression.cs (Argument.Resolve): Signal 1510
19279 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
19280 access not allowed in static code)
19282 2002-01-11 Ravi Pratap <ravi@ximian.com>
19284 * typemanager.cs (IsPointerType): Utility method which we are going
19287 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
19288 the object type, so we take care of that.
19290 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
19292 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
19293 added to non-params parameters :-)
19295 * typemanager.cs (CSharpName): Include 'void' type too.
19297 (void_ptr_type): Include in the set of core types.
19299 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
19302 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
19305 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
19306 completely forgotten about it.
19308 2002-01-10 Ravi Pratap <ravi@ximian.com>
19310 * cs-parser.jay (pointer_type): Add. This begins our implementation
19311 of parsing rules for unsafe code.
19313 (unsafe_statement): Implement.
19315 (embedded_statement): Modify to include the above.
19317 * statement.cs (Unsafe): Implement new class for unsafe blocks.
19319 * codegen.cs (EmitContext.InUnsafe): Add. This determines
19320 if the current context is an unsafe one.
19322 * cs-parser.jay (local_variable_pointer_type): Since local variable types
19323 are handled differently, we need separate rules for them.
19325 (local_variable_declaration): Update to use local_variable_pointer_type
19326 to allow variable declarations of unmanaged pointer types.
19328 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
19329 in unsafe contexts.
19331 * ../errors/cs0214.cs : Add.
19333 2002-01-16 Nick Drochak <ndrochak@gol.com>
19335 * makefile: remove 'response' file when cleaning.
19337 2002-01-15 Miguel de Icaza <miguel@ximian.com>
19339 * cs-parser.jay: Report 1524.
19341 2002-01-14 Miguel de Icaza <miguel@ximian.com>
19343 * typemanager.cs (RegisterMethod): drop checking if we have
19344 registered this from here
19346 2002-01-12 Miguel de Icaza <miguel@ximian.com>
19348 * class.cs (Method.EmitDestructor): Implement calling our base
19351 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
19352 value of InFinally.
19354 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
19355 this routine and will wrap the call in a try/catch block. Deal
19358 2002-01-11 Miguel de Icaza <miguel@ximian.com>
19360 * ecore.cs (Expression.MemberLookup): instead of taking a
19361 parameter `same_type' that was used to tell whether we could
19362 access private members we compute our containing type from the
19365 (FieldExpr): Added partial support for volatile fields. This does
19366 not work for volatile fields exposed from assemblies, as I can not
19367 figure out how to extract the modreq from it.
19369 Updated all the source files to use this.
19371 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
19372 because it is referenced by MemberLookup very often.
19374 2002-01-09 Ravi Pratap <ravi@ximian.com>
19376 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
19377 TypeBuilder.GetCustomAttributes to retrieve what we need.
19379 Get rid of redundant default_member_attr_type as this is the same as
19380 default_member_type which already exists.
19382 * interface.cs, attribute.cs : Update accordingly.
19384 2002-01-08 Miguel de Icaza <miguel@ximian.com>
19386 * typemanager.cs: Enable IndexerPropertyName again. It does not
19387 work for TYpeBuilders though. Ravi, can you please fix this?
19389 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
19391 * expression.cs (Argument.Emit): Handle the case of ref objects
19392 being passed to ref functions;
19394 (ParameterReference.EmitLoad): Loads the content of the pointer
19395 without dereferencing.
19397 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19399 * cs-tokenizer.cs: Implemented the pre-processing expressions.
19401 2002-01-08 Ravi Pratap <ravi@ximian.com>
19403 * class.cs (Indexer.DefineMethod): Incorporate the interface
19404 type in the name of the method if we are doing explicit interface
19407 * expression.cs (ConversionExists): Remove as it is completely obsolete.
19409 (BetterConversion): Fix extremely trivial bug where we were referring to
19410 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19413 * ../errors/bug16.cs : Add although we have fixed it.
19415 2002-01-07 Miguel de Icaza <miguel@ximian.com>
19417 * expression.cs (BaseIndexer): Begin implementation.
19419 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19421 * cs-parser.jay (indexer_declarator): Use qualified_identifier
19422 production directly to remove a shift/reduce, and implement
19423 explicit interface implementation.
19425 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19426 after a floating point suffix.
19428 * expression.cs (DoNumericPromotions): Improved the conversion for
19429 uint/uint. If we have a constant, we avoid doing a typecast to a
19432 * class.cs (Indexer): Implement explicit interface implementation
19435 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19437 * class.cs: make the default instance constructor public and hidebysig.
19439 2001-01-03 Ravi Pratap <ravi@ximian.com>
19441 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19442 so we can call it from elsewhere.
19444 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19445 we emit it internally if the class has a defined indexer; otherwise the user
19446 emits it by decorating the class definition with the DefaultMemberAttribute.
19448 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19449 attribute is not used on a type which defines an indexer.
19451 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19452 character when we skip whitespace.
19454 * ../errors/cs0646.cs : Add.
19456 2002-01-03 Miguel de Icaza <miguel@ximian.com>
19458 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19461 * makefile: Add practical target `mcs3.exe' which builds the third
19462 generation compiler.
19464 * expression.cs (New): Fix structures constructor calling.
19466 * class.cs (Property, Method, Indexer): Emit Final flag on the
19467 method if we are an interface implementation and we are not
19470 * ecore.cs (PropertyExpr): New public field `IsBase', tells
19471 whether this property is referencing a `base' method.
19473 * expression.cs (Invocation.EmitCall): take an extra argument:
19474 is_base, this is used to determine whether the `call' or
19475 `callvirt' opcode should be used.
19478 * delegate.cs: update EmitCall.
19480 * class.cs (Method.Define): Set NewSlot for the cases where we are
19481 not implementing an interface method.
19483 (Property.Define): ditto.
19485 2002-01-02 Miguel de Icaza <miguel@ximian.com>
19487 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19488 'r'. Allows mcs to parse itself fully.
19490 2002-01-02 Ravi Pratap <ravi@ximian.com>
19492 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19493 of the number of initializers that require the InitializeArray method.
19495 (CheckIndices): Store the Expression in all cases - not the plain value. Also
19496 update the above field where necessary.
19498 (MakeByteBlob): Update accordingly.
19500 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
19503 (EmitDynamicInitializers): Update in accordance with the new optimization.
19505 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19506 same OpCode applies.
19508 * cs-parser.jay : Fix some glaring errors I introduced.
19510 2002-01-01 Ravi Pratap <ravi@ximian.com>
19512 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19513 so that we can check for name clashes there too.
19515 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19516 for interface indexers.
19518 * interfaces.cs (Define): Emit the default member attribute.
19520 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19521 variable was being referred to while setting the value ;-)
19523 2002-01-01 Miguel de Icaza <miguel@ximian.com>
19525 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19526 byte-by-byte information when we know the data is zero.
19528 Make the block always a multiple of 4, because
19529 DefineInitializedData has a bug.
19531 * assign.cs: Fix, we should assign from the temporary, not from
19534 * expression.cs (MakeByteBlob): Fix my incorrect code.
19536 2001-12-31 Miguel de Icaza <miguel@ximian.com>
19538 * typemanager.cs (EnumToUnderlying): This function is used to get
19539 the underlying type from an enumeration, because it does not
19542 * constant.cs: Use the I4_S form for values between -128 and 127.
19544 * statement.cs (Block.LookupLabel): Looks up a label.
19545 (Block): Drop support for labeled blocks.
19547 (LabeledStatement): New kind of statement that represents a label
19550 (Goto): Finally implement this bad boy.
19552 * cs-parser.jay: Update to reflect new mechanism to implement
19555 2001-12-30 Miguel de Icaza <miguel@ximian.com>
19557 * codegen.cs (EmitContext.This): a codegen property that keeps the
19558 a single instance of this instead of creating many different this
19561 * delegate.cs (Delegate.DoResolve): Update to use the property;
19563 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19565 * expression.cs (BaseAccess.DoResolve): Ditto.
19567 2001-12-29 Ravi Pratap <ravi@ximian.com>
19569 * typemanager.cs (methodimpl_attr_type): Add to hold the type
19570 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19572 (InitCoreTypes): Update accordingly.
19574 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19575 so we can quickly store the state.
19577 (ApplyAttributes): Set the correct implementation flags
19578 for InternalCall methods.
19580 2001-12-29 Miguel de Icaza <miguel@ximian.com>
19582 * expression.cs (EmitCall): if a method is not virtual, then do
19583 not use callvirt on it.
19585 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19586 user defined stuff) requires the use of stobj, which takes an
19587 address on the stack instead of an array and an index. So emit
19588 the Ldelema operation for it.
19590 (EmitStoreOpcode): Use stobj for valuetypes.
19592 (UnaryMutator.EmitCode): Use the right 1 value depending on
19593 whether we are dealing with int64/uint64, float or doubles.
19595 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19596 constructors that I implemented last night.
19598 (Constructor.IsDefault): Fix to work properly for static
19601 * cs-parser.jay (CheckDef): report method signature errors.
19602 Update error number 103 to be 132.
19604 * decl.cs: New AdditionResult enumeration value: MethodExists.
19605 Although we do this check for methods later on in the semantic
19606 analysis, catching repeated default constructors is so easy that
19607 we catch these here.
19609 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19612 (ParameterReference.EmitAssign, Emit): handle
19615 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19616 (ArrayAccess.EmitStoreOpcode): ditto.
19618 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19620 * expression.cs (MakeByteBlob): Complete all the missing types
19621 (uint, short, ushort, byte, sbyte)
19623 * class.cs: Only init instance field initializers on instance
19626 Rename `constructors' to instance_constructors.
19628 (TypeContainer.AddConstructor): Only add constructors to the list
19629 if it is not static.
19631 Make sure that we handle default_static_constructor independently
19632 everywhere where we handle instance_constructors
19634 2001-12-28 Miguel de Icaza <miguel@ximian.com>
19636 * class.cs: Do not lookup or create a base initializer for a
19637 static constructor.
19639 (ConstructorInitializer.Resolve): use the proper type to lookup
19642 * cs-parser.jay: Report error 1585 (modifiers between type and name).
19644 * enum.cs, interface.cs: Remove CloseType, this is taken care by
19647 * decl.cs: CloseType is now an virtual method, the default
19648 implementation just closes this type.
19650 2001-12-28 Ravi Pratap <ravi@ximian.com>
19652 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19653 to PreserveSig by default. Also emit HideBySig on such methods.
19655 Basically, set the defaults to standard values.
19657 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19658 argument, if candidate is better, it can't be worse than the best !
19660 (Invocation): Re-write bits to differentiate between methods being
19661 applicable in their expanded form and their normal form - for params
19664 Get rid of use_standard everywhere as only standard conversions are allowed
19665 in overload resolution.
19667 More spec conformance.
19669 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19671 * driver.cs: Add --timestamp, to see where the compiler spends
19674 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19675 `this' in static code.
19677 (SimpleName.DoResolve): Implement in terms of a helper function
19678 that allows static-references to be passed upstream to
19681 (Expression.ResolveWithSimpleName): Resolve specially simple
19682 names when called by MemberAccess to implement the special
19685 (Expression.ImplicitReferenceConversion): Handle conversions from
19686 Null to reference types before others, as Null's type is
19689 * expression.cs (Invocation.EmitCall): Handle the special case of
19690 calling methods declared on a reference type from a ValueType
19691 (Base classes System.Object and System.Enum)
19693 (MemberAccess.Resolve): Only perform lookups on Enumerations if
19694 the left hand side is a TypeExpr, not on every enumeration.
19696 (Binary.Resolve): If types are reference types, then do a cast to
19697 object on operators != and == of both arguments.
19699 * typemanager.cs (FindMembers): Extract instance and static
19700 members if requested.
19702 * interface.cs (PopulateProperty): Use void_type instead of null
19703 as the return type for the setter method.
19705 (PopulateIndexer): ditto.
19707 2001-12-27 Ravi Pratap <ravi@ximian.com>
19709 * support.cs (ReflectionParameters): Fix minor bug where we
19710 were examining the wrong parameter for the ParamArray attribute.
19712 Cope with requests for the type of the parameter at position
19713 greater than the params parameter's. We now return the element
19714 type of the params array as that makes more sense.
19716 * expression.cs (Invocation.IsParamsMethodApplicable): Update
19717 accordingly as we no longer have to extract the element type
19720 (Invocation.OverloadResolve): Update.
19722 2001-12-27 Miguel de Icaza <miguel@ximian.com>
19724 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19725 against IEnumerator, test whether the return value is a descendant
19726 of the IEnumerator interface.
19728 * class.cs (Indexer.Define): Use an auxiliary method to implement
19729 the other bits of the method definition. Begin support for
19730 explicit interface implementation.
19732 (Property.DefineMethod): Use TypeManager.void_type instead of null
19733 for an empty return value.
19735 2001-12-26 Miguel de Icaza <miguel@ximian.com>
19737 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19738 dealing with a FieldExpr which is composed of a FieldBuilder, in
19739 the code path we did extract the constant, but we should have
19740 obtained the underlying value to be able to cast it (otherwise we
19741 end up in an infinite loop, this is what Ravi was running into).
19743 (ArrayCreation.UpdateIndices): Arrays might be empty.
19745 (MemberAccess.ResolveMemberAccess): Add support for section
19746 14.5.4.1 that deals with the special case of E.I when E is a type
19747 and something else, that I can be a reference to a static member.
19749 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19750 handle a particular array type to create byte blobs, it is just
19751 something we dont generate byteblobs for.
19753 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19756 * location.cs (Push): remove the key from the hashtable that we
19757 are about to add. This happens for empty files.
19759 * driver.cs: Dispose files after we have parsed them.
19761 (tokenize): new function that only runs the tokenizer on its
19762 input, for speed testing.
19764 2001-12-26 Ravi Pratap <ravi@ximian.com>
19766 * class.cs (Event.Define): Define the private field only if there
19767 are no accessors defined.
19769 * expression.cs (ResolveMemberAccess): If there is no associated
19770 field with the event, that means we have an event defined with its
19771 own accessors and we should flag error cs0070 since transforming
19772 ourselves into a field is not valid in that case.
19774 * ecore.cs (SimpleName.DoResolve): Same as above.
19776 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19777 and charset to sane values.
19779 2001-12-25 Ravi Pratap <ravi@ximian.com>
19781 * assign.cs (DoResolve): Perform check on events only if they
19782 are being accessed outside the declaring type.
19784 * cs-parser.jay (event_declarations): Update rules to correctly
19785 set the type of the implicit parameter etc.
19787 (add_accessor, remove_accessor): Set current local parameters.
19789 * expression.cs (Binary): For delegate addition and subtraction,
19790 cast the return value from the method into the appropriate delegate
19793 2001-12-24 Ravi Pratap <ravi@ximian.com>
19795 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19796 of these as the workaround is unnecessary.
19798 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19799 delegate data - none of that is needed at all.
19801 Re-write bits to extract the instance expression and the delegate method
19804 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
19807 * attribute.cs (ApplyAttributes): New method to take care of common tasks
19808 of attaching attributes instead of duplicating code everywhere.
19810 * everywhere : Update code to do attribute emission using the above method.
19812 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19814 * expression.cs (IsParamsMethodApplicable): if there are not
19815 parameters, return immediately.
19817 * ecore.cs: The 0 literal can be implicity converted to an enum
19820 (SimpleName.DoResolve): First lookup the type, then lookup the
19823 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19824 want to get its address. If the InstanceExpression is not
19825 addressable, store the result in a temporary variable, then get
19828 * codegen.cs: Only display 219 errors on warning level or above.
19830 * expression.cs (ArrayAccess): Make it implement the
19831 IMemoryLocation interface.
19833 (Binary.DoResolve): handle the operator == (object a, object b)
19834 and operator != (object a, object b) without incurring into a
19835 BoxedCast (because 5 != o should never be performed).
19837 Handle binary enumerator operators.
19839 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19840 value type, otherwise use Ldelem_ref.
19842 Use precomputed names;
19844 (AddressOf): Implement address of
19846 * cs-parser.jay (labeled_statement): Fix recursive block
19847 addition by reworking the production.
19849 * expression.cs (New.DoEmit): New has a special case:
19851 If we are dealing with a ValueType, we have a few
19852 situations to deal with:
19854 * The target of New is a ValueType variable, that is
19855 easy, we just pass this as the variable reference
19857 * The target of New is being passed as an argument,
19858 to a boxing operation or a function that takes a
19861 In this case, we need to create a temporary variable
19862 that is the argument of New.
19865 2001-12-23 Ravi Pratap <ravi@ximian.com>
19867 * rootcontext.cs (LookupType): Check that current_type is not null before
19868 going about looking at nested types.
19870 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19871 not implement the IAssignMethod interface any more.
19873 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19874 where we tranform them into FieldExprs if they are being resolved from within
19875 the declaring type.
19877 * ecore.cs (SimpleName.DoResolve): Do the same here.
19879 * assign.cs (DoResolve, Emit): Clean up code considerably.
19881 * ../errors/bug10.cs : Add.
19883 * ../errors/cs0070.cs : Add.
19885 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19887 * assign.cs : Get rid of EventIsLocal everywhere.
19889 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19891 * ecore.cs (ConvertIntLiteral): finished the implementation.
19893 * statement.cs (SwitchLabel): Convert the value we are using as a
19894 key before looking up the table.
19896 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19898 * codegen.cs (EmitTopBlock): Require a Location argument now.
19900 * cs-parser.jay (constructor_declarator): We need to setup
19901 current_local_parameters before we parse the
19902 opt_constructor_initializer, to allow the variables to be bound
19903 to the constructor arguments.
19905 * rootcontext.cs (LookupType): First lookup nested classes in our
19906 class and our parents before we go looking outside our class.
19908 * expression.cs (ConstantFold): Extract/debox the values at the
19911 * rootcontext.cs (EmitCode): Resolve the constants first before we
19912 resolve the types. This is not really needed, but it helps debugging.
19914 * statement.cs: report location.
19916 * cs-parser.jay: pass location to throw statement.
19918 * driver.cs: Small bug fix.
19920 * report.cs: Updated format to be 4-zero filled digits.
19922 2001-12-22 Ravi Pratap <ravi@ximian.com>
19924 * expression.cs (CheckIndices): Fix minor bug where the wrong
19925 variable was being referred to ;-)
19927 (DoEmit): Do not call EmitStaticInitializers when the
19928 underlying type is System.Object.
19930 2001-12-21 Ravi Pratap <ravi@ximian.com>
19932 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19933 and do the usual workaround for SRE.
19935 * class.cs (MyEventBuilder.EventType): New member to get at the type
19936 of the event, quickly.
19938 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19940 * assign.cs (Assign.DoResolve): Handle the case when the target
19941 is an EventExpr and perform the necessary checks.
19943 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19946 (SimpleName.MemberStaticCheck): Include check for EventExpr.
19948 (EventExpr): Set the type in the constructor itself since we
19949 are meant to be born fully resolved.
19951 (EventExpr.Define): Revert code I wrote earlier.
19953 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19954 instance expression is null. The instance expression is a This in that case
19955 or a null, depending on whether it is a static method or not.
19957 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19958 refers to more than one method.
19960 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19961 and accordingly flag errors.
19963 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19965 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19967 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19969 * location.cs (ToString): Provide useful rutine.
19971 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19973 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19974 objects, return the actual integral boxed.
19976 * statement.cs (SwitchLabel): define an ILLabel for each
19979 (Switch.CheckSwitch): If the value is a Literal, extract
19980 the underlying literal.
19982 Also in the unused hashtable we had, add the SwitchLabel so we can
19983 quickly look this value up.
19985 * constant.cs: Implement a bunch of new constants. Rewrite
19986 Literal based on this. Made changes everywhere to adapt to this.
19988 * expression.cs (Expression.MakeByteBlob): Optimize routine by
19989 dereferencing array only once, and also copes with enumrations.
19991 bytes are two bytes wide, not one.
19993 (Cast): Perform constant conversions.
19995 * ecore.cs (TryImplicitIntConversion): Return literals instead of
19996 wrappers to the literals here.
19998 * expression.cs (DoNumericPromotions): long literals can converted
19999 to ulong implicity (this is taken care of elsewhere, but I was
20000 missing this spot).
20002 * ecore.cs (Expression.Literalize): Make the return type Literal,
20003 to improve type checking.
20005 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
20007 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20009 * literal.cs: Revert code from ravi that checked the bounds. The
20010 bounds are sane by the definition of the type itself.
20012 * typemanager.cs: Fix implementation of ImplementsInterface. We
20013 need to actually look up in our parent hierarchy for interfaces
20016 * const.cs: Use the underlying type for enumerations
20018 * delegate.cs: Compute the basename for the delegate creation,
20019 that should fix the delegate test case, and restore the correct
20020 Type Lookup semantics in rootcontext
20022 * rootcontext.cs: Revert Ravi's last patch. The correct way of
20023 referencing a nested type with the Reflection API is using the "+"
20026 * cs-parser.jay: Do not require EOF token at the end.
20028 2001-12-20 Ravi Pratap <ravi@ximian.com>
20030 * rootcontext.cs (LookupType): Concatenate type names with
20031 a '.' instead of a '+' The test suite passes again.
20033 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
20034 field of the enumeration.
20036 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
20037 the case when the member is an EventExpr.
20039 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
20040 static has an associated instance expression.
20042 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
20044 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
20046 * class.cs (Event.Define): Register event and perform appropriate checks
20049 We define the Add and Remove methods even if the use provides none because
20050 in that case, we provide default implementations ourselves.
20052 Define a private field of the type of the event. This is done by the CSC compiler
20053 and we should be doing it too ;-)
20055 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
20056 More methods we use in code we generate.
20058 (multicast_delegate_type, delegate_type): Two separate types since the distinction
20061 (InitCoreTypes): Update accordingly for the above.
20063 * class.cs (Event.Emit): Generate code for default accessors that we provide
20065 (EmitDefaultMethod): Do the job in the above.
20067 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
20070 2001-12-20 Miguel de Icaza <miguel@ximian.com>
20072 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
20073 builders even if we were missing one.
20075 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
20076 pass the Basename as our class name instead of the Name. The
20077 basename will be correctly composed for us.
20079 * parameter.cs (Paramters): Now takes a Location argument.
20081 * decl.cs (DeclSpace.LookupType): Removed convenience function and
20082 make all the code call directly LookupType in RootContext and take
20083 this chance to pass the Location information everywhere.
20085 * Everywhere: pass Location information.
20087 2001-12-19 Miguel de Icaza <miguel@ximian.com>
20089 * class.cs (Constructor.Define): Updated way of detecting the
20090 length of the parameters.
20092 (TypeContainer.DefineType): Use basename as the type name for
20095 (TypeContainer.Define): Do not recursively define types here, as
20096 definition is taken care in order by the RootContext.
20098 * tree.cs: Keep track of namespaces in a per-file basis.
20100 * parameter.cs (Parameter.ComputeSignature): Update to use
20103 (Parameters.GetSignature): ditto.
20105 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
20106 instead of a TypeContainer.
20108 (Interface.SemanticAnalysis): Use `this' instead of our parent to
20109 resolve names. Because we need to be resolve in our context, not
20112 * driver.cs: Implement response files.
20114 * class.cs (TypeContainer.DefineType): If we are defined, do not
20115 redefine ourselves.
20117 (Event.Emit): Emit the code for add/remove handlers.
20118 (Event.Define): Save the MethodBuilders for add/remove.
20120 * typemanager.cs: Use pair here too.
20122 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
20123 DictionaryEntry requires the first argument to be non-null.
20125 (enum_declaration): Compute full name for registering the
20128 (delegate_declaration): Instead of using
20129 formal_parameter_list, use opt_formal_parameter_list as the list
20132 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
20133 (EventParsing): New property that controls whether `add' and
20134 `remove' are returned as tokens or identifiers (for events);
20136 2001-12-19 Ravi Pratap <ravi@ximian.com>
20138 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
20139 use MyEventBuilder only and let it wrap the real builder for us.
20141 (MyEventBuilder): Revamp constructor etc.
20143 Implement all operations that we perform on EventBuilder in precisely the same
20146 (FindMembers): Update to use the EventBuilder member.
20148 (Event.Emit): Update accordingly.
20150 2001-12-18 Ravi Pratap <ravi@ximian.com>
20152 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
20153 by calling the appropriate methods.
20155 (GetCustomAttributes): Make stubs as they cannot possibly do anything
20158 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
20160 2001-12-17 Ravi Pratap <ravi@ximian.com>
20162 * delegate.cs (Delegate.Populate): Check that the return type
20163 and various parameters types are indeed accessible.
20165 * class.cs (Constructor.Define): Same here.
20167 (Field.Define): Ditto.
20169 (Event.Define): Ditto.
20171 (Operator.Define): Check that the underlying Method defined itself
20172 correctly - so it's MethodBuilder should not be null.
20174 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
20175 expression happens to be null.
20177 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
20178 members but as of now we don't seem to be able to do anything really useful with it.
20180 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
20181 not the EventBuilder.
20183 2001-12-18 Miguel de Icaza <miguel@ximian.com>
20185 * cs-tokenizer.cs: Add support for defines.
20186 Add support for #if, #elif, #else, #endif
20188 (eval_var): evaluates a variable.
20189 (eval): stubbed for evaluating functions.
20191 * cs-parser.jay: Pass the defines information
20193 * driver.cs: Add --define command line option.
20195 * decl.cs: Move MemberCore here.
20197 Make it the base class for DeclSpace. This allows us to catch and
20198 report 108 and 109 for everything now.
20200 * class.cs (TypeContainer.Define): Extract all the members
20201 before populating and emit the warning 108 (new keyword required
20202 to override) instead of having each member implement this.
20204 (MemberCore.Define): New abstract method, we will be using this in
20205 the warning reporting engine in Populate.
20207 (Operator.Define): Adjust to new MemberCore protocol.
20209 * const.cs (Const): This does not derive from Expression, it is a
20210 temporary object we use to create fields, it is a MemberCore.
20212 * class.cs (Method.Define): Allow the entry point to be in a
20215 * driver.cs: Rewrite the argument handler to clean it up a bit.
20217 * rootcontext.cs: Made it just an auxiliary namespace feature by
20218 making everything static.
20220 * driver.cs: Adapt code to use RootContext type name instead of
20223 * delegate.cs: Remove RootContext argument.
20225 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
20228 * class.cs (Event.Define): The lookup can fail.
20230 * cs-tokenizer.cs: Begin implementation of pre-procesor.
20232 * expression.cs: Resolve the this instance before invoking the code.
20234 2001-12-17 Miguel de Icaza <miguel@ximian.com>
20236 * cs-parser.jay: Add a production in element_access that allows
20237 the thing to become a "type" reference. This way we can parse
20238 things like "(string [])" as a type.
20240 Note that this still does not handle the more complex rules of
20244 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
20246 * ecore.cs: (CopyNewMethods): new utility function used to
20247 assemble the list of methods from running FindMembers.
20249 (MemberLookup): Rework FindMembers so that
20251 2001-12-16 Miguel de Icaza <miguel@ximian.com>
20253 * class.cs (TypeContainer): Remove Delegates who fail to be
20256 * delegate.cs (Populate): Verify that we dont get null return
20257 values. TODO: Check for AsAccessible.
20259 * cs-parser.jay: Use basename to emit error 574 (destructor should
20260 have the same name as container class), not the full name.
20262 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
20263 possible representation.
20265 Also implements integer type suffixes U and L.
20267 2001-12-15 Miguel de Icaza <miguel@ximian.com>
20269 * expression.cs (ArrayCreation.DoResolve): We need to do the
20270 argument resolution *always*.
20272 * decl.cs: Make this hold the namespace. Hold the root context as
20274 (LookupType): Move here.
20276 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
20278 * location.cs (Row, Name): Fixed the code, it was always returning
20279 references to the first file.
20281 * interface.cs: Register properties defined through interfaces.
20283 * driver.cs: Add support for globbing on the command line
20285 * class.cs (Field): Make it derive from MemberCore as well.
20288 2001-12-15 Ravi Pratap <ravi@ximian.com>
20290 * class.cs (Event::Define): Check that the type of the event is a delegate
20291 type else flag error #66.
20293 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
20296 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
20297 values of EntryPoint, CharSet etc etc.
20299 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
20301 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
20302 be null and we should ignore this. I am not sure if this is really clean. Apparently,
20303 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
20304 which needs this to do its work.
20306 * ../errors/cs0066.cs : Add.
20308 2001-12-14 Miguel de Icaza <miguel@ximian.com>
20310 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
20313 * class.cs: (MethodSignature.MethodSignature): Removed hack that
20314 clears out the parameters field.
20315 (MemberSignatureCompare): Cleanup
20317 (MemberCore): New base class used to share code between MethodCore
20320 (RegisterRequiredImplementations) BindingFlags.Public requires
20321 either BindingFlags.Instace or Static. Use instance here.
20323 (Property): Refactored code to cope better with the full spec.
20325 * parameter.cs (GetParameterInfo): Return an empty array instead
20328 * class.cs (Property): Abstract or extern properties have no bodies.
20330 * parameter.cs (GetParameterInfo): return a zero-sized array.
20332 * class.cs (TypeContainer.MethodModifiersValid): Move all the
20333 method modifier validation to the typecontainer so we can reuse
20334 this on properties.
20336 (MethodCore.ParameterTypes): return an empty sized array of types.
20338 (Property.Define): Test property modifier validity.
20340 Add tests for sealed/override too.
20342 (Method.Emit): abstract or extern methods have no bodies.
20344 2001-12-14 Ravi Pratap <ravi@ximian.com>
20346 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
20349 (Method::Define, ::Emit): Modify accordingly.
20351 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
20353 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
20355 * makefile: Pass in /unsafe.
20357 2001-12-13 Miguel de Icaza <miguel@ximian.com>
20359 * class.cs (MakeKey): Kill routine.
20361 * class.cs (TypeContainer.Define): Correctly define explicit
20362 method implementations (they require the full interface name plus
20365 * typemanager.cs: Deply the PtrHashtable here and stop using the
20366 lame keys. Things work so much better.
20368 This of course broke everyone who depended on `RegisterMethod' to
20369 do the `test for existance' test. This has to be done elsewhere.
20371 * support.cs (PtrHashtable): A hashtable that avoid comparing with
20372 the object stupid Equals method (because, that like fails all over
20373 the place). We still do not use it.
20375 * class.cs (TypeContainer.SetRequiredInterface,
20376 TypeContainer.RequireMethods): Killed these two routines and moved
20377 all the functionality to RegisterRequiredImplementations.
20379 (TypeContainer.RegisterRequiredImplementations): This routine now
20380 registers all the implementations required in an array for the
20381 interfaces and abstract methods. We use an array of structures
20382 which can be computed ahead of time to reduce memory usage and we
20383 also assume that lookups are cheap as most classes will not
20384 implement too many interfaces.
20386 We also avoid creating too many MethodSignatures.
20388 (TypeContainer.IsInterfaceMethod): Update and optionally does not
20389 clear the "pending" bit if we find that there are problems with
20392 (TypeContainer.VerifyPendingMethods): Update to report errors of
20393 methods that look like implementations but are not.
20395 (TypeContainer.Define): Add support for explicit interface method
20398 2001-12-12 Miguel de Icaza <miguel@ximian.com>
20400 * typemanager.cs: Keep track of the parameters here instead of
20401 being a feature of the TypeContainer.
20403 * class.cs: Drop the registration of parameters here, as
20404 InterfaceMethods are also interface declarations.
20406 * delegate.cs: Register methods with the TypeManager not only with
20407 the TypeContainer. This code was buggy.
20409 * interface.cs: Full registation here.
20411 2001-12-11 Miguel de Icaza <miguel@ximian.com>
20413 * expression.cs: Remove reducer for binary expressions, it can not
20416 * const.cs: Put here the code that used to go into constant.cs
20418 * constant.cs: Put here the code for constants, this is a new base
20419 class for Literals.
20421 * literal.cs: Make Literal derive from Constant.
20423 2001-12-09 Miguel de Icaza <miguel@ximian.com>
20425 * statement.cs (Return.Emit): Report error 157 if the user
20426 attempts to return from a finally block.
20428 (Return.Emit): Instead of emitting a return, jump to the end of
20431 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20432 LocalBuilder to store the result of the function. ReturnLabel is
20433 the target where we jump.
20436 2001-12-09 Radek Doulik <rodo@ximian.com>
20438 * cs-parser.jay: remember alias in current namespace
20440 * ecore.cs (SimpleName::DoResolve): use aliases for types or
20443 * class.cs (LookupAlias): lookup alias in my_namespace
20445 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20447 (LookupAlias): lookup alias in this and if needed in parent
20450 2001-12-08 Miguel de Icaza <miguel@ximian.com>
20454 * rootcontext.cs: (ModuleBuilder) Made static, first step into
20455 making things static. I need this to avoid passing the
20456 TypeContainer when calling ParameterType.
20458 * support.cs (InternalParameters.ParameterType): Remove ugly hack
20459 that did string manipulation to compute the type and then call
20460 GetType. Use Parameter.ParameterType instead.
20462 * cs-tokenizer.cs: Consume the suffix for floating values.
20464 * expression.cs (ParameterReference): figure out whether this is a
20465 reference parameter or not. Kill an extra variable by computing
20466 the arg_idx during emission.
20468 * parameter.cs (Parameters.GetParameterInfo): New overloaded
20469 function that returns whether a parameter is an out/ref value or not.
20471 (Parameter.ParameterType): The type of the parameter (base,
20472 without ref/out applied).
20474 (Parameter.Resolve): Perform resolution here.
20475 (Parameter.ExternalType): The full type (with ref/out applied).
20477 * statement.cs (Using.Emit, Using.EmitExpression): Implement
20478 support for expressions on the using statement.
20480 2001-12-07 Miguel de Icaza <miguel@ximian.com>
20482 * statement.cs (Using.EmitLocalVariableDecls): Split the
20483 localvariable handling of the using statement.
20485 (Block.EmitMeta): Keep track of variable count across blocks. We
20486 were reusing slots on separate branches of blocks.
20488 (Try.Emit): Emit the general code block, we were not emitting it.
20490 Check the type of the declaration to be an IDisposable or
20491 something that can be implicity converted to it.
20493 Emit conversions if required.
20495 * ecore.cs (EmptyExpression): New utility class.
20496 (Expression.ImplicitConversionExists): New utility function.
20498 2001-12-06 Miguel de Icaza <miguel@ximian.com>
20500 * statement.cs (Using): Implement.
20502 * expression.cs (LocalVariableReference): Support read only variables.
20504 * statement.cs: Remove the explicit emit for the Leave opcode.
20505 (VariableInfo): Add a readonly field.
20507 2001-12-05 Miguel de Icaza <miguel@ximian.com>
20509 * ecore.cs (ConvCast): new class used to encapsulate the various
20510 explicit integer conversions that works in both checked and
20511 unchecked contexts.
20513 (Expression.ConvertNumericExplicit): Use new ConvCast class to
20514 properly generate the overflow opcodes.
20516 2001-12-04 Miguel de Icaza <miguel@ximian.com>
20518 * statement.cs: The correct type for the EmptyExpression is the
20519 element_type, not the variable type. Ravi pointed this out.
20521 2001-12-04 Ravi Pratap <ravi@ximian.com>
20523 * class.cs (Method::Define): Handle PInvoke methods specially
20524 by using DefinePInvokeMethod instead of the usual one.
20526 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20527 above to do the task of extracting information and defining the method.
20529 2001-12-04 Ravi Pratap <ravi@ximian.com>
20531 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20532 of the condition for string type.
20534 (Emit): Move that here.
20536 (ArrayCreation::CheckIndices): Keep string literals in their expression
20539 (EmitDynamicInitializers): Handle strings appropriately.
20541 2001-12-04 Miguel de Icaza <miguel@ximian.com>
20543 * codegen.cs (EmitContext): Replace multiple variables with a
20544 single pointer to the current Switch statement.
20546 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20549 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20553 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20556 (Foreach.Emit): Foreach on arrays was not setting
20557 up the loop variables (for break/continue).
20559 (GotoCase): Semi-implented.
20561 2001-12-03 Ravi Pratap <ravi@ximian.com>
20563 * attribute.cs (CheckAttribute): Handle system attributes by using
20564 Attribute.GetAttributes to examine information we need.
20566 (GetValidPlaces): Same here.
20568 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20570 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20572 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20574 (Method::Define): Set appropriate flags if we have a DllImport attribute.
20576 (Method::Emit): Handle the case when we are a PInvoke method.
20578 2001-12-03 Miguel de Icaza <miguel@ximian.com>
20580 * expression.cs: Use ResolveWithSimpleName on compound names.
20582 2001-12-02 Ravi Pratap <ravi@ximian.com>
20584 * constant.cs (EmitConstant): Make sure we resolve the associated expression
20585 before trying to reduce it.
20587 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20589 * constant.cs (LookupConstantValue): Implement.
20591 (EmitConstant): Use the above in emitting the constant.
20593 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20594 that are user-defined by doing a LookupConstantValue on them.
20596 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20599 2001-11-29 Miguel de Icaza <miguel@ximian.com>
20601 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20603 (BaseAccess.DoResolve): Implement.
20605 (MemberAccess.DoResolve): Split this routine into a
20606 ResolveMemberAccess routine that can be used independently
20608 2001-11-28 Miguel de Icaza <miguel@ximian.com>
20610 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20611 As that share bits of the implementation. Is returns a boolean,
20612 while As returns the Type that is being probed.
20614 2001-12-01 Ravi Pratap <ravi@ximian.com>
20616 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20617 instead of a Literal - much easier.
20619 (EnumInTransit): Remove - utterly useless :-)
20621 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20623 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20625 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20626 chain when we have no associated expression.
20628 2001-11-30 Ravi Pratap <ravi@ximian.com>
20630 * constant.cs (Define): Use Location while reporting the errror.
20632 Also emit a warning when 'new' is used and there is no inherited
20635 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
20638 (LookupEnumValue): Implement to lookup an enum member's value and define it
20641 (Populate): Re-write accordingly to use the above routine.
20643 2001-11-27 Miguel de Icaza <miguel@ximian.com>
20645 * expression.cs (This): Fix prototype for DoResolveLValue to
20646 override the base class DoResolveLValue.
20648 * cs-parser.cs: Report errors cs574 and cs575 (destructor
20651 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20652 (we need to load the address of the field here). This fixes
20655 (FieldExpr.DoResolveLValue): Call the DoResolve
20656 function to initialize the Instance expression.
20658 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20659 correctly the GetEnumerator operation on a value type.
20661 * cs-parser.jay: Add more simple parsing error catches.
20663 * statement.cs (Switch): Add support for string switches.
20664 Handle null specially.
20666 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
20668 2001-11-28 Ravi Pratap <ravi@ximian.com>
20670 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20672 (declare_local_constant): New helper function.
20674 * statement.cs (AddConstant): Keep a separate record of constants
20676 (IsConstant): Implement to determine if a variable is a constant.
20678 (GetConstantExpression): Implement.
20680 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20682 * statement.cs (IsVariableDefined): Re-write.
20684 2001-11-27 Ravi Pratap <ravi@ximian.com>
20686 * class.cs (TypeContainer::FindMembers): Look for constants
20687 in the case when we are looking for MemberTypes.Field
20689 * expression.cs (MemberAccess::DoResolve): Check that in the
20690 case we are a FieldExpr and a Literal, we are not being accessed
20691 by an instance reference.
20693 * cs-parser.jay (local_constant_declaration): Implement.
20695 (declaration_statement): Implement for constant declarations.
20697 2001-11-26 Miguel de Icaza <miguel@ximian.com>
20699 * statement.cs (Switch): Catch double defaults.
20701 (Switch): More work on the switch() statement
20702 implementation. It works for integral values now, need to finish
20706 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20708 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20709 integer literals into other integer literals. To be used by
20712 2001-11-24 Ravi Pratap <ravi@ximian.com>
20714 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20717 (EmitDynamicInitializers): Cope with the above since we extract data
20718 directly from ArrayData now.
20720 (ExpectInitializers): Keep track of whether initializers are mandatory
20723 (Bounds): Make it a hashtable to prevent the same dimension being
20724 recorded for every element in that dimension.
20726 (EmitDynamicInitializers): Fix bug which prevented the Set array method
20729 Also fix bug which was causing the indices to be emitted in the reverse
20732 2001-11-24 Miguel de Icaza <miguel@ximian.com>
20734 * expression.cs (ArrayCreation): Implement the bits that Ravi left
20735 unfinished. They do not work, because the underlying code is
20738 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20740 * cs-parser.jay: Remove bogus fixme.
20742 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20743 on Switch statement.
20745 2001-11-23 Ravi Pratap <ravi@ximian.com>
20747 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20750 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20751 parameter. Apparently, any expression is allowed.
20753 (ValidateInitializers): Update accordingly.
20755 (CheckIndices): Fix some tricky bugs thanks to recursion.
20757 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
20758 I was being completely brain-dead.
20760 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20761 and re-write acordingly.
20763 (DelegateInvocation): Re-write accordingly.
20765 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20767 (MakeByteBlob): Handle types more correctly.
20769 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20770 initialization from expressions but it is incomplete because I am a complete
20773 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20775 * statement.cs (If.Emit): Fix a bug that generated incorrect code
20776 on If. Basically, we have to return `true' (ie, we do return to
20777 our caller) only if both branches of the if return.
20779 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20780 short-circuit operators, handle them as short circuit operators.
20782 (Cast.DoResolve): Resolve type.
20783 (Cast.Cast): Take an expression as the target type.
20785 * cs-parser.jay (cast_expression): Remove old hack that only
20786 allowed a limited set of types to be handled. Now we take a
20787 unary_expression and we resolve to a type during semantic
20790 Use the grammar productions from Rhys to handle casts (this is
20791 not complete like Rhys syntax yet, we fail to handle that corner
20792 case that C# has regarding (-x), but we will get there.
20794 2001-11-22 Ravi Pratap <ravi@ximian.com>
20796 * class.cs (EmitFieldInitializer): Take care of the case when we have a
20797 field which is an array type.
20799 * cs-parser.jay (declare_local_variables): Support array initialization too.
20801 * typemanager.cs (MakeKey): Implement.
20803 (everywhere): Use the above appropriately.
20805 * cs-parser.jay (for_statement): Update for array initialization while
20806 declaring variables.
20808 * ecore.cs : The error message was correct, it's the variable's names that
20809 were misleading ;-) Make the code more readable.
20811 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20812 the correct type etc.
20814 (ConvertExplicit): Handle Enum types by examining the underlying type.
20816 2001-11-21 Ravi Pratap <ravi@ximian.com>
20818 * parameter.cs (GetCallingConvention): Always return
20819 CallingConventions.Standard for now.
20821 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20823 * expression.cs (Binary.ResolveOperator): Update the values of `l'
20824 and `r' after calling DoNumericPromotions.
20826 * ecore.cs: Fix error message (the types were in the wrong order).
20828 * statement.cs (Foreach.ProbeCollectionType): Need to pass
20829 BindingFlags.Instance as well
20831 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20832 implicit int literal conversion in an empty cast so that we
20833 propagate the right type upstream.
20835 (UnboxCast): new class used to unbox value types.
20836 (Expression.ConvertExplicit): Add explicit type conversions done
20839 (Expression.ImplicitNumericConversion): Oops, forgot to test for
20840 the target type before applying the implicit LongLiterals to ULong
20843 2001-11-21 Miguel de Icaza <miguel@ximian.com>
20845 * cs-parser.jay (for_statement): Reworked the way For works: now
20846 we declare manually any variables that are introduced in
20847 for_initializer to solve the problem of having out-of-band code
20848 emition (that is what got for broken).
20850 (declaration_statement): Perform the actual variable declaration
20851 that used to be done in local_variable_declaration here.
20853 (local_variable_declaration): Do not declare anything, just pass
20854 the information on a DictionaryEntry
20856 2001-11-20 Ravi Pratap <ravi@ximian.com>
20858 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20859 re-write of the logic to now make it recursive.
20861 (UpdateIndices): Re-write accordingly.
20863 Store element data in a separate ArrayData list in the above methods.
20865 (MakeByteBlob): Implement to dump the array data into a byte array.
20867 2001-11-19 Ravi Pratap <ravi@ximian.com>
20869 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20872 * constant.cs (Define): Implement.
20874 (EmitConstant): Re-write fully.
20876 Pass in location info.
20878 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20881 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20882 DictionaryEntry since we need location info too.
20884 (constant_declaration): Update accordingly.
20886 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20887 code into another method : UpdateIndices.
20889 2001-11-18 Ravi Pratap <ravi@ximian.com>
20891 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20892 some type checking etc.
20894 2001-11-17 Ravi Pratap <ravi@ximian.com>
20896 * expression.cs (ArrayCreation::ValidateInitializers): Implement
20897 bits to provide dimension info if the user skips doing that.
20899 Update second constructor to store the rank correctly.
20901 2001-11-16 Ravi Pratap <ravi@ximian.com>
20903 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20904 and try to implement.
20906 * ../errors/cs0150.cs : Add.
20908 * ../errors/cs0178.cs : Add.
20910 2001-11-16 Miguel de Icaza <miguel@ximian.com>
20912 * statement.cs: Implement foreach on multi-dimensional arrays.
20914 * parameter.cs (Parameters.GetParameterByName): Also lookup the
20915 name of the params argument.
20917 * expression.cs: Use EmitStoreOpcode to get the right opcode while
20918 initializing the array.
20920 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20921 we can use this elsewhere.
20923 * statement.cs: Finish implementation of foreach for single
20926 * cs-parser.jay: Use an out-of-band stack to pass information
20927 around, I wonder why I need this.
20929 foreach_block: Make the new foreach_block the current_block.
20931 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20932 function used to return a static Parameters structure. Used for
20933 empty parameters, as those are created very frequently.
20935 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20937 2001-11-15 Ravi Pratap <ravi@ximian.com>
20939 * interface.cs : Default modifier is private, not public. The
20940 make verify test passes again.
20942 2001-11-15 Ravi Pratap <ravi@ximian.com>
20944 * support.cs (ReflectionParameters): Fix logic to determine
20945 whether the last parameter is a params one. Test 9 passes again.
20947 * delegate.cs (Populate): Register the builders we define with
20948 RegisterParameterForBuilder. Test 19 passes again.
20950 * cs-parser.jay (property_declaration): Reference $6 instead
20951 of $$ to get at the location.
20953 (indexer_declaration): Similar stuff.
20955 (attribute): Ditto.
20957 * class.cs (Property): Register parameters for the Get and Set methods
20958 if they exist. Test 23 passes again.
20960 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20961 call to EmitArguments as we are sure there aren't any params arguments.
20962 Test 32 passes again.
20964 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20965 IndexOutOfRangeException.
20967 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20968 Test 33 now passes again.
20970 2001-11-15 Miguel de Icaza <miguel@ximian.com>
20972 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20973 broke a bunch of things. Will have to come up with a better way
20974 of tracking locations.
20976 * statement.cs: Implemented foreach for single dimension arrays.
20978 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20980 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20981 an error. This removes the lookup from the critical path.
20983 * cs-parser.jay: Removed use of temporary_loc, which is completely
20986 2001-11-14 Miguel de Icaza <miguel@ximian.com>
20988 * support.cs (ReflectionParameters.ParameterModifier): Report
20989 whether the argument is a PARAMS argument or not.
20991 * class.cs: Set the attribute `ParamArrayAttribute' on the
20992 parameter argument.
20994 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20995 and cons_param_array_attribute (ConstructorInfo for
20996 ParamArrayAttribute).,
20998 * codegen.cs: Emit the return using the `Return' statement, that
20999 way we can report the error correctly for missing return values.
21001 * class.cs (Method.Emit): Clean up.
21003 * expression.cs (Argument.Resolve): Take another argument: the
21004 location where this argument is used. Notice that this is not
21005 part of the "Argument" class as to reduce the size of the
21006 structure (we know the approximate location anyways).
21008 Test if the argument is a variable-reference, if not, then
21009 complain with a 206.
21011 (Argument.Emit): Emit addresses of variables.
21013 (Argument.FullDesc): Simplify.
21015 (Invocation.DoResolve): Update for Argument.Resolve.
21017 (ElementAccess.DoResolve): ditto.
21019 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
21020 method should be virtual, as this method is always virtual.
21022 (NewDelegate.DoResolve): Update for Argument.Resolve.
21024 * class.cs (ConstructorInitializer.DoResolve): ditto.
21026 * attribute.cs (Attribute.Resolve): ditto.
21028 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21030 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
21032 * expression.cs (ParameterReference): Drop IStackStorage and implement
21033 IAssignMethod instead.
21035 (LocalVariableReference): ditto.
21037 * ecore.cs (FieldExpr): Drop IStackStorage and implement
21038 IAssignMethod instead.
21040 2001-11-13 Miguel de Icaza <miguel@ximian.com>
21042 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
21043 enumerations that are used in heavily used structures derive from
21044 byte in a laughable and pathetic attempt to reduce memory usage.
21045 This is the kind of pre-optimzations that you should not do at
21046 home without adult supervision.
21048 * expression.cs (UnaryMutator): New class, used to handle ++ and
21049 -- separatedly from the other unary operators. Cleans up the
21050 code, and kills the ExpressionStatement dependency in Unary.
21052 (Unary): Removed `method' and `Arguments' from this class, making
21053 it smaller, and moving it all to SimpleCall, so I can reuse this
21054 code in other locations and avoid creating a lot of transient data
21055 strucutres when not required.
21057 * cs-parser.jay: Adjust for new changes.
21059 2001-11-11 Miguel de Icaza <miguel@ximian.com>
21061 * enum.cs (Enum.Populate): If there is a failure during
21064 * cs-parser.jay (opt_enum_base): we used to catch type errors
21065 here, but this is really incorrect. The type error should be
21066 catched during semantic analysis.
21068 2001-12-11 Ravi Pratap <ravi@ximian.com>
21070 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
21071 current_local_parameters as expected since I, in my stupidity, had forgotten
21074 * attribute.cs (GetValidPlaces): Fix stupid bug.
21076 * class.cs (Method::Emit): Perform check on applicability of attributes.
21078 (Constructor::Emit): Ditto.
21080 (Field::Emit): Ditto.
21082 (Field.Location): Store location information.
21084 (Property, Event, Indexer, Operator): Ditto.
21086 * cs-parser.jay (field_declaration): Pass in location for each field.
21088 * ../errors/cs0592.cs : Add.
21090 2001-11-12 Ravi Pratap <ravi@ximian.com>
21092 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
21094 (InitCoreTypes): Update accordingly.
21096 (RegisterAttrType, LookupAttr): Implement.
21098 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
21099 info about the same.
21101 (Resolve): Update to populate the above as necessary.
21103 (Error592): Helper.
21105 (GetValidPlaces): Helper to the above.
21107 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
21109 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
21111 2001-11-12 Ravi Pratap <ravi@ximian.com>
21113 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
21115 * ../errors/cs0617.cs : Add.
21117 2001-11-11 Ravi Pratap <ravi@ximian.com>
21119 * enum.cs (Emit): Rename to Populate to be more consistent with what
21120 we expect it to do and when exactly it is called.
21122 * class.cs, rootcontext.cs : Update accordingly.
21124 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
21125 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
21127 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
21129 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
21130 of a fieldinfo using the above, when dealing with a FieldBuilder.
21132 2001-11-10 Ravi Pratap <ravi@ximian.com>
21134 * ../errors/cs0031.cs : Add.
21136 * ../errors/cs1008.cs : Add.
21138 * ../errrors/cs0543.cs : Add.
21140 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
21143 (FindMembers): Implement.
21145 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
21146 enums and delegates too.
21148 (enum_types): Rename to builder_to_enum.
21150 (delegate_types): Rename to builder_to_delegate.
21152 * delegate.cs (FindMembers): Implement.
21154 2001-11-09 Ravi Pratap <ravi@ximian.com>
21156 * typemanager.cs (IsEnumType): Implement.
21158 * enum.cs (Emit): Re-write parts to account for the underlying type
21159 better and perform checking etc.
21161 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
21162 of the underlying type.
21164 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
21167 * enum.cs (error31): Helper to report error #31.
21169 * cs-parser.jay (enum_declaration): Store location of each member too.
21171 * enum.cs (member_to_location): New hashtable.
21173 (AddEnumMember): Update location hashtable.
21175 (Emit): Use the location of each member while reporting errors.
21177 2001-11-09 Miguel de Icaza <miguel@ximian.com>
21179 * cs-parser.jay: A for_initializer if is a
21180 local_variable_declaration really ammount to have an implicit
21181 block with the variable declaration and no initializer for for.
21183 * statement.cs (For.Emit): Cope with null initializers.
21185 This fixes the infinite loop on for initializers.
21187 2001-11-08 Miguel de Icaza <miguel@ximian.com>
21189 * enum.cs: More cleanup.
21191 * ecore.cs: Remove dead code.
21193 * class.cs (Property.Emit): More simplification.
21194 (Event.Emit): ditto.
21196 Reworked to have less levels of indentation.
21198 2001-11-08 Ravi Pratap <ravi@ximian.com>
21200 * class.cs (Property): Emit attributes.
21210 * enum.cs (Emit): Ditto.
21212 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
21215 * class.cs (Field, Event, etc.): Move attribute generation into the
21216 Emit method everywhere.
21218 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
21219 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
21220 as we had no way of defining nested enums !
21222 * rootcontext.cs : Adjust code accordingly.
21224 * typemanager.cs (AddEnumType): To keep track of enum types separately.
21226 2001-11-07 Ravi Pratap <ravi@ximian.com>
21228 * expression.cs (EvalConstantExpression): Move into ecore.cs
21230 * enum.cs (Enum): Rename some members and make them public and readonly
21231 according to our convention.
21233 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
21236 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
21238 (Enum::Emit): Write a simple version for now which doesn't try to compute
21239 expressions. I shall modify this to be more robust in just a while.
21241 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
21243 (TypeContainer::CloseType): Create the Enum types too.
21245 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
21247 * expression.cs (EvalConstantExpression): Get rid of completely.
21249 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
21250 user-defined values and other cases.
21252 (IsValidEnumLiteral): Helper function.
21254 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
21255 out there in the case we had a literal FieldExpr.
21257 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
21259 (Literalize): Revamp a bit to take two arguments.
21261 (EnumLiteral): New class which derives from Literal to wrap enum literals.
21263 2001-11-06 Ravi Pratap <ravi@ximian.com>
21265 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
21267 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
21269 (Resolve): Use the above to ensure we have proper initializers.
21271 2001-11-05 Ravi Pratap <ravi@ximian.com>
21273 * expression.cs (Expression::EvalConstantExpression): New method to
21274 evaluate constant expressions.
21276 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
21278 2001-11-07 Miguel de Icaza <miguel@ximian.com>
21280 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
21283 (Binary.ResolveOperator): Handle operator != (object a, object b)
21284 and operator == (object a, object b);
21286 (Binary.DoNumericPromotions): Indicate whether the numeric
21287 promotion was possible.
21289 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
21292 Made the ArrayAccess implement interface IAssignMethod instead of
21293 IStackStore as the order in which arguments are passed reflects
21296 * assign.cs: Instead of using expr.ExprClass to select the way of
21297 assinging, probe for the IStackStore/IAssignMethod interfaces.
21299 * typemanager.cs: Load InitializeArray definition.
21301 * rootcontext.cs (RootContext.MakeStaticData): Used to define
21302 static data that can be used to initialize arrays.
21304 2001-11-05 Miguel de Icaza <miguel@ximian.com>
21306 * expression.cs: Handle operator== and operator!= for booleans.
21308 (Conditioal.Reduce): Implement reducer for the ?: operator.
21310 (Conditional.Resolve): Implement dead code elimination.
21312 (Binary.Resolve): Catch string literals and return a new
21313 concatenated string.
21315 (Unary.Reduce): Implement reduction of unary expressions.
21317 * ecore.cs: Split out the expression core handling here.
21319 (Expression.Reduce): New method used to perform constant folding
21320 and CSE. This is needed to support constant-expressions.
21322 * statement.cs (Statement.EmitBoolExpression): Pass true and false
21323 targets, and optimize for !x.
21325 2001-11-04 Ravi Pratap <ravi@ximian.com>
21327 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
21328 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
21329 set custom atttributes.
21331 * literal.cs (Literal::GetValue): New abstract method to return the actual
21332 value of the literal, cast as an object.
21334 (*Literal): Implement GetValue method.
21336 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
21337 expressions to the arraylist but objects of type Argument.
21339 * class.cs (TypeContainer::Emit): Emit our attributes too.
21341 (Method::Emit, Constructor::Emit): Ditto.
21343 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
21344 to be ignoring earlier.
21346 2001-11-03 Ravi Pratap <ravi@ximian.com>
21348 * attribute.cs (AttributeSection::Define): Implement to do the business
21349 of constructing a CustomAttributeBuilder.
21351 (Attribute): New trivial class. Increases readability of code.
21353 * cs-parser.jay : Update accordingly.
21355 (positional_argument_list, named_argument_list, named_argument): New rules
21357 (attribute_arguments): Use the above so that we are more correct.
21359 2001-11-02 Ravi Pratap <ravi@ximian.com>
21361 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
21362 to perform all checks for a method with a params parameter.
21364 (Invocation::OverloadResolve): Update to use the above method and therefore
21365 cope correctly with params method invocations.
21367 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
21370 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
21371 constructors in our parent too because we can't afford to miss out on
21374 * attribute.cs (AttributeSection): New name for the class Attribute
21376 Other trivial changes to improve readability.
21378 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
21379 use the new class names.
21381 2001-11-01 Ravi Pratap <ravi@ximian.com>
21383 * class.cs (Method::Define): Complete definition for params types too
21385 (Indexer::Define): Ditto.
21387 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
21388 Cope everywhere with a request for info about the array parameter.
21390 2001-11-01 Ravi Pratap <ravi@ximian.com>
21392 * tree.cs (RecordNamespace): Fix up to check for the correct key.
21394 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
21395 local_variable_type to extract the string corresponding to the type.
21397 (local_variable_type): Fixup the action to use the new helper method.
21399 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
21402 * expression.cs : Clean out code which uses the above.
21404 2001-10-31 Ravi Pratap <ravi@ximian.com>
21406 * typemanager.cs (RegisterMethod): Check if we already have an existing key
21407 and bale out if necessary by returning a false.
21409 (RegisterProperty): Ditto.
21411 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21412 and print out appropriate error messages.
21414 * interface.cs (everywhere): Ditto.
21416 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21417 location to constructor.
21419 * class.cs (Property, Event, Indexer): Update accordingly.
21421 * ../errors/cs111.cs : Added.
21423 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21424 of a method, as laid down by the spec.
21426 (Invocation::OverloadResolve): Use the above method.
21428 2001-10-31 Ravi Pratap <ravi@ximian.com>
21430 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21431 now take a TypeContainer and a Parameters object.
21433 (ParameterData): Modify return type of ParameterModifier method to be
21434 Parameter.Modifier and not a string.
21436 (ReflectionParameters, InternalParameters): Update accordingly.
21438 * expression.cs (Argument::GetParameterModifier): Same here.
21440 * support.cs (InternalParameters::ParameterType): Find a better way of determining
21441 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21442 symbol in it at all so maybe this is only for now.
21444 2001-10-30 Ravi Pratap <ravi@ximian.com>
21446 * support.cs (InternalParameters): Constructor now takes an extra argument
21447 which is the actual Parameters class.
21449 (ParameterDesc): Update to provide info on ref/out modifiers.
21451 * class.cs (everywhere): Update call to InternalParameters to pass in
21452 the second argument too.
21454 * support.cs (ParameterData): Add ParameterModifier, which is a method
21455 to return the modifier info [ref/out etc]
21457 (InternalParameters, ReflectionParameters): Implement the above.
21459 * expression.cs (Argument::ParameterModifier): Similar function to return
21460 info about the argument's modifiers.
21462 (Invocation::OverloadResolve): Update to take into account matching modifiers
21465 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21466 a new SetFormalParameters object which we pass to InternalParameters.
21468 2001-10-30 Ravi Pratap <ravi@ximian.com>
21470 * expression.cs (NewArray): Merge into the ArrayCreation class.
21472 2001-10-29 Ravi Pratap <ravi@ximian.com>
21474 * expression.cs (NewArray): Merge classes NewBuiltinArray and
21475 NewUserdefinedArray into one as there wasn't much of a use in having
21478 * expression.cs (Argument): Change field's name to ArgType from Type.
21480 (Type): New readonly property which returns the proper type, taking into
21481 account ref/out modifiers.
21483 (everywhere): Adjust code accordingly for the above.
21485 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21486 whether we are emitting for a ref or out parameter.
21488 * expression.cs (Argument::Emit): Use the above field to set the state.
21490 (LocalVariableReference::Emit): Update to honour the flag and emit the
21493 * parameter.cs (Attributes): Set the correct flags for ref parameters.
21495 * expression.cs (Argument::FullDesc): New function to provide a full desc.
21497 * support.cs (ParameterData): Add method ParameterDesc to the interface.
21499 (ReflectionParameters, InternalParameters): Implement the above method.
21501 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21504 (Invocation::FullMethodDesc): Ditto.
21506 2001-10-29 Miguel de Icaza <miguel@ximian.com>
21508 * cs-parser.jay: Add extra production for the second form of array
21511 * expression.cs (ArrayCreation): Update to reflect the above
21514 * Small changes to prepare for Array initialization.
21516 2001-10-28 Miguel de Icaza <miguel@ximian.com>
21518 * typemanager.cs (ImplementsInterface): interface might be null;
21519 Deal with this problem;
21521 Also, we do store negative hits on the cache (null values), so use
21522 this instead of calling t.GetInterfaces on the type everytime.
21524 2001-10-28 Ravi Pratap <ravi@ximian.com>
21526 * typemanager.cs (IsBuiltinType): New method to help determine the same.
21528 * expression.cs (New::DoResolve): Get rid of array creation code and instead
21529 split functionality out into different classes.
21531 (New::FormArrayType): Move into NewBuiltinArray.
21533 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21536 (NewBuiltinArray): New class to handle creation of built-in arrays.
21538 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21539 account creation of one-dimensional arrays.
21541 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21543 (NewUserdefinedArray::DoResolve): Implement.
21545 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21547 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21548 we maintain inside the TypeManager. This is necessary to perform lookups on the
21551 (LookupType): Update to perform GetType on the module builders too.
21553 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21555 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21557 2001-10-23 Ravi Pratap <ravi@ximian.com>
21559 * expression.cs (New::DoResolve): Implement guts of array creation.
21561 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21563 2001-10-27 Miguel de Icaza <miguel@ximian.com>
21565 * expression.cs: Fix bug I introduced lsat night that broke
21568 (Expression.Resolve): Report a 246 error (can not resolve name)
21569 if we find a SimpleName in the stream.
21571 (Expression.ResolveLValue): Ditto.
21573 (Expression.ResolveWithSimpleName): This function is a variant of
21574 ResolveName, this one allows SimpleNames to be returned without a
21575 warning. The only consumer of SimpleNames is MemberAccess
21577 2001-10-26 Miguel de Icaza <miguel@ximian.com>
21579 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21580 might arrive here. I have my doubts that this is correct.
21582 * statement.cs (Lock): Implement lock statement.
21584 * cs-parser.jay: Small fixes to support `lock' and `using'
21586 * cs-tokenizer.cs: Remove extra space
21588 * driver.cs: New flag --checked, allows to turn on integer math
21591 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21592 Threading.Monitor.Exit
21594 2001-10-23 Miguel de Icaza <miguel@ximian.com>
21596 * expression.cs (IndexerAccess::DoResolveLValue): Set the
21597 Expression Class to be IndexerAccess.
21599 Notice that Indexer::DoResolve sets the eclass to Value.
21601 2001-10-22 Miguel de Icaza <miguel@ximian.com>
21603 * class.cs (TypeContainer::Emit): Emit code for indexers.
21605 * assign.cs (IAssignMethod): New interface implemented by Indexers
21606 and Properties for handling assignment.
21608 (Assign::Emit): Simplify and reuse code.
21610 * expression.cs (IndexerAccess, PropertyExpr): Implement
21611 IAssignMethod, clean up old code.
21613 2001-10-22 Ravi Pratap <ravi@ximian.com>
21615 * typemanager.cs (ImplementsInterface): New method to determine if a type
21616 implements a given interface. Provides a nice cache too.
21618 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21621 (ConvertReferenceExplicit): Ditto.
21623 * delegate.cs (Delegate::Populate): Update to define the parameters on the
21624 various methods, with correct names etc.
21626 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
21627 Operator.UnaryNegation.
21629 * cs-parser.jay (operator_declarator): Be a little clever in the case where
21630 we have a unary plus or minus operator.
21632 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
21635 * everywhere : update accordingly.
21637 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21640 * class.cs (Method::Define): For the case where we are implementing a method
21641 inherited from an interface, we need to set the MethodAttributes.Final flag too.
21642 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21644 2001-10-21 Ravi Pratap <ravi@ximian.com>
21646 * interface.cs (FindMembers): Implement to work around S.R.E
21649 * typemanager.cs (IsInterfaceType): Implement.
21651 (FindMembers): Update to handle interface types too.
21653 * expression.cs (ImplicitReferenceConversion): Re-write bits which
21654 use IsAssignableFrom as that is not correct - it doesn't work.
21656 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21657 and accordingly override EmitStatement.
21659 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21660 using the correct logic :-)
21662 2001-10-19 Ravi Pratap <ravi@ximian.com>
21664 * ../errors/cs-11.cs : Add to demonstrate error -11
21666 2001-10-17 Miguel de Icaza <miguel@ximian.com>
21668 * assign.cs (Assign::Resolve): Resolve right hand side first, and
21669 then pass this as a hint to ResolveLValue.
21671 * expression.cs (FieldExpr): Add Location information
21673 (FieldExpr::LValueResolve): Report assignment to readonly
21676 (Expression::ExprClassFromMemberInfo): Pass location information.
21678 (Expression::ResolveLValue): Add new method that resolves an
21681 (Expression::DoResolveLValue): Default invocation calls
21684 (Indexers): New class used to keep track of indexers in a given
21687 (IStackStore): Renamed from LValue, as it did not really describe
21688 what this did. Also ResolveLValue is gone from this interface and
21689 now is part of Expression.
21691 (ElementAccess): Depending on the element access type
21693 * typemanager.cs: Add `indexer_name_type' as a Core type
21694 (System.Runtime.CompilerServices.IndexerNameAttribute)
21696 * statement.cs (Goto): Take a location.
21698 2001-10-18 Ravi Pratap <ravi@ximian.com>
21700 * delegate.cs (Delegate::VerifyDelegate): New method to verify
21701 if two delegates are compatible.
21703 (NewDelegate::DoResolve): Update to take care of the case when
21704 we instantiate a delegate from another delegate.
21706 * typemanager.cs (FindMembers): Don't even try to look up members
21707 of Delegate types for now.
21709 2001-10-18 Ravi Pratap <ravi@ximian.com>
21711 * delegate.cs (NewDelegate): New class to take care of delegate
21714 * expression.cs (New): Split the delegate related code out into
21715 the NewDelegate class.
21717 * delegate.cs (DelegateInvocation): New class to handle delegate
21720 * expression.cs (Invocation): Split out delegate related code into
21721 the DelegateInvocation class.
21723 2001-10-17 Ravi Pratap <ravi@ximian.com>
21725 * expression.cs (New::DoResolve): Implement delegate creation fully
21726 and according to the spec.
21728 (New::DoEmit): Update to handle delegates differently.
21730 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21731 because of which we were printing out arguments in reverse order !
21733 * delegate.cs (VerifyMethod): Implement to check if the given method
21734 matches the delegate.
21736 (FullDelegateDesc): Implement.
21738 (VerifyApplicability): Implement.
21740 * expression.cs (Invocation::DoResolve): Update to accordingly handle
21741 delegate invocations too.
21743 (Invocation::Emit): Ditto.
21745 * ../errors/cs1593.cs : Added.
21747 * ../errors/cs1594.cs : Added.
21749 * delegate.cs (InstanceExpression, TargetMethod): New properties.
21751 2001-10-16 Ravi Pratap <ravi@ximian.com>
21753 * typemanager.cs (intptr_type): Core type for System.IntPtr
21755 (InitCoreTypes): Update for the same.
21757 (iasyncresult_type, asynccallback_type): Ditto.
21759 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21762 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21765 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21766 the builders for the 4 members of a delegate type :-)
21768 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21771 * expression.cs (New::DoResolve): Implement guts for delegate creation.
21773 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21775 2001-10-15 Miguel de Icaza <miguel@ximian.com>
21777 * statement.cs (Break::Emit): Implement.
21778 (Continue::Emit): Implement.
21780 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
21781 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
21782 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
21783 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
21786 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21787 properties that track the label for the current loop (begin of the
21788 loop and end of the loop).
21790 2001-10-15 Ravi Pratap <ravi@ximian.com>
21792 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21793 use of emitting anything at all.
21795 * class.cs, rootcontext.cs : Get rid of calls to the same.
21797 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21799 (Populate): Define the constructor correctly and set the implementation
21802 * typemanager.cs (delegate_types): New hashtable to hold delegates that
21805 (AddDelegateType): Implement.
21807 (IsDelegateType): Implement helper method.
21809 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21811 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21812 and accordingly handle it.
21814 * delegate.cs (Populate): Take TypeContainer argument.
21815 Implement bits to define the Invoke method. However, I still haven't figured out
21816 how to take care of the native int bit :-(
21818 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
21819 Qualify the name of the delegate, not its return type !
21821 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21824 (StandardConversionExists): Checking for array types turns out to be recursive.
21826 (ConvertReferenceExplicit): Implement array conversion.
21828 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21830 2001-10-12 Ravi Pratap <ravi@ximian.com>
21832 * cs-parser.jay (delegate_declaration): Store the fully qualified
21833 name as it is a type declaration.
21835 * delegate.cs (ReturnType, Name): Rename members to these. Make them
21838 (DefineDelegate): Renamed from Define. Does the same thing essentially,
21839 as TypeContainer::DefineType.
21841 (Populate): Method in which all the definition of the various methods (Invoke)
21844 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21847 (CloseDelegate): Finally creates the delegate.
21849 * class.cs (TypeContainer::DefineType): Update to define delegates.
21850 (Populate, Emit and CloseType): Do the same thing here too.
21852 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21853 delegates in all these operations.
21855 2001-10-14 Miguel de Icaza <miguel@ximian.com>
21857 * expression.cs: LocalTemporary: a new expression used to
21858 reference a temporary that has been created.
21860 * assign.cs: Handle PropertyAccess back here, so that we can
21861 provide the proper semantic access to properties.
21863 * expression.cs (Expression::ConvertReferenceExplicit): Implement
21864 a few more explicit conversions.
21866 * modifiers.cs: `NEW' modifier maps to HideBySig.
21868 * expression.cs (PropertyExpr): Make this into an
21869 ExpressionStatement, and support the EmitStatement code path.
21871 Perform get/set error checking, clean up the interface.
21873 * assign.cs: recognize PropertyExprs as targets, and if so, turn
21874 them into toplevel access objects.
21876 2001-10-12 Miguel de Icaza <miguel@ximian.com>
21878 * expression.cs: PropertyExpr::PropertyExpr: use work around the
21881 * typemanager.cs: Keep track here of our PropertyBuilders again to
21882 work around lameness in SRE.
21884 2001-10-11 Miguel de Icaza <miguel@ximian.com>
21886 * expression.cs (LValue::LValueResolve): New method in the
21887 interface, used to perform a second resolution pass for LValues.
21889 (This::DoResolve): Catch the use of this in static methods.
21891 (This::LValueResolve): Implement.
21893 (This::Store): Remove warning, assigning to `this' in structures
21896 (Invocation::Emit): Deal with invocation of
21897 methods on value types. We need to pass the address to structure
21898 methods rather than the object itself. (The equivalent code to
21899 emit "this" for structures leaves the entire structure on the
21900 stack instead of a pointer to it).
21902 (ParameterReference::DoResolve): Compute the real index for the
21903 argument based on whether the method takes or not a `this' pointer
21904 (ie, the method is static).
21906 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21907 value types returned from functions when we need to invoke a
21908 method on the sturcture.
21911 2001-10-11 Ravi Pratap <ravi@ximian.com>
21913 * class.cs (TypeContainer::DefineType): Method to actually do the business of
21914 defining the type in the Modulebuilder or Typebuilder. This is to take
21915 care of nested types which need to be defined on the TypeBuilder using
21916 DefineNestedMethod.
21918 (TypeContainer::GetClassBases): Implement. Essentially the code from the
21919 methods in RootContext, only ported to be part of TypeContainer.
21921 (TypeContainer::GetInterfaceOrClass): Ditto.
21923 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21925 * interface.cs (Interface::DefineInterface): New method. Does exactly
21926 what RootContext.CreateInterface did earlier, only it takes care of nested types
21929 (Interface::GetInterfaces): Move from RootContext here and port.
21931 (Interface::GetInterfaceByName): Same here.
21933 * rootcontext.cs (ResolveTree): Re-write.
21935 (PopulateTypes): Re-write.
21937 * class.cs (TypeContainer::Populate): Populate nested types too.
21938 (TypeContainer::Emit): Emit nested members too.
21940 * typemanager.cs (AddUserType): Do not make use of the FullName property,
21941 instead just use the name argument passed in as it is already fully
21944 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21945 to TypeContainer mapping to see if a type is user-defined.
21947 * class.cs (TypeContainer::CloseType): Implement.
21949 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21950 the default constructor.
21952 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21955 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21957 * interface.cs (CloseType): Create the type here.
21959 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21962 Remove all the methods which are now in TypeContainer.
21964 2001-10-10 Ravi Pratap <ravi@ximian.com>
21966 * delegate.cs (Define): Re-write bits to define the delegate
21969 2001-10-10 Miguel de Icaza <miguel@ximian.com>
21971 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21973 * expression.cs (ImplicitReferenceConversion): handle null as well
21974 as a source to convert to any reference type.
21976 * statement.cs (Return): Perform any implicit conversions to
21977 expected return type.
21979 Validate use of return statement.
21981 * codegen.cs (EmitContext): Pass the expected return type here.
21983 * class.cs (Method, Constructor, Property): Pass expected return
21984 type to EmitContext.
21986 2001-10-09 Miguel de Icaza <miguel@ximian.com>
21988 * expression.cs: Make DoResolve take an EmitContext instead of a
21991 Replaced `l' and `location' for `loc', for consistency.
21993 (Error, Warning): Remove unneeded Tc argument.
21995 * assign.cs, literal.cs, constant.cs: Update to new calling
21998 * codegen.cs: EmitContext now contains a flag indicating whether
21999 code is being generated in a static method or not.
22001 * cs-parser.jay: DecomposeQI, new function that replaces the old
22002 QualifiedIdentifier. Now we always decompose the assembled
22003 strings from qualified_identifier productions into a group of
22006 2001-10-08 Miguel de Icaza <miguel@ximian.com>
22008 * rootcontext.cs: Deal with field-less struct types correctly now
22009 by passing the size option to Define Type.
22011 * class.cs: Removed hack that created one static field.
22013 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22015 * statement.cs: Moved most of the code generation here.
22017 2001-10-09 Ravi Pratap <ravi@ximian.com>
22019 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
22022 (ElementAccess): Remove useless bits for now - keep checks as the spec
22025 2001-10-08 Ravi Pratap <ravi@ximian.com>
22027 * expression.cs (ElementAccess::DoResolve): Remove my crap code
22028 and start performing checks according to the spec.
22030 2001-10-07 Ravi Pratap <ravi@ximian.com>
22032 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
22033 rank_specifiers instead.
22035 (rank_specifiers): Change the order in which the rank specifiers are stored
22037 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
22039 * expression.cs (ElementAccess): Implement the LValue interface too.
22041 2001-10-06 Ravi Pratap <ravi@ximian.com>
22043 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
22044 except that user defined conversions are not included.
22046 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
22047 perform the conversion of the return type, if necessary.
22049 (New::DoResolve): Check whether we are creating an array or an object
22050 and accordingly do the needful.
22052 (New::Emit): Same here.
22054 (New::DoResolve): Implement guts of array creation.
22056 (New::FormLookupType): Helper function.
22058 2001-10-07 Miguel de Icaza <miguel@ximian.com>
22060 * codegen.cs: Removed most of the code generation here, and move the
22061 corresponding code generation bits to the statement classes.
22063 Added support for try/catch/finalize and throw.
22065 * cs-parser.jay: Added support for try/catch/finalize.
22067 * class.cs: Catch static methods having the flags override,
22068 virtual or abstract.
22070 * expression.cs (UserCast): This user cast was not really doing
22071 what it was supposed to do. Which is to be born in fully resolved
22072 state. Parts of the resolution were being performed at Emit time!
22076 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22078 * expression.cs: Implicity convert the result from UserCast.
22080 2001-10-05 Ravi Pratap <ravi@ximian.com>
22082 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
22083 prevented it from working correctly.
22085 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
22086 merely ConvertImplicit.
22088 2001-10-05 Miguel de Icaza <miguel@ximian.com>
22090 * typemanager.cs: Make the LookupTypeContainer function static,
22091 and not per-instance.
22093 * class.cs: Make static FindMembers (the one that takes a Type
22096 * codegen.cs: Add EmitForeach here.
22098 * cs-parser.jay: Make foreach a toplevel object instead of the
22099 inline expansion, as we need to perform semantic analysis on it.
22101 2001-10-05 Ravi Pratap <ravi@ximian.com>
22103 * expression.cs (Expression::ImplicitUserConversion): Rename to
22104 UserDefinedConversion.
22106 (Expression::UserDefinedConversion): Take an extra argument specifying
22107 whether we look for explicit user conversions too.
22109 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
22111 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
22113 (ExplicitUserConversion): Make it a call to UserDefinedConversion
22114 with the appropriate arguments.
22116 * cs-parser.jay (cast_expression): Record location too.
22118 * expression.cs (Cast): Record location info.
22120 (Expression::ConvertExplicit): Take location argument.
22122 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
22123 to determine if we are doing explicit conversions.
22125 (UserCast::Emit): Update accordingly.
22127 (Expression::ConvertExplicit): Report an error if everything fails.
22129 * ../errors/cs0030.cs : Add.
22131 2001-10-04 Miguel de Icaza <miguel@ximian.com>
22133 * modifiers.cs: If the ABSTRACT keyword is present, also set the
22134 virtual and newslot bits.
22136 * class.cs (TypeContainer::RegisterRequiredImplementations):
22137 Record methods we need.
22139 (TypeContainer::MakeKey): Helper function to make keys for
22140 MethodBases, since the Methodbase key is useless.
22142 (TypeContainer::Populate): Call RegisterRequiredImplementations
22143 before defining the methods.
22145 Create a mapping for method_builders_to_methods ahead of time
22146 instead of inside a tight loop.
22148 (::RequireMethods): Accept an object as the data to set into the
22149 hashtable so we can report interface vs abstract method mismatch.
22151 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22153 * report.cs: Make all of it static.
22155 * rootcontext.cs: Drop object_type and value_type computations, as
22156 we have those in the TypeManager anyways.
22158 Drop report instance variable too, now it is a global.
22160 * driver.cs: Use try/catch on command line handling.
22162 Add --probe option to debug the error reporting system with a test
22165 * report.cs: Add support for exiting program when a probe
22166 condition is reached.
22168 2001-10-03 Ravi Pratap <ravi@ximian.com>
22170 * expression.cs (Binary::DoNumericPromotions): Fix the case when
22171 we do a forcible conversion regardless of type, to check if
22172 ForceConversion returns a null.
22174 (Binary::error19): Use location to report error.
22176 (Unary::error23): Use location here too.
22178 * ../errors/cs0019.cs : Check in.
22180 * ../errors/cs0023.cs : Check in.
22182 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
22183 case of a non-null MethodInfo object with a length of 0 !
22185 (Binary::ResolveOperator): Flag error if overload resolution fails to find
22186 an applicable member - according to the spec :-)
22187 Also fix logic to find members in base types.
22189 (Unary::ResolveOperator): Same here.
22191 (Unary::report23): Change name to error23 and make first argument a TypeContainer
22192 as I was getting thoroughly confused between this and error19 :-)
22194 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
22195 (::FindMostEncompassedType): Implement.
22196 (::FindMostEncompassingType): Implement.
22197 (::StandardConversionExists): Implement.
22199 (UserImplicitCast): Re-vamp. We now need info about most specific
22200 source and target types so that we can do the necessary conversions.
22202 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
22203 mathematical union with no duplicates.
22205 2001-10-03 Miguel de Icaza <miguel@ximian.com>
22207 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
22208 in order from base classes to child classes, so that we can in
22209 child classes look up in our parent for method names and
22210 attributes (required for handling abstract, virtual, new, override
22211 constructs: we need to instrospect our base class, and if we dont
22212 populate the classes in order, the introspection might be
22213 incorrect. For example, a method could query its parent before
22214 the parent has any methods and would determine that the parent has
22215 no abstract methods (while it could have had them)).
22217 (RootContext::CreateType): Record the order in which we define the
22220 2001-10-02 Miguel de Icaza <miguel@ximian.com>
22222 * class.cs (TypeContainer::Populate): Also method definitions can
22223 fail now, keep track of this.
22225 (TypeContainer::FindMembers): Implement support for
22226 DeclaredOnly/noDeclaredOnly flag.
22228 (Constructor::Emit) Return the ConstructorBuilder.
22230 (Method::Emit) Return the MethodBuilder.
22231 Check for abstract or virtual methods to be public.
22233 * rootcontext.cs (RootContext::CreateType): Register all the
22234 abstract methods required for the class to be complete and the
22235 interface methods that must be implemented.
22237 * cs-parser.jay: Report error 501 (method requires body if it is
22238 not marked abstract or extern).
22240 * expression.cs (TypeOf::Emit): Implement.
22242 * typemanager.cs: runtime_handle_type, new global type.
22244 * class.cs (Property::Emit): Generate code for properties.
22246 2001-10-02 Ravi Pratap <ravi@ximian.com>
22248 * expression.cs (Unary::ResolveOperator): Find operators on base type
22249 too - we now conform exactly to the spec.
22251 (Binary::ResolveOperator): Same here.
22253 * class.cs (Operator::Define): Fix minor quirk in the tests.
22255 * ../errors/cs0215.cs : Added.
22257 * ../errors/cs0556.cs : Added.
22259 * ../errors/cs0555.cs : Added.
22261 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22263 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
22264 single integer which is really efficient
22266 2001-10-01 Ravi Pratap <ravi@ximian.com>
22268 * expression.cs (Expression::ImplicitUserConversion): Use location
22269 even in the case when we are examining True operators.
22271 * class.cs (Operator::Define): Perform extensive checks to conform
22272 with the rules for operator overloading in the spec.
22274 * expression.cs (Expression::ImplicitReferenceConversion): Implement
22275 some of the other conversions mentioned in the spec.
22277 * typemanager.cs (array_type): New static member for the System.Array built-in
22280 (cloneable_interface): For System.ICloneable interface.
22282 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
22283 we start resolving the tree and populating types.
22285 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
22287 2001-10-01 Miguel de Icaza <miguel@ximian.com>
22289 * expression.cs (Expression::ExprClassFromMemberInfo,
22290 Expression::Literalize): Create literal expressions from
22291 FieldInfos which are literals.
22293 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
22294 type casts, because they were wrong. The test suite in tests
22297 (ImplicitNumericConversion): ushort to ulong requires a widening
22300 Int32 constant to long requires widening cast as well.
22302 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
22303 for integers because the type on the stack is not i4.
22305 2001-09-30 Miguel de Icaza <miguel@ximian.com>
22307 * expression.cs (report118): require location argument.
22309 * parameter.cs: Do not dereference potential null value.
22311 * class.cs: Catch methods that lack the `new' keyword when
22312 overriding a name. Report warnings when `new' is used without
22313 anything being there to override.
22315 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
22317 * class.cs: Only add constructor to hashtable if it is non-null
22318 (as now constructors can fail on define).
22320 (TypeManager, Class, Struct): Take location arguments.
22322 Catch field instance initialization in structs as errors.
22324 accepting_filter: a new filter for FindMembers that is static so
22325 that we dont create an instance per invocation.
22327 (Constructor::Define): Catch errors where a struct constructor is
22330 * cs-parser.jay: Pass location information for various new
22333 * delegate.cs (Delegate): take a location argument.
22335 * driver.cs: Do not call EmitCode if there were problesm in the
22336 Definition of the types, as many Builders wont be there.
22338 * decl.cs (Decl::Decl): Require a location argument.
22340 * cs-tokenizer.cs: Handle properly hex constants that can not fit
22341 into integers, and find the most appropiate integer for it.
22343 * literal.cs: Implement ULongLiteral.
22345 * rootcontext.cs: Provide better information about the location of
22346 failure when CreateType fails.
22348 2001-09-29 Miguel de Icaza <miguel@ximian.com>
22350 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
22353 * expression.cs (Binary::CheckShiftArguments): Add missing type
22355 (Binary::ResolveOperator): Add type to the logical and and logical
22356 or, Bitwise And/Or and Exclusive Or code paths, it was missing
22359 (Binary::DoNumericPromotions): In the case where either argument
22360 is ulong (and most signed types combined with ulong cause an
22361 error) perform implicit integer constant conversions as well.
22363 2001-09-28 Miguel de Icaza <miguel@ximian.com>
22365 * expression.cs (UserImplicitCast): Method should always be
22367 (Invocation::BetterConversion): Simplified test for IntLiteral.
22369 (Expression::ImplicitNumericConversion): Split this routine out.
22370 Put the code that performs implicit constant integer conversions
22373 (Expression::Resolve): Become a wrapper around DoResolve so we can
22374 check eclass and type being set after resolve.
22376 (Invocation::Badness): Remove this dead function
22378 (Binary::ResolveOperator): Do not compute the expensive argumnets
22379 unless we have a union for it.
22381 (Probe::Emit): Is needs to do an isinst and then
22382 compare against null.
22384 (::CanConvert): Added Location argument. If the Location argument
22385 is null (Location.Null), then we do not report errors. This is
22386 used by the `probe' mechanism of the Explicit conversion. We do
22387 not want to generate an error for something that the user
22388 explicitly requested to be casted. But the pipeline for an
22389 explicit cast first tests for potential implicit casts.
22391 So for now, if the Location is null, it means `Probe only' to
22392 avoid adding another argument. Might have to revise this
22395 (ClassCast): New class used to type cast objects into arbitrary
22396 classes (used in Explicit Reference Conversions).
22398 Implement `as' as well.
22400 Reverted all the patches from Ravi below: they were broken:
22402 * The use of `level' as a mechanism to stop recursive
22403 invocations is wrong. That was there just to catch the
22404 bug with a strack trace but not as a way of addressing
22407 To fix the problem we have to *understand* what is going
22408 on and the interactions and come up with a plan, not
22409 just get things going.
22411 * The use of the type conversion cache that I proposed
22412 last night had an open topic: How does this work across
22413 protection domains. A user defined conversion might not
22414 be public in the location where we are applying the
22415 conversion, a different conversion might be selected
22416 (ie, private A->B (better) but public B->A (worse),
22417 inside A, A->B applies, but outside it, B->A will
22420 * On top of that (ie, even if the above is solved),
22421 conversions in a cache need to be abstract. Ie, `To
22422 convert from an Int to a Short use an OpcodeCast', not
22423 `To convert from an Int to a Short use the OpcodeCast on
22424 the variable 5' (which is what this patch was doing).
22426 2001-09-28 Ravi Pratap <ravi@ximian.com>
22428 * expression.cs (Invocation::ConversionExists): Re-write to use
22429 the conversion cache
22431 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22432 cache all conversions done, not just user-defined ones.
22434 (Invocation::BetterConversion): The real culprit. Use ConversionExists
22435 to determine if a conversion exists instead of acutually trying to
22436 perform the conversion. It's faster too.
22438 (Expression::ConvertExplicit): Modify to use ConversionExists to check
22439 and only then attempt the implicit conversion.
22441 2001-09-28 Ravi Pratap <ravi@ximian.com>
22443 * expression.cs (ConvertImplicit): Use a cache for conversions
22444 already found. Check level of recursion and bail out if necessary.
22446 2001-09-28 Miguel de Icaza <miguel@ximian.com>
22448 * typemanager.cs (string_concat_string_string, string_concat_object_object):
22449 Export standard methods that we expect for string operations.
22451 * statement.cs (Block::UsageWarning): Track usage of variables and
22452 report the errors for not used variables.
22454 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22457 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22459 * codegen.cs: remove unnneded code
22461 * expression.cs: Removed BuiltinTypeAccess class
22463 Fix the order in which implicit conversions are
22466 The previous fixed dropped support for boxed conversions (adding a
22467 test to the test suite now)
22469 (UserImplicitCast::CanConvert): Remove test for source being null,
22470 that code is broken. We should not feed a null to begin with, if
22471 we do, then we should track the bug where the problem originates
22472 and not try to cover it up here.
22474 Return a resolved expression of type UserImplicitCast on success
22475 rather than true/false. Ravi: this is what I was talking about,
22476 the pattern is to use a static method as a "constructor" for
22479 Also, do not create arguments until the very last minute,
22480 otherwise we always create the arguments even for lookups that
22481 will never be performed.
22483 (UserImplicitCast::Resolve): Eliminate, objects of type
22484 UserImplicitCast are born in a fully resolved state.
22486 * typemanager.cs (InitCoreTypes): Init also value_type
22487 (System.ValueType).
22489 * expression.cs (Cast::Resolve): First resolve the child expression.
22491 (LValue): Add new method AddressOf to be used by
22494 Change the argument of Store to take an EmitContext instead of an
22495 ILGenerator, because things like FieldExpr need to be able to call
22496 their children expression to generate the instance code.
22498 (Expression::Error, Expression::Warning): Sugar functions for
22501 (Expression::MemberLookup): Accept a TypeContainer instead of a
22502 Report as the first argument.
22504 (Expression::ResolvePrimary): Killed. I still want to improve
22505 this as currently the code is just not right.
22507 (Expression::ResolveMemberAccess): Simplify, but it is still
22510 (Unary::Resolve): Catch errors in AddressOf operators.
22512 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22513 index to a byte for the short-version, or the compiler will choose
22514 the wrong Emit call, which generates the wrong data.
22516 (ParameterReference::Emit, ::Store): same.
22518 (FieldExpr::AddressOf): Implement.
22520 * typemanager.cs: TypeManager: made public variable instead of
22523 * driver.cs: document --fatal.
22525 * report.cs (ErrorMessage, WarningMessage): new names for the old
22526 Error and Warning classes.
22528 * cs-parser.jay (member_access): Turn built-in access to types
22529 into a normal simplename
22531 2001-09-27 Ravi Pratap <ravi@ximian.com>
22533 * expression.cs (Invocation::BetterConversion): Fix to cope
22534 with q being null, since this was introducing a bug.
22536 * expression.cs (ConvertImplicit): Do built-in conversions first.
22538 2001-09-27 Ravi Pratap <ravi@ximian.com>
22540 * expression.cs (UserImplicitCast::Resolve): Fix bug.
22542 2001-09-27 Ravi Pratap <ravi@ximian.com>
22544 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22545 I had introduced long ago (what's new ?).
22547 * expression.cs (UserImplicitCast::CanConvert): Static method to do
22548 the work of all the checking.
22549 (ConvertImplicit): Call CanConvert and only then create object if necessary.
22550 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22552 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22553 that is the right way.
22555 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
22556 overloading resolution. Use everywhere instead of cutting and pasting code.
22558 (Binary::ResolveOperator): Use MakeUnionSet.
22560 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
22561 we have to convert to bool types. Not complete yet.
22563 2001-09-27 Miguel de Icaza <miguel@ximian.com>
22565 * typemanager.cs (TypeManager::CSharpName): support ushort.
22567 * expression.cs (Expression::TryImplicitIntConversion): Attempts
22568 to provide an expression that performsn an implicit constant int
22569 conversion (section 6.1.6).
22570 (Expression::ConvertImplicitRequired): Reworked to include
22571 implicit constant expression conversions.
22573 (Expression::ConvertNumericExplicit): Finished.
22575 (Invocation::Emit): If InstanceExpression is null, then it means
22576 that we perform a call on this.
22578 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22580 * expression.cs (Unary::Emit): Remove some dead code.
22581 (Probe): Implement Resolve and Emit for `is'.
22582 (Expression::ConvertImplicitRequired): Attempt to do constant
22583 expression conversions here. Maybe should be moved to
22584 ConvertImplicit, but I am not sure.
22585 (Expression::ImplicitLongConstantConversionPossible,
22586 Expression::ImplicitIntConstantConversionPossible): New functions
22587 that tell whether is it possible to apply an implicit constant
22588 expression conversion.
22590 (ConvertNumericExplicit): Started work on explicit numeric
22593 * cs-parser.jay: Update operator constants.
22595 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22596 (Parameters::GetSignature): Hook up VerifyArgs here.
22597 (Parameters::VerifyArgs): Verifies that no two arguments have the
22600 * class.cs (Operator): Update the operator names to reflect the
22601 ones that the spec expects (as we are just stringizing the
22604 * expression.cs (Unary::ResolveOperator): Fix bug: Use
22605 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22606 previous usage did only work for our methods.
22607 (Expression::ConvertImplicit): Handle decimal implicit numeric
22608 conversions as well.
22609 (Expression::InternalTypeConstructor): Used to invoke constructors
22610 on internal types for default promotions.
22612 (Unary::Emit): Implement special handling for the pre/post
22613 increment/decrement for overloaded operators, as they need to have
22614 the same semantics as the other operators.
22616 (Binary::ResolveOperator): ditto.
22617 (Invocation::ConversionExists): ditto.
22618 (UserImplicitCast::Resolve): ditto.
22620 2001-09-26 Ravi Pratap <ravi@ximian.com>
22622 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22623 operator, return after emitting body. Regression tests pass again !
22625 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22626 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22627 (Invocation::OverloadResolve): Ditto.
22628 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22630 * everywhere : update calls to the above methods accordingly.
22632 2001-09-26 Miguel de Icaza <miguel@ximian.com>
22634 * assign.cs (Assign): Make it inherit from ExpressionStatement.
22636 * expression.cs (ExpressionStatement): New base class used for
22637 expressions that can appear in statements, so that we can provide
22638 an alternate path to generate expression that do not leave a value
22641 (Expression::Emit, and all the derivatives): We no longer return
22642 whether a value is left on the stack or not. Every expression
22643 after being emitted leaves a single value on the stack.
22645 * codegen.cs (EmitContext::EmitStatementExpression): Use the
22646 facilties of ExpressionStatement if possible.
22648 * cs-parser.jay: Update statement_expression.
22650 2001-09-25 Miguel de Icaza <miguel@ximian.com>
22652 * driver.cs: Change the wording of message
22654 2001-09-25 Ravi Pratap <ravi@ximian.com>
22656 * expression.cs (Binary::ResolveOperator): Had forgottten to set
22657 the type of the expression to the return type of the method if
22658 we have an overloaded operator match ! The regression tests pass again !
22659 (Unary::ResolveOperator): Ditto.
22661 * expression.cs (Invocation::ConversionExists): Correct the member lookup
22662 to find "op_Implicit", not "implicit" ;-)
22663 (UserImplicitCast): New class to take care of user-defined implicit conversions.
22664 (ConvertImplicit, ForceConversion): Take TypeContainer argument
22666 * everywhere : Correct calls to the above accordingly.
22668 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22669 (ConvertImplicit): Do user-defined conversion if it exists.
22671 2001-09-24 Miguel de Icaza <miguel@ximian.com>
22673 * assign.cs: track location.
22674 (Resolve): Use implicit conversions on assignment.
22676 * literal.cs: Oops. Not good, Emit of short access values should
22677 pass (Bytes) or the wrong argument will be selected.
22679 * expression.cs (Unary::Emit): Emit code for -expr.
22681 (Unary::ResolveOperator): Handle `Substract' for non-constants
22682 (substract from zero from the non-constants).
22683 Deal with Doubles as well.
22685 (Expression::ConvertImplicitRequired): New routine that reports an
22686 error if no implicit conversion exists.
22688 (Invocation::OverloadResolve): Store the converted implicit
22689 expressions if we make them
22691 2001-09-24 Ravi Pratap <ravi@ximian.com>
22693 * class.cs (ConstructorInitializer): Take a Location argument.
22694 (ConstructorBaseInitializer): Same here.
22695 (ConstructorThisInitializer): Same here.
22697 * cs-parser.jay : Update all calls accordingly.
22699 * expression.cs (Unary, Binary, New): Take location argument.
22700 Update accordingly everywhere.
22702 * cs-parser.jay : Update all calls to the above to take a location
22705 * class.cs : Ditto.
22707 2001-09-24 Ravi Pratap <ravi@ximian.com>
22709 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22710 (Invocation::BetterConversion): Same here
22711 (Invocation::ConversionExists): Ditto.
22713 (Invocation::ConversionExists): Implement.
22715 2001-09-22 Ravi Pratap <ravi@ximian.com>
22717 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22718 Also take an additional TypeContainer argument.
22720 * All over : Pass in TypeContainer as argument to OverloadResolve.
22722 * typemanager.cs (CSharpName): Update to check for the string type and return
22725 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22728 2001-09-21 Ravi Pratap <ravi@ximian.com>
22730 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22731 (Invocation::BetterFunction): Implement.
22732 (Invocation::BetterConversion): Implement.
22733 (Invocation::ConversionExists): Skeleton, no implementation yet.
22735 Okay, things work fine !
22737 2001-09-21 Miguel de Icaza <miguel@ximian.com>
22739 * typemanager.cs: declare and load enum_type, delegate_type and
22742 * expression.cs (Expression::Emit): Now emit returns a value that
22743 tells whether a value is left on the stack or not. This strategy
22744 might be reveted tomorrow with a mechanism that would address
22745 multiple assignments.
22746 (Expression::report118): Utility routine to report mismatches on
22749 (Unary::Report23): Report impossible type/operator combination
22752 (Unary::IsIncrementableNumber): Whether the type can be
22753 incremented or decremented with add.
22754 (Unary::ResolveOperator): Also allow enumerations to be bitwise
22756 (Unary::ResolveOperator): Implement ++, !, ~,
22758 (Invocation::Emit): Deal with new Emit convetion.
22760 * All Expression derivatives: Updated their Emit method to return
22761 whether they leave values on the stack or not.
22763 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22764 stack for expressions that are statements.
22766 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22768 * expression.cs (LValue): New interface. Must be implemented by
22770 (LocalVariableReference, ParameterReference, FieldExpr): Implement
22773 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22774 interface for generating code, simplifies the code.
22776 2001-09-20 Ravi Pratap <ravi@ximian.com>
22778 * expression.cs (everywhere): Comment out return statements in ::Resolve
22779 methods to avoid the warnings.
22781 2001-09-20 Miguel de Icaza <miguel@ximian.com>
22783 * driver.cs (parse): Report error 2001 if we can not open the
22786 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22789 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22792 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22793 otherwise nested blocks end up with the same index.
22795 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22797 * expression.cs: Instead of having FIXMEs in the Resolve
22798 functions, throw exceptions so it is obvious that we are facing a
22801 * cs-parser.jay (invocation_expression): Pass Location information.
22803 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22804 Use a basename for those routines because .NET does not like paths
22807 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22810 2001-09-19 Miguel de Icaza <miguel@ximian.com>
22812 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22813 are loading the correct data types (throws an exception if not).
22814 (TypeManager::InitCoreTypes): Use CoreLookupType
22816 * expression.cs (Unary::ResolveOperator): return the child
22817 expression for expressions which are just +expr.
22818 (Unary::ResolveOperator): Return negative literals for -LITERAL
22819 expressions (otherwise they are Unary {Literal}).
22820 (Invocation::Badness): Take into account `Implicit constant
22821 expression conversions'.
22823 * literal.cs (LongLiteral): Implement long literal class.
22824 (IntLiteral): export the `Value' of the intliteral.
22826 2001-09-19 Ravi Pratap <ravi@ximian.com>
22828 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22830 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
22831 instead of 'Operator'
22833 * expression.cs (Binary::ResolveOperator): Update accordingly.
22834 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22837 * cs-parser.jay (unary_expression): Update to use the new names.
22839 * gen-treedump.cs (GetUnary): Same here.
22841 * expression.cs (Unary::Resolve): Implement.
22842 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
22843 operators are found instead of making noise ;-)
22844 (Unary::ResolveOperator): New method to do precisely the same thing which
22845 Binary::ResolveOperator does for Binary expressions.
22846 (Unary.method, .Arguments): Add.
22847 (Unary::OperName): Implement.
22848 (Unary::ForceConversion): Copy and Paste !
22850 * class.cs (Operator::Define): Fix a small bug for the case when we have
22853 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22854 for the inbuilt operators. Only overloading works for now ;-)
22856 2001-09-18 Miguel de Icaza <miguel@ximian.com>
22858 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22859 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22861 * expression.cs (This::Emit): Implement.
22862 (This::Resolve): Implement.
22863 (TypeOf:Resolve): Implement.
22864 (Expression::ResolveSimpleName): Add an implicit this to instance
22866 (MemberAccess::Resolve): Deal with Parameters and Fields.
22867 Bind instance variable to Field expressions.
22868 (FieldExpr::Instance): New field used to track the expression that
22869 represents the object instance.
22870 (FieldExpr::Resolve): Track potential errors from MemberLookup not
22872 (FieldExpr::Emit): Implement.
22874 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22875 the last instruction contains a return opcode to avoid generating
22876 the last `ret' instruction (this generates correct code, and it is
22877 nice to pass the peverify output).
22879 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22880 initializer for static and instance variables.
22881 (Constructor::Emit): Allow initializer to be null in the case of
22882 static constructors. Only emit initializer for instance
22885 (TypeContainer::FindMembers): Return a null array if there are no
22888 Also fix the code for the MemberTypes.Method branch, as it was not
22889 scanning that for operators (or tried to access null variables before).
22891 * assign.cs (Assign::Emit): Handle instance and static fields.
22895 * driver.cs: Stop compilation if there are parse errors.
22897 * cs-parser.jay (constructor_declaration): Provide default base
22898 initializer for non-static constructors.
22899 (constructor_declarator): Do not provide a default base
22900 initializers if none was specified.
22901 Catch the fact that constructors should not have parameters.
22903 * class.cs: Do not emit parent class initializers for static
22904 constructors, that should be flagged as an error.
22906 2001-09-18 Ravi Pratap <ravi@ximian.com>
22908 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22909 Move back code into TypeContainer::Populate.
22911 2001-09-18 Ravi Pratap <ravi@ximian.com>
22913 * class.cs (TypeContainer::AddConstructor): Fix the check to
22914 compare against Name, not Basename.
22915 (Operator::OpType): Change Plus and Minus to Add and Subtract.
22917 * cs-parser.jay : Update accordingly.
22919 * class.cs (TypeContainer::FindMembers): For the case where we are searching
22920 for methods, don't forget to look into the operators too.
22921 (RegisterMethodBuilder): Helper method to take care of this for
22922 methods, constructors and operators.
22923 (Operator::Define): Completely revamp.
22924 (Operator.OperatorMethod, MethodName): New fields.
22925 (TypeContainer::Populate): Move the registering of builders into
22926 RegisterMethodBuilder.
22927 (Operator::Emit): Re-write.
22929 * expression.cs (Binary::Emit): Comment out code path to emit method
22930 invocation stuff for the case when we have a user defined operator. I am
22931 just not able to get it right !
22933 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22935 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22938 (Expression::MemberLookup): Provide a version that allows to
22939 specify the MemberTypes and BindingFlags.
22941 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22942 so it was not fetching variable information from outer blocks.
22944 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22945 Beforefieldinit as it was buggy.
22947 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22948 that Ravi put here.
22950 * class.cs (Constructor::Emit): Only emit if block is not null.
22951 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22952 deal with this by semantically definining it as if the user had
22955 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22956 constructors as we now "emit" them at a higher level.
22958 (TypeContainer::DefineDefaultConstructor): Used to define the
22959 default constructors if none was provided.
22961 (ConstructorInitializer): Add methods Resolve and Emit.
22963 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22965 2001-09-17 Ravi Pratap <ravi@ximian.com>
22967 * class.cs (TypeContainer::EmitDefaultConstructor): Register
22968 the default constructor builder with our hashtable for methodbuilders
22971 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22972 and argument_count is 0 in which case we have a match.
22973 (Binary::ResolveOperator): More null checking and miscellaneous coding
22976 2001-09-17 Ravi Pratap <ravi@ximian.com>
22978 * rootcontext.cs (IsNameSpace): Compare against null.
22980 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22982 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22983 and Unary::Operator.
22985 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22988 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22989 we have overloaded operators.
22990 (Binary::ResolveOperator): Implement the part which does the operator overload
22993 * class.cs (Operator::Emit): Implement.
22994 (TypeContainer::Emit): Emit the operators we have too.
22996 * expression.cs (Binary::Emit): Update to emit the appropriate code for
22997 the case when we have a user-defined operator.
22999 2001-09-17 Miguel de Icaza <miguel@ximian.com>
23001 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
23003 2001-09-16 Ravi Pratap <ravi@ximian.com>
23005 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
23006 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
23007 (Constructor::Emit): Implement.
23008 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
23009 if we have no work to do.
23010 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
23013 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
23014 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
23016 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
23019 2001-09-15 Ravi Pratap <ravi@ximian.com>
23021 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
23023 (Tree::RecordNamespace): Method to do what the name says ;-)
23024 (Tree::Namespaces): Property to get at the namespaces hashtable.
23026 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
23029 * rootcontext.cs (IsNamespace): Fixed it :-)
23031 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23033 * class.cs (TypeContainer::FindMembers): Add support for
23035 (MethodCore): New class that encapsulates both the shared aspects
23036 of a Constructor and a Method.
23037 (Method, Constructor): Factored pieces into MethodCore.
23039 * driver.cs: Added --fatal which makes errors throw exceptions.
23040 Load System assembly as well as part of the standard library.
23042 * report.cs: Allow throwing exceptions on errors for debugging.
23044 * modifiers.cs: Do not use `parent', instead use the real type
23045 container to evaluate permission settings.
23047 * class.cs: Put Ravi's patch back in. He is right, and we will
23048 have to cope with the
23050 2001-09-14 Ravi Pratap <ravi@ximian.com>
23052 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
23053 FamORAssem, not FamANDAssem.
23055 2001-09-14 Miguel de Icaza <miguel@ximian.com>
23057 * driver.cs: Added --parse option that only parses its input files
23060 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
23061 incorrect. IsTopLevel is not used to tell whether an object is
23062 root_types or not (that can be achieved by testing this ==
23063 root_types). But to see if this is a top-level *class* (not
23064 necessarly our "toplevel" container).
23066 2001-09-14 Ravi Pratap <ravi@ximian.com>
23068 * enum.cs (Enum::Define): Modify to call the Lookup method on the
23069 parent instead of a direct call to GetType.
23071 2001-09-14 Ravi Pratap <ravi@ximian.com>
23073 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
23074 Modifiers.TypeAttr. This should just be a call to that method.
23076 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
23077 object so that we can determine if we are top-level or not.
23079 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
23082 * enum.cs (Enum::Define): Ditto.
23084 * modifiers.cs (FieldAttr): Re-write.
23086 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
23087 (TypeContainer::HaveStaticConstructor): New property to provide access
23088 to precisely that info.
23090 * modifiers.cs (MethodAttr): Re-write.
23091 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
23093 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
23094 of top-level types as claimed.
23096 2001-09-13 Miguel de Icaza <miguel@ximian.com>
23098 * expression.cs (MemberLookup): Fruitless attempt to lookup
23099 constructors. Maybe I need to emit default constructors? That
23100 might be it (currently .NET emits this for me automatically).
23101 (Invocation::OverloadResolve): Cope with Arguments == null.
23102 (Invocation::EmitArguments): new function, shared by the new
23103 constructor and us.
23104 (Invocation::Emit): Handle static and instance methods. Emit
23105 proper call instruction for virtual or non-virtual invocations.
23106 (New::Emit): Implement.
23107 (New::Resolve): Implement.
23108 (MemberAccess:Resolve): Implement.
23109 (MethodGroupExpr::InstanceExpression): used conforming to the spec
23110 to track instances.
23111 (FieldExpr::Resolve): Set type.
23113 * support.cs: Handle empty arguments.
23115 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
23116 SimpleLookup): Auxiliary routines to help parse a qualifier
23119 Update qualifier_identifier rule.
23121 * codegen.cs: Removed debugging messages.
23123 * class.cs: Make this a global thing, this acts just as a "key" to
23124 objects that we might have around.
23126 (Populate): Only initialize method_builders_to_methods once.
23128 * expression.cs (PropertyExpr): Initialize type from the
23131 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
23132 Resolve pattern. Attempt to implicitly convert value to boolean.
23135 * expression.cs: Set the type for the int32/int32 argument case.
23136 (Binary::ResolveOperator): Set the return type to boolean for
23137 comparission operators
23139 * typemanager.cs: Remove debugging print code.
23141 (Invocation::Resolve): resolve type.
23143 * class.cs: Allocate a MemberInfo of the correct size, as the code
23144 elsewhere depends on the test to reflect the correct contents.
23146 (Method::) Keep track of parameters, due to System.Reflection holes
23148 (TypeContainer::Populate): Keep track of MethodBuilders to Method
23151 (TypeContainer::FindMembers): Use ArrayList and then copy an array
23152 of the exact size and return that.
23154 (Class::LookupMethodByBuilder): New function that maps
23155 MethodBuilders to its methods. Required to locate the information
23156 on methods because System.Reflection bit us again.
23158 * support.cs: New file, contains an interface ParameterData and
23159 two implementations: ReflectionParameters and InternalParameters
23160 used to access Parameter information. We will need to grow this
23163 * expression.cs (Invocation::GetParameterData): implement a cache
23164 and a wrapper around the ParameterData creation for methods.
23165 (Invocation::OverloadResolve): Use new code.
23167 2001-09-13 Ravi Pratap <ravi@ximian.com>
23169 * class.cs (TypeContainer::EmitField): Remove and move into
23170 (Field::Define): here and modify accordingly.
23171 (Field.FieldBuilder): New member.
23172 (TypeContainer::Populate): Update accordingly.
23173 (TypeContainer::FindMembers): Implement.
23175 2001-09-13 Miguel de Icaza <miguel@ximian.com>
23177 * statement.cs: (VariableInfo::VariableType): New field to be
23178 initialized with the full type once it is resolved.
23180 2001-09-12 Miguel de Icaza <miguel@ximian.com>
23182 * parameter.cs (GetParameterInfo): Use a type cache to compute
23183 things only once, and to reuse this information
23185 * expression.cs (LocalVariableReference::Emit): Implement.
23186 (OpcodeCast::Emit): fix.
23188 (ParameterReference::Resolve): Implement.
23189 (ParameterReference::Emit): Implement.
23191 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
23192 that are expressions need to stay as Expressions.
23194 * typemanager.cs (CSharpName): Returns the C# name of a type if
23197 * expression.cs (Expression::ConvertImplicit): New function that
23198 implements implicit type conversions.
23200 (Expression::ImplicitReferenceConversion): Implements implicit
23201 reference conversions.
23203 (EmptyCast): New type for transparent casts.
23205 (OpcodeCast): New type for casts of types that are performed with
23206 a sequence of bytecodes.
23208 (BoxedCast): New type used for casting value types into reference
23209 types. Emits a box opcode.
23211 (Binary::DoNumericPromotions): Implements numeric promotions of
23212 and computation of the Binary::Type.
23214 (Binary::EmitBranchable): Optimization.
23216 (Binary::Emit): Implement code emission for expressions.
23218 * typemanager.cs (TypeManager): Added two new core types: sbyte
23221 2001-09-12 Ravi Pratap <ravi@ximian.com>
23223 * class.cs (TypeContainer::FindMembers): Method which does exactly
23224 what Type.FindMembers does, only we don't have to use reflection. No
23225 implementation yet.
23227 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
23228 typecontainer objects as we need to get at them.
23229 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
23231 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
23232 typecontainer object.
23234 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
23235 of just a Report object.
23237 2001-09-11 Ravi Pratap <ravi@ximian.com>
23239 * class.cs (Event::Define): Go back to using the prefixes "add_" and
23241 (TypeContainer::Populate): Now define the delegates of the type too.
23242 (TypeContainer.Delegates): Property to access the list of delegates defined
23245 * delegates.cs (Delegate::Define): Implement partially.
23247 * modifiers.cs (TypeAttr): Handle more flags.
23249 2001-09-11 Ravi Pratap <ravi@ximian.com>
23251 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
23253 (Operator::Define): Re-write logic to get types by using the LookupType method
23254 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
23255 (Indexer::Define): Ditto.
23256 (Event::Define): Ditto.
23257 (Property::Define): Ditto.
23259 2001-09-10 Ravi Pratap <ravi@ximian.com>
23261 * class.cs (TypeContainer::Populate): Now define operators too.
23262 (TypeContainer.Operators): New property to access the list of operators
23264 (Operator.OperatorMethodBuilder): New member to hold the method builder
23265 for the operator we are defining.
23266 (Operator::Define): Implement.
23268 2001-09-10 Ravi Pratap <ravi@ximian.com>
23270 * class.cs (Event::Define): Make the prefixes of the accessor methods
23271 addOn_ and removeOn_
23273 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
23274 of the location being passed in too. Ideally, this should go later since all
23275 error reporting should be done through the Report object.
23277 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
23278 (Populate): Iterate thru the indexers we have and define them too.
23279 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
23280 for the get and set accessors.
23281 (Indexer::Define): Implement.
23283 2001-09-09 Miguel de Icaza <miguel@ximian.com>
23285 * expression.cs (Binary::Resolve): Beginning of it. I scratched
23286 my previous implementation, did not work.
23288 * typemanager.cs: Add a couple of missing types (the longs).
23290 * literal.cs: Use TypeManager.bool_type instead of getting it.
23292 * expression.cs (EventExpr): New kind of expressions.
23293 (Expressio::ExprClassFromMemberInfo): finish
23295 2001-09-08 Miguel de Icaza <miguel@ximian.com>
23297 * assign.cs: Emit stores to static fields differently.
23299 2001-09-08 Ravi Pratap <ravi@ximian.com>
23301 * Merge in changes and adjust code to tackle conflicts. Backed out my
23302 code in Assign::Resolve ;-)
23304 2001-09-08 Ravi Pratap <ravi@ximian.com>
23306 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
23307 instead Report.Error and also pass in the location.
23308 (CSharpParser::Lexer): New readonly property to return the reference
23309 to the Tokenizer object.
23310 (declare_local_variables): Use Report.Error with location instead of plain
23314 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
23315 (Operator.CheckBinaryOperator): Ditto.
23317 * cs-parser.jay (operator_declarator): Update accordingly.
23319 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
23320 (CheckBinaryOperator): Same here.
23322 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
23323 on the name without any prefixes of namespace names etc. This is because we
23324 already might have something already fully qualified like
23325 'System.Console.WriteLine'
23327 * assign.cs (Resolve): Begin implementation. Stuck ;-)
23329 2001-09-07 Ravi Pratap <ravi@ximian.com>
23331 * cs-tokenizer.cs (location): Return a string which also contains
23334 * expression.cs (ElementAccess): New class for expressions of the
23335 type 'element access.'
23336 (BaseAccess): New class for expressions of the type 'base access.'
23337 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
23340 * cs-parser.jay (element_access): Implement action.
23341 (base_access): Implement actions.
23342 (checked_expression, unchecked_expression): Implement.
23344 * cs-parser.jay (local_variable_type): Correct and implement.
23345 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
23347 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
23349 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
23350 name and the specifiers.
23352 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
23354 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
23355 making them all public ;-)
23357 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
23360 2001-09-07 Miguel de Icaza <miguel@ximian.com>
23362 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
23364 (FieldExpr, PropertyExprs): New resolved expressions.
23365 (SimpleName::MemberStaticCheck): Perform static checks for access
23366 to non-static fields on static methods. Maybe this should be
23367 generalized for MemberAccesses.
23368 (SimpleName::ResolveSimpleName): More work on simple name
23371 * cs-parser.jay (primary_expression/qualified_identifier): track
23372 the parameter index.
23374 * codegen.cs (CodeGen::Save): Catch save exception, report error.
23375 (EmitContext::EmitBoolExpression): Chain to expression generation
23376 instead of temporary hack.
23377 (::EmitStatementExpression): Put generic expression code generation.
23379 * assign.cs (Assign::Emit): Implement variable assignments to
23380 local variables, parameters and fields.
23382 2001-09-06 Miguel de Icaza <miguel@ximian.com>
23384 * statement.cs (Block::GetVariableInfo): New method, returns the
23385 VariableInfo for a variable name in a block.
23386 (Block::GetVariableType): Implement in terms of GetVariableInfo
23388 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
23389 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
23391 2001-09-06 Ravi Pratap <ravi@ximian.com>
23393 * cs-parser.jay (operator_declaration): Continue on my quest : update
23394 to take attributes argument.
23395 (event_declaration): Ditto.
23396 (enum_declaration): Ditto.
23397 (indexer_declaration): Ditto.
23399 * class.cs (Operator::Operator): Update constructor accordingly.
23400 (Event::Event): Ditto.
23402 * delegate.cs (Delegate::Delegate): Same here.
23404 * enum.cs (Enum::Enum): Same here.
23406 2001-09-05 Ravi Pratap <ravi@ximian.com>
23408 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23410 * ../tests/cs0658.cs : New file to demonstrate error 0658.
23412 * attribute.cs (Attributes): New class to encapsulate all attributes which were
23413 being passed around as an arraylist.
23414 (Attributes::AddAttribute): Method to add attribute sections.
23416 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23417 (struct_declaration): Update accordingly.
23418 (constant_declaration): Update.
23419 (field_declaration): Update.
23420 (method_header): Update.
23421 (fixed_parameter): Update.
23422 (parameter_array): Ditto.
23423 (property_declaration): Ditto.
23424 (destructor_declaration): Ditto.
23426 * class.cs (Struct::Struct): Update constructors accordingly.
23427 (Class::Class): Ditto.
23428 (Field::Field): Ditto.
23429 (Method::Method): Ditto.
23430 (Property::Property): Ditto.
23431 (TypeContainer::OptAttribute): update property's return type.
23433 * interface.cs (Interface.opt_attributes): New member.
23434 (Interface::Interface): Update to take the extra Attributes argument.
23436 * parameter.cs (Parameter::Parameter): Ditto.
23438 * constant.cs (Constant::Constant): Ditto.
23440 * interface.cs (InterfaceMemberBase): New OptAttributes field.
23441 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
23442 the attributes as a parameter.
23443 (InterfaceProperty): Update constructor call.
23444 (InterfaceEvent): Ditto.
23445 (InterfaceMethod): Ditto.
23446 (InterfaceIndexer): Ditto.
23448 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
23449 pass the attributes too.
23450 (interface_event_declaration): Ditto.
23451 (interface_property_declaration): Ditto.
23452 (interface_method_declaration): Ditto.
23453 (interface_declaration): Ditto.
23455 2001-09-05 Miguel de Icaza <miguel@ximian.com>
23457 * class.cs (Method::Define): Track the "static Main" definition to
23458 create an entry point.
23460 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23461 EntryPoint if we find it.
23463 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23464 (EmitContext::ig): Make this variable public.
23466 * driver.cs: Make the default output file be the first file name
23467 with the .exe extension.
23469 Detect empty compilations
23471 Handle various kinds of output targets. Handle --target and
23472 rename -t to --dumper.
23474 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23475 methods inherited from Expression return now an Expression. This
23476 will is used during the tree rewriting as we resolve them during
23479 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23480 the spec. Missing entirely is the information about
23481 accessability of elements of it.
23483 (Expression::ExprClassFromMemberInfo): New constructor for
23484 Expressions that creates a fully initialized Expression based on
23485 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23488 (Invocation::Resolve): Begin implementing resolution of invocations.
23490 * literal.cs (StringLiteral): Implement Emit.
23492 2001-09-05 Ravi Pratap <ravi@ximian.com>
23494 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23497 2001-09-04 Ravi Pratap <ravi@ximian.com>
23499 * cs-parser.jay (attribute_arguments): Implement actions.
23500 (attribute): Fix bug in production. Implement action.
23501 (attribute_list): Implement.
23502 (attribute_target): Implement.
23503 (attribute_target_specifier, opt_target_specifier): Implement
23504 (CheckAttributeTarget): New method to check if the attribute target
23506 (attribute_section): Implement.
23507 (opt_attributes): Implement.
23509 * attribute.cs : New file to handle attributes.
23510 (Attribute): Class to hold attribute info.
23512 * cs-parser.jay (opt_attribute_target_specifier): Remove production
23513 (attribute_section): Modify production to use 2 different rules to
23514 achieve the same thing. 1 s/r conflict down !
23515 Clean out commented, useless, non-reducing dimension_separator rules.
23517 * class.cs (TypeContainer.attributes): New member to hold list
23518 of attributes for a type.
23519 (Struct::Struct): Modify to take one more argument, the attribute list.
23520 (Class::Class): Ditto.
23521 (Field::Field): Ditto.
23522 (Method::Method): Ditto.
23523 (Property::Property): Ditto.
23525 * cs-parser.jay (struct_declaration): Update constructor call to
23526 pass in the attributes too.
23527 (class_declaration): Ditto.
23528 (constant_declaration): Ditto.
23529 (field_declaration): Ditto.
23530 (method_header): Ditto.
23531 (fixed_parameter): Ditto.
23532 (parameter_array): Ditto.
23533 (property_declaration): Ditto.
23535 * constant.cs (Constant::Constant): Update constructor similarly.
23536 Use System.Collections.
23538 * parameter.cs (Parameter::Parameter): Update as above.
23540 2001-09-02 Ravi Pratap <ravi@ximian.com>
23542 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23543 (TypeContainer.delegates): New member to hold list of delegates.
23545 * cs-parser.jay (delegate_declaration): Implement the action correctly
23546 this time as I seem to be on crack ;-)
23548 2001-09-02 Miguel de Icaza <miguel@ximian.com>
23550 * rootcontext.cs (RootContext::IsNamespace): new function, used to
23551 tell whether an identifier represents a namespace.
23553 * expression.cs (NamespaceExpr): A namespace expression, used only
23554 temporarly during expression resolution.
23555 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23556 utility functions to resolve names on expressions.
23558 2001-09-01 Miguel de Icaza <miguel@ximian.com>
23560 * codegen.cs: Add hook for StatementExpressions.
23562 * class.cs: Fix inverted test for static flag in methods.
23564 2001-09-02 Ravi Pratap <ravi@ximian.com>
23566 * class.cs (Operator::CheckUnaryOperator): Correct error number used
23567 to make it coincide with MS' number.
23568 (Operator::CheckBinaryOperator): Ditto.
23570 * ../errors/errors.txt : Remove error numbers added earlier.
23572 * ../errors/cs1019.cs : Test case for error # 1019
23574 * ../errros/cs1020.cs : Test case for error # 1020
23576 * cs-parser.jay : Clean out commented cruft.
23577 (dimension_separators, dimension_separator): Comment out. Ostensibly not
23578 used anywhere - non-reducing rule.
23579 (namespace_declarations): Non-reducing rule - comment out.
23581 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23582 with TypeContainer::AddEnum.
23584 * delegate.cs : New file for delegate handling classes.
23585 (Delegate): Class for declaring delegates.
23587 * makefile : Update.
23589 * cs-parser.jay (delegate_declaration): Implement.
23591 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
23593 * class.cs (Event::Define): Implement.
23594 (Event.EventBuilder): New member.
23596 * class.cs (TypeContainer::Populate): Update to define all enums and events
23598 (Events): New property for the events arraylist we hold. Shouldn't we move to using
23599 readonly fields for all these cases ?
23601 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23603 * class.cs (Property): Revamp to use the convention of making fields readonly.
23604 Accordingly modify code elsewhere.
23606 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23607 the Define method of the Property class.
23609 * class.cs : Clean up applied patch and update references to variables etc. Fix
23611 (TypeContainer::Populate): Update to define all the properties we have. Also
23612 define all enumerations.
23614 * enum.cs (Define): Implement.
23616 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
23618 * cs-parser.jay (overloadable_operator): The semantic value is an
23619 enum of the Operator class.
23620 (operator_declarator): Implement actions.
23621 (operator_declaration): Implement.
23623 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23624 validity of definitions.
23625 (Operator::CheckBinaryOperator): Static method to check for binary operators
23626 (TypeContainer::AddOperator): New method to add an operator to a type.
23628 * cs-parser.jay (indexer_declaration): Added line to actually call the
23629 AddIndexer method so it gets added ;-)
23631 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
23632 already taken care of by the MS compiler ?
23634 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23636 * class.cs (Operator): New class for operator declarations.
23637 (Operator::OpType): Enum for the various operators.
23639 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
23641 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23642 ostensibly handle this in semantic analysis.
23644 * cs-parser.jay (general_catch_clause): Comment out
23645 (specific_catch_clauses, specific_catch_clause): Ditto.
23646 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23647 (catch_args, opt_catch_args): New productions.
23648 (catch_clause): Rewrite to use the new productions above
23649 (catch_clauses): Modify accordingly.
23650 (opt_catch_clauses): New production to use in try_statement
23651 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23652 and re-write the code in the actions to extract the specific and
23653 general catch clauses by being a little smart ;-)
23655 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23656 Hooray, try and catch statements parse fine !
23658 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23660 * statement.cs (Block::GetVariableType): Fix logic to extract the type
23661 string from the hashtable of variables.
23663 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23664 I end up making that mistake ;-)
23665 (catch_clauses): Fixed gross error which made Key and Value of the
23666 DictionaryEntry the same : $1 !!
23668 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23670 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23672 * cs-parser.jay (event_declaration): Correct to remove the semicolon
23673 when the add and remove accessors are specified.
23675 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
23677 * cs-parser.jay (IndexerDeclaration): New helper class to hold
23678 information about indexer_declarator.
23679 (indexer_declarator): Implement actions.
23680 (parsing_indexer): New local boolean used to keep track of whether
23681 we are parsing indexers or properties. This is necessary because
23682 implicit_parameters come into picture even for the get accessor in the
23683 case of an indexer.
23684 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23686 * class.cs (Indexer): New class for indexer declarations.
23687 (TypeContainer::AddIndexer): New method to add an indexer to a type.
23688 (TypeContainer::indexers): New member to hold list of indexers for the
23691 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23693 * cs-parser.jay (add_accessor_declaration): Implement action.
23694 (remove_accessor_declaration): Implement action.
23695 (event_accessors_declaration): Implement
23696 (variable_declarators): swap statements for first rule - trivial.
23698 * class.cs (Event): New class to hold information about event
23700 (TypeContainer::AddEvent): New method to add an event to a type
23701 (TypeContainer::events): New member to hold list of events.
23703 * cs-parser.jay (event_declaration): Implement actions.
23705 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
23707 * cs-parser.jay (dim_separators): Implement. Make it a string
23708 concatenating all the commas together, just as they appear.
23709 (opt_dim_separators): Modify accordingly
23710 (rank_specifiers): Update accordingly. Basically do the same
23711 thing - instead, collect the brackets here.
23712 (opt_rank_sepcifiers): Modify accordingly.
23713 (array_type): Modify to actually return the complete type string
23714 instead of ignoring the rank_specifiers.
23715 (expression_list): Implement to collect the expressions
23716 (variable_initializer): Implement. We make it a list of expressions
23717 essentially so that we can handle the array_initializer case neatly too.
23718 (variable_initializer_list): Implement.
23719 (array_initializer): Make it a list of variable_initializers
23720 (opt_array_initializer): Modify accordingly.
23722 * expression.cs (New::NType): Add enumeration to help us
23723 keep track of whether we have an object/delegate creation
23724 or an array creation.
23725 (New:NewType, New::Rank, New::Indices, New::Initializers): New
23726 members to hold data about array creation.
23727 (New:New): Modify to update NewType
23728 (New:New): New Overloaded contructor for the array creation
23731 * cs-parser.jay (array_creation_expression): Implement to call
23732 the overloaded New constructor.
23734 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
23736 * class.cs (TypeContainer::Constructors): Return member
23737 constructors instead of returning null.
23739 2001-08-26 Miguel de Icaza <miguel@ximian.com>
23741 * typemanager.cs (InitCoreTypes): Initialize the various core
23742 types after we have populated the type manager with the user
23743 defined types (this distinction will be important later while
23744 compiling corlib.dll)
23746 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23747 on Expression Classification. Now all expressions have a method
23748 `Resolve' and a method `Emit'.
23750 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23751 generation from working. Also add some temporary debugging
23754 2001-08-24 Miguel de Icaza <miguel@ximian.com>
23756 * codegen.cs: Lots of code generation pieces. This is only the
23757 beginning, will continue tomorrow with more touches of polish. We
23758 handle the fundamentals of if, while, do, for, return. Others are
23759 trickier and I need to start working on invocations soon.
23761 * gen-treedump.cs: Bug fix, use s.Increment here instead of
23764 * codegen.cs (EmitContext): New struct, used during code
23765 emission to keep a context. Most of the code generation will be
23768 * cs-parser.jay: Add embedded blocks to the list of statements of
23769 this block. So code generation proceeds in a top down fashion.
23771 2001-08-23 Miguel de Icaza <miguel@ximian.com>
23773 * statement.cs: Add support for multiple child blocks.
23775 2001-08-22 Miguel de Icaza <miguel@ximian.com>
23777 * codegen.cs (EmitCode): New function, will emit the code for a
23778 Block of code given a TypeContainer and its ILGenerator.
23780 * statement.cs (Block): Standard public readonly optimization.
23781 (Block::Block constructors): Link children.
23782 (Block::Child): Child Linker.
23783 (Block::EmitVariables): Emits IL variable declarations.
23785 * class.cs: Drop support for MethodGroups here, delay until
23787 (Method::): Applied the same simplification that I did before, and
23788 move from Properties to public readonly fields.
23789 (Method::ParameterTypes): Returns the parameter types for the
23790 function, and implements a cache that will be useful later when I
23791 do error checking and the semantic analysis on the methods is
23793 (Constructor::GetCallingConvention): Renamed from CallingConvetion
23794 and made a method, optional argument tells whether this is a class
23795 or a structure to apply the `has-this' bit.
23796 (Method::GetCallingConvention): Implement, returns the calling
23798 (Method::Define): Defines the type, a second pass is performed
23799 later to populate the methods.
23801 (Constructor::ParameterTypes): implement a cache similar to the
23802 one on Method::ParameterTypes, useful later when we do semantic
23805 (TypeContainer::EmitMethod): New method. Emits methods.
23807 * expression.cs: Removed MethodGroup class from here.
23809 * parameter.cs (Parameters::GetCallingConvention): new method.
23811 2001-08-21 Miguel de Icaza <miguel@ximian.com>
23813 * class.cs (TypeContainer::Populate): Drop RootContext from the
23816 (Constructor::CallingConvention): Returns the calling convention.
23817 (Constructor::ParameterTypes): Returns the constructor parameter
23820 (TypeContainer::AddConstructor): Keep track of default constructor
23821 and the default static constructor.
23823 (Constructor::) Another class that starts using `public readonly'
23824 instead of properties.
23826 (Constructor::IsDefault): Whether this is a default constructor.
23828 (Field::) use readonly public fields instead of properties also.
23830 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23831 track of static constructors; If none is used, turn on
23832 BeforeFieldInit in the TypeAttributes.
23834 * cs-parser.jay (opt_argument_list): now the return can be null
23835 for the cases where there are no arguments.
23837 (constructor_declarator): If there is no implicit `base' or
23838 `this', then invoke the default parent constructor.
23840 * modifiers.cs (MethodAttr): New static function maps a set of
23841 modifiers flags into a MethodAttributes enum
23842 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
23843 MethodAttr, TypeAttr to represent the various mappings where the
23844 modifiers are used.
23845 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
23847 2001-08-19 Miguel de Icaza <miguel@ximian.com>
23849 * parameter.cs (GetParameterInfo): Fix bug where there would be no
23852 * interface.cs (PopulateIndexer): Implemented the code generator
23853 for interface indexers.
23855 2001-08-17 Miguel de Icaza <miguel@ximian.com>
23857 * interface.cs (InterfaceMemberBase): Now we track the new status
23860 (PopulateProperty): Implement property population. Woohoo! Got
23861 Methods and Properties going today.
23863 Removed all the properties for interfaces, and replaced them with
23864 `public readonly' fields.
23866 2001-08-16 Miguel de Icaza <miguel@ximian.com>
23868 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23869 initialize their hashtables/arraylists only when they are needed
23870 instead of doing this always.
23872 * parameter.cs: Handle refs and out parameters.
23874 * cs-parser.jay: Use an ArrayList to construct the arguments
23875 instead of the ParameterCollection, and then cast that to a
23878 * parameter.cs: Drop the use of ParameterCollection and use
23879 instead arrays of Parameters.
23881 (GetParameterInfo): Use the Type, not the Name when resolving
23884 2001-08-13 Miguel de Icaza <miguel@ximian.com>
23886 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23887 and instead use public readonly fields.
23889 * class.cs: Put back walking code for type containers.
23891 2001-08-11 Miguel de Icaza <miguel@ximian.com>
23893 * class.cs (MakeConstant): Code to define constants.
23895 * rootcontext.cs (LookupType): New function. Used to locate types
23898 2001-08-08 Miguel de Icaza <miguel@ximian.com>
23900 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
23901 this System.Reflection code is. Kudos to Microsoft
23903 * typemanager.cs: Implement a type cache and avoid loading all
23904 types at boot time. Wrap in LookupType the internals. This made
23905 the compiler so much faster. Wow. I rule!
23907 * driver.cs: Make sure we always load mscorlib first (for
23908 debugging purposes, nothing really important).
23910 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
23911 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
23913 * rootcontext.cs: Lookup types on their namespace; Lookup types
23914 on namespaces that have been imported using the `using' keyword.
23916 * class.cs (TypeContainer::TypeAttr): Virtualize.
23917 (Class::TypeAttr): Return attributes suitable for this bad boy.
23918 (Struct::TypeAttr): ditto.
23919 Handle nested classes.
23920 (TypeContainer::) Remove all the type visiting code, it is now
23921 replaced with the rootcontext.cs code
23923 * rootcontext.cs (GetClassBases): Added support for structs.
23925 2001-08-06 Miguel de Icaza <miguel@ximian.com>
23927 * interface.cs, statement.cs, class.cs, parameter.cs,
23928 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23929 Drop use of TypeRefs, and use strings instead.
23931 2001-08-04 Miguel de Icaza <miguel@ximian.com>
23935 * class.cs (Struct::Struct): set the SEALED flags after
23936 checking the modifiers.
23937 (TypeContainer::TypeAttr): new property, returns the
23938 TypeAttributes for a class.
23940 * cs-parser.jay (type_list): Oops, list production was creating a
23941 new list of base types.
23943 * rootcontext.cs (StdLib): New property.
23944 (GetInterfaceTypeByName): returns an interface by type name, and
23945 encapsulates error handling here.
23946 (GetInterfaces): simplified.
23947 (ResolveTree): Encapsulated all the tree resolution here.
23948 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23951 * driver.cs: Add support for --nostdlib, to avoid loading the
23952 default assemblies.
23953 (Main): Do not put tree resolution here.
23955 * rootcontext.cs: Beginning of the class resolution.
23957 2001-08-03 Miguel de Icaza <miguel@ximian.com>
23959 * rootcontext.cs: Provide better error reporting.
23961 * cs-parser.jay (interface_base): set our $$ to be interfaces.
23963 * rootcontext.cs (CreateInterface): Handle the case where there
23964 are no parent interfaces.
23966 (CloseTypes): Routine to flush types at the end.
23967 (CreateInterface): Track types.
23968 (GetInterfaces): Returns an array of Types from the list of
23969 defined interfaces.
23971 * typemanager.c (AddUserType): Mechanism to track user types (puts
23972 the type on the global type hash, and allows us to close it at the
23975 2001-08-02 Miguel de Icaza <miguel@ximian.com>
23977 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23978 RecordInterface instead.
23980 * cs-parser.jay: Updated to reflect changes above.
23982 * decl.cs (Definition): Keep track of the TypeBuilder type that
23983 represents this type here. Not sure we will use it in the long
23984 run, but wont hurt for now.
23986 * driver.cs: Smaller changes to accomodate the new code.
23988 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23991 * rootcontext.cs (CreateInterface): New method, used to create
23992 the System.TypeBuilder type for interfaces.
23993 (ResolveInterfaces): new entry point to resolve the interface
23995 (CodeGen): Property, used to keep track of the code generator.
23997 2001-07-26 Miguel de Icaza <miguel@ximian.com>
23999 * cs-parser.jay: Add a second production for delegate_declaration
24002 (enum_body): Put an opt_comma here instead of putting it on
24003 enum_body or enum_member_declarations so we can handle trailing
24004 commas on enumeration members. Gets rid of a shift/reduce.
24006 (type_list): Need a COMMA in the middle.
24008 (indexer_declaration): Tell tokenizer to recognize get/set
24010 * Remove old targets.
24012 * Re-add the parser target.
24014 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24016 * cs-parser.jay: Add precendence rules for a number of operators
24017 ot reduce the number of shift/reduce conflicts in the grammar.
24019 2001-07-17 Miguel de Icaza <miguel@ximian.com>
24021 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
24024 Get rid of old crufty code.
24026 * rootcontext.cs: Use this to keep track of the parsed
24027 representation and the defined types available to the program.
24029 * gen-treedump.cs: adjust for new convention.
24031 * type.cs: Split out the type manager, and the assembly builder
24034 * typemanager.cs: the type manager will live here now.
24036 * cil-codegen.cs: And the code generator here.
24038 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
24040 * makefile: Fixed up for easy making.
24042 2001-07-13 Simon Cozens <simon@simon-cozens.org>
24044 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
24047 (unary_expression): Expand pre_increment_expression and
24048 post_decrement_expression to reduce a shift/reduce.
24050 2001-07-11 Simon Cozens
24052 * cs-tokenizer.cs: Hex numbers should begin with a 0.
24054 Improve allow_keyword_as_indent name.
24056 2001-06-19 Miguel de Icaza <miguel@ximian.com>
24058 * Adjustments for Beta2.
24060 2001-06-13 Miguel de Icaza <miguel@ximian.com>
24062 * decl.cs: Added `Define' abstract method.
24063 (InTransit): new property, used to catch recursive definitions.
24065 * interface.cs: Implement `Define'.
24067 * modifiers.cs: Map Modifiers.constants to
24068 System.Reflection.TypeAttribute flags.
24070 * class.cs: Keep track of types and user-defined types.
24071 (BuilderInit): New method for creating an assembly
24072 (ResolveType): New function to launch the resolution process, only
24073 used by interfaces for now.
24075 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
24076 that are inserted into the name space.
24078 2001-06-08 Miguel de Icaza <miguel@ximian.com>
24080 * ARGH. I have screwed up my tree so many times due to the use of
24081 rsync rather than using CVS. Going to fix this at once.
24083 * driver.cs: Objetify driver. Load assemblies, use assemblies to
24086 2001-06-07 Miguel de Icaza <miguel@ximian.com>
24088 * Experiment successful: Use System.Type rather that our own
24091 2001-05-25 Miguel de Icaza <miguel@ximian.com>
24093 * cs-parser.jay: Removed nsAliases from here.
24095 Use new namespaces, handle `using XXX;'
24097 * namespace.cs: Reimplemented namespace handling, use a recursive
24098 definition of the class. Now we can keep track of using clauses
24099 and catch invalid using clauses.
24101 2001-05-24 Miguel de Icaza <miguel@ximian.com>
24103 * gen-treedump.cs: Adapted for all the renaming.
24105 * expression.cs (Expression): this class now has a Type property
24106 which returns an expression Type.
24108 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
24109 `Type', as this has a different meaning now in the base
24111 2001-05-22 Miguel de Icaza <miguel@ximian.com>
24113 * interface.cs, class.cs: Removed from all the sources the
24114 references to signature computation, as we can not do method
24115 signature computation during the parsing time, as we are not
24116 trying to solve at that point distinguishing:
24120 void a (NS.Blah x) {}
24123 Which depending on the context might be valid or not, as we do not
24124 know if Blah is the same thing as NS.Blah at that point.
24126 * Redid everything so the code uses TypeRefs now instead of
24127 Types. TypeRefs are just temporary type placeholders, that need
24128 to be resolved. They initially have a pointer to a string and the
24129 current scope in which they are used. This is used later by the
24130 compiler to resolve the reference to an actual Type.
24132 * DeclSpace is no longer a CIR.Type, and neither are
24133 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
24134 are all DeclSpaces, but no Types.
24136 * type.cs (TypeRefManager): This implements the TypeRef manager,
24137 which keeps track of all the types that need to be resolved after
24138 the parsing has finished.
24140 2001-05-13 Miguel de Icaza <miguel@ximian.com>
24142 * ARGH. We are going to have to store `foreach' as a class rather
24143 than resolving it, as we need to verify error 1579 after name
24144 resolution. *OR* we could keep a flag that says `This request to
24145 IEnumerator comes from a foreach statement' which we can then use
24146 to generate the error.
24148 2001-05-10 Miguel de Icaza <miguel@ximian.com>
24150 * class.cs (TypeContainer.AddMethod): we now add methods to the
24151 MethodGroup instead of the method hashtable.
24153 * expression.cs: Add MethodGroup abstraction, which gets us one
24154 step closer to the specification in the way we handle method
24157 * cs-parser.jay (primary_expression): qualified_identifier now
24158 tried to match up an identifier to a local variable reference or
24159 to a parameter reference.
24161 current_local_parameters is now a parser global variable that
24162 points to the current parameters for the block, used during name
24165 (property_declaration): Now creates an implicit `value' argument to
24168 2001-05-09 Miguel de Icaza <miguel@ximian.com>
24170 * parameter.cs: Do not use `param' arguments as part of the
24171 signature, per the spec.
24173 2001-05-08 Miguel de Icaza <miguel@ximian.com>
24175 * decl.cs: Base class for classes, structs and interfaces. This
24176 is the "Declaration Space"
24178 * cs-parser.jay: Use CheckDef for checking declaration errors
24179 instead of having one on each function.
24181 * class.cs: Factor out some code for handling error handling in
24182 accordance to the "Declarations" section in the "Basic Concepts"
24183 chapter in the ECMA C# spec.
24185 * interface.cs: Make all interface member classes derive from
24186 InterfaceMemberBase.
24188 2001-05-07 Miguel de Icaza <miguel@ximian.com>
24190 * Many things: all interfaces are parsed and generated in
24191 gen-treedump. Support for member variables, constructors,
24192 destructors, properties, constants is there.
24194 Beginning of the IL backend, but very little done, just there for
24197 2001-04-29 Miguel de Icaza <miguel@ximian.com>
24199 * cs-parser.jay: Fix labeled statement.
24201 * cs-tokenizer.cs (escape): Escape " and ' always.
24202 ref_line, ref_name: keep track of the line/filename as instructed
24203 by #line by the compiler.
24206 2001-04-27 Miguel de Icaza <miguel@ximian.com>
24208 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
24209 to match the values in System.CodeDOM.
24211 Divid renamed to Divide.
24213 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
24215 (Statements.set): remove.
24217 * System.CodeDOM/CodeCatchClause.cs: always have a valid
24220 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
24221 falseStatements always have valid values.
24223 * cs-parser.jay: Use System.CodeDOM now.